Home › Forums › General › Using Ctrlr › The “old chestnut” throttling Midi transfer
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by dnaldoog.
-
AuthorPosts
-
April 23, 2020 at 10:13 pm #117899
So I have read quite a few of the threads related to this. Lots of great ideas but so far I not found the definitive solution
1 – when the Sysex fails it seems to block the Ctrlr from sending any more sysex successfully
Is there a way to reset the “send” buffer?
I can still receive and process Sysex from my K1r. And I can send to it from MidiOx so I suspect it is something I corrupt in Ctrlr?
2 – I saw various threads about midi parameters in Ctrl
I find under Edit->Preferences MIDI Mon input/output buffer sizes. That’s all.
Where should I be looking for timeouts etc please?
I seems to me the older threads no longer apply to more modern Ctrlr??3 – I have to split my sysex into a series of single transfers
What is a way to wait say 125ms?
The best I could find was Stackoflow-- delay in s function addDelay(n) local t = os.clock() while os.clock() - t <= n do -- nothing end end
but this means I take 32 seconds to transfer 32 patches.
Midi baud rate is 31250 +/- 10%. so what 3k per second.
The largest midi I need to send is 8K .. so should take what 3 seconds if the buffers are not overflowed. I increase the midiMon buffer sizes … perhaps I should decrease them?K1 bulk sysex is
HEADER
[patch1]
[patch2]..
[patch32]
EOSSo I had to generate N headers, pull out patch_i, then compute and add checksum and add F7
The good news is I have to do this anyhow to send in memory modifications – so this is ok.
I will take stability over speed any dayHence I have to
... elseif size == gMULTIPLE_MULTI_SYSEX_TRAN then debugConsole("received multiple multis") console("received multiple multis") worked = processMultiD(d, false) if worked == true and fromFile == true then -- send to synth utils.warnWindow("\n\nINFO", "About to load a Multiple Multis into K1. WILL TAKE 32 SECONDS") console("sending 1") -- midi channel 00 -- how to find it? local bias = d:getByte(7) dumpMultiBlockIndividually(00, bias) end debugConsole("END received multiple multis") console("END received multiple multis") ... function dumpMultiBlockIndividually(ch, bias) -- here we have read a multiBlock into our local buffers -- if you send the whole block to the K1r it chokes. -- so instead we create the sysex necessary to send as individuals. for i = 0, 31 do addDelay(1) local sysex = string.format("F0 40 %02x 20 00 03 00 %02x ",ch, i + bias) sysex=sysex..g_multiPatch:getRange(0, g_multiPatch:getSize() - 1):toHexString(1) local checksum = 0xA5 for j=0, g_multiPatch:getSize()-1 do checksum = checksum + g_multiPatch:getByte(j) end -- console("checksum"..checksum) checksum = BitAND(checksum, 127) console("checksum"..checksum) sysex = sysex..string.format(" %02x F7",checksum) -- console(""..sysex) panel:sendMidiMessageNow(CtrlrMidiMessage(sysex)) end end
But now at least I can read Sysex single/multi |X| bulk |X| {sysex, from file}.
thanks in anticipation.
April 24, 2020 at 1:08 am #117901Hi Shooking!
Try
os.execute(sleep(125))
April 25, 2020 at 1:42 pm #117903been trying to reply for ages – wordpress was playing silly bugger games!
I call you out for Kudos @ 27 seconds in to my YT vid – https://www.youtube.com/watch?v=pO5xzGVCIoA&feature=youtu.be
Your suggestion sure makes my panel behave like a 125 old British train (when they worked!)
thanks again
SteveApril 25, 2020 at 3:11 pm #117907Great! I watched the video – nice panel and thanks for the mention!
-
AuthorPosts
- The forum ‘Using Ctrlr’ is closed to new topics and replies.