; More demonstrations of the phase distortion opcode ; pdhalf ; new in Csound 5.08 ; by Anthony Kozar ; http://www.anthonykozar.net/ sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 giDblPhaseTbl ftgen 0, 0, 16385, 7, 0.0, 8192, 1.0, 0, 0.0, 8193, 1.0 ; Shows how to obtain the "double sine" waveform ; of the Casio CZ-series synthesizers by using ; the output of pdhalf to read a second phase ; distortion table with a "double phasor" shape. ; This modified phase is then used to read a ; cosine table as in the other CZ waveforms. instr 4 idur = p3 iamp = p4 ifreq = p5 itable = p6 aenv linseg 0, .001, 1.0, idur - .051, 1.0, .05, 0 aosc phasor ifreq kamount linseg -1.0, 0.1, -0.9, 1.0, 0.0 apd pdhalf aosc, kamount apd2 tablei apd, giDblPhaseTbl, 1 aout tablei apd2, itable, 1 out aenv*aout*iamp endin f1 0 16385 10 1 f3 0 16385 9 1 1 270 ; inverted cosine ; descending "just blues" scale ; the CZ-series "double sine" waveform t 0 100 i4 0 .333 10000 512 3 i. + . . 448 i. + . . 384 i. + . . 360 i. + . . 341.33 i. + . . 298.67 i. + 2 . 256 e