after some surprises in using a negative p3 in the score i think this is important to understand:
1. only one instance of such an instrument can be active (because this feature was designed for quasi legato).
2. if only a negative duration is present in the score, csound will terminate immediately:
a) the score
i 1 0 -1 400
will terminate immediately.
b) the score
i 1 0 -1 400
i 1 3 -1 500
will terminate after three seconds.
(only adding something like "e 60" replaces the first instance of instrument 1 by the second.)
i think this is consistent, but also surprising.
i had a look in the reference manual, but found no documentation.
is it somehow hidden, or should we add it?
Nice observations. Actually, it looks like I expect it to behave. Do note that you can initiate several instances with infinite duration if you use fractional instr numbers.
i 1.1 0 -1 400
i 1.2 0 -1 400
…
I think the termination on the last infinite event also makes sense, since the score then contains no more information.
As you suggest, it might be good to check if the manual documents the behaviour clearly enough.
after some surprises in using a negative p3 in the score i think this is
important to understand:
only one instance of such an instrument can be active (because this
feature was designed for quasi legato).
if only a negative duration is present in the score, csound will
terminate immediately:
a) the score
i 1 0 -1 400
will terminate immediately.
b) the score
i 1 0 -1 400
i 1 3 -1 500
will terminate after three seconds.
(only adding something like “e 60” replaces the first instance of
instrument 1 by the second.)
i think this is consistent, but also surprising.
i had a look in the reference manual, but found no documentation.
is it somehow hidden, or should we add it?
A -p3 used in the score will act as a tied note ex. i1 0 -1 or -5 will terminate immediately if i1 is the only instrument but technically still compile, for example printing, running loops, init ftables in the instr etc.). If there are other instruments in the score -p3 acts as an always on instrument until the rest of the score completes. For example with:
i1 0 -1
i2 2 5
instr 1 will remain on for 7 sec.
When used in schedule as Victor wrote the instr runs indefinitely even if there are no other instr playing.
I’m not sure this is specifically documented anywhere although perhaps the Csound manual schedule explanation defines this behavior:
If the duration is zero or negative the new event is of MIDI type, and inherits the release sub-event from the scheduling instruction.
It’s not implicitly obvious to me, I’m sure someone else can better elaborate.
Maybe it makes sense to mention different behaviour of score and schedule here…
Score below will start instrument 1 at time 0s for indefinitely and then stop it at time 2s.
i 1 0 -1
i 1 2 -1
When using schedule below, it will start instrument 1 at time 0s for indefinitely and then restart it at time 2s also for indefinitely
schedule(1, 0, -1)
schedule(1, 2, -1)
To imitate behaviour of a score above, the second schedule needs to be as below and then instrument 1 will be stopped at time 2s. p3 can have arbitrary value