sr=44100 kr=4410 ksmps=10 nchnls=2 instr 1 ;Global initialization gi2fqc init cpspch(p4) gi3fqc init cpspch(p5) endin instr 2 ; Epicycloid or Spirograph curve ; This set of parametric equations defines the path traced by ; a point on a circle of radius B rotating outside a circle of ; radius A. ifqc init cpspch(p5) ifqci init gi2fqc gi2fqc init ifqc ia init p6 ib init p7 ihole init p8 iscale init 1/(ia+2*ib) kampenv linseg 0, .02, p4*iscale, p3-.04, p4*iscale, .02, 0 kptchenv linseg ifqci, .2*p3, ifqc, .8*p3, ifqc kvibenv linseg 0, .5, 0, .2, 1, .2, 1 kvibr oscil 20, 8, 1 kfqc = kptchenv+kvibr*kvibenv ; Sine and Cosine acos1 oscil ia+ib, kfqc, 1, .25 acos2 oscil ib*ihole, (ia-ib)/ib*kfqc, 1, .25 ax = acos1 + acos2 asin1 oscil ia+ib, kfqc, 1 asin2 oscil ib, (ia-ib)/ib*kfqc, 1 ay = asin1 - asin2 outs kampenv*ax, kampenv*ay endin instr 3 ; Hypocycloid or Spirograph curve ; This set of parametric equations defines the path traced by ; a point on a circle of radius B rotating inside a circle of ; radius A. ifqc = cpspch(p5) ifqci init gi3fqc gi3fqc init ifqc ia = p6 ib = p7 ihole = p8 iscale = (ia