| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac ;;;realtime audio out |
| 5 |
;-iadc ;;;uncomment -iadc if realtime audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o loopseg.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
nchnls = 2 |
| 14 |
0dbfs = 1 |
| 15 |
|
| 16 |
instr 1 |
| 17 |
kfreq init p4 ; frequency of loop repetition |
| 18 |
ifrac = p5 ; frequency ratio of restart triggers |
| 19 |
ktrig metro kfreq * ifrac ; triggers to restart loop |
| 20 |
iphase = 0 ; initial phase |
| 21 |
; loop of note values (some glissandi) |
| 22 |
; val dur val dur etc... |
| 23 |
knote loopseg kfreq, ktrig, iphase, 40, 1, 40, 0, 43,1,43,0, 49,2,48,0, \ |
| 24 |
47,1,47,0, 46,1,46,0, 46,1,47,0, 49,1,49,0, 43,1,43,0, 46,1,46,0, 40,1,39,0 |
| 25 |
; loop of filter cutoff values (oct format). This loop, half speed of note loop. |
| 26 |
kcfoct loopseg kfreq*0.5, ktrig, iphase, 11,2,4,0, 12,1,4,0, 13,1,4,0, \ |
| 27 |
11.5,3,4,0, 12.5,1,4,0, 13,2,4,0, 12.5,1,4,0 |
| 28 |
kenv linseg 0,0.01,1,p3-5.01,1,5,0 |
| 29 |
ioct = int((rnd(0.999)*4)-2) ; random value either -1, 0 or 1 |
| 30 |
asig vco2 0.2*kenv,cpsmidinn(knote)*octave(ioct),0 ; sawtooth |
| 31 |
asig moogladder asig,cpsoct(kcfoct),rnd(0.6) ; filter sawtooth |
| 32 |
aL,aR pan2 asig,rnd(1) ; random static pan location |
| 33 |
outs aL, aR |
| 34 |
endin |
| 35 |
|
| 36 |
</CsInstruments> |
| 37 |
<CsScore> |
| 38 |
|
| 39 |
; 4 layers, each with a different frequency of loop repetition (p4), |
| 40 |
; frequency ratio of restart triggers (p5) and pan position (p6). |
| 41 |
i 1 0 30 0.5 [11/19] |
| 42 |
i 1 6 30 0.25 [11/13] |
| 43 |
i 1 12 30 0.125 [11/16] |
| 44 |
i 1 18 30 1 [11/12] |
| 45 |
e |
| 46 |
</CsScore> |
| 47 |
</CsoundSynthesizer> |