| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
;;;RT audio out, midi in, note=p4 and velocity=p5 |
| 5 |
-odac -+rtmidi=virtual -M0d --midi-key=4 --midi-velocity-amp=5 |
| 6 |
;-iadc ;;;uncomment -iadc if RT audio input is needed too |
| 7 |
; For Non-realtime ouput leave only the line below: |
| 8 |
; -o cpsmidinn.wav -W ;;; for file output any platform |
| 9 |
</CsOptions> |
| 10 |
<CsInstruments> |
| 11 |
|
| 12 |
sr = 44100 |
| 13 |
ksmps = 32 |
| 14 |
nchnls = 2 |
| 15 |
0dbfs = 1 |
| 16 |
|
| 17 |
massign 0, 1 ;assign all midi to instr. 1 |
| 18 |
|
| 19 |
instr 1 ;play virtual keyboard |
| 20 |
|
| 21 |
inote = p4 |
| 22 |
icps = cpsmidinn(inote) |
| 23 |
asig oscil 0.6, icps, 1 |
| 24 |
print icps |
| 25 |
outs asig, asig |
| 26 |
|
| 27 |
endin |
| 28 |
|
| 29 |
</CsInstruments> |
| 30 |
<CsScore> |
| 31 |
f0 20 |
| 32 |
;sine wave. |
| 33 |
f 1 0 16384 10 1 |
| 34 |
;play note from score too |
| 35 |
i1 0 1 60 |
| 36 |
e |
| 37 |
</CsScore> |
| 38 |
</CsoundSynthesizer> |