Skip to content

Commit

Permalink
Merge pull request #680 from tjingboem/master
Browse files Browse the repository at this point in the history
2 more Jacko opcode examples
  • Loading branch information
tjingboem authored Oct 7, 2023
2 parents bebbad3 + 8672741 commit f7d8fff
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 2 deletions.
78 changes: 78 additions & 0 deletions examples/JackoFreewheel.csd
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<CsoundSynthesizer>
<CsOptions>
csound -m255 -M0 -+rtmidi=null -RWf --midi-key=4 --midi-velocity=5 -o jacko_test.wav
</CsOptions>
<CsInstruments>
; NOTE: this csd must be run after starting the software synthesizer "aeolus -t".
sr = 48000 ; The control rate must be BOTH a power of 2 (for Jack)
ksmps = 128
nchnls = 2
0dbfs = 1
JackoInit "default", "csound"
; JackoMidiInConnect "alsa_pcm:in-131-0-Master", "midiin"
JackoAudioInConnect "aeolus:out.L", "leftin"
JackoAudioInConnect "aeolus:out.R", "rightin"
JackoMidiOutConnect "midiout", "aeolus:Midi/in"
; Note that Jack enables audio to be output to a regular Csound soundfile and, at the same time, to a
; soundcard in real time to the system client via Jack.
JackoAudioOutConnect "leftout", "system:playback_1"
JackoAudioOutConnect "rightout", "system:playback_2"
JackoInfo
JackoFreewheel 1 ; Turning freewheeling on seems automatically to turn system playback off. This is good!
JackoOn
alwayson "jackin"
instr 1
ichannel = p1 - 1
itime = p2
iduration = p3
ikey = p4
ivelocity = p5
JackoNoteOut "midiout", ichannel, ikey, ivelocity
print itime, iduration, ichannel, ikey, ivelocity
endin
instr jackin
JackoTransport 3, 1.0
aleft JackoAudioIn "leftin"
aright JackoAudioIn "rightin"
; Aeolus uses MIDI controller 98 to control stops. Only 1 data value byte is used, not the 2 data
; bytes often used with NRPNs. The format for control mode is
; 01mm0ggg: mm 10 to set stops, 0, ggg group (or Division, 0 based).
; The format for stop selection is 000bbbbb: bbbbb for button number (0 based).
; Mode to enable stops for Divison I: b1100010 (98) [this controller VALUE is a pure coincidence]).
JackoMidiOut "midiout", 176, 0, 98, 98
; Stops: Principal 8 (0), Principal 4 (1) , Flote 8 (8) , Flote 2 (10)
JackoMidiOut "midiout", 176, 0, 98, 0
JackoMidiOut "midiout", 176, 0, 98, 1
JackoMidiOut "midiout", 176, 0, 98, 8
JackoMidiOut "midiout", 176, 0, 98, 10
; Sends audio coming in from Aeolus out not only to the Jack system out (sound card), but also to the output soundfile.
; Note that in freewheeling mode, "leftout" and "rightout" simply go silent.
JackoAudioOut "leftout", aleft
JackoAudioOut "rightout", aright
outs aright, aleft
endin
</CsInstruments>
<CsScore>
f 0 30
i 1 1 30 60 60
i 1 2 30 64 60
i 1 3 30 71 60
e 2
</CsScore>
</CsoundSynthesizer>
32 changes: 32 additions & 0 deletions examples/JackoMidiInConnect.csd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<CsoundSynthesizer>
<CsOptions>
-M0 -+rtmidi=null
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 128
nchnls = 2
0dbfs = 1
; by Menno Knevel - 2023
; The example shows how to connect a Midi port (Edirol) to the Midi In of Instrument 1
JackoInit "default", "csound6" ; Csound as a Jack client
JackoMidiInConnect "UM-3:midi/playback_2", "midiinEDIROL" ; create 1 Midi in port
JackoOn
instr 1 ; get notes to the EDIROL Midi port
ifreq cpsmidi
iamp ampmidi .7
aout vco2 iamp, ifreq
outs aout, aout
endin
</CsInstruments>
<CsScore>
i1 1 30
e
</CsScore>
</CsoundSynthesizer>
7 changes: 6 additions & 1 deletion opcodes/JackoFreewheel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@
<refsect1>
<title>Examples</title>
<para>
Here is an example of the JackoFreewheel opcode. It uses the file <ulink url="examples/jacko.csd"><citetitle>jacko.csd</citetitle></ulink>.
Here is an example of the JackoFreewheel opcode. It uses the file <ulink url="examples/JackoFreewheel.csd"><citetitle>JackoFreewheel.csd</citetitle></ulink>.
<example>
<title>Example of the JackoFreewheel opcode.</title>
<para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
<xi:include href="examples-xml/JackoFreewheel.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</example>
</para>
</refsect1>

Expand Down
7 changes: 6 additions & 1 deletion opcodes/JackoMidiInConnect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@
<refsect1>
<title>Examples</title>
<para>
Here is an example of the JackoMidiInConnect opcode. It uses the file <ulink url="examples/jacko.csd"><citetitle>jacko.csd</citetitle></ulink>.
Here is an example of the JackoMidiInConnect opcode. It uses the file <ulink url="examples/JackoMidiInConnect.csd"><citetitle>JackoMidiInConnect.csd</citetitle></ulink>.
<example>
<title>Example of the JackoMidiInConnect opcode.</title>
<para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
<xi:include href="examples-xml/JackoMidiInConnect.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</example>
</para>
</refsect1>

Expand Down

0 comments on commit f7d8fff

Please sign in to comment.