| 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 gensone.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 ; simple oscillator with loudness correction. |
| 17 |
|
| 18 |
kcps = cpspch(p4) |
| 19 |
kenv linseg 0, p3*0.25, 1, p3*0.75, 0 ;amplitude envelope |
| 20 |
kamp tablei 16384 *kenv, 2 |
| 21 |
asig oscil kamp, kcps, 1 |
| 22 |
outs asig, asig |
| 23 |
|
| 24 |
endin |
| 25 |
|
| 26 |
instr 2 ;neutral oscillator to compare with |
| 27 |
|
| 28 |
kcps = cpspch(p4) |
| 29 |
kenv linseg 0, p3*0.25, 1, p3*0.75, 0 ;amplitude envelope |
| 30 |
asig oscil kenv, kcps, 1 |
| 31 |
outs asig, asig |
| 32 |
|
| 33 |
endin |
| 34 |
|
| 35 |
</CsInstruments> |
| 36 |
<CsScore> |
| 37 |
f 1 0 16384 10 1 ;sine wave |
| 38 |
f 2 0 16385 "sone" 0 32000 32000 0 |
| 39 |
|
| 40 |
s |
| 41 |
f 0 1 ;1 second of silence before we start... |
| 42 |
s |
| 43 |
i 1 0 2 7.00 |
| 44 |
i 1 + . 7.01 |
| 45 |
i 1 + . 8.02 |
| 46 |
i 1 + . 8.03 |
| 47 |
s |
| 48 |
i 2 0 2 7.00 |
| 49 |
i 2 + . 7.01 |
| 50 |
i 2 + . 8.02 |
| 51 |
i 2 + . 8.03 |
| 52 |
e |
| 53 |
</CsScore> |
| 54 |
</CsoundSynthesizer> |
| 55 |
|