JackoMidiOut

JackoMidiOut — Sends a MIDI channel message to a Jack port.

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

Sends a MIDI channel message to a Jack MIDI output port inside this instance of Csound, and in turn to its connected external Jack MIDI input port.

Syntax

JackoMidiOut  ScsoundPortName, kstatus, kchannel, kdata1[, kdata2]

Initialization

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

Performance

kstatus -- MIDI status byte; must indicate a MIDI channel message.

kchannel -- MIDI channel (from 0 through 15).

kdata1 -- First data byte of a MIDI channel message.

kdata2 -- Optional second data byte of a MIDI channel message.

This opcode can be called any number of times in the same kperiod. Messages from multiple instances of the opcode sending to the same port are collected before sending.

Running status, system exclusive messages, and real-time messages are not supported.

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 JackoMidiOut opcode. It uses the file JackoMidiOut.csd.

Example 499. Example of the JackoMidiOut opcode.

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

<CsoundSynthesizer>
<CsOptions>
-n ; no sound
</CsOptions>
<CsInstruments>

sr      = 48000 ; one possible Jack setting
ksmps   = 128
nchnls  = 2

; by Menno Knevel - 2023
; The example shows how Control Changes and Program Change 
; to drive an external synthesizer

JackoInit   "default", "csound6"                        ; Csound as a Jack client
JackoMidiOutConnect "midioutMAUDIO", "M-Audio-Delta-1010:midi/capture_1"

instr 1	

irandom     random      30, 80
JackoMidiOut  "midioutMAUDIO", 192, 1-1, 21             ; Program Change (GM Musette)
JackoMidiOut  "midioutMAUDIO", 176, 1-1, 74, p4         ; Control Change Brightness
JackoNoteOut  "midioutMAUDIO", 1-1, irandom, 100        ; channel range 0-15

endin

</CsInstruments>
<CsScore>

i1 1 1 100
i1 2 1 50
i1 3 3 30
i1 6 2 127
e 
</CsScore>
</CsoundSynthesizer>


See also

Jacko Opcodes

Credits

By: Michael Gogins 2010