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
    lecleto
    Participant
      • Topics: 10
      • Replies: 34
      • Total: 44

      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: 1
        • Replies: 54
        • Total: 55

        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
        dnaldoog
        Participant
          • Topics: 4
          • Replies: 480
          • Total: 484
          • ★★

          Hi Lecleto!

          Try

          os.execute(sleep(125))

          125=Milliseconds for example.

          #118669
          samoht
          Participant
            • Topics: 1
            • Replies: 54
            • Total: 55

            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
            lecleto
            Participant
              • Topics: 10
              • Replies: 34
              • Total: 44

              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)
            • The forum ‘Panels, Components, Macros’ is closed to new topics and replies.
            There is currently 0 users and 95 guests online
            No users are currently active
            Forum Statistics
            Threads: 2,495, Posts: 17,374, Members: 77,605
            Most users ever online was 12 on January 22, 2019 3:47 pm
            Ctrlr