| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-+rtmidi=null -M0 |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
sr = 44100 |
| 7 |
ksmps = 8 |
| 8 |
nchnls = 2 |
| 9 |
0dbfs = 1 |
| 10 |
|
| 11 |
giSine ftgen 0, 0, 2^10, 10, 1 |
| 12 |
|
| 13 |
instr 1 |
| 14 |
iFreq cpsmidi ;gets frequency of a pressed key |
| 15 |
iAmp ampmidi 8;gets amplitude and scales 0-8 |
| 16 |
iRatio random .9, 1.1; ratio randomly between 0.9 and 1.1 |
| 17 |
aTone foscili .1, iFreq, 1, iRatio/5, iAmp+1, giSine; fm |
| 18 |
aEnv linenr aTone, 0, .01, .01; avoiding clicks at the end of a note |
| 19 |
outs aEnv, aEnv |
| 20 |
endin |
| 21 |
|
| 22 |
</CsInstruments> |
| 23 |
<CsScore> |
| 24 |
f 0 36000; play for 10 hours |
| 25 |
e |
| 26 |
</CsScore> |
| 27 |
</CsoundSynthesizer> |
| 28 |
;example by joachim heintz |