I’ve got part of the way there, but with the way I’ve set it up it’s overloading the MIDI buffer on my synth and freezing it. This wasn’t happening before virtual parameters.
First I put only the patch response headers into JSON:
Then I moved the requests over to LUA:
function patch.onRequest(device)
local chan = parameterMap.get (1, PT_VIRTUAL, 311)
local requestVoiceDump = {0x43,chan+32,0x7e,0x4c,0x4d,0x20,0x20,0x38,0x39,0x37,0x36,0x41,0x45}
midi.sendSysex (PORT_1, requestVoiceDump)
local requestSystemDump = {0x43,chan+32,0x7e,0x4c,0x4d,0x20,0x20,0x38,0x39,0x37,0x36,0x53,0x30}
midi.sendSysex (PORT_1, requestSystemDump)
local requestEffectsDump = {0x43,chan+32,0x7e,0x4c,0x4d,0x20,0x20,0x38,0x39,0x37,0x36,0x53,0x32}
midi.sendSysex (PORT_1, requestEffectsDump)
end
function patch.onResponse (device, responseId, sysexBlock)
local blockLength = sysexBlock:getLength()
print ("Received sysex message " .. blockLength .. " bytes long.")
if blockLength == 41 then
parseACED (sysexBlock)
elseif blockLength == 101 then
parseVCED (sysexBlock)
elseif blockLength == 45 then
parseSYS (sysexBlock)
elseif blockLength == 73 then
parseFX (sysexBlock)
end
end
Then I put in the rules in like so:
parameterMap.set (1, PT_SYSEX , 99, sysexBlock:peek(7)) -- Op4 AR (Attack Rate)
parameterMap.set (1, PT_SYSEX , 1, sysexBlock:peek(8)) -- Op4 D1R (Decay 1 Rate)
parameterMap.set (1, PT_SYSEX , 2, sysexBlock:peek(9)) -- Op4 D2R (Decay 1 Rate)
parameterMap.set (1, PT_SYSEX , 3, sysexBlock:peek(10)) -- Op4 RR (Release Rate)
parameterMap.set (1, PT_VIRTUAL, 4, sysexBlock:peek(11)) -- Op4 D1L (Decay 1 Level)
It looks like each parameterMap.set()
function sends out a midi message, so it’s too much MIDI traffic for the synth to handle. When the mapping rules are purely in JSON they don’t do that. So still stuck with my original problem. How do I sync the virtual controls with the synth’s memory?