Wow! Thanks for the great tip of the @ operator! Is there a manual entry for this??
Another solution that I have found to be particularlly effective in this case is using one of Steven Yi's UDO's
http://www.csounds.com/udo/displayOpcode.php?opcode_id=19
to generate the table with ftgen in the orchestra. If you set it up in a separate instrument it also allows you to write it's length to a global variable so that for example even though i-time happens once in an "always on" instrument, you can say, change table sizes at some arbitrary second instrument's i-rate.
-David
I can understand this point. It is easy to remember a few simple values
like 256 or 1024, but most people seem to be using larger tables these days
and may not want to expend the effort to memorize or recalculate sizes like
65536 or 262144 on a regular basis.
My suggestion to those people is to use a feature that already exists in
Csound: the @ and @@ score expression operators.
Try f1 0 [@ 1000] 10 1
or f2 0 [@@ 50000] 9 1 1.0 0.0 2.5 0.5 0.32
@ rounds up to the nearest power of 2 (1024 above) and @@ rounds up to the
nearest power-of-2-plus-1 (65537 above).
Anthony Kozar
anthonykozar AT sbcglobal DOT net
Matt Ingalls wrote on 1/24/06 1:00 PM:
> But the main thing i am annoyed with as a USER
> is that i do not want to THINK about power-of-2. And after
> teaching this csound class
> this past semester i can tell you i am not the only one!