I have several templates with patch parsing that stopped working.
I am pretty sure its due to updates to the webapp and/or json schema.
To all the templates there was added a “deviceid 1”, automaticly.
Where I used a different id in the template.
I am not a person to complain so easily but man this is frustrating.
I spend long hours making it work and now again long hours to make something work that already used to work.
I have other templates I need to fix but have not investigated yet.
The first issue is that getPatchNumberByte()
stopped working.
After creating a new json and amending the device id to 1 and migrate the patch data it now works.
Here is the .epr and .lua for the version i try to fix.
In the bottom i will describe the issue and why I consider this a bug.
Here is the LUA code:
mirageSoundProcessDeviceId = 1
incCount1 = 1
incCount2 = 1
device = devices.get (mirageSoundProcessDeviceId)
-- getPatchNumberByte function is added in the patch request and reponse in the json
-- it fetches the value from parameterNumber 40 (patch select) on the moment the patch request button is pressed
-- so that the same patch is requested as parameterNumber 40 (patch select) is set to.
function getPatchNumberByte()
local parameterNumber = 40
patchNumber = parameterMap.get (mirageSoundProcessDeviceId, PT_SYSEX, parameterNumber )
return (patchNumber)
end
-- SetMidiChannel callback added in json
function setMidiChannel (control, value)
device = devices.get (mirageSoundProcessDeviceId)
device:setChannel (value +1)
end
-- oscPairSelect1 and oscPairSelect2 send a osc pair select message once, after that the counter of the other function
-- is reset so if we switch to that page the corresponding osc pair select message is send out again.
-- controls belonging to osc pair 1 have the function oscPairSelect1 added in the json .epr file and controls osc pair 2
-- oscPairSelect2
function oscPairSelect1()
if incCount1 == 1 then
-- device = devices.get (mirageSoundProcessDeviceId)
midi.sendSysex (PORT_1, { 0, 0, 35, 1, 67, 60, 1, 0 })
incCount1 = incCount1 + 1
-- reset the other counter so the message will be send for pair 2 once we switch to that controls
incCount2 = 1
end
end
function oscPairSelect2()
if incCount2 == 1 then
device = devices.get (mirageSoundProcessDeviceId)
midi.sendSysex (PORT_1, { 0, 0, 35, 1, 67, 60, 2, 0 })
incCount2 = incCount2 + 1
incCount1 = 1
end
end
function fetchProgram (control, value)
device = devices.get (mirageSoundProcessDeviceId)
midi.sendSysex (PORT_1, { 0, 0, 35, 1, 2 })
print(value +1)
midi.sendSysex (PORT_1, { 1, 2, 3, 4, value +1 } )
end
Here is the preset
edit.epr (239.3 KB)
Byte 0 = AMP envelope attack
So I am pretty sure I have that correct.
The patch request goes out.
"responses": [
{
"header": [
"00",
"00",
"23",
"01",
"44",
{
"type": "function",
"name": "getPatchNumberByte"
}
],
"rules": [
{
"type": "sysex",
"parameterNumber": 49,
"parameterBitPosition": 0,
"byte": 0,
"byteBitPosition": 0,
"bitWidth": 4
},
The patch parameter 40 is set to 10:
The amp attack value is 8 and in the dump coming back I can see the 2 nybbles 08 00
Why are no parameters updated?
Now the old template:
link: Electra One App
After the update the patch parse section is not visible in the webapp.
If you look in the json you will see a “general midi device” was added with id:1
And you can see my device with "id": 9,
See lua: mirageSoundProcessDeviceId = 9
None of my calls work. I always get no results for getPatchNumberByte()
It always returns 0.0
Here is the old patch parse section. I removed some bytes the full one you can see in the template.
What is "instrumentId": "generic-midi"
its added in the bottom.
This should be for " “id”: 9," I think this is the issue of the updates and how it broke the template.
Ok no problem. But what is missing in my fixed
.epr on top?
The old template contains 2 different request and responses.
The new one is only 1 for now.
I cannot see why it does not work.
Is there a way to use the latest json schema and validate my template against it?
"devices": [
{
"id": 1,
"name": "Generic MIDI",
"port": 1,
"channel": 1,
"instrumentId": "generic-midi"
},
{
"id": 9,
"name": "Ensoniq Mirage Soundprocess",
"port": 1,
"channel": 1,
"patch": [
{
"request": [
"00",
"00",
"23",
"01",
"04",
{
"type": "function",
"name": "getPatchNumberByte"
}
],
"responses": [
{
"header": [
"00",
"00",
"23",
"01",
"44",
{
"type": "function",
"name": "getPatchNumberByte"
}
],
"rules": [
{
"type": "sysex",
"parameterNumber": 49,
"parameterBitPosition": 0,
"byte": 0,
"byteBitPosition": 0,
"bitWidth": 4
},
{
"type": "sysex",
"parameterNumber": 49,
"parameterBitPosition": 4,
"byte": 1,
"byteBitPosition": 0,
"bitWidth": 4
},
{
"type": "sysex",
"parameterNumber": 120,
"parameterBitPosition": 0,
"byte": 122,
"byteBitPosition": 0,
"bitWidth": 4
},
{
"type": "sysex",
"parameterNumber": 120,
"parameterBitPosition": 4,
"byte": 123,
"byteBitPosition": 0,
"bitWidth": 4
}
]
}
]
},
{
"request": [
"00",
"00",
"23",
"01",
"07"
],
"responses": [
{
"header": [
"00",
"00",
"23",
"01",
"47"
],
"rules": [
{
"type": "sysex",
"parameterNumber": 794,
"parameterBitPosition": 0,
"byte": 5,
"byteBitPosition": 0,
"bitWidth": 4
},
{
"type": "sysex",
"parameterNumber": 794,
"parameterBitPosition": 4,
"byte": 6,
"byteBitPosition": 0,
"bitWidth": 4
}
]
}
]
}
],
"instrumentId": "generic-midi"
}
],
EDIT:
See here trying to get the bytes in the webapp.
The dump comes in.
But notice the lua byte: ANH NaN
Not that I care for this functionality in this case as the patch parsing has done already by hand.
But I am not able to fix my template.
EDIT:
The last thing i noticed a some *
and -
chars in the template on some groupnames.
I do not remember I put them there.