Parsing Korg KARMA Sys-Ex #547
-
Greetings, Starting a new thread regarding the parsing of Korg Karma Sysex strings when switching programs / banks... NOT URGENT but for future reference and eventual panel functionality. So while it is possible to switch banks and program presets with a rather simple a straightforward external sysex from a panel such as : I've taken note that the on board controls returns a super long sysex string within a single F0 ... F7 message. Which seems to contain a bunch of internal settings which pertain to the preset. This is returned when using the on board bank buttons but not when switching bank / programs with the Ctrlr panel??? So I am wondering if it is possible to parse the single string into it components so as to "set" sliders within the Ctrlr panel? Side note, if interested: I have been cataloging, into a spreadsheet, ALL the sysex messages to control the synth and the KARMA functions and happy to post here or goto , KARMA-Lab Forums, where I've been posting updates as the spreadsheet progresses and hopefully Stephen will call out any errors I'm making... so far so good. Below is an example of the returned sysex from the keyboard when program / banks are switched using the on board controls Peace
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Here is what I think is probably correct parsing of the data. It is adapted from my M3R panel — so some small details may be incorrect. parse Korg Karma sysex_1_0.zip The data parseKorgData = function(--[[ CtrlrComponent --]] comp --[[ MouseEvent --]], event) local offset = 6 -- ignore KORG Header local nameSize = 16 local m = MemoryBlock() m:loadFromHexString(sysexString) console(string.format("Initial Dump Size=%d bytes", m:getSize())) local numberofpatchesindump = m:getSize() -- this will be something different (like 128 etc) local sizeOfLoop = m:getSize() - 1 - 4 - 7 --[[ always getSize()-1,-4 extra nul bytes,-7 header+eox--]] local accrue = MemoryBlock() for i = offset, sizeOfLoop, 8 do local set = MemoryBlock(m:getRange(i, 8)) local res = convert827(set) accrue:append(res) end for i = 0, accrue:getSize() - 1, numberofpatchesindump do console(accrue:getRange(i, nameSize):toString()) -- extract all names end console(string.format("Actual Korg Data: %s\n%d bytes", accrue:toHexString(1), accrue:getSize())) end function convert827(m) -- take a set of 8 bytes (first byte contains) msbit data of each subsequent byte local t = {} assert(m:getSize() == 8, "size=" .. m:getSize()) local b = {1, 2, 4, 8, 16, 32, 64} local msb = m:getByte(0) -- for i = 1, m:getSize() - 1 do -- start at the second byte local mask = b[i] local band = bit.rshift(bit.band(msb, mask), i - 1) local addmsb = m:getByte(i) + (band * 128) table.insert(t, addmsb) end local result = MemoryBlock() result:createFromTable(t) assert(result:getSize() == 7) return result -- MEMORYBLOCK end |
Beta Was this translation helpful? Give feedback.
Here is what I think is probably correct parsing of the data. It is adapted from my M3R panel — so some small details may be incorrect.
parse Korg Karma sysex_1_0.zip
The data
sysexString
is the string above in your post.