| 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 linseg.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 |
giSine ftgen 0, 0, 2^10, 10, 1 |
| 17 |
|
| 18 |
instr 1 |
| 19 |
|
| 20 |
kcps = cpspch(p4) |
| 21 |
kenv linsegb 0, 0.25, 1, 1, 0 |
| 22 |
asig poscil kenv, kcps, giSine |
| 23 |
outs asig, asig |
| 24 |
|
| 25 |
endin |
| 26 |
|
| 27 |
instr 2 ; scaling to duration |
| 28 |
|
| 29 |
kcps = cpspch(p4) |
| 30 |
kenv linseg 0, p3*0.25, 1, p3, 0 |
| 31 |
asig poscil kenv, kcps, giSine |
| 32 |
outs asig, asig |
| 33 |
|
| 34 |
endin |
| 35 |
|
| 36 |
</CsInstruments> |
| 37 |
<CsScore> |
| 38 |
|
| 39 |
i 1 0 1 7.00 ; = 1 sec, p3 fits exactly |
| 40 |
i 1 2 2 7.00 ; = 2 sec, p3 truncated at 1 sec |
| 41 |
|
| 42 |
i 2 4 1 7.00 ; scales to duration |
| 43 |
i 2 6 2 7.00 ; of p3 |
| 44 |
|
| 45 |
e |
| 46 |
</CsScore> |
| 47 |
</CsoundSynthesizer> |