summaryrefslogtreecommitdiff
path: root/examples-xml/midiprogramchange.csd.xml
diff options
context:
space:
mode:
Diffstat (limited to 'examples-xml/midiprogramchange.csd.xml')
-rw-r--r--examples-xml/midiprogramchange.csd.xml36
1 files changed, 36 insertions, 0 deletions
diff --git a/examples-xml/midiprogramchange.csd.xml b/examples-xml/midiprogramchange.csd.xml
new file mode 100644
index 0000000..16e78fd
--- /dev/null
+++ b/examples-xml/midiprogramchange.csd.xml
@@ -0,0 +1,36 @@
+<programlisting>
+<emphasis role="csdtag">&lt;CsoundSynthesizer&gt;</emphasis>
+<emphasis role="csdtag">&lt;CsOptions&gt;</emphasis>
+<emphasis role="comment">; Select audio/midi flags here according to platform</emphasis>
+-odac -M1 -Q1 <emphasis role="comment">;;;realtime audio out and midi in and midi out</emphasis>
+<emphasis role="comment">;-iadc ;;;uncomment -iadc if realtime audio input is needed too</emphasis>
+<emphasis role="comment">; For Non-realtime ouput leave only the line below:</emphasis>
+<emphasis role="comment">; -o midiprogramchange.wav -W ;;; for file output any platform</emphasis>
+<emphasis role="csdtag">&lt;/CsOptions&gt;</emphasis>
+<emphasis role="csdtag">&lt;CsInstruments&gt;</emphasis>
+
+<emphasis role="ohdr">sr</emphasis> <emphasis role="op">=</emphasis> 44100
+<emphasis role="ohdr">ksmps</emphasis> <emphasis role="op">=</emphasis> 32
+<emphasis role="ohdr">nchnls</emphasis> <emphasis role="op">=</emphasis> 2
+<emphasis role="ohdr">0dbfs</emphasis> <emphasis role="op">=</emphasis> 1
+
+<emphasis role="oblock">instr</emphasis> 1 <emphasis role="comment">;uses external midi device</emphasis>
+
+kkey <emphasis role="opc">init</emphasis> 0 <emphasis role="comment">;initialize key number</emphasis>
+kvel <emphasis role="opc">init</emphasis> 0 <emphasis role="comment">;initialize velocity</emphasis>
+<emphasis role="opc">midiprogramchange</emphasis> 52 <emphasis role="comment">;choose GM program number 52 = string pad</emphasis>
+<emphasis role="opc">midinoteonkey</emphasis> kkey, kvel <emphasis role="comment">;MIDI note number value</emphasis>
+<emphasis role="opc">printk2</emphasis> kkey <emphasis role="comment">;display the key value when it changes and when key is pressed </emphasis>
+<emphasis role="opc">midion</emphasis> 1, kkey, kvel <emphasis role="comment">;sent note to external device</emphasis>
+
+<emphasis role="oblock">endin</emphasis>
+<emphasis role="csdtag">&lt;/CsInstruments&gt;</emphasis>
+<emphasis role="csdtag">&lt;CsScore&gt;</emphasis>
+<emphasis role="stamnt">f</emphasis> 0 30 <emphasis role="comment">;runs for 30 seconds </emphasis>
+
+<emphasis role="stamnt">i</emphasis> 1 0 2 62 <emphasis role="comment">; play these notes from score as well</emphasis>
+<emphasis role="stamnt">i</emphasis> 1 + 2 65
+<emphasis role="stamnt">e</emphasis>
+<emphasis role="csdtag">&lt;/CsScore&gt;</emphasis>
+<emphasis role="csdtag">&lt;/CsoundSynthesizer&gt;</emphasis>
+</programlisting> \ No newline at end of file