| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-odac |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
sr = 44100 |
| 7 |
ksmps = 1 |
| 8 |
nchnls = 2 |
| 9 |
0dbfs = 1 |
| 10 |
|
| 11 |
instr 1 |
| 12 |
;delay time |
| 13 |
iDelTm = 0.01 |
| 14 |
;fill the delay line with either -1 or 1 randomly |
| 15 |
kDur timeinsts |
| 16 |
if kDur < iDelTm then |
| 17 |
aFill rand 1, 2, 1, 1 ;values 0-2 |
| 18 |
aFill = floor(aFill)*2 - 1 ;just -1 or +1 |
| 19 |
else |
| 20 |
aFill = 0 |
| 21 |
endif |
| 22 |
;delay and feedback |
| 23 |
aUlt init 0 ;last sample in the delay line |
| 24 |
aUlt1 init 0 ;delayed by one sample |
| 25 |
aMean = (aUlt+aUlt1)/2 ;mean of these two |
| 26 |
aUlt delay aFill+aMean, iDelTm |
| 27 |
aUlt1 delay1 aUlt |
| 28 |
outs aUlt, aUlt |
| 29 |
endin |
| 30 |
|
| 31 |
</CsInstruments> |
| 32 |
<CsScore> |
| 33 |
i 1 0 60 |
| 34 |
</CsScore> |
| 35 |
</CsoundSynthesizer> |
| 36 |
;example by joachim heintz, after martin neukom |