| 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 lpshold.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 |
kfrq init p4 ; frequency of the loop |
| 18 |
ifrac = p5 ; fraction of frequency at which to force retrigger |
| 19 |
ipan = p6 ; pan position |
| 20 |
ktrig metro kfrq * ifrac ; trigger to force restart the loop |
| 21 |
iphs = 0 ; initial phase of the loop |
| 22 |
; a loop of midi note numbers: note duration etc... |
| 23 |
knote lpshold kfrq, ktrig, iphs, 61, 0.0625, 60, 0.9375, 61, 1, 58, 1, \ |
| 24 |
63, 2, 65, 3 |
| 25 |
aenv linseg 0,0.01,1,p3-0.11,1,0.1,0 ; amplitude envelope |
| 26 |
krnd rspline -0.05,0.05,0.5,1 ; random detune |
| 27 |
asig gbuzz 0.2*aenv, cpsmidinn(knote+krnd), 30, 1, 0.5, 1 |
| 28 |
outs asig*ipan, asig*(1-ipan) |
| 29 |
endin |
| 30 |
|
| 31 |
</CsInstruments> |
| 32 |
<CsScore> |
| 33 |
; cosine wave. |
| 34 |
f 1 0 16384 11 1 |
| 35 |
|
| 36 |
; 3 layers of the loop are played, each at a different speed, |
| 37 |
; - with different retriggering rate, and pan location. |
| 38 |
i 1 0 60 0.5 [8/10] 0.5 |
| 39 |
i 1 0 60 0.375 [8/11] 0.1 |
| 40 |
i 1 0 60 0.25 [8/13] 0.9 |
| 41 |
e |
| 42 |
</CsScore> |
| 43 |
</CsoundSynthesizer> |