| 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 NervousHappyBirthday_Cucchi.wav -W ;;; for file output any platform |
| 8 |
; By Stefano Cucchi 2022 |
| 9 |
</CsOptions> |
| 10 |
<CsInstruments> |
| 11 |
|
| 12 |
sr = 48000 |
| 13 |
ksmps = 10 |
| 14 |
nchnls = 2 |
| 15 |
0dbfs = 1 |
| 16 |
instr 1 |
| 17 |
|
| 18 |
; MAX - MIN - JUMP |
| 19 |
gicount cntCreate p4, p5, p6 |
| 20 |
kreadcount cntRead gicount |
| 21 |
kvalcycles cntCycles gicount |
| 22 |
printk2 kreadcount ; print the actual value |
| 23 |
printk2 kvalcycles ; print "how many times" the counter has cycled |
| 24 |
endin |
| 25 |
|
| 26 |
instr 10 |
| 27 |
kTrigFreq randomi 0.57, 12, p4 |
| 28 |
ktrigger metro kTrigFreq |
| 29 |
idur = 0.65 |
| 30 |
ifunction = p5 |
| 31 |
schedkwhen ktrigger, 0, 20, 20, 0, idur, ifunction |
| 32 |
endin |
| 33 |
|
| 34 |
instr 20 |
| 35 |
ipchndx count_i gicount |
| 36 |
ipch table ipchndx, p4 |
| 37 |
aenv expseg 1, p3, .001 |
| 38 |
asig oscil 0.2 * aenv, cpspch(ipch), 1 |
| 39 |
outs asig, asig |
| 40 |
endin |
| 41 |
|
| 42 |
</CsInstruments> |
| 43 |
<CsScore> |
| 44 |
f 1 0 4096 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 |
| 45 |
f 2 0 64 -2 7 7.00 7.00 7.02 7.00 7.05 7.04 7.00 7.00 7.02 7.00 7.07 7.05 |
| 46 |
f 3 0 64 -2 7 7.00 8.00 8.00 7.09 7.05 7.02 7.00 8.00 8.00 7.09 7.05 7.02 |
| 47 |
f 4 0 64 -2 7 7.10 7.10 7.09 7.05 7.07 7.05 7.10 7.10 7.09 7.05 7.07 7.05 |
| 48 |
|
| 49 |
i 1 0 10 12 0 1 ; play every note |
| 50 |
i 1 5 5 12 0 2 ; one note YES and one note NO - JUMP = 2 |
| 51 |
i 1 10 5 12 7 1 ; every note from position 7 to 12 |
| 52 |
i 1 15 10 12 0 1 ; play every note |
| 53 |
i 10 0 20 24 2 |
| 54 |
i 10 12 12 21 3 |
| 55 |
i 10 13 20 11 4 |
| 56 |
e |
| 57 |
</CsScore> |
| 58 |
</CsoundSynthesizer> |