JackoMidiInConnect

JackoMidiInConnect — Creates a MIDI connection from a Jack port to Csound.

Description

Plugin opcode in jacko. This opcode is part of the plugin repository and has to be installed separately. The plugin repository can be found here: https://github.com/csound/plugins

In the orchestra header, creates a MIDI connection from an external Jack MIDI output port to this instance of Csound.

Syntax

JackoMidiInConnect SexternalPortName, ScsoundPortName

Initialization

SexternalPortName -- The full name ("clientname:portname") of an external Jack MIDI output port.

ScsoundPortName -- The short name ("portname") of the internal Jack MIDI input port.

Must be used in conjunction with the -M0 -+rtmidi=null Csound command-line options. Can be used in with the MIDI inter-operability command-line options and/or opcodes to enable the use of ordinary Csound instrument definitions to render external scores or MIDI sequences.

Note that Csound can connect to ALSA ports through Jack, but in that case you will have to identify the port by its alias in the JackInfo printout.

Performance

The actual MIDI events will be received in the regular Csound way, i.e. through a MIDI driver and the sensevents mechanism, rather than through a Jack input port opcode.

The granularity of timing is Csound's kperiod.

[Note] Note
works with an already running Jack daemon. Do not use -+rtaudio=jack in CsOptions

Examples

Here is an example of the JackoMidiInConnect opcode. It uses the file JackoMidiInConnect.csd.

Example 497. Example of the JackoMidiInConnect opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<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

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>


See also

Jacko Opcodes

Credits

By: Michael Gogins 2010