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) )
<CsoundSynthesizer><CsOptions>-odac -d
</CsOptions><CsInstruments>sr=48000ksmps=32nchnls=20dbfs=1gisineftgen0,0,2^12,10,1gScurves[]fillarray"ELLIPSE ","LEMNISKATE ","LIMACON ","CORNOID ","TRISEXTIC ","SCARABEUS ","FOLIUM ","TALBOT "instr1printsgScurves[p4]kdclkinit0kdclklinsegr0,0.1,1,p3-0.02,1,0.9,0kparaminit0krotinit0krotlinseg0,p3,6.28; ROTATE THE CURVE SLOWLYkparamlinseg0,p3,4; INCREASE CURVEPARAMETERasigLwterrain20.5,110,0.5,0.5,0.8,0.4,krot,gisine,gisine,p4,kparam; LET THE POINT FOR RIGHT RUNNING BACKWARDS FOR A LITTLE STEREO EFFECTasigRwterrain20.5,-110,0.5,0.5,0.8,0.4,krot,gisine,gisine,p4,kparamasigRdcblockasigLasigLdcblockasigRasigL*=kdclkasigR*=kdclkaL,aRreverbscasigL,asigR,0.6,15000,44100,0.5,1outsaL,aRendin</CsInstruments><CsScore>i10400; ELLIPSEi141401; LEMNSIKATEi182402; LIMACONi1123403; CORNOIDi1164404; TRISEXTICi1205405; SCARABEUSi1246406; FOLIUMi1287407; TALBOTe</CsScore></CsoundSynthesizer>
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
<CsoundSynthesizer><CsOptions>-odac -d
</CsOptions><CsInstruments>sr=48000ksmps=32nchnls=20dbfs=1gisineftgen0,0,2^12,10,1instr1kampadsr0.1,0.01,1,10; THE MODULATION PARAMETERS krotlinseg0,p3,6.28; ROTATEkparamrandc2.5,0.1,0.993; CONTROL CURVEPARAMETER WITH CUBIC RANDOM kxlinseg0,p3/2,1,p3/2,0; MOVE HORIZONTAL THROUGH THE TERRAINkylinseg0,p3,1; MOVE VERTICAL THROUGH THE TERRAIN; TRY THE OTHER CURVES AS WELL asigLwterrain20.2,55*p4,kx,ky,0.5,0.4,krot,gisine,gisine,5,kparamasigRwterrain20.2,-55*p4,kx,ky,0.5,0.4,krot,gisine,gisine,5,kparamasigRdcblockasigLasigLdcblockasigRasigLbutterlpasigL,9000asigRbutterlpasigR,9000aL,aRreverbscasigL,asigR,0.7,15000,44100,0.5,1outsaL*kamp*p5,aR*kamp*p5endin</CsInstruments><CsScore>i1030011i1130070.4i12299[9/2]0.4i13.1296.9[16/3]0.45i14.3295.7[27/4]0.5i16.9292.160.5e</CsScore></CsoundSynthesizer>