MIDI TX Speed on Ctrlr

Home Forums General Panels, Components, Macros MIDI TX Speed on Ctrlr

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #118667
    lecletolecleto
    Participant
    • Topics: 9
    • Replies: 31
    • Total: 40

    Hello Ctrlrs!

    I have in my panel a function that copy a Tone1 parameters of Roland JV-880 to Tone2 setting moduladors and sending a midi message with new values for JV-880.
    The problem is that sometimes I get a Midi Overload message and when I get this error I lost part of new configs. It seems that a lot of messages are transmitted at same time overload the midi in buffer by consequence.

    Is possible generate a delay between each trasmited message or maybe reduce a Midi TX speed (data rate) of Ctrlr and with this action reduce a lost data and this overload?

    Here is the part of code:

    function copyTone()
    	
        comboValue = panel:getModulatorByName("COPY-SELECT"):getModulatorValue()
    
        
        if comboValue==01 then -- Copy T1 to T2
    
           
            a = panel:getModulatorByName("T1-WAVEGROUP"):getValue() -- get the present value of modulator
            panel:getModulatorByName("T2-WAVEGROUP"):setModulatorValue(a,false,true,false) -- set the same value for this modulator, sending it to the synth
                
            a = panel:getModulatorByName("T1-WAVE-INT"):getValue()
            panel:getModulatorByName("T2-WAVE-INT"):setModulatorValue(a,false,true,false) -- set the same value for this modulator, sending it to the synth
            
            a = panel:getModulatorByName("T1-SWITCH"):getValue()
            panel:getModulatorByName("T2-SWITCH"):setModulatorValue(a,false,true,false)
    
    end

    Thanks in advance!

    #118668
    samoht
    Participant
    • Topics: 0
    • Replies: 13
    • Total: 13

    Hi,

    Timer:startTimer(“integer interval in milliseconds”)
    Timer:getTimerInterval(“const”)
    Timer:stopTimer()

    (See: https://docs.juce.com/master/classTimer.html#a3515b6e7a1e3777965e35686eaeb2da7)

    Armed with Lua and the Juce Timer class functions, it should be possible to generate a delay.
    I just started studying lua, ctrlr and Juce, so for now I leave it to others to work out the script :-).

    Thomas

    #118670
    dnaldoogdnaldoog
    Participant
    • Topics: 3
    • Replies: 371
    • Total: 374
    • ★★

    Hi Lecleto!

    Try

    os.execute(sleep(125))

    125=Milliseconds for example.

    #118669
    samoht
    Participant
    • Topics: 0
    • Replies: 13
    • Total: 13

    These two Juce classes may also be helpful:

    MidiBuffer()
    https://docs.juce.com/master/classMidiBuffer.html

    MidiMessageSequence()
    https://docs.juce.com/master/classMidiMessageSequence.html

    Thomas

    #118675
    lecletolecleto
    Participant
    • Topics: 9
    • Replies: 31
    • Total: 40

    Thank you Thomas and Dnaldoog!
    The problem is solved!
    Now I´m just trying adjust the time for best compromise solution.

    This worked!

    function copyTone()
    	
        comboValue = panel:getModulatorByName("COPY-SELECT"):getModulatorValue()
    
        
        if comboValue==01 then -- Copy T1 to T2
    
           
            a = panel:getModulatorByName("T1-WAVEGROUP"):getValue() -- get the present value of modulator
            panel:getModulatorByName("T2-WAVEGROUP"):setModulatorValue(a,false,true,false) -- set the same value for this modulator, sending it to the synth
            os.execute(sleep(125))    
            a = panel:getModulatorByName("T1-WAVE-INT"):getValue()
            panel:getModulatorByName("T2-WAVE-INT"):setModulatorValue(a,false,true,false) -- set the same value for this modulator, sending it to the synth
            os.execute(sleep(125))
            a = panel:getModulatorByName("T1-SWITCH"):getValue()
            panel:getModulatorByName("T2-SWITCH"):setModulatorValue(a,false,true,false) -- set the same value for this modulator, sending it to the synth
            os.execute(sleep(125))

    One more time, Thanks!

Viewing 5 posts - 1 through 5 (of 5 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,393, Posts: 16,738, Members: 59,189
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!