sterrain
A wave-terrain synthesis opcode using curves computed with the superformula
See Wikipedia for more information.
Syntax
aout sterrain kamp, kcps, kx, ky, krx, kry, krot, ktab0, ktab1, km1, km2, \
kn1, kn2, kn3, ka, kb, kperiod
Performance
ktabx, ktaby -- The two tables that define the terrain - they can be changed at krate.
The output is the result of drawing the superformula curve with parameters km1, km2, kn1, kn2, kn3, ka, kb (see on wikipedia), scaled with krx and kry and centered at kx, ky on the terrain, rotated around the center with krot radians, and traversing it at frequency kcps/kperiod.km1,km2 are converted to integers.
As the speed of the point can change considerably for some parameter classes when drawing curve on the terrain some different sounds can be produced compared with other standard curves e.g. it can make triangle like parts in the output wave.
The following ranges are supported and useful:
kn1, ka, kb -- !=0 and continous.
kn2, kn3 -- continous.
km1, km2 -- positive integer > 0: note that the curves are not on all combinations of km1,km2 closed and have poles (closed in infinity) for example if kn1>0 and there exists an n,m in Z with 2*km1/km2 = 2m+1/n i.e curves with (3,2) (5,2) (7,2) etc and (5,4) (6,4) (7,4) (9,4) etc. have a pole which is noticeable when listening. If kn1 < 0 then the curve is reversed and the poles go towards zero in this case. If km1 and km2 are zero silence is produced (a plain circ - same effect occurs with the tuple 2,2,2,2,2,1,1).
kperiod -- some km1 and km2 ratios may cause pitch shifts. With the kperiod parameter this can be fixed. If the ratio is 1 then the kperiod value should also be set to km1 to get the incoming pitch out.
Examples
Here is an example of the sterrain opcode wich shows the impact of letting kn1 running towards zero. It uses the file sterrain.csd.
Here is an other example of the sterrain opcode showing overtone building. It uses the file sterrain2.csd.
See Also
Credits
Author: Christian Bacher
New in version 6.15