A Karplus-Strong algorithm
This section describes the karplus_strong() function, available in Sample Mode, which is simpler to use than repeat(...).
karplus_strong(@SLOT
grain(f=F channels=CHANNELS type(FORMAT))
synth(...) outer(...)
len(T)
filter(...)
mix_filter(...)
)
An initial excitation sample or grain SLOT is created with length 1/F, CHANNELS channels, and a sample type FORMAT. Looping and gating are disabled.
The instructions within synth(...) are executed in Synth mode. There is no need to specify the slot. Filters are available in Synth mode.
If more complex initial processing is needed, normal Sample mode can be accessed via outer(...). (This takes place after synth(...) if both are specified.)
Next, repeat(...) is used in order to provide a sample called SLOT of maximum length T. At each repeat, the filters within filter(...) are applied.
Next, the filters within mix_filter(...) are applied.
Some final polishing is carried out. The new sample has bias removed from each channel on the basis of the final value. It is trimmed at the start and end to remove any silence, and has the amplitude scaled to maximise the dynamic range.
SLOT must not already exist.
Both filter blocks are optional.
Karplus, K & Strong, A. (1983). Digital synthesis of plucked-string and drum timbres. Computer Music Journal 7:43-55.
A Chowning algorithm
This section describes the chowning() function, available in Sample mode, which carries out sample generation by repeated frequency modulation.
chowning(@SLOT
channels=C type(FORMAT) len(P-LENGTH)
synth(...) outer(...)
modulators(
(synth(...) a=AMP bias=BIAS1 env(ENV1))
(...)
)
filter(...)
env(ENV)
)
A sample SLOT is generated with length P-PENGTH and C channels with sample format FORMAT.
The instructions within synth(...) are executed in Synth mode. Filters are available in Synth mode.
If more complex initial processing is needed, normal Sample mode can be accessed via outer(...). (This takes place after synth(...) if both are specified.)
Each block within the modulators() block is applied to SLOT. This behaves the same as the modulator(...) function with Sample Mode with the exception that a sample name is not required. Any number of modulators may be specified. For the Chowning algorithm, FM is usual, however AM can be used.
Next, the filters block and envelope ENV are applied to the finished sample (optional).
Some final polishing is carried out: The new sample has bias removed from each channel on the basis of the mean value, and has the amplitude scaled to maximise the dynamic range.
Chowning, J. (1973) The synthesis of complex audio spectra by means of frequency modulation. Journal of the Audio Engineering Society 21:526-534.