| 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 gen08.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 |
|
| 18 |
ifn = p4 ;choose between tables |
| 19 |
kcps init 1/p3 ;create index over duration of note. |
| 20 |
kndx phasor kcps |
| 21 |
ixmode = 1 |
| 22 |
kval table kndx, 2, ixmode ;normalize index data |
| 23 |
|
| 24 |
ibasefreq = 440 |
| 25 |
kfreq = kval * 100 ;scale |
| 26 |
asig poscil .7, ibasefreq + kfreq, 1 ;and add to frequency |
| 27 |
outs asig, asig |
| 28 |
|
| 29 |
endin |
| 30 |
</CsInstruments> |
| 31 |
<CsScore> |
| 32 |
f 1 0 16384 10 1 ;sine wave. |
| 33 |
f 2 0 65 8 0 16 1 16 1 16 0 17 0 |
| 34 |
f 3 0 65 8 -1 32 1 2 0 14 0 17 0 |
| 35 |
|
| 36 |
i 1 0 2 1 |
| 37 |
i 1 3 2 2 |
| 38 |
e |
| 39 |
</CsScore> |
| 40 |
</CsoundSynthesizer> |
| 41 |
|