Replies: 27 comments 116 replies
-
Hi, welcome along. |
Beta Was this translation helpful? Give feedback.
-
Hi @suce-ex Here is an example panel of how to do that - it's one of many ways! |
Beta Was this translation helpful? Give feedback.
-
You are right a sysex MIDI message can never contain a value higher the Ordinarily that second byte will be the manufacturer id. ie 43 is Yamaha, 41 is Roland and if the manufacturer doesn't have a number 00 is used I believe. You can change the incoming value dynamically by changing the "reverse" receiving message to See new panel. |
Beta Was this translation helpful? Give feedback.
-
That's right - one way to visualise or convert a hex number to decimal (maybe you know all this already) is to split the binary text representation of a hex number into two. Well I didn't know this for the longest time. So visualise Midi data values have a limit of 127 as represented by one byte, so that is 0x7f (7 * 16=112) and (F*1=15) = 127. If you are adding a string '80' to a MIDI message something is wrong. |
Beta Was this translation helpful? Give feedback.
-
Hi there @suce-ex . For Cubase I use the following method: Is this the same as what you did? Running as VST under Cubase
|
Beta Was this translation helpful? Give feedback.
-
This panel might give you a head start! It's not a full implementation and would need a lot more work, (it's already pretty comprehensive) but it's functional at least. 😸 |
Beta Was this translation helpful? Give feedback.
-
This panel now saves state and snapshots can be loaded from uiCombo directly - also a 'clear all' feature. |
Beta Was this translation helpful? Give feedback.
-
Finally I analyzed the SysEx messages being used on 65 buttons : Basically i found 3 string sections
variations are
xx is replaced by
so, if I made my sysex lesson correctly, the beauty of this is that however the "xx"s are added up, due to hexadecimal they keep unique combinations!
Calling both on one string would be
now the big question, how would i take off f0 00 00 57 01 00 08 00 00 00 f7 without taking off f0 00 00 57 01 00 02 00 00 00 f7? thanks so much to all |
Beta Was this translation helpful? Give feedback.
-
Dear @dnaldoog , I hope I can express myself better today than 6 days ago.
The way it's done: on expression to evaluate: setGlobal (0, setBit (global.k0, 4, modulatorValue)) : value 4 stands for hexadecimal 10 (as you know of course, but i didnt know nothing about it 6 days ago) value 0 = 1, value 1=2, value 2= 4, value 3=8, value 5=20, value 6=40 If I create 7 buttons this way, the output sysex is exactly what I want. Adding and substracting (on/off mouse on button) sends out exactly the sysex message my instrument understands. All 7 buttons turned on will send out "7F" (127 decimal) and that's how it's programmed. Now, there are a couple of problems I ran into:
There must be also a general misunderstand of myself with Ctrlr Panels:
What I wish to achieve:
As I found out before:
and if "00" "08" "10" are "IDs" before 4 following strings ... and those are all used, my instrument sends out this message to reset them all this way: Since I wasn't even able to copy/paste the "DEMO- Complex expressions" (should i re-upload this panel?) into a new panel without making it work, it would be marvelous to have another start of those functions integrated in your amazing "save_snapshot 2" panel! big love p.s.: I am intrigued by the mod1 DISABLE knob of "DEMO - Complex expressions panel" how this and why: setGlobal (0, setBitRangeAsInt (global.k0, 4, 2, 0))
|
Beta Was this translation helpful? Give feedback.
-
Here is an idea of what you might be after, but warning! It seems to be very buggy and has taken me hours to even get it to this point :) - but it should set you on your way. You can send a CC signal from a controller B0 03 00 will load 'snapshot 3' and send all midi. It's basically working, but Ctrlr itself could be buggy with the buttons. The sliders seemed much more stable and I have read people having problems with Global Variables in the past. |
Beta Was this translation helpful? Give feedback.
-
This version v5.0.0 sends out all MIDI when changing the comboBox - it utilises a hidden uiSlider which has the summed fields of each group of 7 buttons, using modulatorCustomIndex. function sendSnapshotMIDIout() local div7 = #listOfModsIndexed / 7 -- currently 21 controls - this table size will be 3 local t = {} -- initialise for i = 1, div7 do -- in lua a multidimensional table must be initialized t[i] = {} end -- initialise multidimensional table for i, v in ipairs(listOfModsIndexed) do -- a table.sorted index of hash array listOfMods --NOTE:: modulator names must end in 1-7 local index = panel:getModulatorByName(v):getProperty("modulatorCustomIndex") table.insert(t[tonumber(index)], v) - a multi dimensional list of modulator names end for i, v in ipairs(t) do local sum = 0 for i, value in pairs(v) do sum = sum + bit.lshift(panel:getModulatorByName(value):getModulatorValue(), i - 1) -- sum the values and bit shift left using the multi dimensional array of 7 values --(i.e. the value of the 7th button gets left shifted by 6 so 0000 0001 becomes 0100 0000 or 0x40) end panel:getModulatorByName("bank" .. i):setModulatorValue(sum, false, true, false) -- a hidden uiSlider modulator that fires off the sum of seven buttons as a MIDI message to machine end end ... so now if you add any more buttons, you will have to enter in the row number they belong to in the Actually, if I had know the end goal better from the start I would have not used the ModulatorValue Expression from the DEMO panel and would have used a modulatorCustomIndex to sum each button with lua and send the single summed value that way, but whichever works is fine. Just if you run into problems with the panel global variables, it might be best to change to pure lua. EDIT: Version 5 might address the incoming MIDI distribution!!! |
Beta Was this translation helpful? Give feedback.
-
Version 9! This works very well with incoming MIDI assignment - all pure lua and much more stable. function repopulateSysexFromIncoming(m) if m:getData():getByte(5) == 0x08 then -- testing for each family of bytes - duplicate as needed local j = 0 for i = 1, 4 do -- fours bytes of data j = i + 5 -- position of first byte of data local mask = {1, 2, 4, 8, 16, 32, 64} -- bit AND masking local byte2split = m:getData():getByte(j) for andb = 1, #mask do local split = bit.rshift(bit.band(byte2split, mask[andb]), andb - 1) panel:getModulatorByName(bytLUref[i] .. andb):setModulatorValue(split, false, true, false) -- see below for fix end j = j + 1 end end end EDIT 2022/04/15 Fixed reverse value bug in version 10 (code above adjusted) |
Beta Was this translation helpful? Give feedback.
-
I could have sworn I had that working, but yes it was reversed - Have made the necessary changes. |
Beta Was this translation helpful? Give feedback.
-
Can you put this another way? Reword the problem perhaps? |
Beta Was this translation helpful? Give feedback.
-
This panel is an adaption of your code. I have to say that at this point I have spent countless hours on this project. Most of last week and just doing this panel took me from 5:00pm to now 10:45pm! Lol 😢 Because I don't really know what direction you are taking, I am like a pilot flying in heavy cloud. Where am I going? What instrument is this even for? Also, personally I would never be testing VST or Standalone instances unless I had fully sorted out the logic of the panel first. It is a long process even if one has experience; but I really recommend you study someone's panels (mine?) to get ideas on which direction to take. Aslo lua; if you can understand tables you can work with data and then implement efficient code. Without deep knowledge of tables tables, people tend to write C style, which I think is less efficient in lua. I printed that page off and read it and read it on the train to work until I had that eureka moment! To me now to reintegrate the snapshot code I originally showed you would take more countless hours, because the overall blueprint has changed from what I first posted - actually these were only ever pointers, not fully conceived solutions. Ctrlr is difficult, but I think you have plenty of code to work from and also many challenges to get it working! Anyway I hope this panel is working. Again it is an adaption of your code and I decided I would probably do it differently given the second bank of controls (admittedly) I always knew you needed to implement those. But such is the importance of planning, which I can't do in this case! ❤ |
Beta Was this translation helpful? Give feedback.
-
Here is version 17! I have done a lot of work on this - I hope it's want you want and I hope I interpreted the incoming sysex request properly - that took hours! 🤷♀️ Save Snapshots Integrated 17.zip |
Beta Was this translation helpful? Give feedback.
-
This version uses a uiSlider to set a CC number to 0-127 - if an external MIDI controller sends out a signal when set to that MIDI number, the panel will set the snapshot corresponding to the CC value and send the snapshot. Values sent above the number of snapshots saved on the panel are ignored. |
Beta Was this translation helpful? Give feedback.
-
In version 20 setting all controls to You would have to give more detail about:
What sysex received and what sysex sent? |
Beta Was this translation helpful? Give feedback.
-
Try this one! |
Beta Was this translation helpful? Give feedback.
-
The
I think I fixed 1. |
Beta Was this translation helpful? Give feedback.
-
@dnaldoog |
Beta Was this translation helpful? Give feedback.
-
Question: uiButton name msh201 is the first intrsument on the top left of the panel, listed as f0 00 00 57 01 00 01 00 00 00 f7, if no other buttons are switched on. |
Beta Was this translation helpful? Give feedback.
-
This TOOK A LOT of work. 🤢🤢🤢🤢🤢 |
Beta Was this translation helpful? Give feedback.
-
This is how you would send all CC messages out. I am presuming the unit can handle the data sent at once, otherwise you would need to stagger each message in a timer (See Organic 22_22_1_mod1 timer CC send). The function sendBulkCCmessage() local chann = chOut() for _, myMod in pairs(listOfMods) do for k in pairs(myMod) do if tonumber(_G[k]:getMidiMessage():getProperty("midiMessageType"))==0 then -- it's a CC message local value = _G[k]:getModulatorValue() local midiNumber = _G[k]:getMidiMessage():getProperty("midiMessageCtrlrNumber") panel:sendMidiMessageNow(CtrlrMidiMessage(sf("b%.1X %.2X %.2X",chann,midiNumber,value))) end -- it's cc end -- inner loop end -- outer loop end init = function(--[[ CtrlrInstance --]] type) --save all modulators as lua variable names (no spaces or illegal lua variable characters allowed) for _, byt in pairs(listOfMods) do for k, v in pairs(byt) do _G[k] = panel:getModulatorByName(k) end end ... end function chOut() return panel:getProperty("panelMidiOutputChannelDevice")-1 end |
Beta Was this translation helpful? Give feedback.
-
Do you mean mapping to a vst index? All you need to do is change the cc mapping slider’s vst index to a number you want and access it in Cubase that way, maybe 😵💫 ?? |
Beta Was this translation helpful? Give feedback.
-
This version 23 has VST indexes generated. There's a button there which you can right click and send to hidden layer and only use when you want to regenerate. Here is a cubase project file showing how to access a parameter on the panel. |
Beta Was this translation helpful? Give feedback.
-
Okay! 🤔🤔🤔🤔 How about this then? This is the incoming interpolation formula: function interpolateIncomingCCValue(value) local s = #snapshotList local div = 127 / s local z = value / div z = jmax(1, math.ceil(z)) return z end |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I am new here, discovering this wonderful playstation, just amazing.
My first task:
I d wish to get an on/off sysex signal BUTTON.
On an 11 section Sysex message ( I got both on/off messages ; which btw are starting in ctrlr monitor f0 f0 ??)
I tried to understand this: https://ctrlr.org/forums/topic/toggle-two-sysex-strings/
but i just discovered this wonderful application and forum yesterday, and i dont know how to apply it.
I'd be very thankful, if one of you could send out a little panel example for such a button (which toggles between 2 colors)
Love
SYS-EX
Beta Was this translation helpful? Give feedback.
All reactions