Fragments of a Bohlen-Pierce Composition Jacob Joaquin Feb 10, 2010 jacobjoaquin@gmail.com csound.noisepages.com sr = 44100 kr = 44100 ksmps = 1 nchnls = 2 0dbfs = 1.0 # define Synth # 1 # ; Just Intonation Bohlen-Pierce Tuning gitemp ftgen 13, 0, 64, -2, 13, 3, 440 * 2 ^ (-9 / 12), 60, \ 1, \ 27 / 25, \ 25 / 21, \ 9 / 7, \ 7 / 5, \ 75 / 49, \ 5 / 3, \ 9 / 5, \ 49 / 25, \ 15 / 7, \ 7 / 3, \ 63 / 25, \ 25 / 9, \ 3 gitemp ftgen 1, 0, 2 ^ 16, 10, 1 ; Sine wave gitemp ftgen 20, 0, -10, -2, 0, 1, 3, 4, 5, 6, 7, 10, 11, 13 ; Dur I gitemp ftgen 21, 0, -10, -2, 0, 2, 3, 4, 6, 7, 9, 10, 12, 13 ; Lambda gitemp ftgen 22, 0, -8, -2, 0, 2, 3, 0, 2, 7, 6, 13 ; Pattern gitemp ftgen 30, 0, 8192, -7, 0, 192, 1, 8000, 0 ; Envelope Shape instr $Synth idur = p3 ; Duration iamp = p4 ; Amplitude ibase = p5 ; Base note ipattern = p6 ; Table storing a pattern of intervals irate = p7 ; Rate phasor scans through pattern/envelope tables ipan = p8 ; Pan position i_index = p9 ; FM index of carrier i_ratio = p10 ; Ratio frequency of carrier kphasor phasor irate ktable table kphasor, ipattern, 1 kenv table kphasor * ftlen(ipattern), 30, 1, 0, 1 kenv2 linseg 1, idur * 0.95, 1, idur * 0.05, 0 kfreq cpstun 1, ibase + ktable, 13 a1 foscil 0.5, kfreq, 1, i_ratio, i_index, 1 a1 = a1 * kenv * kenv2 outs a1 * sqrt(1 - ipan), a1 * sqrt(ipan) endin # define Synth # 1 # t 0 60 i $Synth 0 600 0.5 70 22 0.350 0.2 1.5 1.618 i $Synth 0 600 0.5 70 22 0.3515 0.5 1.0 1 i $Synth 0 600 0.5 70 22 0.353 0.8 2.0 1.381 ; Alternate. Clean timbres. Different mode? ;i $Synth 0 600 0.5 60 22 0.350 0.2 1.5 2 ;i $Synth 0 600 0.5 60 22 0.3515 0.5 1.0 2 ;i $Synth 0 600 0.5 60 22 0.353 0.8 2.0 2