pkgsrc/audio/csound4-manual/files/rt-midi-input.orc
ben ebc5a306bb Moved from audio/csound-manual to audio/csound4-manual in preparation for
coexistence with csound5-manual.  Remove pkgrevision.
2006-05-21 22:34:08 +00:00

23 lines
565 B
Text

# use: csound -o /dev/sound -M /dev/rmidi1 rt-midi-input.orc rt-midi-input.sco
#
# you may need to use /dev/rmidi0 instead
instr 1
inum notnum ; note number
kfreq cpsmidib ; MIDI to frequency
iamp ampmidi inum*100 ; MIDI to amplitude
; (scaled within range)
if inum > 60 goto fun1 ; if the MIDI note number
; is over 60...
if inum < 61 goto fun2 ; if the note number is
; less than 61...
fun1:
ifn = 1
goto contin
fun2:
ifn = 2
goto contin
contin:
asig oscil iamp,kfreq,ifn
out asig
endin