Loopy Pro: Create music, your way.

What is Loopy Pro?Loopy Pro is a powerful, flexible, and intuitive live looper, sampler, clip launcher and DAW for iPhone and iPad. At its core, it allows you to record and layer sounds in real-time to create complex musical arrangements. But it doesn’t stop there—Loopy Pro offers advanced tools to customize your workflow, build dynamic performance setups, and create a seamless connection between instruments, effects, and external gear.

Use it for live looping, sequencing, arranging, mixing, and much more. Whether you're a live performer, a producer, or just experimenting with sound, Loopy Pro helps you take control of your creative process.

Download on the App Store

Loopy Pro is your all-in-one musical toolkit. Try it for free today.

Request new Mozaic Scripts *HERE*

1606163656669

Comments

  • edited August 2024

    @wim said:
    @jjpl2001, here's an example that I think probably does the same thing as your script, though without the XY pad display. I added an on/off button just because I prefer not to assume things should always be running.

    @OnLoad
      // LFO default settings
      min = 0
      max = 127
      lowNote = 69  // A3
      highNote = 93 // A5
      
      if (Unassigned init)
        init = YES
        speed = 500 // half a Hz.
        state = 0
        SetKnobValue 0, (TranslateScale speed,100,3000,0,127)
        run = YES  // change to NO to not automatically start on load
      endif
      
      // GUI
      LabelKnob 0, {Speed}
      LabelPad 0, {Start/Stop}
      LatchPad 0, run
      
      // Set timer interval and start the timer
      SetTimerInterval speed
      if run
        StartTimer
      endif
    @End
    
    @OnTimer
      // Check the value of x and send corresponding MIDI note on
      if state = 0
        SendMIDINoteOn 1, lowNote, 127 // A3
        SendMIDINoteOff 1, lowNote, 127 // A3
        state = 1
      elseif state = 1
        SendMIDINoteOn 1, highNote, 127 // A5
        SendMIDINoteOff 1, highNote, 127 // A5
        state = 0
      endif
    @End
    
    @OnKnobChange
      if LastKnob = 0
        v = GetKnobValue 0
        speed = TranslateScale v, 0, 127, 100, 2000
        SetTimerInterval speed
        ResetTimer
      endif
    @End
    
    @OnMidiCC
      // Check for MIDI CC 01
      if MIDIByte2 = 1
        if MIDIByte3 < 64
          speed = 1000
        else
          speed = 3000
        endif
        Call @MyLFOSetup
      endif
    @End
    
    @OnPadDown
      if LastPad = 0
        run = not run
        LatchPad 0,run
        if run
          StartTimer
        else
          StopTimer
        endif
      endif
    @End
    
    
    @Description
    This script sends alternating notes based on a timer that is set by the speed knob.
    @End
    

    Thank you very much, your corrections and insights helped me to improve my code.

    https://patchstorage.com/piano-led-visualizer-rotary-sim-alternate/
    https://patchstorage.com/piano-led-visualizer-rotary-sim-sweep-v1-0/

    After some rework I eded up with 2 versions that will do the trick.

    The first code is alternating 2 notes at both ends of my keyboard's LED Strip.

    @OnLoad 
      // Default settings
      currentNote = 29  // MIDI note for F1
      Note01 = 29       // F1 note
      Note02 = 98       // D7 note
      SusNote = 95      // B6 note
      speed = 625       // Default speed in milliseconds (corresponding to 0.8 Hz)
      SpeedFast = 0.8 * 2
      SpeedLow = 6 * 2    
      sustainState = 0  // Sustain pedal state
    
      // Set timer interval and start the timer
      SetTimerInterval speed
      StartTimer
    @end
    
    @OnTimer
      // Send the current note
      SendMIDINoteOn 1, currentNote, 127
      SendMIDINoteOff 1, currentNote, 127
    
      // Alternate the note
      if currentNote = Note01  // If current note is F1
        currentNote = Note02   // Switch to D7
      else
        currentNote = Note01   // Switch to F1
      endif
    @end
    
    @OnMidiCC
      // Check for MIDI CC 01 (modwheel) to control speed
      if MIDIByte2 = 1
        // Map the modwheel value to a speed range of 0.8 Hz to 6 Hz
        modwheelValue = MIDIByte3
        speedHz = TranslateScale modwheelValue, 0, 127, SpeedLow, SpeedFast
        speed = Round(1000 / speedHz)  // Convert Hz to milliseconds
        SetTimerInterval speed
      endif
    
      // Check for MIDI CC 64 (sustain pedal)
      if MIDIByte2 = 64
        if MIDIByte3 >= 64 and sustainState = 0
          SendMIDINoteOn 1, SusNote, 127  // B6 Note On
          sustainState = 1
        elseif MIDIByte3 < 64 and sustainState = 1
          SendMIDINoteOff 1, SusNote, 0   // B6 Note Off
          sustainState = 0
        endif
      endif
    @end
    
    @Description
    This script alternates between sending MIDI notes F1 and D7 periodically. The speed of alternation is controlled by the incoming MIDI CC 01 (modwheel), ranging from approximately 0.8 Hz to 6 Hz. The script also detects the sustain pedal (MIDI CC 64) and sends a single B6 note on when pressed and a single B6 note off when released. The notes are sent with a velocity of 127 on MIDI channel 1.
    @end
    

    The second code turns on a trail of notes at one side of the Keyboard's LED strip

    @OnLoad 
      // Default settings
      currentNote = 92    // Start with D6
      startNote = 92      // Starting note (D6)
      endNote = 98        // Ending note (D7)
      speed = 625/4         // Default speed in milliseconds (corresponding to 0.8 Hz)
      SpeedLow = 0.8 * 2 * 4
      SpeedFast = 6 * 2 * 3.5
      SustNote = 29
      sustainState = 0    // Sustain pedal state
    
      // Set timer interval and start the timer
      SetTimerInterval speed
      StartTimer
    @end
    
    @OnTimer
      // Send the current note
      SendMIDINoteOff 1, currentNote-1, 127
      SendMIDINoteOn 1, currentNote, 127
    
      // Move to the next note
      currentNote = currentNote + 1
      if currentNote > endNote
        currentNote = startNote
      endif
    @end
    
    @OnMidiCC
      // Check for MIDI CC 01 (modwheel) to control speed
      if MIDIByte2 = 1
        // Map the modwheel value to a speed range of 0.8 Hz to 6 Hz
        modwheelValue = MIDIByte3
        speedHz = TranslateScale modwheelValue, 0, 127, SpeedLow, SpeedFast
        speed = Round(1000 / speedHz)  // Convert Hz to milliseconds
        SetTimerInterval speed
      endif
    
      // Check for MIDI CC 64 (sustain pedal)
      if MIDIByte2 = 64
        if MIDIByte3 >= 64 and sustainState = 0
          SendMIDINoteOn 1, SustNote, 127  // B6 Note On
          sustainState = 1
        elseif MIDIByte3 < 64 and sustainState = 1
          SendMIDINoteOff 1, SustNote, 0   // B6 Note Off
          sustainState = 0
        endif
      endif
    @end
    
    @Description
    This script sequentially turns on and off MIDI notes from D6 to D7. The speed of the sequence is by the incoming MIDI CC 01 (modwheel), ranging from approximately 0.8 Hz to 6 Hz. The script also detects the sustain pedal (MIDI CC 64) and sends a single B6 note on when pressed and a single B6 note off when released. The notes are sent with a velocity of 127 on MIDI channel 1.
    @end
    

    Here is the end result
    https://youtu.be/NAIaEoDAVyY

  • Nice job @jjpl2001 👍🏼

  • Is there a script that will quantise incoming midi velocities to a certain range, eg. 100 to 127? in this example, any incoming note below 100 will be output at a value of 100, and any incoming note above 100 will be output at the same velocity as its input value.

  • That’s going to be easy. You can also do it easily with MIDI Curves.

  • wimwim
    edited September 2024

    @Gavinski said:
    Is there a script that will quantise incoming midi velocities to a certain range, eg. 100 to 127? in this example, any incoming note below 100 will be output at a value of 100, and any incoming note above 100 will be output at the same velocity as its input value.

    https://patchstorage.com/midi-scaler-v1-0/

    It doesn't do "clipping" as you describe though. It compresses the full range proportionally into the given range.

  • I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

  • @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Something like this should work

    Set timer interval to 2 secs

    each time a cc event arrives set lastCcTime to systemTime and stop timer and start timer

    when the timer goes off compare current time to system time; if the time elapsed is >2000, stop the timer and do your timeout stuff

  • @espiegel123 said:

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Something like this should work

    Set timer interval to 2 secs

    each time a cc event arrives set lastCcTime to systemTime and stop timer and start timer

    when the timer goes off compare current time to system time; if the time elapsed is >2000, stop the timer and do your timeout stuff

    That sounds like the right concept, would you mind helping with the actual script? I'm in baby shoes! ;) Thank you!

  • @ztones said:

    @espiegel123 said:

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Something like this should work

    Set timer interval to 2 secs

    each time a cc event arrives set lastCcTime to systemTime and stop timer and start timer

    when the timer goes off compare current time to system time; if the time elapsed is >2000, stop the timer and do your timeout stuff

    That sounds like the right concept, would you mind helping with the actual script? I'm in baby shoes! ;) Thank you!

    I’m afraid that I am short time.

  • wimwim
    edited October 2024

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Call me old-school, but all my WAH pedals are analog. What model do you have? Is it actually a WAH pedal, or an expression pedal? What midi cc does it send out?

  • @wim said:

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Call me old-school, but all my WAH pedals are analog. What model do you have? Is it actually a WAH pedal, or an expression pedal? What midi cc does it send out?

    It's an expression pedal. Sends cc23 on ch1, but can be set to anything. I'm using a wah in Tonestack Pro. Not bad actually!

  • wimwim
    edited October 2024

    @ztones said:

    @wim said:

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Call me old-school, but all my WAH pedals are analog. What model do you have? Is it actually a WAH pedal, or an expression pedal? What midi cc does it send out?

    It's an expression pedal. Sends cc23 on ch1, but can be set to anything. I'm using a wah in Tonestack Pro. Not bad actually!

    I'll see if I can whip up a script that works. Not knowing what you want to happen during the on and off periods, I'll just put in log messages or something as placeholders.

  • @wim said:

    @ztones said:

    @wim said:

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Call me old-school, but all my WAH pedals are analog. What model do you have? Is it actually a WAH pedal, or an expression pedal? What midi cc does it send out?

    It's an expression pedal. Sends cc23 on ch1, but can be set to anything. I'm using a wah in Tonestack Pro. Not bad actually!

    I'll see if I can whip up a script that works.

    I'd really appreciate that! Thank you so much!

  • wimwim
    edited October 2024

    @ztones said:

    @wim said:

    @ztones said:

    @wim said:

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Call me old-school, but all my WAH pedals are analog. What model do you have? Is it actually a WAH pedal, or an expression pedal? What midi cc does it send out?

    It's an expression pedal. Sends cc23 on ch1, but can be set to anything. I'm using a wah in Tonestack Pro. Not bad actually!

    I'll see if I can whip up a script that works.

    I'd really appreciate that! Thank you so much!

    This should work, I think. I kept it to the basics. Let me know if I made any careless mistakes or if you need help with fleshing the script out.

    @Description
    Listen for a changing cc value and do one thing if values are changing and another if not.
    Switch to log view for this demo.
    @End
    
    @OnLoad
      exp_ch = 0          // The channel to listen to
      exp_cc = 23         // The message to listen for
      timeout = 2000      // Wait time to detect stopped movement
      
      lastTime = -1
      value = -1
      lastValue = -1
      running = NO
      SetTimerInterval 10  //Increase if CPU use is too high (unlikely)
      
      Log {Waiting for movement...}
    @End
    
    @OnMidiCC
      if (MIDIChannel = exp_ch) and (MIDIByte2 = exp_cc)
        value = MIDIByte3
        lastTime = SystemTime
        if not running
          StartTimer
          running = YES
        endif
      else
        SendMIDIThru
      endif
    @End
    
    @OnMidiInput
      // Pass all other MIDI Thru (cc messages are handled above)
      if MIDICommand <> 0xB0  //CC message
        SendMIDIThru
      endif
    @End
    
    @OnTimer
      now = SystemTime
      if (now - lastTime) < timeout
        // Take the in-motion action, but only after checking that values have 
        // actually changed, to avoid spamming unnecessary messages.
        if value <> lastValue
          lastValue = value
          Call @InMotion
        endif
      else
        // Take the stopped action
        StopTimer
        running = NO
        Call @Stopped
      endif
    @End
    
    @InMotion
        // Substitute your own in-motion actions here...
        Log {Chan. }, (exp_ch+1), { - cc}, exp_cc, {: }, value
    @End
    
    @Stopped
      // Substitute your own resting actions here.
      Log {Waiting for movement...}
    @End
    
  • edited October 2024

    @wim said:

    @ztones said:

    @wim said:

    @ztones said:

    @wim said:

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Call me old-school, but all my WAH pedals are analog. What model do you have? Is it actually a WAH pedal, or an expression pedal? What midi cc does it send out?

    It's an expression pedal. Sends cc23 on ch1, but can be set to anything. I'm using a wah in Tonestack Pro. Not bad actually!

    I'll see if I can whip up a script that works.

    I'd really appreciate that! Thank you so much!

    This should work, I think. I kept it to the basics. Let me know if I made any careless mistakes or if you need help with fleshing the script out.


    Wow! This works exactly as I was hoping! Awesome work! Thank you so much for your help!!! Your notes and hints were helpful! No noticeable change on the CPU. I definitely couldn’t have done this on my own!

  • edited October 2024

    Would it be possible with Mozaic to capture all MIDI notes and truncate those that are longer than e.g. 1 bar or in the moment when the next note is started?
    I'm trying find out a workaround for this bug in iBassist:

  • wimwim
    edited October 2024

    @filo01 said:
    Would it be possible with Mozaic to capture all MIDI notes and truncate those that are longer than e.g. 1 bar or in the moment when the next note is started?
    I'm trying find out a workaround for this bug in iBassist:

    I don't understand "in the moment when the next note is started". Can you elaborate?

  • @wim said:

    @filo01 said:
    Would it be possible with Mozaic to capture all MIDI notes and truncate those that are longer than e.g. 1 bar or in the moment when the next note is started?
    I'm trying find out a workaround for this bug in iBassist:

    I don't understand "in the moment when the next note is started". Can you elaborate?

    Wait. I think I understand.
    You want to cut off a very long note as soon as any other note is played. Correct?

    If so, then that's not practical. To detect if the note is over one bar long, you have to wait until one bar has passed. You can't then go back in time and truncate the note - At least not until time travel is invented. This would probably have to be a Mozaic 2.0 feature request.

    The best you could do would be to cut off any note as soon as the next note comes in, effectively making the midi monophonic, which might be a reasonable thing to do with iBassist. There's an existing script that claims to do that: https://patchstorage.com/force-monophonic/

  • edited October 2024

    @wim said:

    @wim said:

    @filo01 said:
    Would it be possible with Mozaic to capture all MIDI notes and truncate those that are longer than e.g. 1 bar or in the moment when the next note is started?
    I'm trying find out a workaround for this bug in iBassist:

    I don't understand "in the moment when the next note is started". Can you elaborate?

    Wait. I think I understand.
    You want to cut off a very long note as soon as any other note is played. Correct?

    If so, then that's not practical. To detect if the note is over one bar long, you have to wait until one bar has passed. You can't then go back in time and truncate the note - At least not until time travel is invented. This would probably have to be a Mozaic 2.0 feature request.

    The best you could do would be to cut off any note as soon as the next note comes in, effectively making the midi monophonic, which might be a reasonable thing to do with iBassist. There's an existing script that claims to do that: https://patchstorage.com/force-monophonic/

    It is correct, sorry for MIDI term mismatch.
    You nail it - making the midi monophonic is a clever and straightforward way.
    Thank you @wim!

  • edited October 2024

    @wim said:

    @ztones said:

    @wim said:

    @ztones said:

    @wim said:

    @ztones said:
    I've searched, but can't find the answer.... What I would like to achieve in Mosaic is turn on the wah (unbypass) while the pedal is moving and turn off IF the pedal stops moving (no midi activity) for longer than 2000ms for example. So (I think) basically something like onMidiCC do this, otherwise do that, but ONLY IF the CC's are no longer coming in for more than X period of time. Another way to put it, IF X happens, do Y, otherwise do Z but but only if X value hasn't changed in 2000ms (for example). Thank you so much!

    Call me old-school, but all my WAH pedals are analog. What model do you have? Is it actually a WAH pedal, or an expression pedal? What midi cc does it send out?

    It's an expression pedal. Sends cc23 on ch1, but can be set to anything. I'm using a wah in Tonestack Pro. Not bad actually!

    I'll see if I can whip up a script that works.

    I'd really appreciate that! Thank you so much!

    This should work, I think. I kept it to the basics. Let me know if I made any careless mistakes or if you need help with fleshing the script out.

    @Description
    Listen for a changing cc value and do one thing if values are changing and another if not.
    Switch to log view for this demo.
    @End
    
    @OnLoad
      exp_ch = 0          // The channel to listen to
      exp_cc = 23         // The message to listen for
      timeout = 2000      // Wait time to detect stopped movement
      
      lastTime = -1
      value = -1
      lastValue = -1
      running = NO
      SetTimerInterval 10  //Increase if CPU use is too high (unlikely)
      
      Log {Waiting for movement...}
    @End
    
    @OnMidiCC
      if (MIDIChannel = exp_ch) and (MIDIByte2 = exp_cc)
        value = MIDIByte3
        lastTime = SystemTime
        if not running
          StartTimer
          running = YES
        endif
      else
        SendMIDIThru
      endif
    @End
    
    @OnMidiInput
      // Pass all other MIDI Thru (cc messages are handled above)
      if MIDICommand <> 0xB0  //CC message
        SendMIDIThru
      endif
    @End
    
    @OnTimer
      now = SystemTime
      if (now - lastTime) < timeout
        // Take the in-motion action, but only after checking that values have 
        // actually changed, to avoid spamming unnecessary messages.
        if value <> lastValue
          lastValue = value
          Call @InMotion
        endif
      else
        // Take the stopped action
        StopTimer
        running = NO
        Call @Stopped
      endif
    @End
    
    @InMotion
        // Substitute your own in-motion actions here...
        Log {Chan. }, (exp_ch+1), { - cc}, exp_cc, {: }, value
    @End
    
    @Stopped
      // Substitute your own resting actions here.
      Log {Waiting for movement...}
    @End
    

    @wim, I've been using your timed script for my expression pedal and it works flawlessly! Now that my expression pedal turns on/off the wah if not moving, I'd love to add a double and triple tap option to my buttons. I've been searching and looking at some code(s), but I wasn't sure if its possible to have other timer events added without messing up the first one?

    My floor switches currently send out a single message of CC#4 through #11 with a value of 64. This can be edited of course and I believe if needed, to be set up as either momentary or latching.

    So it is eight switches and currently they are triggering 8 pads in mosaic. I'm assuming creating double and triple tap for the pads is the way to go in the script?

    If doable, can you please help with where and how to add those? Thank you very much!

  • wimwim
    edited October 2024

    @ztones said:
    @wim, I've been using your timed script for my expression pedal and it works flawlessly! Now that my expression pedal turns on/off the wah if not moving, I'd love to add a double and triple tap option to my buttons. I've been searching and looking at some code(s), but I wasn't sure if its possible to have other timer events added without messing up the first one?

    My floor switches currently send out a single message of CC#4 through #11 with a value of 64. This can be edited of course and I believe if needed, to be set up as either momentary or latching.

    So it is eight switches and currently they are triggering 8 pads in mosaic. I'm assuming creating double and triple tap for the pads is the way to go in the script?

    If doable, can you please help with where and how to add those? Thank you very much!

    That gets a quite a bit more complicated. There's only one timer. So, there needs to be 9 checks in total (8 for the switches and one for the expression pedal) within the timer. Then there needs to be a routine to determine if each is a single, double, or triple tap.

    I have an old script around somewhere that has tap-detect code. I'll try to dust that one off and see if it still makes sense to me now. 😂

    No promises. But I'll look into it.
    Maybe we'll both get lucky and someone else who knows what they're doing more than I do will beat me to it.

  • @wim said:

    @ztones said:
    @wim, I've been using your timed script for my expression pedal and it works flawlessly! Now that my expression pedal turns on/off the wah if not moving, I'd love to add a double and triple tap option to my buttons. I've been searching and looking at some code(s), but I wasn't sure if its possible to have other timer events added without messing up the first one?

    My floor switches currently send out a single message of CC#4 through #11 with a value of 64. This can be edited of course and I believe if needed, to be set up as either momentary or latching.

    So it is eight switches and currently they are triggering 8 pads in mosaic. I'm assuming creating double and triple tap for the pads is the way to go in the script?

    If doable, can you please help with where and how to add those? Thank you very much!

    That gets a quite a bit more complicated. There's only one timer. So, there needs to be 9 checks in total (8 for the switches and one for the expression pedal) within the timer. Then there needs to be a routine to determine if each is a single, double, or triple tap.

    I have an old script around somewhere that has tap-detect code. I'll try to dust that one off and see if it still makes sense to me now. 😂

    No promises. But I'll look into it.
    Maybe we'll both get lucky and someone else who knows what they're doing more than I do will beat me to it.

    I appreciate that! If there is only one timer, would another instance of Mosaic (in AUM) solve that?

  • FWIW, I used to do double-tap detection by recording the system time on the cc on event and whenever a cc on event I checked to see if it was within my timeout (let’s say 250 ms). It frees you from needing to have complicated timer loops.

  • @ztones said:
    I appreciate that! If there is only one timer, would another instance of Mosaic (in AUM) solve that?

    You'd need an additional instance for each thing you want to time. That would mean 9 instances in this case, assuming you want to have tap detection for all buttons. That would be a clumsy and high-maintenance solution.

    No, it's all doable in a single script without too much trouble. And as @espiegel123 noted above (and I remember now ... it's been a long time), you don't need to use a timer for that anyway.

    Detecting and acting on the different tap types is probably the more involved of the two issues.

  • @espiegel123 said:
    FWIW, I used to do double-tap detection by recording the system time on the cc on event and whenever a cc on event I checked to see if it was within my timeout (let’s say 250 ms). It frees you from needing to have complicated timer loops.

    I found this script. Is this what you used?

    `@OnLoad
    FillArray downStart,0,16
    pressTime = 250
    @End

    @OnPadDown
    downStart[LastPad] = SystemTime
    @End

    @OnPadUp
    pad = LastPad
    if SystemTime - downStart[pad] < pressTime
    Log {Short tap pad }, pad
    else
    Log {Long tap pad }, pad
    endif
    @End`

    Does the desired action go into the OnPadDown and/or OnPadUp section?

  • @wim said:

    @ztones said:
    I appreciate that! If there is only one timer, would another instance of Mosaic (in AUM) solve that?

    You'd need an additional instance for each thing you want to time. That would mean 9 instances in this case, assuming you want to have tap detection for all buttons. That would be a clumsy and high-maintenance solution.

    No, it's all doable in a single script without too much trouble. And as @espiegel123 noted above (and I remember now ... it's been a long time), you don't need to use a timer for that anyway.

    Detecting and acting on the different tap types is probably the more involved of the two issues.

    Yeah, 9 instances is not elegant at all! LOL Instead of single/double/triple tap, would a single/double/long-hold be easier to detect or same difference?

  • @ztones said:
    Yeah, 9 instances is not elegant at all! LOL Instead of single/double/triple tap, would a single/double/long-hold be easier to detect or same difference?

    Doesn't matter too much. In fact, I think my old script has all three.

  • @wim said:

    @ztones said:
    Yeah, 9 instances is not elegant at all! LOL Instead of single/double/triple tap, would a single/double/long-hold be easier to detect or same difference?

    Doesn't matter too much. In fact, I think my old script has all three.

    Nice! That would give really multiply my buttons usefulness! And probably add to my confusion! LOL I can't wait to see your script!

  • Btw, @ztones, what host(s) are you using Mozaic in?
    If you're interested, Loopy Pro has various tap detections built-in.

Sign In or Register to comment.