Hi All, I was thinking today that as a way to cut down global variables in projects of mine it would be nice to have some sort of static instrument variables that would be only viewable in scope by and instrument, but also would be shareable by all instances of that instrument. Some usages of this idea off the top of my head would be: -Instrument wide volume adjustments -ftables that an instrument may depend on but doesn't need to generate on every new instance (ftgen could be used and the number stored in an i-time var), this would allow embedding ftables an instrument depends on with an instrument It would be nice to have something that was in the syntax of the language itself, but knowing what I know of what's underneath, this would be complicated and probably not necessary. What I am thinking of instead is something a bit more generic but could be used for the above purpose. The idea is that one would use invalue and outvalue, which can work with string names, and an id system for one's instrument. If your instrument requires an ftable, instead of putting it out in global scope with ftgen or and f-statement in the score, you could check with invalue to see if it's been defined (invalue nicely defaults to 0 if no value is assigned), and if not, define the table using ftgen. Something like: Stable1 = "myInstrument_tab1" Stable2 = "myInstrument_tab1" itab1 invalue Stable1 itab2 invalue Stable2 if (itab1 <= 0) then itab1 ftgen ... ; define a table here outvalue Stable1, itab1 endif if (itab2 <= 0) then itab2 ftgen ... ; define a table here outvalue Stable2, itab2 endif Now, I think invalue doesn't work with S strings (need to check), and that might be fine if you want to statically read in from a string channel name (i.e. itab1 invalue "myinstrument_tab1"), but being able to concatenate the instrument id of the instrument: i_instr_id = int(abs(p1)) Stable1 concat "myInstrument_tab1_", i_instr_id might make it a bit more robust to overlapping instruments, especially if you're using two copies of the instrument with different instrument id's, you could control them independently. Has anyone tried anything like this, or perhaps has a better method? Thanks, steven -- Send bugs reports to this list. To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk