Csound Csound-dev Csound-tekno Search About

[Csnd] lastcycle with turnoff2

Date2020-06-26 22:00
FromdocB <000005d2745f1ec0-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] lastcycle with turnoff2

hi it seems that lastcycle does not work with turnoff2 insno, 4,1

may be i am wrong or made a mistake but i thought because of this documentation it could work (i interpret the "and" that turnoff2 without 0 at last parameter should work)

" The only sitatuation where lastcycle does not detect that the event will not run for another cycle is when the note is turned off by another event (using turnoff2) *and* is not given the possibility of running through its release stage (using turnoff2 instrnum, imode, 0)"

the following csd does not print the lastcycle (i have made this to clarify as in my real csd i detected the issue)

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>

<CsInstruments>
sr  = 48000
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
  event "i",3,0,-1
  turnoff
endin
instr 2
  turnoff2 3,4,1
  turnoff
endin
instr 3
    if lastcycle() == 1 then
      printks "-------------------------------> lastcycle\n",0
    endif
endin

</CsInstruments>

<CsScore>
i1 0 0.5
i2 1 0.5

</CsScore>
</CsoundSynthesizer>

SECTION 1:
new alloc for instr 1:
  rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
new alloc for instr 3:
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
new alloc for instr 2:
B  1.000 ..  1.500 T  1.500 TT  1.500 M:  0.00000  0.00000
Score finished in csoundPerform().

thx christian


Date2020-06-27 00:51
FromEduardo Moguillansky
SubjectRe: [Csnd] lastcycle with turnoff2

Your example can't work. instr 3 has undefined duration (-1) and defines no extra time (does not use an opcode like xtratim or linsegr, etc). In order to make it work, add a minimal extra time to instr 3, something like "xtratim ksmps/sr".

An alternative is to use the opcode "atstop" (https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html), which will schedule another event when the current event stops, independent of how it stopped.

---
eduardo

On 26.06.20 23:00, docB wrote:

hi it seems that lastcycle does not work with turnoff2 insno, 4,1

may be i am wrong or made a mistake but i thought because of this documentation it could work (i interpret the "and" that turnoff2 without 0 at last parameter should work)

" The only sitatuation where lastcycle does not detect that the event will not run for another cycle is when the note is turned off by another event (using turnoff2) *and* is not given the possibility of running through its release stage (using turnoff2 instrnum, imode, 0)"

the following csd does not print the lastcycle (i have made this to clarify as in my real csd i detected the issue)

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>

<CsInstruments>
sr  = 48000
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
  event "i",3,0,-1
  turnoff
endin
instr 2
  turnoff2 3,4,1
  turnoff
endin
instr 3
    if lastcycle() == 1 then
      printks "-------------------------------> lastcycle\n",0
    endif
endin

</CsInstruments>

<CsScore>
i1 0 0.5
i2 1 0.5

</CsScore>
</CsoundSynthesizer>

SECTION 1:
new alloc for instr 1:
  rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
new alloc for instr 3:
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
new alloc for instr 2:
B  1.000 ..  1.500 T  1.500 TT  1.500 M:  0.00000  0.00000
Score finished in csoundPerform().

thx christian

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-06-27 12:12
FromdocB <000005d2745f1ec0-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] lastcycle with turnoff2


Your example can't work. instr 3 has undefined duration (-1) and defines no extra time (does not use an opcode like xtratim or linsegr, etc). In order to make it work, add a minimal extra time to instr 3, something like "xtratim ksmps/sr".

ok thanks,

the problem in my original csd was that the linsegr was called inside an adsr opcode after lastcycle

e.g. this fragment doesnt work

  if lastcycle() == 1 then
    printks "--------------------> lastcycle\n",0
  endif
  xtratim ksmps/sr


- i put it before - then it worked.

--christian

An alternative is to use the opcode "atstop" (https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html), which will schedule another event when the current event stops, independent of how it stopped.


---
eduardo

On 26.06.20 23:00, docB wrote:

hi it seems that lastcycle does not work with turnoff2 insno, 4,1

may be i am wrong or made a mistake but i thought because of this documentation it could work (i interpret the "and" that turnoff2 without 0 at last parameter should work)

" The only sitatuation where lastcycle does not detect that the event will not run for another cycle is when the note is turned off by another event (using turnoff2) *and* is not given the possibility of running through its release stage (using turnoff2 instrnum, imode, 0)"

the following csd does not print the lastcycle (i have made this to clarify as in my real csd i detected the issue)

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>

<CsInstruments>
sr  = 48000
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
  event "i",3,0,-1
  turnoff
endin
instr 2
  turnoff2 3,4,1
  turnoff
endin
instr 3
    if lastcycle() == 1 then
      printks "-------------------------------> lastcycle\n",0
    endif
endin

</CsInstruments>

<CsScore>
i1 0 0.5
i2 1 0.5

</CsScore>
</CsoundSynthesizer>

SECTION 1:
new alloc for instr 1:
  rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
new alloc for instr 3:
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
new alloc for instr 2:
B  1.000 ..  1.500 T  1.500 TT  1.500 M:  0.00000  0.00000
Score finished in csoundPerform().

thx christian

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-06-27 15:21
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] lastcycle with turnoff2
Eduardo,

Checking out your plugins WIKI and wanting to explore them this weekend.
On Catalina - MacOS 10.15.5
I have followed your installation instructions and thing seem to work up to the "make" step:

git clone https://github.com/csound-plugins/csound-plugins cd csound-plugins mkdir build cd build cmake .. make  
sudo make install

Seems the make can't find "arrays.h" in the else.c file and this returns a "fatal error"

Can you offer me any advice?

dB@db build % make

/usr/local/Cellar/cmake/3.17.3/bin/cmake -S/Users/dB/csound-plugins -B/Users/dB/csound-plugins/build --check-build-system CMakeFiles/Makefile.cmake 0

/usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_progress_start /Users/dB/csound-plugins/build/CMakeFiles /Users/dB/csound-plugins/build/CMakeFiles/progress.marks

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 all

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/else/CMakeFiles/else.dir/build.make src/else/CMakeFiles/else.dir/depend

cd /Users/dB/csound-plugins/build && /usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_depends "Unix Makefiles" /Users/dB/csound-plugins /Users/dB/csound-plugins/src/else /Users/dB/csound-plugins/build /Users/dB/csound-plugins/build/src/else /Users/dB/csound-plugins/build/src/else/CMakeFiles/else.dir/DependInfo.cmake --color=

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/else/CMakeFiles/else.dir/build.make src/else/CMakeFiles/else.dir/build

[  4%] Building C object src/else/CMakeFiles/else.dir/src/else.c.o

cd /Users/dB/csound-plugins/build/src/else && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Delse_EXPORTS -I/Library/Frameworks/CsoundLib.framework/Headers  -std=c99 -fPIC -Wall -DUSE_DOUBLE -DB64BIT -ftree-vectorize -ffast-math -fomit-frame-pointer -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -fPIC   -o CMakeFiles/else.dir/src/else.c.o   -c /Users/dB/csound-plugins/src/else/src/else.c

/Users/dB/csound-plugins/src/else/src/else.c:177:10: fatal error: 'arrays.h' file not found

#include "arrays.h"

         ^~~~~~~~~~

1 error generated.

make[2]: *** [src/else/CMakeFiles/else.dir/src/else.c.o] Error 1

make[1]: *** [src/else/CMakeFiles/else.dir/all] Error 2

make: *** [all] Error 2


Dr. Richard Boulanger

Professor of Electronic Production and Design

Professional Writing and Technology Division

Berklee College of Music


skype: radiobaton 

facebook: https://www.facebook.com/richard.boulanger.58

about: http://www.boulangerlabs.com/#about

about: http://www.csounds.com/community/developers/dr-richard-boulanger/

music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/


Boulanger Labs - http://boulangerlabs.com

The Csound Book http://mitpress.mit.edu/books/csound-book

The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book



On Fri, Jun 26, 2020 at 7:53 PM Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Your example can't work. instr 3 has undefined duration (-1) and defines no extra time (does not use an opcode like xtratim or linsegr, etc). In order to make it work, add a minimal extra time to instr 3, something like "xtratim ksmps/sr".

An alternative is to use the opcode "atstop" (https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html), which will schedule another event when the current event stops, independent of how it stopped.

---
eduardo

On 26.06.20 23:00, docB wrote:

hi it seems that lastcycle does not work with turnoff2 insno, 4,1

may be i am wrong or made a mistake but i thought because of this documentation it could work (i interpret the "and" that turnoff2 without 0 at last parameter should work)

" The only sitatuation where lastcycle does not detect that the event will not run for another cycle is when the note is turned off by another event (using turnoff2) *and* is not given the possibility of running through its release stage (using turnoff2 instrnum, imode, 0)"

the following csd does not print the lastcycle (i have made this to clarify as in my real csd i detected the issue)

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>

<CsInstruments>
sr  = 48000
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
  event "i",3,0,-1
  turnoff
endin
instr 2
  turnoff2 3,4,1
  turnoff
endin
instr 3
    if lastcycle() == 1 then
      printks "-------------------------------> lastcycle\n",0
    endif
endin

</CsInstruments>

<CsScore>
i1 0 0.5
i2 1 0.5

</CsScore>
</CsoundSynthesizer>

SECTION 1:
new alloc for instr 1:
  rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
new alloc for instr 3:
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
new alloc for instr 2:
B  1.000 ..  1.500 T  1.500 TT  1.500 M:  0.00000  0.00000
Score finished in csoundPerform().

thx christian

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-06-27 15:37
FromEduardo Moguillansky
SubjectRe: [Csnd] lastcycle with turnoff2

dear Richard,

(please don't hijack a thread with unrelated comments)

The build works fine, you need a recent csound (arrays.h is part of the header files installed by csound).
The best way to install the plugins is to use risset.

$ risset update
$ risset install else

cheers
eduardo


On 27.06.20 16:21, Dr. Richard Boulanger wrote:
Eduardo,

Checking out your plugins WIKI and wanting to explore them this weekend.
On Catalina - MacOS 10.15.5
I have followed your installation instructions and thing seem to work up to the "make" step:

git clone https://github.com/csound-plugins/csound-plugins cd csound-plugins mkdir build cd build cmake .. make  
sudo make install
Seems the make can't find "arrays.h" in the else.c file and this returns a "fatal error"
Can you offer me any advice?

dB@db build % make

/usr/local/Cellar/cmake/3.17.3/bin/cmake -S/Users/dB/csound-plugins -B/Users/dB/csound-plugins/build --check-build-system CMakeFiles/Makefile.cmake 0

/usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_progress_start /Users/dB/csound-plugins/build/CMakeFiles /Users/dB/csound-plugins/build/CMakeFiles/progress.marks

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 all

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/else/CMakeFiles/else.dir/build.make src/else/CMakeFiles/else.dir/depend

cd /Users/dB/csound-plugins/build && /usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_depends "Unix Makefiles" /Users/dB/csound-plugins /Users/dB/csound-plugins/src/else /Users/dB/csound-plugins/build /Users/dB/csound-plugins/build/src/else /Users/dB/csound-plugins/build/src/else/CMakeFiles/else.dir/DependInfo.cmake --color=

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/else/CMakeFiles/else.dir/build.make src/else/CMakeFiles/else.dir/build

[  4%] Building C object src/else/CMakeFiles/else.dir/src/else.c.o

cd /Users/dB/csound-plugins/build/src/else && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Delse_EXPORTS -I/Library/Frameworks/CsoundLib.framework/Headers  -std=c99 -fPIC -Wall -DUSE_DOUBLE -DB64BIT -ftree-vectorize -ffast-math -fomit-frame-pointer -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -fPIC   -o CMakeFiles/else.dir/src/else.c.o   -c /Users/dB/csound-plugins/src/else/src/else.c

/Users/dB/csound-plugins/src/else/src/else.c:177:10: fatal error: 'arrays.h' file not found

#include "arrays.h"

         ^~~~~~~~~~

1 error generated.

make[2]: *** [src/else/CMakeFiles/else.dir/src/else.c.o] Error 1

make[1]: *** [src/else/CMakeFiles/else.dir/all] Error 2

make: *** [all] Error 2


Dr. Richard Boulanger

Professor of Electronic Production and Design

Professional Writing and Technology Division

Berklee College of Music


skype: radiobaton 

facebook: https://www.facebook.com/richard.boulanger.58

about: http://www.boulangerlabs.com/#about

about: http://www.csounds.com/community/developers/dr-richard-boulanger/

music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/


Boulanger Labs - http://boulangerlabs.com

The Csound Book http://mitpress.mit.edu/books/csound-book

The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book



On Fri, Jun 26, 2020 at 7:53 PM Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Your example can't work. instr 3 has undefined duration (-1) and defines no extra time (does not use an opcode like xtratim or linsegr, etc). In order to make it work, add a minimal extra time to instr 3, something like "xtratim ksmps/sr".

An alternative is to use the opcode "atstop" (https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html), which will schedule another event when the current event stops, independent of how it stopped.

---
eduardo

On 26.06.20 23:00, docB wrote:

hi it seems that lastcycle does not work with turnoff2 insno, 4,1

may be i am wrong or made a mistake but i thought because of this documentation it could work (i interpret the "and" that turnoff2 without 0 at last parameter should work)

" The only sitatuation where lastcycle does not detect that the event will not run for another cycle is when the note is turned off by another event (using turnoff2) *and* is not given the possibility of running through its release stage (using turnoff2 instrnum, imode, 0)"

the following csd does not print the lastcycle (i have made this to clarify as in my real csd i detected the issue)

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>

<CsInstruments>
sr  = 48000
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
  event "i",3,0,-1
  turnoff
endin
instr 2
  turnoff2 3,4,1
  turnoff
endin
instr 3
    if lastcycle() == 1 then
      printks "-------------------------------> lastcycle\n",0
    endif
endin

</CsInstruments>

<CsScore>
i1 0 0.5
i2 1 0.5

</CsScore>
</CsoundSynthesizer>

SECTION 1:
new alloc for instr 1:
  rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
new alloc for instr 3:
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
new alloc for instr 2:
B  1.000 ..  1.500 T  1.500 TT  1.500 M:  0.00000  0.00000
Score finished in csoundPerform().

thx christian

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-06-27 15:57
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] lastcycle with turnoff2
Eduardo,

Thanks, I will try "risset" to install them too.

Sorry everyone about "hijacking" this thread, but Eduardo's recommendation of using the plugins in one of your emails about "atstop" led me down this path and I thought that this might be the place to ask these questions about getting all the paths correct for any/all versions of Csound that one might be running - to work with plugins, UDOs, and opcodes that are listed in the manual.

I will start a new thread about the path issues that seem to be a problem for all my students (and me too!)

-dB 



Dr. Richard Boulanger

Professor of Electronic Production and Design

Professional Writing and Technology Division

Berklee College of Music


skype: radiobaton 

facebook: https://www.facebook.com/richard.boulanger.58

about: http://www.boulangerlabs.com/#about

about: http://www.csounds.com/community/developers/dr-richard-boulanger/

music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/


Boulanger Labs - http://boulangerlabs.com

The Csound Book http://mitpress.mit.edu/books/csound-book

The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book



On Sat, Jun 27, 2020 at 10:39 AM Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

dear Richard,

(please don't hijack a thread with unrelated comments)

The build works fine, you need a recent csound (arrays.h is part of the header files installed by csound).
The best way to install the plugins is to use risset.

$ risset update
$ risset install else

cheers
eduardo


On 27.06.20 16:21, Dr. Richard Boulanger wrote:
Eduardo,

Checking out your plugins WIKI and wanting to explore them this weekend.
On Catalina - MacOS 10.15.5
I have followed your installation instructions and thing seem to work up to the "make" step:

git clone https://github.com/csound-plugins/csound-plugins cd csound-plugins mkdir build cd build cmake .. make  
sudo make install
Seems the make can't find "arrays.h" in the else.c file and this returns a "fatal error"
Can you offer me any advice?

dB@db build % make

/usr/local/Cellar/cmake/3.17.3/bin/cmake -S/Users/dB/csound-plugins -B/Users/dB/csound-plugins/build --check-build-system CMakeFiles/Makefile.cmake 0

/usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_progress_start /Users/dB/csound-plugins/build/CMakeFiles /Users/dB/csound-plugins/build/CMakeFiles/progress.marks

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 all

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/else/CMakeFiles/else.dir/build.make src/else/CMakeFiles/else.dir/depend

cd /Users/dB/csound-plugins/build && /usr/local/Cellar/cmake/3.17.3/bin/cmake -E cmake_depends "Unix Makefiles" /Users/dB/csound-plugins /Users/dB/csound-plugins/src/else /Users/dB/csound-plugins/build /Users/dB/csound-plugins/build/src/else /Users/dB/csound-plugins/build/src/else/CMakeFiles/else.dir/DependInfo.cmake --color=

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/else/CMakeFiles/else.dir/build.make src/else/CMakeFiles/else.dir/build

[  4%] Building C object src/else/CMakeFiles/else.dir/src/else.c.o

cd /Users/dB/csound-plugins/build/src/else && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Delse_EXPORTS -I/Library/Frameworks/CsoundLib.framework/Headers  -std=c99 -fPIC -Wall -DUSE_DOUBLE -DB64BIT -ftree-vectorize -ffast-math -fomit-frame-pointer -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -fPIC   -o CMakeFiles/else.dir/src/else.c.o   -c /Users/dB/csound-plugins/src/else/src/else.c

/Users/dB/csound-plugins/src/else/src/else.c:177:10: fatal error: 'arrays.h' file not found

#include "arrays.h"

         ^~~~~~~~~~

1 error generated.

make[2]: *** [src/else/CMakeFiles/else.dir/src/else.c.o] Error 1

make[1]: *** [src/else/CMakeFiles/else.dir/all] Error 2

make: *** [all] Error 2


Dr. Richard Boulanger

Professor of Electronic Production and Design

Professional Writing and Technology Division

Berklee College of Music


skype: radiobaton 

facebook: https://www.facebook.com/richard.boulanger.58

about: http://www.boulangerlabs.com/#about

about: http://www.csounds.com/community/developers/dr-richard-boulanger/

music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/


Boulanger Labs - http://boulangerlabs.com

The Csound Book http://mitpress.mit.edu/books/csound-book

The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book



On Fri, Jun 26, 2020 at 7:53 PM Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Your example can't work. instr 3 has undefined duration (-1) and defines no extra time (does not use an opcode like xtratim or linsegr, etc). In order to make it work, add a minimal extra time to instr 3, something like "xtratim ksmps/sr".

An alternative is to use the opcode "atstop" (https://csound-plugins.github.io/csound-plugins/opcodes/atstop.html), which will schedule another event when the current event stops, independent of how it stopped.

---
eduardo

On 26.06.20 23:00, docB wrote:

hi it seems that lastcycle does not work with turnoff2 insno, 4,1

may be i am wrong or made a mistake but i thought because of this documentation it could work (i interpret the "and" that turnoff2 without 0 at last parameter should work)

" The only sitatuation where lastcycle does not detect that the event will not run for another cycle is when the note is turned off by another event (using turnoff2) *and* is not given the possibility of running through its release stage (using turnoff2 instrnum, imode, 0)"

the following csd does not print the lastcycle (i have made this to clarify as in my real csd i detected the issue)

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>

<CsInstruments>
sr  = 48000
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
  event "i",3,0,-1
  turnoff
endin
instr 2
  turnoff2 3,4,1
  turnoff
endin
instr 3
    if lastcycle() == 1 then
      printks "-------------------------------> lastcycle\n",0
    endif
endin

</CsInstruments>

<CsScore>
i1 0 0.5
i2 1 0.5

</CsScore>
</CsoundSynthesizer>

SECTION 1:
new alloc for instr 1:
  rtevent:       T  0.001 TT  0.001 M:  0.00000  0.00000
new alloc for instr 3:
B  0.000 ..  1.000 T  1.000 TT  1.000 M:  0.00000  0.00000
new alloc for instr 2:
B  1.000 ..  1.500 T  1.500 TT  1.500 M:  0.00000  0.00000
Score finished in csoundPerform().

thx christian

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here