;--------------------------------------------------------- ; Terrain Mapping with Dynamical Modulation ; Coded by Hans Mikelson October 1998 ;--------------------------------------------------------- sr = 44100 ; Sample rate kr = 4410 ; Kontrol rate ksmps = 10 ; Samples/Kontrol period nchnls = 2 ; Normal stereo ;--------------------------------------------------------- ; Terrain modulated by Planet system ;--------------------------------------------------------- instr 10 idur = p3 ; Duration iamp = p4*.05 ; Amplitude ifqc = cpspch(p5) ; Frequency ipanl = sqrt(p6) ; Pan left ipanr = sqrt(1-p6) ; Pan right imass1 = p7 ; Mass 1 imass2 = p8 ; Mass 2 kamp linseg 0, .02, 1, idur-.04, 1, .02, 0 ; Mass1 Mass2 Sep X Y Z VX VY VZ h Friction axp, ayp, azp planet imass1, imass2, 2.2, 2, .1, .1, .5, .6, -.1, .0002, .01 ascal = 100 + .1*(ayp + axp +azp) arosl oscil 4, 3.01*ifqc, 1 ; Rose Curve axl oscil arosl, ifqc, 1, .10 ; Convert from polar to ayl oscil arosl, ifqc, 1, .35 ; rectangular coordinates ahill = 1/(10+(axl-axp*.1)*(axl-axp*.1)+(ayl-ayp*.1)*(ayl-ayp*.1)) ; Create a moving hill azl = ascal*cos((1+azp*.1)*(axl+1)*(ayl+1)*.7)*ahill ; Compute a bumpy 3D surface arosr oscil 4, 2.99*ifqc, 1, .2 ; Rose Curve rotated slightly axr oscil arosr, ifqc, 1, .10 ; Convert from polar to ayr oscil arosr, ifqc, 1, .35 ; rectangular coordinates ahilr = 1/(10+(axr-axp*.1)*(axr-axp*.1)+(ayr-ayp*.1)*(ayr-ayp*.1)) ; Create a moving hill azr = ascal*cos((1+azp*.1)*(axr+1)*(ayr+1)*.7)*ahilr ; Compute a bumpy 3D surface aoutl butterhp azl, 10 ; Block DC aoutr butterhp azr, 10 ; Block DC outs aoutl*iamp*kamp*ipanl, aoutr*iamp*kamp*ipanr endin ;--------------------------------------------------------- ; Terrain modulated by Lorenz system ;--------------------------------------------------------- instr 11 idur = p3 ; Duration iamp = p4*.5 ; Amplitude ifqc = cpspch(p5) ; Frequency ipanl = sqrt(p6) ; Pan left ipanr = sqrt(1-p6) ; Pan right kamp linseg 0, .02, 1, idur-.04, 1, .02, 0 ; Lorenz system axl, ayl, azl lorenz 10, 28, 8/3, .00001, 9.8, 17.6, 14.8, 1 ax oscil 4, ifqc, 1 ; Convert from polar to ay oscil 4, ifqc, 1, .25 ; rectangular coordinates ascal = 1+.02*(axl+ayl+azl) ; Overall scaling ahv = 4/(1+exp(ax-axl))-4/(1+exp(ay-ayl)) ; A moving hill and valley azl = ascal*cos((1+.04*ayl)*ay*ay/(2+ax*ax*(1+.04*azl)))+ahv ; Compute a bumpy 3D surface azr = ascal*cos((1+.04*axl)*ay*ay/(2+ax*ax*(1+.04*azl)))-ahv ; Compute a bumpy 3D surface aoutl butterhp azl, 10 ; Block DC aoutr butterhp azr, 10 ; Block DC aoutl = aoutl*iamp*kamp*.6*ipanl ; Prepare to output aoutr = aoutr*iamp*kamp*.6*ipanr ; Prepare to output outs aoutl, aoutr ; Output endin