[id] = soundfx.Generate(dst, fx)
dst. If you
pass Nil in dst, soundfx.Generate() will automatically choose an available
identifier and return it to you.
Usage is very similar to soundfx.Process() except that
soundfx.Generate() doesn't require you to pass input samples. Instead, the source sample
is generated by this function. This means that the first effect in the fx
table should be a generative effect like the synth effect.
After that effect, you could then add some more effects which process the
audio data a generative effect like synth has just produced.
See below for an example.
Note that if you don't use a generative effect as the first effect in the
fx table, this function will run forever because the following effects
will wait for audio data which isn't there if you don't use a generative
effect first.
You might also want to set the Channels, Bits, and Frequency tags
when calling soundfx.Generate() to set the desired
format of the sample to be generated.
See the documentation of soundfx.Process() for a
detailed description of how to pass effects and options in the fx table.
Nil for auto id selectionNil as argument 1 (see above)
soundfx.Generate(1, {{"synth", "sin", "%-12", "sin", "%-9", "sin", "%-5",
"sin", "%-2"}, {"fade", "h", "0.1", "1", "0.1"}, Channels = 1})
The code above creates a synthesised A minor seventh chord with a pipe-organ
sound and stores it as sample 1.