-
Ok I wanted to ask if I am on the right track for creating a sysex string that collects the values of several juno 106 buttons into one sysex message. The midi implementation states: so parameters 16 and 17 are a combination of several button values into one 7 bit value. My (incomplete) code approach that I am imagining: establish a variable for each value of the group of parameters use an if then to walk through all the modulators and assign correct values to the variables create a table that collects the modulators in the right order then convert the binary string to a single hex value and insert it in the sysex string and send then all the buttons in that group will execute the same method when pressed ` -- 1 for chrous 1, 0 for chorus 2 -- 1 for Chorus on, 0 for chorus off -- 1 for on, 0 for off -- 1 for on, 0 for off -- 100 = 4' range = 100 --here is were I need to make an if then to walk thru the modulators and create the right combination of values for the string table --this will be used to create the 7 bit sysex string for the juno --then the table has to be converted to a proper sysex string an sent for parameter 16 end Is this the right approach? I am struggling with syntax as always. I made some of these UI designs using the 3d in illustrator. It was easy and fun! |
Beta Was this translation helpful? Give feedback.
Replies: 21 comments 17 replies
-
Hi @puffer3 , NOTE: 2022/06/04 The following explanation is correct generally for coding bit packing, but the Roland Juno 106 doesn't quite work this way. For example 16',8',4' are toggled on/off . Chorus1=64,Chorus2=0 share byte 6 and byte 5 is
For Byte 16local byte16=0 local t={ panel:getModulatorByName("chorusOne"):getValue()*64, -- panel:getModulatorByName("chorusTw0"):getValue()*0, -- always 0 bit.bxor(panel:getModulatorByName("chorusOff"):getValue(),1)*32, panel:getModulatorByName("sixteenFeet"):getValue()*1, panel:getModulatorByName("eightFeet"):getValue()*2, panel:getModulatorByName("fourFeet"):getValue()*4, panel:getModulatorByName("squareShape"):getValue()*8, panel:getModulatorByName("sawShape"):getValue()*16, } for _,v in ipairs (t) do byte16=byte16+v end local channelOut=panel:getProperty("panelMidiOutputChannelDevice")-1 local syx=string.format("F0 41 32 %.2X 10 %.2X f7",channelOut,byte16) panel:sendMidiMessageNow(CtrlrMidiMessage(syx)) For byte17:If every control is set to 1, you will get a total of 63. 0011 1111 local byte17=0 local t={ ["HP filter"]=bit.lshift(panel:getModulatorByName("HP filter"):getValue(),3) -- bitwise left shift 3 bits VCA=panel:getModulatorByName("VCA"):getValue()*4, ENV=panel:getModulatorByName("ENV"):getValue()*2, MOD=panel:getModulatorByName("MOD"):getValue()*1, } for _,v in pairs (t) do byte17=byte17+v end local channelOut=panel:getProperty("panelMidiOutputChannelDevice")-1 local syx=string.format("F0 41 32 %.2X 11 %.2X f7",channelOut,byte17) panel:sendMidiMessageNow(CtrlrMidiMessage(syx)) 😊 P.S when you write |
Beta Was this translation helpful? Give feedback.
-
Wow i was way off lol. @dnaldoog I am pretty blown away at the simultaneous complexity and simplicity you managed to achieve here. I guess that's what good computer science is. I think I still don't understand how the sysex is constructed then. I managed to get your code working (after I found my chorusTw0 type hehe) but I still think I need to learn more about binary to hex conversion or bitwise shifting. Is there like an article or a book that is good for that? I will do some googling as for 10 instead of 16, I thought looking at the midi implementation that the bit packed parameters were 16 and 17. What am I missing here? Is using radio groups ok for these buttons with this method? The sysex message seems to be the same unless I click the buttons on and off. Is it important to change the button values from True/False to 1/0? Thanks for your patience. This is so helpful tho thanks John! |
Beta Was this translation helpful? Give feedback.
-
For radio buttons, you probably need lua. https://ctrlr.org/forums/search/radio+buttons/ You can't download the example panel from that site, but here it is again. |
Beta Was this translation helpful? Give feedback.
-
Hi @puffer3 I wrote an editor today! |
Beta Was this translation helpful? Give feedback.
-
something happened and midiox stopped receiving messages, after i clicked 'snapshot', and can't get it working again. ?? |
Beta Was this translation helpful? Give feedback.
-
Yes I can confirm I have still been unable to get the chorus buttons to work correctly ! I am still trying to solve this issue |
Beta Was this translation helpful? Give feedback.
-
that code in the button array looks ok (familiar!) but i can't see the panel because it is an exe. i had minimal buttons using Ctrlr graphic objects, and a 'led' above them that changes colour values when selected. for the hex/bin/dec conversion, i have a nice table chart here, worth hanging onto. i tend to use it to look up quickly where bits are, or look up the hex for a decimal value. oh can't seem to attach files :-/ |
Beta Was this translation helpful? Give feedback.
-
i might need to post a bit more to get my attachment-posting rights back, been away for most of the year (ran out of computer juice during the summer heat, and got a couple of things to tinker with, was programming my novation remoteSL etc.) yes, the bpanelz of course. i only saw the exe before. so you're using an external image resource with LED on/off. i just use a Ctrlr 'dot' and make it change colour - ** LOVE THAT COLOUR TABLE BTW !! :tu: ** much better than trying to remember hex.. although i got quite quick at bashing in FF00FF00 and the few other colours i've been using. so the button itself is not a 2-state toggle: it's a momentary, and pops up again, sending its 'trigger' to shift to the next value - there are only 2 values, 0 and 1, off or on, so that becomes a toggling on off action. you can have the LED change state, latching, following the value, or just blink when pressed, and a value/state change can be displayed elsewhere. |
Beta Was this translation helpful? Give feedback.
-
actually had a lot of fun in synthedit making things with LEDs and stepcounters, shift registers, binary/hex to decimal. it's a great environment for experimenting with stuff like this - it's how i figured out how 808 and 909 sequence LEDs work .. (XOR, which meant nothing to me previously lol) |
Beta Was this translation helpful? Give feedback.
-
Chorus: i think blue is just Off. it is enabled when you select I or II. so choice is Off, I, II - yeah blue does not have a LED, it is just Off. this is what i based my UI on for sizing: i think the thing with these combined parameters is that is ignores 0s because: binary addition: on a bit, 1+0=1, 0+0=0, doesn't change. there is, no doubt, an atari editor or cubase mixer map for this >> (mention of MKS7 panel there, for someone who was looking for one) EDIT: forget those, not useful, just checked. was hoping to see a nice easy list of sysex messages ;D |
Beta Was this translation helpful? Give feedback.
-
All right! I have uploaded a new version 1.2.0 which hopefully fixes the Chorus sysex (byte 16) – all new code: Please check it out @puffer3 and @subv0x . I looked at the implementation in Midi Quest 12 Demo and SoundDiver 3.0. Sound Diver is contrary to the manual and so is MidiQuest - MidiQuest seems to have the 6th byte reversed (switches between Chorus 1 and Chorus 2) but maybe the manual is wrong? Note to self: Only write panels when you have the synth in front of you 👍 ... local byte = 0 local t = { panel:getModulatorByName("range-16"):getModulatorValue(), -- bit 0 panel:getModulatorByName("range-8"):getModulatorValue(), -- bit 1 panel:getModulatorByName("range-4"):getModulatorValue(), -- bit 2 panel:getModulatorByName("pulse"):getModulatorValue(), -- bit 3 panel:getModulatorByName("saw"):getModulatorValue(), -- bit 4 bit.bxor(panel:getModulatorByName("chorusOff"):getModulatorValue(),1), -- bit 5 panel:getModulatorByName("chorus1"):getModulatorValue() + panel:getModulatorByName("chorus2"):getModulatorValue() * 0 -- bit 5 ( off=1,on=0) -- bit 6 ( if zero then chorus 2/ if 1 then chorus 1) } for i,v in pairs(t) do -- concatenate each bit byte=byte+bit.lshift(v,i-1) end --console(string.reverse(table.concat(t))) -- debug binary representation --console(string.format("byte=%d 0x%.2x",byte,byte)) -- debug final result local channelOut = panel:getProperty("panelMidiOutputChannelDevice") - 1 local syx = string.format("F0 41 32 %.2X 10 %.2X f7", channelOut, byte) panel:sendMidiMessageNow(CtrlrMidiMessage(syx)) ※ Note:
could just as easily be
|
Beta Was this translation helpful? Give feedback.
-
@dnaldoog i only have the exe here. in midiox, i'm getting messages, it all looks ok. i see you've gone for values 01h/21h/41h. CH Off (with II selected otherwise) = 21h is it something simple like decimal 64/32/16? which is 40h/20h/10h made some notes earlier: xxxx 1000 is unused eg: dec 16 .. 10h,20h,40h xxxx x111 is unused > 7 (07h) what happens if you send 0111 1111 ? .. which is dec/hex 127/7Fh ch= i*/ii (5 parameters to set, on one parameter address.) the Octave parameter uses 4/2/1 (04h/02h/01h). if you send F0 41 32 00 10 01 F7 which ChorusII does, it will set the octave/' to whichever length that corresponds to. (many years ago i messed around with this kind of thing with a quadraverb, trying to see which values were needed. fascinating. and then never used the cubase mixer map ever.) |
Beta Was this translation helpful? Give feedback.
-
just found this. does look as if it has to be a composite message. so any change on any of those switches means collecting the state of all of them, and a single value/byte. (so ignore my meanderings above) |
Beta Was this translation helpful? Give feedback.
-
yes got the button back. the Kawai K1 also does some stuff like this - but i've got all of that responding to a Novation RemoteSL .. (do you have any insight about handshake messages? is there a generic sysex request for obtaining the sysex format of a device? i have some recollection of sending an ID request to an Alesis MidiverbIII, and it sending me its message format. from that i was able to guess parameter numbers, and get a full midi mapping for an effects box i didn't have the sysex data sheet for.) |
Beta Was this translation helpful? Give feedback.
-
off top of my head, another way? > (trying to interpret your method. great panel setup, what is all that? and what does BootStrapState mean?) ie: for 16 and 17 collect into table (for each group) all current values -as bit states, or as decimal values; each bit having a decimal On value, (1/2/4/8/16/32/64) and zero Off value. that's my unsophisticated take on it :-) will now go and re-read your post on bitshifting.. |
Beta Was this translation helpful? Give feedback.
-
@dnaldoog and @puffer3 |
Beta Was this translation helpful? Give feedback.
-
also hadn't seen reference to Lua bitshift thing, which i must check out. |
Beta Was this translation helpful? Give feedback.
-
I uploaded Version 1.3.0 which changes the GUI logic of switching the chorus - I think you @subv0x mentioned the previous version was a bit odd~ 😑 |
Beta Was this translation helpful? Give feedback.
-
just loaded it - it greys out the I & II buttons now? I & II buttons are sending the message twice (02h for II, 42h for I) - a double trigger somewhere - i have a feeling the 'Off' button should just do Off. and Chorus is activated by pressing I or II. not certain of this, but seems logical. edit: ok, yes, all the numbers are changing depending on which switches are activated. (what an annoying thing for Roland to have done !) |
Beta Was this translation helpful? Give feedback.
-
@subv0x Well I have changed the chorus buttons yet again. See version 1.4.0 🥱 |
Beta Was this translation helpful? Give feedback.
-
downloading.. if it's any consolation, when i did the UI in synthedit i probably spent at least a couple of days figuring out buttons. didn't have to deal with bitwise hex though. there's an OR in there somewhere :-) >> boolean truth table. |
Beta Was this translation helpful? Give feedback.
Hi @puffer3 ,
NOTE: 2022/06/04 The following explanation is correct generally for coding bit packing, but the Roland Juno 106 doesn't quite work this way. For example 16',8',4' are toggled on/off . Chorus1=64,Chorus2=0 share byte 6 and byte 5 is
xor
'ed ― (meaning on=0 and off =1 i.e. the bit is flipped) †For Byte 16