wterrain2 Signal Generators:Wave Terrain Synthesis wterrain2 wterrain2 A wave-terrain synthesis opcode using different curves Description A wave-terrain synthesis opcode that enhances the wterrain opcode by providing some more curves, krate table parameters and a parameter for rotating the curve. Syntax aout wterrain2 kamp, kcps, kx, ky, krx, kry, krot, \ ktab0, ktab1, kcurve, kcurveparam Performance ktabx, ktaby -- The two tables that define the terrain - they can be changed at krate. The output is the result of traversing at frequency kcps the curve kcurve with the parameter kcurveparam (see below), scaled with krx and kry and centered at kx, ky on the terrain and rotated around the center with krot radians. kcurve=0: ellipse as in the wterrain opcode but with a special extension. kcurveparam controls a speed change of the traversing point. The formula is: fx(t) = kx + krx * sin( t + kcurveparam * sin(t) ) fy(t) = ky + kry * cos( t + kcurveparam * sin(t) ) kcurve=1: lemniskate - this is a simple 8. here also the kcurveparam controls a speed change of the traversing point. The formula is: fx(t) = kx + krx * cos( t + kcurveparam * sin(t) ) fy(t) = ky + kry * sin( t + kcurveparam * sin(t) ) * cos( t + kcurveparam * sin(t) ) kcurve=2: limacon fx(t) = kx + krx * sin(t) * (cos(t) + kcurveparam); fy(t) = ky + kry * cos(t) * (cos(t) + kcurveparam); limacon curve with different parameters limacon curve with different parameters kcurve=3: cornoid fx(t) = kx + krx * cos(t) * cos(2*t) fy(t) = ky + kry * sin(t) * (kcurveparam + cos(2*t)) cornoid with different parameters a cornoid curve with different parameters kcurve=4: trisectrix (Ceva) fx(t) = kx + krx * cos(t) * (1+kcurveparam*sin(2*t)); fy(t) = ky + kry * sin(t) * (1+kcurveparam*sin(2*t)); trisectrix curve with different parameters a trisectrix curve with different parameters kcurve=5: scarabeus fx(t) = kx + krx * cos(t) * (1+kcurveparam*sin(2*t)); fy(t) = ky + kry * sin(t) * (1+kcurveparam*sin(2*t)); scarabeus curve with different parameters a scarabeus curve with different parameters kcurve=6: folium fx(t) = kx + krx * cos(t) * cos(t) * (sin(t)*sin(t) - kcurveparam); fy(t) = ky + kry * sin(t) * cos(t) * (sin(t)*sin(t) - kcurveparam); folium with different parameters a folium with different parameters kcurve=7: Talbot curve fx(t) = kx + krx * cos(t) * (1 + kcurveparam * sin(t)*sin(t)); fy(t) = ky + kry * sin(t) * (1 - kcurveparam - kcurveparam*cos(t)*cos(t)); Talbot curve with different parameters a Talbot curve with different parameters Examples Here is an example of the wterrain2 opcode. It uses the file wterrain2.csd. Example of the wterrain2 opcode. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. Here is an other example of the wterrain2 - a sound fugue. It uses the file wterrain2_2.csd. Another Example of the wterrain2 opcode - a sound fugue See Also Wave Terrain Synthesis Credits Author: Christian Bacher New in version 6.15