p3 – Duration time in beats (usually positive). A negative value will initiate a held note (see also ihold). A negative value can also be used for ‘always on’ instruments like reverberation. These notes are not terminated by s statements A zero value will invoke an initialization pass without performance (see also instr).
-n -d
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr 99
prints(“starting %d\n”, p4)
if metro(1) == 1 then
printks(“tick (%d)\n”, 0, p4)
endif
endin
i 99 0 10 1
i 99 0 -1 2
i 99 0 z 3
i 99 0 0 4
So, why doesn’t the number 2 instance execute at the k-rate? It used to. It does execute the i-rate.
The reason is that you start a negative p3 and then immediately it gets replaced by the positive matching p1 following it and
so you only have 2 instances running. If instead you mark the negative p3 with a specific instance number, then it
can only be replaced with a matching p1.
From the same page in the manual
"An instrument may be turned on and left to perform indefinitely either by giving it a negative p3 or by including an ihold in its i-time code. If a held note is active, an i statement with matching p1 will not cause a new allocation but will take over the data space of the held note."
Thanks, Victor. I’ll check it again tonight. This problems arose with using just a single instance of an instr. -1 wouldn’t work at k-rate, and Rory suggested trying ‘z’, which worked.
Just trying to figure out while all of a sudden this is happening.
Ok, was able to try these things again, and I effectively ran each line by themselves, and I didn’t get any different results. 1, 3, & 4 worked, as expected. But 2 still only ran during the i-rate. When I changed the instr called to 99.1, 2 ran as it should have.
Maybe this isn’t exactly as I have been using these things because I normally use named instr’s. But I still swear that I have been able to use -1 to run these instr’s… Anyway, I’ll just start to use the ‘z’ option for the duration in a score.
I’m not sure what to say, but using -1 does not work for me anymore, unless I use an instr number with a fractional part.
I’m suspecting that my copy of Csound is somehow corrupt. I just install Csound from the Cabbage bundle, so I was thinking about removing Csound altogether, and doing a fresh install.
Advice from Rory Walsh to my students and me was to:
Install a fresh Csound (it is the latest release), and not to install the Csound that is part of the Cabbage Bundle (which is not as current) as the 6.17 at csound.com
I should have completed: it will run forever like in the first example.
Why?
1 - in the first example, there is no numeric score, Csound runs forever. The scheduled instr 1 with p3=-1 will
run forever.
2 - in the second example, the first instr 1 with p3=-1 instance is immediately replaced by the instance with p3=1
3 - in the third example, the score runs to the end before any performance can be run.
4 - in the fourth example the score requires to run an f statement at time z (which is the end of times as far as we are concerned)
so Csound has to run until then. The i1 0 -1 then turns instrument 1 indefinitely on.
This is the first machine that I’ve used the bundled version. But then again, I only took a month off, and now this is somehow different. My Mac is older so I can’t get access to all the tools I would need to compile everything from scratch. Homebrew no longer supports the version of the Mac system I can get. I keep thinking Linux…
OK. but you probably should not need to install the Csound bundled with Cabbage 2.8 from September 2021 over the more recent Csound 6.17 from csound.com - Feb2, 2022