ftgenonceSignal Flow Graph Opcodesftgenonceftgenonce
Generate a function table from within an instrument definition, without duplication of data.
DescriptionPlugin opcode in signalflowgraph.
Enables the creation of function tables entirely inside
instrument definitions, without any duplication of data.
The ftgenonce opcode is designed to simplify writing instrument definitions
that can be re-used in different orchestras simply by #including them
and plugging them into some output instrument. There is no need to define
function tables either in the score, or in the orchestra header.
The ftgenonce opcode is similar to ftgentmp, and has identical arguments.
However, function tables are neither duplicated nor deleted. Instead,
all of the arguments to the opcode are concatenated to form the key to a
lookup table that points to the function table number. Thus, every request
to ftgenonce with the same arguments receives the same instance of the
function table data. Every change in the value of any ftgenonce argument
causes the creation of a new function table.
Syntaxifno ftgenonce ip1, ip2dummy, isize, igen, iarga, iargb, ...Initializationifno -- an automatically
assigned table number.
ip1 -- the number of the table to be
generated or 0 if the number is to be assigned.
ip2dummy -- ignored.
isize -- table size. Corresponds to p3 of the score f statement.
igen -- function table GEN routine. Corresponds to p4 of the score f statement.
iarga, iargb, ... -- function table arguments. Correspond to p5 through pn of the score f statement.
Csound was originally designed to support tables with power of two sizes only. Though this has changed in recent versions (you can use any size by using a negative number), many opcodes will not accept them.Examples
Here is an example of the ftgenonce opcode. It uses the file ftgenonce.csd.
Example of the ftgenonce opcode.See alsoSignal Flow Graph OpcodesCreditsAuthors: &namemichael;2009