Further to my post about issues I’m having with Bass Station 2 and NRPNs
I think I’ve found the cause and a possible bug
When sending NRPNs electra will send a pair of messages CC98 and CC99 to indicate which parameter is going to be adjusted
Electra then sends CC6 and a CC38 messages for values. However, it doesn’t appear to be setting these pair of messages correctly. According to MIDI NRPN and RPN by Phil Rees CC38 is an optional message for refinement of the main value which is sent in CC6.
So if I setup an NRPN which only has 4 possible values (0-3). Electra will always send CC6 as zero with the CC38 sent with a value of 0 - 3. This is irrespective of the MSB first / LSB first setting
In the case of the Bass Station 2. it is only monitoring the CC6 value which is always received as zero.
Doing a bit more googling it seems that some manufacturers particularly Novation use NRPNs to give themselves more midi controllable parameters but when the value to be communicated is 7 bit they are omitting the CC38
Nevermind, I got it to work. Turns out I was using a bad value for the port… duh. In case someone else needs to send NRPN messages, here is the implementation in Lua:
function sendNrpn(port, channel, parameter, value)
local parameterMSB = (parameter >> 7) & 0x7F
local parameterLSB = parameter & 0x7F
local valueMSB = (value >> 7) & 0x7F
local valueLSB = value & 0x7F
local messages = {
{channel = channel, type = CONTROL_CHANGE, controllerNumber = 99, value = parameterMSB},
{channel = channel, type = CONTROL_CHANGE, controllerNumber = 98, value = parameterLSB},
{channel = channel, type = CONTROL_CHANGE, controllerNumber = 6, value = valueMSB},
{channel = channel, type = CONTROL_CHANGE, controllerNumber = 38, value = valueLSB}
}
for i, msg in ipairs(messages) do
midi.sendMessage(port, msg)
end
end