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.

Any app or widget that will set/alter gate length?

I’m looking for a way to extend the more or less instant gate length sent by midi drum pads.would prefer something where the gate length can run reaaaaaly long (multiples of measures) down to like 1/128. Needs to have gate length exposed as midi/AU param.

Ideas?

«1

Comments

  • That'd be an easy Mozaic script. Maybe I'll whip something up.

  • wimwim
    edited April 2023

    or ... maybe I already did?

    https://patchstorage.com/note-length-mugger/

  • Rhythm Bud will take a note on and play it out up to 2 whole notes

  • McDMcD
    edited April 2023

    In my Mozaic scripts I generally provide a knob for what I call “Note Length” and use values in milliseconds: 10 to 5000 in my most recent creation.

    For PPQN based lengths I would test the system time and get a calculation of the milliseconds between
    “Clicks” of interest like 1/128 as you mention. Then I would provide a knob for multiples of that value for the “Note Off” event.

    I had this “Aha” moment when I realized I could dispatch Notes with terminations at the same time and just let Mozaic’s interpreter create the timing for the note offs (i.e. gates).

    So, for every note out I send a pair of instructions:

    SendMIDINoteOn Channel, Note + Transpose, Volume
    SendMIDINoteOff Channel, Note + Transpose, 0, NoteTime
    

    So, my variables typically set by knobs or incoming MIDI streams are:

    1. Channel
    2. Note
    3. Transpose (useful for melodic purposes and maybe useful to find a good drum target NOTE. I usually code this knob from -12 to +12 values but multiple octaves are allowed too).
    4. Volume - either set from the input or fixed to a value like 100
    5. NoteTime - 10 to 1000*second

    I can research how to code detecting the 1/128 values into milliseconds and test some code too if you like.

    My big aha was realizing I could save systemtime for every MIDI event into buffers:
    Channel[]
    Note[]
    Velocity[]
    Time[] * systemtime - (the systemtime at “start” of sequence)

    And I
    Inc Index
    For every incoming note event.

    Then I can playback using this bit of code:

    For Index = 0 to Time[LastIndex]
    
      SendMIDINoteOn Channel[Index], Note[Index] + Transpose, Volume[Index], Time[Index]
      SendMIDINoteOff Channel[Index], Note[Index] + Transpose, 0, NoteTime + Time[Index]
    
    Endif
    

    Mozaic will complain about sending out more than 256 events at one go but for sequences of less than 256 events this code works just like a “MIDI Recorder” app like
    4 Pockets “Neon Recorder” without the extras for post recording editing or quantizing.
    Mozaic doesn’t have a great set of UI tools for a piano roll like editor.

  • At 120 BPM this code prints out millisecond intervals to calculate and use for your gates.

    PPQN = 8 shows 64 ms
    16 shows 32 ms
    32 shows 16 ms
    64 shows 8 Ms
    128 shows ~5 ms adding extra time for the Mozaic runtime overhead but 4 Ms is the right value).

    BPM*4.3 / 128 will get you close to your “gate” setting to use with multiples.

    @OnLoad

    ppqn = 128
    SetMetroPPQN ppqn
    Last_Time = 0

    @End

    @OnMetroPulse

    This_Time = systemtime
    Log {Milliseconds = }, This_Time - Last_Time
    Last_Time = This_Time

    @End

  • wimwim
    edited April 2023

    @McD said:
    At 120 BPM this code prints out millisecond intervals to calculate and use for your gates.

    PPQN = 8 shows 64 ms
    16 shows 32 ms
    32 shows 16 ms
    64 shows 8 Ms
    128 shows ~5 ms adding extra time for the Mozaic runtime overhead but 4 Ms is the right value).

    BPM*4.3 / 128 will get you close to your “gate” setting to use with multiples.

    @OnLoad

    ppqn = 128
    SetMetroPPQN ppqn
    Last_Time = 0

    @End

    @OnMetroPulse

    This_Time = systemtime
    Log {Milliseconds = }, This_Time - Last_Time
    Last_Time = This_Time

    @End

    [edit, nvm] I misread your intent, which is to use delay to dispatch the note-off.

    Or, you can just use @SetMetroPPQN and @OnMetroPulse directly rather than delay or @OnTimer so that the timing automatically adapts to host tempo. That avoids cumulative timing errors due to math precision.

    [edit] I make it a habit to avoid dispatching lots of delayed midi messages as Bram advises against this. I try to dispatch note-offs using a timer or metro pulse. delay does make for far easier code, but needs to be kept to not too many messages.

    But you're absolutely right that it's appropriate in many situations.

  • This code will Log the Gate_Millisecond_Multiplier for various BPM values:

    @OnLoad

    ppqn = 128
    SetMetroPPQN ppqn
    Last_Time = 0

    @End

    @OnNewBar

    This_Time = systemtime
    Log {Gate_Muliplier in Millisecs for PPQN of },ppqn, { = }, (This_Time - Last_Time) / (ppqn*4)
    Last_Time = This_Time

    @End

    It shows the Gate at 3.9 milliseconds for BPM = 120 and a PPQN of 128.

  • wimwim
    edited April 2023

    btw, a generalized formula for finding the delay time is:
    (at least I think it is from memory - no time to test, so apologies in advance if it's off)

    Sorry for the thread hijack @MonkeyDrummer - last OT post from me here.

    // example using 3/16 beat
    mult = 3
    beat_div = 16
    delay = 60000 / HostTempo / beat_div * 4 * mult
    Log {Delay: }, delay, {ms}
    
  • @wim said:
    or ... maybe I already did?

    https://patchstorage.com/note-length-mugger/

    Is there a page on patch storage with all these mozaic scripts? The thread on the forum is so long and some of the scripts are pages apart. Makes it hard to see what all is out there and useful for me.

  • wimwim
    edited April 2023

    @HotStrange said:

    @wim said:
    or ... maybe I already did?

    https://patchstorage.com/note-length-mugger/

    Is there a page on patch storage with all these mozaic scripts? The thread on the forum is so long and some of the scripts are pages apart. Makes it hard to see what all is out there and useful for me.

    Each platform on Patchstorage has it's own section and a search facility. That's not always real easy to find what you're after though.

    There's a nice succinct list on the wiki: https://wiki.audiob.us/doku.php?id=mozaic_scripts_list. That's the easiest way to find things IMO. It's manually maintained, but I think is rigorously kept up to date by @_ki.

  • @wim said:

    @HotStrange said:

    @wim said:
    or ... maybe I already did?

    https://patchstorage.com/note-length-mugger/

    Is there a page on patch storage with all these mozaic scripts? The thread on the forum is so long and some of the scripts are pages apart. Makes it hard to see what all is out there and useful for me.

    Each platform on Patchstorage has it's own section and a search facility. That's not always real easy to find what you're after though.

    There's a nice succinct list on the wiki: https://wiki.audiob.us/doku.php?id=mozaic_scripts_list. That's the easiest way to find things IMO. It's manually maintained, but I think is rigorously kept up to date by @_ki.

    Oh sweet thanks! Exactly what I need. I’ve been hesitant to get mozaic due to this but I think I can dive in now. Would you recommend it? How easy is it to upload these scripts?

  • @HotStrange said:

    @wim said:

    @HotStrange said:

    @wim said:
    or ... maybe I already did?

    https://patchstorage.com/note-length-mugger/

    Is there a page on patch storage with all these mozaic scripts? The thread on the forum is so long and some of the scripts are pages apart. Makes it hard to see what all is out there and useful for me.

    Each platform on Patchstorage has it's own section and a search facility. That's not always real easy to find what you're after though.

    There's a nice succinct list on the wiki: https://wiki.audiob.us/doku.php?id=mozaic_scripts_list. That's the easiest way to find things IMO. It's manually maintained, but I think is rigorously kept up to date by @_ki.

    Oh sweet thanks! Exactly what I need. I’ve been hesitant to get mozaic due to this but I think I can dive in now. Would you recommend it? How easy is it to upload these scripts?

    There are two reasons why one would want mozaic. 1) Because you want to learn some programming to make your own midi plugins, or 2) Because there are existing scripts that you feel would be useful. Or both.

    It's very easy to download and install scripts. Just download the file, then hit the share icon thing and select to open it in Mozaic. That'll open the standalone app and the script will be available to load. You don't need to open it in the standalone app but the standalone app is what imports the script, if that makes sense. It's easier to do than to explain.

  • @wim said:

    @HotStrange said:

    @wim said:

    @HotStrange said:

    @wim said:
    or ... maybe I already did?

    https://patchstorage.com/note-length-mugger/

    Is there a page on patch storage with all these mozaic scripts? The thread on the forum is so long and some of the scripts are pages apart. Makes it hard to see what all is out there and useful for me.

    Each platform on Patchstorage has it's own section and a search facility. That's not always real easy to find what you're after though.

    There's a nice succinct list on the wiki: https://wiki.audiob.us/doku.php?id=mozaic_scripts_list. That's the easiest way to find things IMO. It's manually maintained, but I think is rigorously kept up to date by @_ki.

    Oh sweet thanks! Exactly what I need. I’ve been hesitant to get mozaic due to this but I think I can dive in now. Would you recommend it? How easy is it to upload these scripts?

    There are two reasons why one would want mozaic. 1) Because you want to learn some programming to make your own midi plugins, or 2) Because there are existing scripts that you feel would be useful. Or both.

    It's very easy to download and install scripts. Just download the file, then hit the share icon thing and select to open it in Mozaic. That'll open the standalone app and the script will be available to load. You don't need to open it in the standalone app but the standalone app is what imports the script, if that makes sense. It's easier to do than to explain.

    Those are the exact 2 reasons I want it haha. Thanks! Definitely gonna grab it soon.

  • @wim said:
    btw, a generalized formula for finding the delay time is:
    (at least I think it is from memory - no time to test, so apologies in advance if it's off)

    Sorry for the thread hijack @MonkeyDrummer - last OT post from me here.

    // example using 3/16 beat
    mult = 3
    beat_div = 16
    delay = 60000 / HostTempo / beat_div * 4 * mult
    Log {Delay: }, delay, {ms}
    

    Hijack away! :)

    CC Mugger did what I wanted. Unfortunately, what I wanted is not what I need. Of course.

    I think what I need is a type of monophonic latch/sustain thing...

    So a note played will be held until another note comes along, then the first note gets an OFF. If you play/repeat the same note it just sends an OFF.

    I've found some "latch" things, but they are all polyphonic.

  • wimwim
    edited April 2023

    @MonkeyDrummer said:
    So a note played will be held until another note comes along, then the first note gets an OFF. If you play/repeat the same note it just sends an OFF.

    That sounds easy - just a few lines of code, especially if we're dealing with a single midi channel. The only hitch I think is there would never be a note off for the last note without some way of signaling that it's the last one.

  • @wim As i understood, playing a note a second time will switch it off and perhaps one could also switch off an active note on Host stop.

  • @_ki said:
    @wim As i understood, playing a note a second time will switch it off and perhaps one could also switch off an active note on Host stop.

    Yea, that's exactly it.

    So there'd be 3 ways to STOP the note that's playing (again, this would only ever hold open one note)
    1) Play same note again to unlatch it
    2) Toggle the app's "bypass" or turn off hold, etc.
    3) Host stop or all notes off/panic

    Again, the use case is playing melodic "stuff" with drums. Obviously for non-sustaining percussion it's not required. But for long slow envelopes, I need a way to keep notes open. And if I play a flurry of notes, the "set gate length" just makes a mess of things with a mass of open notes. So I figure that something that woks as a monophonic sustain/latch would make more sense as long as I can turn it on/off via CC with something like a blueboard.

  • The first method won’t work but the others would. I was thinking just to have tapping a pad be the signal to kill the last note. You could map anything you want to that pad’s AUv3 parameter.

    It’s a real simple script and is already almost done. I had to go out for a bit, but will have something for you to try out later today.

  • @wim said:
    The first method won’t work but the others would. I was thinking just to have tapping a pad be the signal to kill the last note. You could map anything you want to that pad’s AUv3 parameter.

    Why would the first method not work?

    I play C4, it holds C4, I play C4 again, and it turns it off.

    Play C4, holds C4
    Play D4, turns off C4, holds D4
    Play D4, turns off D4

    It’s a real simple script and is already almost done. I had to go out for a bit, but will have something for you to try out later today.

    You're insane! :)

  • wimwim
    edited April 2023

    It wouldn’t work because there’s no way of knowing at the end that you won’t be playing any more notes.

    The way I wrote the script, I ignore note-off messages. Instead, I automatically send a note-off for the previous note just before sending the next note-on through. That’s all fine, but after that last note-on, there’s nothing to trigger the next note-off.

  • @MonkeyDrummer this should work for the latching aspect assuming a single static MIDI channel. It's doable if it's not, but it requires a bit more work with the NoteState matrix:

    @OnLoad
      previousNote = -1
    @End 
    
    @OnMidiNoteOn
      SendMIDINoteOff MIDIChannel, previousNote
      if previousNote = MIDINote 
        previousNote = -1
      else
        previousNote = MIDINote
        SendMIDIThru
      endif 
    @End 
    
  • Oh - i‘ve also implemented it as it sounded simple and like a nice afternoon diversion… But from the length of my script it seems i‘ve added too much subtleties (UI with description, shift/knob or Au param bypass toggle, knob-double-tap, retains channel and other midi events …) :)

    .

    Since wim was the first one responding, i don‘t post mine (but perhaps upoad it to patchstorage)

  • @wim said:
    It wouldn’t work because there’s no way of knowing at the end that you won’t be playing any more notes.

    That's fine...

    So from before:

    Play C4, holds C4
    Play D4, turns off C4, holds D4
    Play D4, turns off D4
    At this point, there's silence, nothing is playing...

    Then I play B3 and it plays and holds B3...

    Then hit B3 and it sends note off and waits for next note...

    I guess I don't see why that would not work... :/

    The way I wrote the script, I ignore note-off messages. Instead, I automatically send a note-off for the previous note just before sending the next note-on through. That’s all fine, but after that last note-on, there’s nothing to trigger the next note-off.

  • wimwim
    edited April 2023

    Yep. That’s close to how I approached it. That won’t handle multiple channels though, and the last note will never get a note-off, resulting in a stuck note.

    It will also try to send an invalid note-off before the first note.

  • @Grandbear said:
    @MonkeyDrummer this should work for the latching aspect assuming a single static MIDI channel. It's doable if it's not, but it requires a bit more work with the NoteState matrix:

    @OnLoad
      previousNote = -1
    @End 
    
    @OnMidiNoteOn
      SendMIDINoteOff MIDIChannel, previousNote
      if previousNote = MIDINote 
        previousNote = -1
      else
        previousNote = MIDINote
        SendMIDIThru
      endif 
    @End 
    

    That's almost perfect! Can you add one knob to be a toggle to bypass processing (I can't just bypass mozaic in AUM as it kills the routing I need).

    Thanks @grandbear! (and @wim and @_ki) You guys rock!

  • @_ki said:
    But from the length of my script it seems i‘ve added too much subtleties (UI with description, shift/knob or Au param bypass toggle, knob-double-tap, retains channel and other midi events …) :)

    You?! Create something complex?! No way!!! ;) <3

  • @wim could you put a note off of the last note after a predetermined period of time - which would be nullified on the next note on, Or a button to trigger note off with user feedback?

  • _ki_ki
    edited April 2023

    @MonkeyDrummer Another question regarding the bypass toggle, you said you wanted to use a blueboard sending out CCs.

    What exactly is send by the blueboard ?

    Is the toggling of CC value done by the bluebord (toggling between CC #id 0 and CC #id 123 with two knob presses) or does it kind of send its knob state (pressed => CC #id with value=13, released => CC #id with value = 0) or even responds in yet another way ?

    That would require different handling in the script, the first could directly map the CC value to the bypass knob, the second variant could be implemented for AU user 0 param.

  • wimwim
    edited April 2023

    Hey @MonkeyDrummer - you can use AUMs midi busses to get around the bypass routing problems.

    Keep in mind that if you bypass there should not be any notes still sustaining or you get stuck notes.

  • @wim said:
    Yep. That’s close to how I approached it. That won’t handle multiple channels though, and the last note will never get a note-off, resulting in a stuck note.

    What if you treat/analyze the incoming notes as control parameters before you consider them as notes for the latching process?

    It will also try to send an invalid note-off before the first note.

    Multiple channels is not required for my lil' use case.

Sign In or Register to comment.