Home › Forums › General › Programming › help with midiMessageRecieved & microwave XT
- This topic has 2 replies, 2 voices, and was last updated 12 years, 8 months ago by msepsis.
-
AuthorPosts
-
August 27, 2011 at 9:59 pm #425
I was hoping somebody might be able to lend me a hand with figuring out what might be going on wrong here..
I’ve been working on implementing the lua code that updates my panel based on the synth’s program settings. off and on for what seems like a while now…
Currently I’m using the latest and greatest ctrlr 709 on win 32 with a motu MTPAV (with latest ROM)..I know the sysex message size and have figured the range by tweaking the first and last indexed modulators and watching where they fall in the placement of the 265 bytes of the microwave XT’s sysex dump.
I can get the panel to update the values, but from what is played before and after a panel update I can tell that something isn’t right as the program sounds altered after hitting my update button w/ the programRequest Lua script. I’ve been starting out testing this by only including a selection of modulators in my midiMessageReceived script, that shouldn’t matter I wouldn’t think.
I figure I’ll first post an excerpt from the manual and then post snippets of my code. Thanks in advance to anybody who can help.
3. Data Formats
3.1 SDATA – Sound Data
******************************************************
Note: All Parameters marked as "reserved" should be
set to 0 for future compatibility.
Index Range Value Parameter
1 16-112 -4…+4 Osc 1 Octave in Steps of 12
2 52-76 -12..+12 Osc 1 Semitone
…
…
194 0-33 see List 3.13 Mod 1 Destination
195 0-31 see List 3.12 Mod 2 Source
196 0-127 -64..+63 Mod 2 Amount
197 0-33 see List 3.13 Mod 2 Destination
198 0-31 see List 3.12 Mod 3 Source
199 0-127 -64..+63 Mod 3 Amount
200 0-33 see List 3.13 Mod 3 Destination
201 0-31 see List 3.12 Mod 4 Source
202 0-127 -64..+63 Mod 4 Amount
203 0-33 see List 3.13 Mod 4 Destination
204 0-31 see List 3.12 Mod 5 Source
205 0-127 -64..+63 Mod 5 Amount
206 0-33 see List 3.13 Mod 5 Destination
207 0-31 see List 3.12 Mod 6 Source
208 0-127 -64..+63 Mod 6 Amount
209 0-33 see List 3.13 Mod 6 Destination
210 0-31 see List 3.12 Mod 7 Source
211 0-127 -64..+63 Mod 7 Amount
212 0-33 see List 3.13 Mod 7 Destination
….my update panel button has this Lua script attached:
[code:38rndwij]
—
— Called when Request Program button is pressed
—programRequest = function(modulator, newValue)
program = panel:getModulatorByName("Program")
bank = panel:getModulatorByName("Bank")if program ~= nil and bank ~= nil then
m = CtrlrMidiMessage({0xF0, 0x3E, 0x0e, 0, 0, bank:getModulatorValue(), program:getModulatorValue(), 0x7F, 0xF7})
panel:sendMidiMessageNow(m)
endend
[/code:38rndwij]My panel has the following attached:
[code:38rndwij]midiMessageReceived = function(midiMessage)
s = midiMessage:getSize()
if s == 265 then
out = panel:getModulatorByName("outputLabel")
out:getComponent():setPropertyString ("uiLabelText", midiMessage:toString())
console("received program data")assignValues(midiMessage)
end
endfunction assignValues(midiMessage)
console ("assignValues")
lastSavedProgram = midiMessage:getLuaData()
programData = midiMessage:getLuaData():getRange(7,262)
— unpackedData = utils.unpackDsiData(programData)console ("RAW DATA: ")
console (programData:toHexString(1))
— console ("UNPACKED DATA: ")
— console (unpackedData:toHexString(1))–Mod Matrix
panel:getModulatorByName("Mod 1 Source"):setModulatorValue(programData:getByte(192), false, true, true)
panel:getModulatorByName("Mod 1 Amount"):setModulatorValue(programData:getByte(193), false, true, true)
panel:getModulatorByName("Mod 1 Destination"):setModulatorValue(programData:getByte(194), false, true, true)panel:getModulatorByName("Mod 2 Source"):setModulatorValue(programData:getByte(195), false, true, true)
panel:getModulatorByName("Mod 2 Amount"):setModulatorValue(programData:getByte(196), false, true, true)
panel:getModulatorByName("Mod 2 Destination"):setModulatorValue(programData:getByte(197), false, true, true)panel:getModulatorByName("Mod 3 Source"):setModulatorValue(programData:getByte(198), false, true, true)
panel:getModulatorByName("Mod 3 Amount"):setModulatorValue(programData:getByte(199), false, true, true)
panel:getModulatorByName("Mod 3 Destination"):setModulatorValue(programData:getByte(200), false, true, true)panel:getModulatorByName("Mod 4 Source"):setModulatorValue(programData:getByte(201), false, true, true)
panel:getModulatorByName("Mod 4 Amount"):setModulatorValue(programData:getByte(202), false, true, true)
panel:getModulatorByName("Mod 4 Destination"):setModulatorValue(programData:getByte(203), false, true, true)panel:getModulatorByName("Mod 5 Source"):setModulatorValue(programData:getByte(204), false, true, true)
panel:getModulatorByName("Mod 5 Amount"):setModulatorValue(programData:getByte(205), false, true, true)
panel:getModulatorByName("Mod 5 Destination"):setModulatorValue(programData:getByte(206), false, true, true)panel:getModulatorByName("Mod 6 Source"):setModulatorValue(programData:getByte(207), false, true, true)
panel:getModulatorByName("Mod 6 Amount"):setModulatorValue(programData:getByte(208), false, true, true)
panel:getModulatorByName("Mod 6 Destination"):setModulatorValue(programData:getByte(209), false, true, true)panel:getModulatorByName("Mod 7 Source"):setModulatorValue(programData:getByte(210), false, true, true)
panel:getModulatorByName("Mod 7 Amount"):setModulatorValue(programData:getByte(211), false, true, true)
panel:getModulatorByName("Mod 7 Destination"):setModulatorValue(programData:getByte(212), false, true, true)panel:getModulatorByName("Mod 8 Source"):setModulatorValue(programData:getByte(213), false, true, true)
panel:getModulatorByName("Mod 8 Amount"):setModulatorValue(programData:getByte(214), false, true, true)
panel:getModulatorByName("Mod 8 Destination"):setModulatorValue(programData:getByte(215), false, true, true)panel:getModulatorByName("Mod 9 Source"):setModulatorValue(programData:getByte(216), false, true, true)
panel:getModulatorByName("Mod 9 Amount"):setModulatorValue(programData:getByte(217), false, true, true)
panel:getModulatorByName("Mod 9 Destination"):setModulatorValue(programData:getByte(218), false, true, true)panel:getModulatorByName("Mod 10 Source"):setModulatorValue(programData:getByte(219), false, true, true)
panel:getModulatorByName("Mod 10 Amount"):setModulatorValue(programData:getByte(220), false, true, true)
panel:getModulatorByName("Mod 10 Destination"):setModulatorValue(programData:getByte(221), false, true, true)panel:getModulatorByName("Mod 11 Source"):setModulatorValue(programData:getByte(222), false, true, true)
panel:getModulatorByName("Mod 11 Amount"):setModulatorValue(programData:getByte(223), false, true, true)
panel:getModulatorByName("Mod 11 Destination"):setModulatorValue(programData:getByte(224), false, true, true)panel:getModulatorByName("Mod 12 Source"):setModulatorValue(programData:getByte(225), false, true, true)
panel:getModulatorByName("Mod 12 Amount"):setModulatorValue(programData:getByte(226), false, true, true)
panel:getModulatorByName("Mod 12 Destination"):setModulatorValue(programData:getByte(227), false, true, true)panel:getModulatorByName("Mod 13 Source"):setModulatorValue(programData:getByte(228), false, true, true)
panel:getModulatorByName("Mod 13 Amount"):setModulatorValue(programData:getByte(229), false, true, true)
panel:getModulatorByName("Mod 13 Destination"):setModulatorValue(programData:getByte(230), false, true, true)panel:getModulatorByName("Mod 14 Source"):setModulatorValue(programData:getByte(231), false, true, true)
panel:getModulatorByName("Mod 14 Amount"):setModulatorValue(programData:getByte(232), false, true, true)
panel:getModulatorByName("Mod 14 Destination"):setModulatorValue(programData:getByte(233), false, true, true)panel:getModulatorByName("Mod 15 Source"):setModulatorValue(programData:getByte(234), false, true, true)
panel:getModulatorByName("Mod 15 Amount"):setModulatorValue(programData:getByte(235), false, true, true)
panel:getModulatorByName("Mod 15 Destination"):setModulatorValue(programData:getByte(236), false, true, true)panel:getModulatorByName("Mod 16 Source"):setModulatorValue(programData:getByte(237), false, true, true)
panel:getModulatorByName("Mod 16 Amount"):setModulatorValue(programData:getByte(238), false, true, true)
panel:getModulatorByName("Mod 16 Destination"):setModulatorValue(programData:getByte(239), false, true, true)end
[/code:38rndwij]
Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen
August 28, 2011 at 5:11 pm #3198Sounds like maybe a parameter is getting a value incorrectly, or your getbyte value is for another parameter than what you set it for. When the setting for the panel modulator is updated, it is then outputting a value which is changing your XT value to something different than it was.
One way to start trying to figure this out is to perhaps parse your your midi dump into a list with the modulator name and the value it thinks it’s being sent, then cross reference that list with the current patch parameters on your XT. A PITA, but step forward in finding the bug.
August 28, 2011 at 8:49 pm #3199I got it figured out… at least narrowed down. Thanks Filch for the post – luckily I didn’t need to go the PITA route ” title=”Smile” />
I think I can say once and for all this beast is ready for prime time – no more midiOX/VB script!I thought I had already gone through them but indeed I had a grouping of index numbers that were off, result of not cleaning up my copy/paste job.
Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.