/*Getting started.. Realtime Interaction: MIDI Notes
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.
Without modification, the MIDI-Channel-Number selects the Csound Instrument Number. (MIDI Ch 1 = instr 1, MIDI Ch 2 = instr 2, ...)
To route the desired MIDI-information (note-number and velocity) to the p-arguments (4 and 5), it will be defined in CsOptions:
--midi-key-cps=4 --midi-velocity=5
Each instrument can be played polyphonic, and every voice has independent velocity.
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.
*/
--midi-key-cps=4 --midi-velocity-amp=5
ksmps = 32
massign 0, 1 ; assign all midi-channels to instr 1
instr 1
anote oscils p5, p4, 0
kenv madsr 0.01, 0.1, 0.9, 0.01 ; defining the envelope
out anote * kenv ; scaling the source-signal with the envelope
endin
e 3600
; written by Alex Hofmann & Joachim Heintz (Dec. 2009) - Incontri HMT-Hannover
803279563397true795162252413753{9bdfe824-cf72-4d54-ad73-95b589534259}true0-3left
Lucida Grande
183255255255255255255noborder11