| 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 gen24.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 ;normalize to 0-1 |
| 22 |
kval table kndx, ifn, ixmode |
| 23 |
asig poscil .7, 440 + kval, 1 ;add to frequency |
| 24 |
outs asig, asig |
| 25 |
|
| 26 |
endin |
| 27 |
</CsInstruments> |
| 28 |
<CsScore> |
| 29 |
f 1 0 16384 10 1 ;sine wave |
| 30 |
f 10 0 16384 -24 1 0 400;scale sine wave from table 1 from 0 to 400 |
| 31 |
f 11 0 16384 -24 1 0 50 ;and from 0 to 50 |
| 32 |
|
| 33 |
i 1 0 3 10 |
| 34 |
i 1 4 3 11 |
| 35 |
e |
| 36 |
</CsScore> |
| 37 |
</CsoundSynthesizer> |