If I don’t specify an instrument number, only names, then CSound numbers them on order of their definition?
As far as I know this is correct.
nstrnum opcode reveals the number that Csound is using: https://csound.com/docs/manual/nstrnum.html
I’m actually trying to figure out if I can get away with not using numbers, and just defining the instruments in the order I need them.
I seen to remember having an issue though of trying to use turnoff with a name and not a number, and it seems that you can only turnoff an instrument that was instantiated with a number.
I see what you mean. Numbered instruments can be a hindrance when combining orchestras from different sources when a lot of renumbering becomes necessary. Renumbering instruments might then break in-orchestra event opcodes like
event_i etc. I often use the approach of defining instrument numbers in these opcodes as ‘p1 + 1’ to point to the ‘next higher numbered instrument’ and get around this. This will work with named instruments in a list also.
I’ve not really adopted named instruments but I know others use them exclusively.
Your original assertion is correct that Csound numbers named instruments according to the order in which they appear, starting at ‘1’ (if not already defined).
Thanks for the suggestion on using p1. Never really knew it was available to use, but it does make sense.