Just wanted to post a little code for something I’ve been wanting to do for bug testing and development.
How to post a sysex string to the console, so we can see what’s going on?
My methodology – I have a table of hex values that I manipulate, and periodically convert it to a MIDI Message and send it to the synth.
Here’s the code for the function to display the table to the console.
function sysexToString(--[[ CtrlrMidiMessage --]] midi)
-- Expects userdata Table of Hex
local midiString = ""
for i= 1, table.getn(midi) do
midiString = midiString .. string.format("%02x", midi) .. " "
end --for
return midiString
end
It’s called from a method like this
testConsoleMethod = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source)
console (String("Control Mode Enabled"))
console (String(sysexToString(midiBuffer)))
end
The initial value of midiBuffer (so you can see the formatting used)
midiBuffer = {0xf0,0x00,0x00,0x2f,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x0c,0x00,0x00,0x00,0x00,0x0b,0x02,0x06,0x02,0x0f,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,0x09,0x0c,0x00,0x00,0x00,0x00,0x08,0x08,0x00,0x00,0x02,0x0c,0x01,0x07,0x0f,0x07,0xf7}
To convert this table to a Midi Message that you can send, use
midiBufferMessage = CtrlrMidiMessage(midiBuffer)
Hope this helps you guys in the future
-
This topic was modified 6 years, 5 months ago by Puppeteer.
-
This topic was modified 6 years, 5 months ago by Puppeteer. Reason: Added Code Tags
The Puppeteer
http://godlike.com.au