Reply To: simple way to pass the changed value in a midi cc formula

Home Forums General Programming simple way to pass the changed value in a midi cc formula Reply To: simple way to pass the changed value in a midi cc formula

#118928
dnaldoog
Participant
    • Topics: 4
    • Replies: 480
    • Total: 484
    • ★★

    Hi Damien,

    You shouldn’t need xx or ‘multi’ as long as you assign the value in the Button Values field thus:

    off=0
    on=127

    Then use CC option:


    If you do it in lua, and you have

    off=0
    on=1

    as button values, you can just multiply the incoming value by 127

    
    myFunction=function(mod,value,source)
    --local channelOut=panel:getProperty("panelMidiOutputChannelDevice")
    --local statusByte=0xb0+(channelOut-1) -- use this code for dynamic channel changes
    local midiNum=tonumber(mod:getProperty("modulatorCustomIndex") )
    local statusByte=0xB6 -- you are using channel 7
    	local myMessage= CtrlrMidiMessage({statusByte, midiNum, value*127})
    	panel:sendMidiMessageNow(myMessage)
    end
    

    If you want to make this a shared function you would have to work out how to pass in the CC number, maybe using modulatorCustomIndex with a value of 75 etc for each button

    ?

    • This reply was modified 3 years, 9 months ago by dnaldoog. Reason: realised 75 is decimal nit hex
    Ctrlr