position of data in sysex received

Home Forums General Programming position of data in sysex received

Viewing 14 posts - 41 through 54 (of 54 total)
  • Author
    Posts
  • #117258
    Tedjuh
    Participant
    • Topics: 7
    • Replies: 62
    • Total: 69

    Don’t know if it’s of any help but I saw a program somewhere written in basic (it’s from the eighties) for the six trak that deals with this problem if I remember correctly. I have to search for it so I’ll get back on it.

    Can’t remember it had to do with midi cc or with the sysex.. so don’t hold your breath.

    #117259
    EnzoF04
    Participant
    • Topics: 17
    • Replies: 102
    • Total: 119
    • ★★

    Hi Tedjuh,

    Dutch too, I assume? Would be nice! My main goal is to set a decent panel for the Six-Trak; with bidirectional communication, the correct way. I have bidirectional communication, synth gets parameters and sends parameters from and to the panel but the data is not the same. Have to figure it out. Panel sends in CC and synth sends in sysex. It’s challenging but fun!

    #117260
    EnzoF04
    Participant
    • Topics: 17
    • Replies: 102
    • Total: 119
    • ★★

    Dnaldoog, can you please explain this lShift and rShift again in a different way?

    I think of this bit shifting as follows, please correct me if I’m wrong:
    in a byte (I use alphabetical characters as placeholders)
    a b c d e f g h
    that is bit rShifted by (2,2), becomes
    a b g h c d e f
    Am I right?
    Two positions off the start of the data, wich is ‘c’ the data is shifted 2 positions to the right and the ‘overload’ which is ‘e f’ is moved to the blank places at positions 3 and 4?

    #117264
    EnzoF04
    Participant
    • Topics: 17
    • Replies: 102
    • Total: 119
    • ★★

    UPDATE! It’s getting to work; all ‘on/off’ switches work on sysex now! I’ve removed the CC because of the difference between CC and sysex. And the best thing is: it’s bi-directional. So they update correctly when receiving program data and the synth follows the changes made on the panel.

    Now I’m going to match all the rotary values.

    But how…. 😉

    • This reply was modified 6 months, 2 weeks ago by EnzoF04.
    Attachments:
    You must be logged in to view attached files.
    #117274
    EnzoF04
    Participant
    • Topics: 17
    • Replies: 102
    • Total: 119
    • ★★

    It’s all really abstract in my head but your explanation is clear and I can wrap my mind around it from time to time. That’s really cool; good job on explaining how it works. Now my challenge is to change parameter data over sysex. For example the coarse frequency. I’ve experienced that it is a 7 bit parameter with a maximum of hex 60 (dec 96). On the Six-Trak the value’s are in half. on the panel 47 (dec) sent as b5 02 2f will become a parameter of 23 in the synth. So I need to make code where I calculate hex from component:getValue().

    I did the code for switching the on/off parameters (1 bit) as follows:

    swUnison = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source)
    
    	modUni = panel:getModulatorByName("modUnison")
    	modUniValue = modUni:getModulatorValue()
    	
    	if modUniValue == 1 then
    		modUniValue = 0x7f
    
    		swUni = CtrlrMidiMessage({0xb5, 0x25, modUniValue})
    	else
    	modUniValue = 0x00
    		swUni= CtrlrMidiMessage({0xb5, 0x25, modUniValeu})
    	end
    	panel:sendMidiMessageNow(swUni)
    
    end
    #117275
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 430
    • Total: 433
    • ★★

    This is all you need there if the ctrlr modulator is a toggle between 1 and 0. Also in functions try to declare variables only used in that function as ‘local’ otherwise they become global. 🙂

    
    swUnison = function(mod,value,source)
    local modUni = panel:getModulatorByName("modUnison"):getModulatorValue()*0x7f
    panel:sendMidiMessageNow( CtrlrMidiMessage({0xb5, 0x25, modUni}))
    end
    

    I edited that post on r/l shifting and then it all disappeared, but it won’t let me repost; might try again later

    #117276
    EnzoF04
    Participant
    • Topics: 17
    • Replies: 102
    • Total: 119
    • ★★

    OK, local declaration is a good advice! Didn’t know if they were global when ‘just’ declaring. If you are able to post it in a private message on the forum, I’d really appreciate it.

    Here is my code for altering the other data.

    rtrVcoCoarse = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source)
    
    	modVcoC = panel:getModulatorByName("modVcoCrsFreq")
    	modVcoCValue = modVcoC:getModulatorValue()
    	
    	modVcoCMsg= CtrlrMidiMessage({0xb5, 0x02, modVcoCValue})
    	panel:sendMidiMessageNow(modVcoCMsg)
    
    end
    #117277
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 430
    • Total: 433
    • ★★

    That looks good to me, with the addition of local mdVcoC and local modVcoSMsg! Is b5 channel 6?

    #117278
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 430
    • Total: 433
    • ★★

    You can use any channel using this code:

    
    local channelOut=panel:getProperty("panelMidiOutputChannelDevice")
    local statusByte=0xb0+(channelOut-1)
    
    modVcoC = panel:getModulatorByName("modVcoCrsFreq")
    	modVcoCValue = modVcoC:getModulatorValue()
    	
    	modVcoCMsg= CtrlrMidiMessage({statusByte, 0x02, modVcoCValue})
    	panel:sendMidiMessageNow(modVcoCMsg)
    
    #117279
    EnzoF04
    Participant
    • Topics: 17
    • Replies: 102
    • Total: 119
    • ★★

    I observed the midi monitor; what was going out when I changed the slider on the panel. b5 is the sysex of parameter change, second byte is the parameter (similar to the CC) in this case it’s parameter 02 and the third byte is the actual data. For parameter 02 (coarse frequency) it can be between (hex) 00 and (hex) 60.

    #117280
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 430
    • Total: 433
    • ★★

    Confused again. When sending sysex it needs to start with F0 then 01 (for Sequential) and end in F7, right?

    b5 02 value

    should be a CC message (sending out on channel 6).

    • This reply was modified 6 months, 1 week ago by dnaldoogdnaldoog.
    #117281
    EnzoF04
    Participant
    • Topics: 17
    • Replies: 102
    • Total: 119
    • ★★

    Confused again. When sending sysex it needs to start with F0 then 01 (for Sequential) and end in F7, right?

    b5 02 value

    should be a CC message (sending out on channel 4) I think.

    I guess you are right. And when doing this, I need to shift bits because in the sent bytes the last bit(s) are ‘X’-ed out when data is smaller than 7 bits. That will do the trick, I guess.

    • This reply was modified 6 months, 2 weeks ago by EnzoF04.
    Attachments:
    You must be logged in to view attached files.
    #117284
    EnzoF04
    Participant
    • Topics: 17
    • Replies: 102
    • Total: 119
    • ★★

    Dnaldoog, could you please help me with shifting the bits in the parameters with a range?

    I’ve come to the conclusion that that is what I need to do. But how! 😉

    I’ve got a modulator on the panel and I fetch the value of it in this way: (not perfect but works for me)

    	local modVcoC = panel:getModulatorByName("modVcoCrsFreq")
    	local modVcoCValue = modVcoC:getModulatorValue()

    Let’s say that the value is 8 (decimal). That is in binary:
    0 0 0 0 1 0 0 0
    I need to alter the bits into:
    0 0 0 1 0 0 0 0

    I guess I have to store the modVcoCValue into an other variable (in Hexadecimal) and can do the bit operations in that variable. I need a for i = 1 to 7 (7 bits to be shifted). And after that I have to handle the altered hexadecimal variable to a midi message.

    Hope you can crystallize a decent work around for this? Many thanks again!

    #119800
    BAUSBAUS
    Participant
    • Topics: 1
    • Replies: 10
    • Total: 11

    Goed bezig!

    This is great. I am looking forward to implement something similar in the Panel that I am making.
    Both on Patch level and on Program level, a Program can contain between 1 and 6 Patches.

    Would be great to have the Panel reflect the current Patch settings because the Mirage, just like the Six Trak, only has a 2 digit display and no further knobs or sliders.

    Updating a 25 year old Editor

Viewing 14 posts - 41 through 54 (of 54 total)
  • You must be logged in to reply to this topic.
There is currently 0 users and 29 guests online
No users are currently active
Forum Statistics
Threads: 2,417, Posts: 17,039, Members: 57,321
Most users ever online was 12 on January 22, 2019 3:47 pm
Do NOT follow this link or you will be banned from the site!