| 1 |
/*Getting started.. Realtime Interaction: MIDI Notes |
| 2 |
|
| 3 |
Select the MIDI input port in CsoundQts "preferences" menu under the tab "run" -> "RT MIDI Module". Then you can choose between "portmidi" or "virtual". "portmidi" with option "a", enables all available midi-devices. "Virtual" enables the virtual midikeyboard, which you can play with your alphabetic computer keyboard. |
| 4 |
|
| 5 |
Without modification, the MIDI-Channel-Number selects the Csound Instrument Number. (MIDI Ch 1 = instr 1, MIDI Ch 2 = instr 2, ...) |
| 6 |
To route the desired MIDI-information (note-number and velocity) to the p-arguments (4 and 5), it will be defined in CsOptions: |
| 7 |
--midi-key-cps=4 --midi-velocity=5 |
| 8 |
Each instrument can be played polyphonic, and every voice has independent velocity. |
| 9 |
|
| 10 |
The opcode 'massign' can be used, to make new connections between MIDI-Ch. and Csound Instruments. In this case, "massign 0, 1" assigns all MIDI-Channels to instrument 1. |
| 11 |
|
| 12 |
*/ |
| 13 |
<CsoundSynthesizer> |
| 14 |
<CsOptions> |
| 15 |
--midi-key-cps=4 --midi-velocity-amp=5 |
| 16 |
</CsOptions> |
| 17 |
<CsInstruments> |
| 18 |
ksmps = 32 |
| 19 |
massign 0, 1 ; assign all midi-channels to instr 1 |
| 20 |
|
| 21 |
instr 1 |
| 22 |
anote oscils p5, p4, 0 |
| 23 |
kenv madsr 0.01, 0.1, 0.9, 0.01 ; defining the envelope |
| 24 |
out anote * kenv ; scaling the source-signal with the envelope |
| 25 |
endin |
| 26 |
</CsInstruments> |
| 27 |
<CsScore> |
| 28 |
e 3600 |
| 29 |
</CsScore> |
| 30 |
</CsoundSynthesizer> |
| 31 |
; written by Alex Hofmann & Joachim Heintz (Dec. 2009) - Incontri HMT-Hannover |
| 32 |
<bsbPanel> |
| 33 |
<label>Widgets</label> |
| 34 |
<objectName/> |
| 35 |
<x>803</x> |
| 36 |
<y>279</y> |
| 37 |
<width>563</width> |
| 38 |
<height>397</height> |
| 39 |
<visible>true</visible> |
| 40 |
<uuid/> |
| 41 |
<bgcolor mode="background"> |
| 42 |
<r>7</r> |
| 43 |
<g>95</g> |
| 44 |
<b>162</b> |
| 45 |
</bgcolor> |
| 46 |
<bsbObject version="2" type="BSBLabel"> |
| 47 |
<objectName/> |
| 48 |
<x>25</x> |
| 49 |
<y>24</y> |
| 50 |
<width>137</width> |
| 51 |
<height>53</height> |
| 52 |
<uuid>{9bdfe824-cf72-4d54-ad73-95b589534259}</uuid> |
| 53 |
<visible>true</visible> |
| 54 |
<midichan>0</midichan> |
| 55 |
<midicc>-3</midicc> |
| 56 |
<label>..nothing here!</label> |
| 57 |
<alignment>left</alignment> |
| 58 |
<font>Lucida Grande</font> |
| 59 |
<fontsize>18</fontsize> |
| 60 |
<precision>3</precision> |
| 61 |
<color> |
| 62 |
<r>255</r> |
| 63 |
<g>255</g> |
| 64 |
<b>255</b> |
| 65 |
</color> |
| 66 |
<bgcolor mode="nobackground"> |
| 67 |
<r>255</r> |
| 68 |
<g>255</g> |
| 69 |
<b>255</b> |
| 70 |
</bgcolor> |
| 71 |
<bordermode>noborder</bordermode> |
| 72 |
<borderradius>1</borderradius> |
| 73 |
<borderwidth>1</borderwidth> |
| 74 |
</bsbObject> |
| 75 |
</bsbPanel> |
| 76 |
<bsbPresets> |
| 77 |
</bsbPresets> |
| 78 |
<EventPanel name="Events" tempo="60.00000000" loop="8.00000000" x="60" y="304" width="513" height="322" visible="true" loopStart="0" loopEnd="0"> </EventPanel> |