Output midi channels


Hello all,

I have a little problem with midi channels (Ardour 5.8 and Linux). I have midi keyboard connected to computer via USB. I have external soud card Lexicon Lambda with midi. To this midi I have plug Novation Circuit. I set input midi (usb keyboard) and output midi (Lexicon Lambda). My problem is, when I can not set other output channel than 1. Please, exists any other possibilities? Thank you for help.


Yes, noticed this too. There is no way to change the midi channel on the midi output in realtime. The MIDI channel selector on the track does not change the realtime output. Does it just change the played notes from the track? Never tried it. The only way to change the channel in realtime I have found is using the plugin MIDI Channel Map from x42. http://x42-plugins.com/x42/x42-midifilter


Hello Swindus, thank you very much. For me is this plugin good solution.


Here ist another solution to this, it spares you from having to set 16 channel dropdowns to the same channel. Save this in a file called _midi_fix_channel.lua in your ~/.config/ardour5/scripts folder. Restart Ardour, you will then have a Plugin MIDI fix channel. Add it to your strip, double-click to edit the MIDI channel you want to nail everyting to.

function dsp_ioconfig ()
return { { midi_in = 1, midi_out = 1, audio_in = 0, audio_out = 0}, }

function dsp_params ()
{ [“type”] = “input”,
name = “Channel”,
doc = “Channel to be used for all data”,
min = 1, max = 16, default = 1, integer = true }

function dsp_run (_, _, n_samples)
assert (type(midiin) == “table”)
assert (type(midiout) == “table”)
local cnt = 1
local ctrl = CtrlPorts:array ()
local channel = ctrl[1];

function tx_midi (time, data)
	midiout[cnt] = {}
	midiout[cnt]["time"] = time;
	midiout[cnt]["data"] = data;
	cnt = cnt + 1;

-- for each incoming midi event
for _,b in pairs (midiin) do
	local t = b["time"] -- t = [ 1 .. n_samples ]
	local d = b["data"] -- get midi-event

	if (bit32.band (d[1], 240) ~= 240) then -- not a SYSEX
		d[1] = bit32.band (d[1], 240) + channel - 1
	tx_midi (t, d)



Dear Robert,
thank you very much for next solution. I am save script to file and put it to script folder. But I cannot find script in the Ardour. In log is write Script ‘/home/linuxium/.config/ardour5/scripts/_midi_fix_channel.lua’ has no valid descriptor. Please, what I make bad?
Thank you for your help :slight_smile:


I am sorry, indeed, the descriptor is missing. I have pasted the complete file with proper indention here: http://pastebin.com/nF9B4PRt
Now it should work.


Good job. Works very good.
Thank you very much Robert.