Combined MIDI controllers 14-bit

Home Forums General Programming Combined MIDI controllers 14-bit

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #116422
    human fly
    • Topics: 124
    • Replies: 1070
    • Total: 1194
    • ★★★★

    hi everyone,

    lazy initial question (passing thought), re: 14-bit MIDI CC protocol.

    eg: ‘combined controllers’ – you use two MIDI CC to send your higher resolution message,
    as MSB/LSB pair (‘coarse/fine’).

    you can have a look at Atom’s Synth Lite2 panel to see how this is implemented in Ctrlr,
    as a standard feature of Ctrlr. but i would like to code this in Lua. i’m a bit rusty,
    so i’m polling some advice before attacking it.

    essentially, the ‘low’/MSB CC will 0-31 ,and the ‘high’/LSB CC will be 32-63 (eg: n + 32 )

    i want to make a controller for MFB PolyLite, the ‘multi’/poly version of the SynthLite2,
    with a bit of flexibility, rather than relying on the built-in Ctrlr CC handling.

    thanks for any thought on this :tu:

    • Topics: 4
    • Replies: 480
    • Total: 484
    • ★★

    You can do that with BigInteger getBitRangeAsInt() method:

    To convert a Multi CC message as in:


    In Lua:

    -- Called when a modulator value changes
    -- @mod
    -- @value    new numeric value of the modulator
    myMultiCC = function(mod,value,source)
    local myChannel=panel:getProperty("panelMidiOutputChannelDevice")
    local add=0xb0+(myChannel-1)
          local bv=BigInteger(value) --break the value into 4bit nibbles
          local msb=bv:getBitRangeAsInt(7,7) -- position of msb
          local lsb=bv:getBitRangeAsInt(0,7) -- position of lsb
        m = CtrlrMidiMessage({add, 23, msb}) 
        l = CtrlrMidiMessage({add, 55, lsb}) 

    Where 23 and 55 are the MSB/LSB Bank Select control numbers for adsr2Sustain uiSlider [ADSR Sustain] on that panel by Atom.

    … or alternatively you could split the value this way:

    msb=bit.rshift(value, 7), 127)


Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Programming’ is closed to new topics and replies.
There is currently 0 users and 26 guests online
No users are currently active
Forum Statistics
Threads: 2,460, Posts: 17,299, Members: 53,062
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!