summaryrefslogtreecommitdiff
path: root/audio/csound4-manual/files/rt-midi-input.orc
diff options
context:
space:
mode:
authorben <ben>2006-05-21 22:34:08 +0000
committerben <ben>2006-05-21 22:34:08 +0000
commit57b675f6fa9fa143c5858790b700efbedb8547f1 (patch)
tree4c75250d7fc3e756f3960de304fb6abf6d916746 /audio/csound4-manual/files/rt-midi-input.orc
parent4c3e1c53d8848f3bf2ba9fc48c756e8cf0593c2a (diff)
downloadpkgsrc-57b675f6fa9fa143c5858790b700efbedb8547f1.tar.gz
Moved from audio/csound-manual to audio/csound4-manual in preparation for
coexistence with csound5-manual. Remove pkgrevision.
Diffstat (limited to 'audio/csound4-manual/files/rt-midi-input.orc')
-rw-r--r--audio/csound4-manual/files/rt-midi-input.orc23
1 files changed, 23 insertions, 0 deletions
diff --git a/audio/csound4-manual/files/rt-midi-input.orc b/audio/csound4-manual/files/rt-midi-input.orc
new file mode 100644
index 00000000000..57d12052c0a
--- /dev/null
+++ b/audio/csound4-manual/files/rt-midi-input.orc
@@ -0,0 +1,23 @@
+# 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