Output midi channels

6 replies [Last post]
BinaryCat
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 2017-03-12
Posts:

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.

swindus
User offline. Last seen 4 hours 30 min ago. Offline
Joined: 2014-07-30
Posts:

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

BinaryCat
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 2017-03-12
Posts:

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

robertaramar
robertaramar's picture
User offline. Last seen 1 week 5 days ago. Offline
Joined: 2012-05-10
Posts:

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}, }
end

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

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;
end

-- 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
end
tx_midi (t, d)
end
end

BinaryCat
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 2017-03-12
Posts:

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 :-)

robertaramar
robertaramar's picture
User offline. Last seen 1 week 5 days ago. Offline
Joined: 2012-05-10
Posts:

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.

BinaryCat
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 2017-03-12
Posts:

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