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.

MOZAIC Help Line

11618202122

Comments

  • wimwim
    edited December 2024

    @OscarSouth said:
    A quick one for now -- what'd be a quick/efficient way to get the first index in an array holding a -1 value?

    What I'm really trying to do here is basically to get the 'length' of an array where -1 is representing an empty value. Preferably as a one liner rather than a loop if possible.

    You can't do that without a loop. A while loop, being careful to also limit the iterations to the length of the array in case no empty spot is found, is the most efficient.

    What I'll usually do if I can is to find a way to track where the empty index should be in another variable as I go.

  • wimwim
    edited December 2024

    here's an example @OscarSouth :

    @OnLoad
      FillArray haystack,1
      needle = Random 0,1023
      log {1: haystack[}, needle, {] = -1}
      haystack[needle] = -1
    
      index = 0
      while haystack[index] <> -1 and index < 1024
        if haystack[index] <> -1
          Inc index
        endif
      endwhile
    
      if index = 1024
        log {2: Not found!}
      else
        log {2: Found needle at hastack[},index,{]}
      endif
    @End
    

    [edit] I get an error in the final if - else if I don't set anything to -1. I had assumed the else clause wouldn't be evaluated, but it seems it is so I get an invalid index error. So, the example needs to be enhanced a little to handle the not found situation better.

  • @OscarSouth said:
    A quick one for now -- what'd be a quick/efficient way to get the first index in an array holding a -1 value?

    What I'm really trying to do here is basically to get the 'length' of an array where -1 is representing an empty value. Preferably as a one liner rather than a loop if possible.

    What I do for that use case, is to use the first byte of the array as the array length—and increment or decrement it as cells are added or subtracted.

  • @pejman said:

    @pejman said:
    @wim

    @wim said:
    @pejman - If you have two things that are supposed to happen virtually simultaneously, but you can't be sure which will happen first, then you need to check if the first has happened yet.

    I haven't been following the conversation closely so this may not be the proper solution, but here's what I was thinking in generalized pseudo code.

    in onLoad
    // set both variables to something impossible
    speedCC = -1
    modeCC = -1
    
    in OnMidiCC
    // set speedCC or modeCC to the incoming value based on which arrived
    // check if both are not -1
    // if they are both <> -1 then 
      do something
      and then set them both back to -1
    

    The idea is, nothing happens unless both cc's are in the state you expect them to be. If one hasn't been set yet then wait for the other to be set. Then take the action that you want to do and un-set them both to repeat the next time around.

    Thanks @wim for help 🙏🙏🙏 , I'm glad there's a solution that doesn't require another mozaic.
    I will try your method. It is a valuable experience.

    @wim

    I added the codes to the script. Is this what you have in mind? If so, unfortunately it doesn't work.

    In the first step of steppolyarp, which sends both speedcc and modecc with values (midibyte3) higher than 0, nothing happens. These codes only prevent the number 0 corresponding to the modecc value from being sent, whereas I expect that after x, log will show the number corresponding to modecc which is higher than 0.


    @OnLoad speedcc = - 1 //13 modecc = -1 //14 x = 0 resetmode = 0 countnote = 0 countcc = 0 @End @OnXYChange resetmode = Round TranslateScale (GetXValue), 0, 127, 0, 1 @End @OnMidiCC //Log {cc received. #:}, midibyte2, { value: }, midibyte3 //log {x beginning of handler : }, x if MIDIByte2 = 14 modecc = MIDIByte2 elseif MIDIByte2 = 13 speedcc = MIDIByte2 endif if MIDIByte2 = modecc x = Round TranslateScale (MIDIByte3), 0, 127, 0, 7 //Log {cc assign to x. #:}, midibyte2, { value: }, midibyte3 //log {processing done. x: }, x endif if resetmode = 0 if MIDIByte2 = speedcc if MIDIByte3 > 0 Inc countcc elseif MIDIByte3 = 0 countcc = 0 endif endif if modecc <> -1 and speedcc <> -1 if MIDIByte2 = speedcc and MIDIByte3 > 0 and countnote = 1 and countcc = 1 log {🔺x after second handler : } ,x endif endif endif if countnote = 0 countcc = 0 speedcc = - 1 modecc = -1 endif //log {x end handler : } ,x @End @OnMidiNoteOn if resetmode = 0 countnote = 1 endif @End @OnMidiNoteOff countcc = 0 countnote = 0 @End

    I'm sorry, it's more work than I'm ready to go to in order to understand the whole picture. There is more going on than just the script, and although you've posted screen shots, with external things going on and an unclear idea of what you're trying to accomplish, it's just not fruitful to keep hazarding guesses about the code.

    The best thing you can to figure this out yourself is to list exactly what is incoming to the script in order on that first step. Then, keeping in mind, that each @OnMidiCC, @OnMidiNoteOn, and @OnMidiNoteOff can only work on one message at a time, list what each variable will be after each message. Lastly, only act when all variables have gotten to the state that you expect.

    Sorry, I'd like to be more help, but my trying to suggest scripting changes when not in possession of all the information won't be helpful. And asking all the questions needed would be too time consuming.

  • @wim said:

    @pejman said:

    @pejman said:
    @wim

    @wim said:
    @pejman - If you have two things that are supposed to happen virtually simultaneously, but you can't be sure which will happen first, then you need to check if the first has happened yet.

    I haven't been following the conversation closely so this may not be the proper solution, but here's what I was thinking in generalized pseudo code.

    in onLoad
    // set both variables to something impossible
    speedCC = -1
    modeCC = -1
    
    in OnMidiCC
    // set speedCC or modeCC to the incoming value based on which arrived
    // check if both are not -1
    // if they are both <> -1 then 
      do something
      and then set them both back to -1
    

    The idea is, nothing happens unless both cc's are in the state you expect them to be. If one hasn't been set yet then wait for the other to be set. Then take the action that you want to do and un-set them both to repeat the next time around.

    Thanks @wim for help 🙏🙏🙏 , I'm glad there's a solution that doesn't require another mozaic.
    I will try your method. It is a valuable experience.

    @wim

    I added the codes to the script. Is this what you have in mind? If so, unfortunately it doesn't work.

    In the first step of steppolyarp, which sends both speedcc and modecc with values (midibyte3) higher than 0, nothing happens. These codes only prevent the number 0 corresponding to the modecc value from being sent, whereas I expect that after x, log will show the number corresponding to modecc which is higher than 0.


    @OnLoad speedcc = - 1 //13 modecc = -1 //14 x = 0 resetmode = 0 countnote = 0 countcc = 0 @End @OnXYChange resetmode = Round TranslateScale (GetXValue), 0, 127, 0, 1 @End @OnMidiCC //Log {cc received. #:}, midibyte2, { value: }, midibyte3 //log {x beginning of handler : }, x if MIDIByte2 = 14 modecc = MIDIByte2 elseif MIDIByte2 = 13 speedcc = MIDIByte2 endif if MIDIByte2 = modecc x = Round TranslateScale (MIDIByte3), 0, 127, 0, 7 //Log {cc assign to x. #:}, midibyte2, { value: }, midibyte3 //log {processing done. x: }, x endif if resetmode = 0 if MIDIByte2 = speedcc if MIDIByte3 > 0 Inc countcc elseif MIDIByte3 = 0 countcc = 0 endif endif if modecc <> -1 and speedcc <> -1 if MIDIByte2 = speedcc and MIDIByte3 > 0 and countnote = 1 and countcc = 1 log {🔺x after second handler : } ,x endif endif endif if countnote = 0 countcc = 0 speedcc = - 1 modecc = -1 endif //log {x end handler : } ,x @End @OnMidiNoteOn if resetmode = 0 countnote = 1 endif @End @OnMidiNoteOff countcc = 0 countnote = 0 @End

    I'm sorry, it's more work than I'm ready to go to in order to understand the whole picture. There is more going on than just the script, and although you've posted screen shots, with external things going on and an unclear idea of what you're trying to accomplish, it's just not fruitful to keep hazarding guesses about the code.

    The best thing you can to figure this out yourself is to list exactly what is incoming to the script in order on that first step. Then, keeping in mind, that each @OnMidiCC, @OnMidiNoteOn, and @OnMidiNoteOff can only work on one message at a time, list what each variable will be after each message. Lastly, only act when all variables have gotten to the state that you expect.

    Sorry, I'd like to be more help, but my trying to suggest scripting changes when not in possession of all the information won't be helpful. And asking all the questions needed would be too time consuming.

    What more information do you need from me?

  • @pejman said:

    @wim said:

    @pejman said:

    @pejman said:
    @wim

    @wim said:
    @pejman - If you have two things that are supposed to happen virtually simultaneously, but you can't be sure which will happen first, then you need to check if the first has happened yet.

    I haven't been following the conversation closely so this may not be the proper solution, but here's what I was thinking in generalized pseudo code.

    in onLoad
    // set both variables to something impossible
    speedCC = -1
    modeCC = -1
    
    in OnMidiCC
    // set speedCC or modeCC to the incoming value based on which arrived
    // check if both are not -1
    // if they are both <> -1 then 
      do something
      and then set them both back to -1
    

    The idea is, nothing happens unless both cc's are in the state you expect them to be. If one hasn't been set yet then wait for the other to be set. Then take the action that you want to do and un-set them both to repeat the next time around.

    Thanks @wim for help 🙏🙏🙏 , I'm glad there's a solution that doesn't require another mozaic.
    I will try your method. It is a valuable experience.

    @wim

    I added the codes to the script. Is this what you have in mind? If so, unfortunately it doesn't work.

    In the first step of steppolyarp, which sends both speedcc and modecc with values (midibyte3) higher than 0, nothing happens. These codes only prevent the number 0 corresponding to the modecc value from being sent, whereas I expect that after x, log will show the number corresponding to modecc which is higher than 0.


    @OnLoad speedcc = - 1 //13 modecc = -1 //14 x = 0 resetmode = 0 countnote = 0 countcc = 0 @End @OnXYChange resetmode = Round TranslateScale (GetXValue), 0, 127, 0, 1 @End @OnMidiCC //Log {cc received. #:}, midibyte2, { value: }, midibyte3 //log {x beginning of handler : }, x if MIDIByte2 = 14 modecc = MIDIByte2 elseif MIDIByte2 = 13 speedcc = MIDIByte2 endif if MIDIByte2 = modecc x = Round TranslateScale (MIDIByte3), 0, 127, 0, 7 //Log {cc assign to x. #:}, midibyte2, { value: }, midibyte3 //log {processing done. x: }, x endif if resetmode = 0 if MIDIByte2 = speedcc if MIDIByte3 > 0 Inc countcc elseif MIDIByte3 = 0 countcc = 0 endif endif if modecc <> -1 and speedcc <> -1 if MIDIByte2 = speedcc and MIDIByte3 > 0 and countnote = 1 and countcc = 1 log {🔺x after second handler : } ,x endif endif endif if countnote = 0 countcc = 0 speedcc = - 1 modecc = -1 endif //log {x end handler : } ,x @End @OnMidiNoteOn if resetmode = 0 countnote = 1 endif @End @OnMidiNoteOff countcc = 0 countnote = 0 @End

    I'm sorry, it's more work than I'm ready to go to in order to understand the whole picture. There is more going on than just the script, and although you've posted screen shots, with external things going on and an unclear idea of what you're trying to accomplish, it's just not fruitful to keep hazarding guesses about the code.

    The best thing you can to figure this out yourself is to list exactly what is incoming to the script in order on that first step. Then, keeping in mind, that each @OnMidiCC, @OnMidiNoteOn, and @OnMidiNoteOff can only work on one message at a time, list what each variable will be after each message. Lastly, only act when all variables have gotten to the state that you expect.

    Sorry, I'd like to be more help, but my trying to suggest scripting changes when not in possession of all the information won't be helpful. And asking all the questions needed would be too time consuming.

    What more information do you need from me?

    Short of being in the same room with you to work through it, watching what you’re doing with StepPolyArp, and asking questions as we go, I can’t think of a way to approach this that would be an effective use of time. 🤷🏻‍♂️

    I believe you can work it put if you do the things that have been suggested already. If not then maybe focus on other things for a bit. Sometimes when I return after a break from a project I’ve gotten stuck on, things finally start to become clear.

  • edited December 2024

    @wim

    This is my script, very simple and clear, and I did all the things that espiegel asked me to do, and finally we came to the conclusion that mozaic processes the received ccs one by one and not all at once, this is the problem I am facing. Even with putting a lot of logs and collecting information, we finally came to the same conclusion and I really don't know what else to do.

    Is there anything else I should have done that I haven't done?

    @OnLoad
      PBspeedcc = 13
      PBmodecc = 14
      x = 0 
      resetmode = 0
      countnote = 0
      countcc = 0
    @End
    
    @OnXYChange
    resetmode = Round TranslateScale (GetXValue), 0, 127, 0, 1  
    @End 
    
    
    @OnMidiCC
    if MIDIByte2 = PBmodecc 
       x = Round TranslateScale (MIDIByte3), 0, 127, 0, 7  
    endif
    
      if resetmode = 0 
        if MIDIByte2 = PBspeedcc 
          if MIDIByte3 > 0 
            Inc countcc
          elseif MIDIByte3 = 0 
             countcc = 0 
          endif
         endif
                      
    if MIDIByte2 = PBspeedcc and MIDIByte3 > 0 and countnote = 1 and countcc = 1  
                    //do something  if x = 3 for example
           log x        
    endif      
    endif
         
         
    if countnote = 0
      countcc = 0
      endif
    
    @End 
     
    
    @OnMidiNoteOn
    if resetmode = 0
     countnote = 1
     endif
    @End 
    
    @OnMidiNoteOff
      countcc = 0
      countnote = 0  
    @End 
    
    
  • edited December 2024

    @wim

    @wim said:

    You wrote: _I believe you can work it put if you do the things that have been suggested already. If not then maybe focus on other things for a bit. Sometimes when I return after a break from a project I’ve gotten stuck on, things finally start to become clear.
    _

    This is the method I use most often to solve the puzzle. I followed your advice and left the house and went to the nearest mountain to my house. On the way back home, remembering what @espiegel was trying to tell me, especially Order of processing ccs in mozaic , this solution came to my mind.

    It’s working.

    I simplified the script even further.


    @OnLoad PBspeedcc = 13 PBmodecc = 14 x = 0 state = 0 stateb = 0 @End @OnMidiCC if MIDIByte2 = PBmodecc and MIDIByte3 > 0 state = 1 endif if MIDIByte2 = PBspeedcc and MIDIByte3 > 0 stateb = 1 endif if state = 1 and stateb = 1 if MIDIByte2 = PBmodecc x = Round TranslateScale (MIDIByte3), 0, 127, 0, 7 log x endif endif @End
  • That's awesome @pejman! 😎👍🏼

  • Hello .
    I want each of the 16 pads to not be colored when they are in position 0 (if lonoff[LastPad] = 0 ) and the colorpad to jump to the next pad if it was in position 1 ( if lonoff[LastPad] = 1) .
    What should I change or what should I add to script?

    I would be grateful if you could help.

    @OnLoad
    ShowLayout 2
    count = -1
    padrevert = 0
    FillArray onoff, 64
    FillArray lonoff, 1
    @End

    @OnPadDown
    Call @set
    @End

    @OnHostStart
    if HostBar = 0
    count = -1
    endif
    @End

    @OnNewBeat
    inc count
    if count = 16
    count = 0
    endif
    ColorPad padrevert, 0
    ColorPad count, 5
    padrevert = count
    @End

    @OnKnobChange
    onoff[LastPad] = (GetKnobValue 0)
    lonoff[LastPad] = Round TranslateScale (onoff[LastPad]), 0, 127, 0, 1
    Call @set
    @End

    @set
    SetKnobValue 0, onoff[LastPad]
    LabelKnob 0, lonoff[LastPad]
    @end

  • edited May 2025

    Inside AUM, I want to use a button on an external controller to cycle through a range of values to control a parameter on an app - the parameter has 6 values. Each time I press the button, the next value in the list would be selected and after the final value is selected, the next press would bring it back to the first value. I don’t think I can do this just using AUM, can I? If it is possible, please let me know how. I was wondering if there is a Moziac script I could use to do this? Thnx

  • wimwim
    edited May 2025

    That would be an easy Mozaic script. There isn’t a premade one though.

  • @wim said:
    That would be an easy Mozaic script. There isn’t a premade one though.

    Mozaic comes with a “CC Sequencer” script that can be found in the sequencer section. Just replace the @OnMetroPulse bit with @OnMidiCC or @OnNoteOn and let it count through how many steps you want instead of using CurrentMetroPulse.

  • @catherder said:

    @wim said:
    That would be an easy Mozaic script. There isn’t a premade one though.

    Mozaic comes with a “CC Sequencer” script that can be found in the sequencer section. Just replace the @OnMetroPulse bit with @OnMidiCC or @OnNoteOn and let it count through how many steps you want instead of using CurrentMetroPulse.

    Sounds like I might actually be capable of editing that myself, I'll try it later, thnx guys 🔥

  • @Gavinski said:

    @catherder said:

    @wim said:
    That would be an easy Mozaic script. There isn’t a premade one though.

    Mozaic comes with a “CC Sequencer” script that can be found in the sequencer section. Just replace the @OnMetroPulse bit with @OnMidiCC or @OnNoteOn and let it count through how many steps you want instead of using CurrentMetroPulse.

    Sounds like I might actually be capable of editing that myself, I'll try it later, thnx guys 🔥

    Actually, no, I am not sure how to get that working

  • @Gavinski said:

    @Gavinski said:

    @catherder said:

    @wim said:
    That would be an easy Mozaic script. There isn’t a premade one though.

    Mozaic comes with a “CC Sequencer” script that can be found in the sequencer section. Just replace the @OnMetroPulse bit with @OnMidiCC or @OnNoteOn and let it count through how many steps you want instead of using CurrentMetroPulse.

    Sounds like I might actually be capable of editing that myself, I'll try it later, thnx guys 🔥

    Actually, no, I am not sure how to get that working

    And neither is Claude nor ChatGPT, the useless bastards, lol

  • edited May 2025

    @Gavinski said:

    @Gavinski said:

    @Gavinski said:

    @catherder said:

    @wim said:
    That would be an easy Mozaic script. There isn’t a premade one though.

    Mozaic comes with a “CC Sequencer” script that can be found in the sequencer section. Just replace the @OnMetroPulse bit with @OnMidiCC or @OnNoteOn and let it count through how many steps you want instead of using CurrentMetroPulse.

    Sounds like I might actually be capable of editing that myself, I'll try it later, thnx guys 🔥

    Actually, no, I am not sure how to get that working

    And neither is Claude nor ChatGPT, the useless bastards, lol

    This is an example of what could be used to step through a sequence of five CC values when a button is pressed (CC11 is greater than 63). Replace the @OnMetroPulse section with this. I have left out any channel filtering to make it easier - and AUM can do this:


    @OnMidiCC if MIDIByte2 = 11 // CC of sending button if MIDIByte3 > 63 // Momentary CC message (button pressed) Call @Step // Read knob and send CC message on CC 13 Inc stepcounter if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4) stepcounter = 0 endif endif endif @End @Step if stepcounter < 8 cc = GetKnobValue stepcounter // knobs 0-7 else cc = GetKnobValue ( stepcounter + 3 ) // knobs 11-18 endif SendMIDICC 0, 13, cc @End
  • @catherder said:

    @Gavinski said:

    @Gavinski said:

    @Gavinski said:

    @catherder said:

    @wim said:
    That would be an easy Mozaic script. There isn’t a premade one though.

    Mozaic comes with a “CC Sequencer” script that can be found in the sequencer section. Just replace the @OnMetroPulse bit with @OnMidiCC or @OnNoteOn and let it count through how many steps you want instead of using CurrentMetroPulse.

    Sounds like I might actually be capable of editing that myself, I'll try it later, thnx guys 🔥

    Actually, no, I am not sure how to get that working

    And neither is Claude nor ChatGPT, the useless bastards, lol

    This is an example of what could be used to step through a sequence of five CC values when a button is pressed (CC11 is greater than 63). Replace the @OnMetroPulse section with this. I have left out any channel filtering to make it easier - and AUM can do this:


    @OnMidiCC if MIDIByte2 = 11 // CC of sending button if MIDIByte3 > 63 // Momentary CC message (button pressed) Call @Step // Read knob and send CC message on CC 13 Inc stepcounter if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4) stepcounter = 0 endif endif endif @End @Step if stepcounter < 8 cc = GetKnobValue stepcounter // knobs 0-7 else cc = GetKnobValue ( stepcounter + 3 ) // knobs 11-18 endif SendMIDICC 0, 13, cc @End

    Thank you very much Catherder—but what do you mean ‘CC11 is greater than 63’? I really don’t have a clue about how to understand a script like this. The CC I want to send is 52 so should I replace 13 in this script with 52? I am lost as to what CC63 and 11 have to do with it tbh

  • This is what I ended up putting in. I replaced all mentions of cc13 with 52. There must be something wrong though as Mozaic is receiving midi but not sending any out:

    @OnMidiCC
    if MIDIByte2 = 11 // CC of sending button
    if MIDIByte3 > 63 // Momentary CC message (button pressed)
    Call @Step // Read knob and send CC message on CC 52
    Inc stepcounter
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    stepcounter = 0
    endif
    endif
    endif
    @End

    @Step
    if stepcounter < 8
    cc = GetKnobValue stepcounter // knobs 0-7
    else
    cc = GetKnobValue ( stepcounter + 3 ) // knobs 11-18
    endif
    SendMIDICC 0, 52, cc
    @End

    @OnLoad
    ShowLayout 1
    SetMetroPPQN 4 // 16th steps
    LabelKnobs {CC#52 Sequencer}
    LabelKnob 0, {1}
    LabelKnob 1, {2}
    LabelKnob 2, {3}
    LabelKnob 3, {4}
    LabelKnob 4, {5}
    LabelKnob 5, {6}
    LabelKnob 6, {7}
    LabelKnob 7, {8}
    LabelKnob 11, {9}
    LabelKnob 12, {10}
    LabelKnob 13, {11}
    LabelKnob 14, {12}
    LabelKnob 15, {13}
    LabelKnob 16, {14}
    LabelKnob 17, {15}
    LabelKnob 18, {16}

    LabelKnob 8, { }
    LabelKnob 9, { }
    LabelKnob 10, { }
    LabelKnob 19, { }
    LabelKnob 20, { }
    LabelKnob 21, { }
    @End

    @Description
    Use the 16 numbered knobs to sequence a MIDI CC pattern of 16th steps. The CC values are sent out to CC#52.
    @End

    @Gavinski said:

    @catherder said:

    @Gavinski said:

    @Gavinski said:

    @Gavinski said:

    @catherder said:

    @wim said:
    That would be an easy Mozaic script. There isn’t a premade one though.

    Mozaic comes with a “CC Sequencer” script that can be found in the sequencer section. Just replace the @OnMetroPulse bit with @OnMidiCC or @OnNoteOn and let it count through how many steps you want instead of using CurrentMetroPulse.

    Sounds like I might actually be capable of editing that myself, I'll try it later, thnx guys 🔥

    Actually, no, I am not sure how to get that working

    And neither is Claude nor ChatGPT, the useless bastards, lol

    This is an example of what could be used to step through a sequence of five CC values when a button is pressed (CC11 is greater than 63). Replace the @OnMetroPulse section with this. I have left out any channel filtering to make it easier - and AUM can do this:


    @OnMidiCC if MIDIByte2 = 11 // CC of sending button if MIDIByte3 > 63 // Momentary CC message (button pressed) Call @Step // Read knob and send CC message on CC 13 Inc stepcounter if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4) stepcounter = 0 endif endif endif @End @Step if stepcounter < 8 cc = GetKnobValue stepcounter // knobs 0-7 else cc = GetKnobValue ( stepcounter + 3 ) // knobs 11-18 endif SendMIDICC 0, 13, cc @End

    Thank you very much Catherder—but what do you mean ‘CC11 is greater than 63’? I really don’t have a clue about how to understand a script like this. The CC I want to send is 52 so should I replace 13 in this script with 52? I am lost as to what CC63 and 11 have to do with it tbh

  • @Gavinski said:
    This is what I ended up putting in. I replaced all mentions of cc13 with 52. There must be something wrong though as Mozaic is receiving midi but not sending any out:

    @OnMidiCC
    if MIDIByte2 = 11 // CC of sending button
    if MIDIByte3 > 63 // Momentary CC message (button pressed)
    Call @Step // Read knob and send CC message on CC 52
    Inc stepcounter
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    stepcounter = 0
    endif
    endif
    endif
    @End

    @Step
    if stepcounter < 8
    cc = GetKnobValue stepcounter // knobs 0-7
    else
    cc = GetKnobValue ( stepcounter + 3 ) // knobs 11-18
    endif
    SendMIDICC 0, 52, cc
    @End

    @OnLoad
    ShowLayout 1
    SetMetroPPQN 4 // 16th steps
    LabelKnobs {CC#52 Sequencer}
    LabelKnob 0, {1}
    LabelKnob 1, {2}
    LabelKnob 2, {3}
    LabelKnob 3, {4}
    LabelKnob 4, {5}
    LabelKnob 5, {6}
    LabelKnob 6, {7}
    LabelKnob 7, {8}
    LabelKnob 11, {9}
    LabelKnob 12, {10}
    LabelKnob 13, {11}
    LabelKnob 14, {12}
    LabelKnob 15, {13}
    LabelKnob 16, {14}
    LabelKnob 17, {15}
    LabelKnob 18, {16}

    LabelKnob 8, { }
    LabelKnob 9, { }
    LabelKnob 10, { }
    LabelKnob 19, { }
    LabelKnob 20, { }
    LabelKnob 21, { }
    @End

    @Description
    Use the 16 numbered knobs to sequence a MIDI CC pattern of 16th steps. The CC values are sent out to CC#52.
    @End

    @Gavinski said:

    @catherder said:

    @Gavinski said:

    @Gavinski said:

    @Gavinski said:

    @catherder said:

    @wim said:
    That would be an easy Mozaic script. There isn’t a premade one though.

    Mozaic comes with a “CC Sequencer” script that can be found in the sequencer section. Just replace the @OnMetroPulse bit with @OnMidiCC or @OnNoteOn and let it count through how many steps you want instead of using CurrentMetroPulse.

    Sounds like I might actually be capable of editing that myself, I'll try it later, thnx guys 🔥

    Actually, no, I am not sure how to get that working

    And neither is Claude nor ChatGPT, the useless bastards, lol

    This is an example of what could be used to step through a sequence of five CC values when a button is pressed (CC11 is greater than 63). Replace the @OnMetroPulse section with this. I have left out any channel filtering to make it easier - and AUM can do this:


    @OnMidiCC if MIDIByte2 = 11 // CC of sending button if MIDIByte3 > 63 // Momentary CC message (button pressed) Call @Step // Read knob and send CC message on CC 13 Inc stepcounter if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4) stepcounter = 0 endif endif endif @End @Step if stepcounter < 8 cc = GetKnobValue stepcounter // knobs 0-7 else cc = GetKnobValue ( stepcounter + 3 ) // knobs 11-18 endif SendMIDICC 0, 13, cc @End

    Thank you very much Catherder—but what do you mean ‘CC11 is greater than 63’? I really don’t have a clue about how to understand a script like this. The CC I want to send is 52 so should I replace 13 in this script with 52? I am lost as to what CC63 and 11 have to do with it tbh

    A CC message has two parameters, the CC number and its value. The number distinguishes the different CCs (11 in this case). The value is the actual data in the range of 0 to 127. This can be the position of a knob on a controller, or indication if a button is pressed or not. In our case we do expect MIDI from a button and the generic convention is that a value of 127 indicates pressed, and 0 released. That 63 is just a means to identify the pressed state (127 is greater than 63).
    So in order for the script to work you must send it CC messages on any channel, but with CC number 11 and a value > 63. If your controller button uses a different CC number, then use that.

  • @catherder said:
    A CC message has two parameters, the CC number and its value. The number distinguishes the different CCs (11 in this case). The value is the actual data in the range of 0 to 127. This can be the position of a knob on a controller, or indication if a button is pressed or not. In our case we do expect MIDI from a button and the generic convention is that a value of 127 indicates pressed, and 0 released. That 63 is just a means to identify the pressed state (127 is greater than 63).
    So in order for the script to work you must send it CC messages on any channel, but with CC number 11 and a value > 63. If your controller button uses a different CC number, then use that.

    Thanks, I understand all those concepts but I didn’t understand stuff like what MidiByte2 and 3 mean so was confused. Please assume total ignorance of Mozaic code from my end. I adjusted your script to change the CC number and added in the rest of the original script. It now looks like below, but it is still not working, Mozaic is still not sending out any midi. I checked that my midi controller button is indeed sending CC 52, it is sending a value of 127 when pressed and 0 when released. Something is not right somewhere. Thnx for your patience and for attempting to help:

    OnMidiCC
    if MIDIByte2 = 52 // CC of sending button
    if MIDIByte3 > 63 // Momentary CC message (button pressed)
    Call @Step // Read knob and send CC message on CC 13
    Inc stepcounter
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    stepcounter = 0
    endif
    endif
    endif
    @End

    @Step
    if stepcounter < 8
    cc = GetKnobValue stepcounter // knobs 0-7
    else
    cc = GetKnobValue ( stepcounter + 3 ) // knobs 11-18
    endif
    SendMIDICC 0, 13, cc
    @End
    @OnLoad
    ShowLayout 1
    SetMetroPPQN 4 // 16th steps
    LabelKnobs {CC#13 Sequencer}
    LabelKnob 0, {1}
    LabelKnob 1, {2}
    LabelKnob 2, {3}
    LabelKnob 3, {4}
    LabelKnob 4, {5}
    LabelKnob 5, {6}
    LabelKnob 6, {7}
    LabelKnob 7, {8}
    LabelKnob 11, {9}
    LabelKnob 12, {10}
    LabelKnob 13, {11}
    LabelKnob 14, {12}
    LabelKnob 15, {13}
    LabelKnob 16, {14}
    LabelKnob 17, {15}
    LabelKnob 18, {16}

    LabelKnob 8, { }
    LabelKnob 9, { }
    LabelKnob 10, { }
    LabelKnob 19, { }
    LabelKnob 20, { }
    LabelKnob 21, { }
    @End

    @Description
    Use the 16 numbered knobs to sequence a MIDI CC pattern of 16th steps. The CC values are sent out to CC#52.
    @End

  • @Gavinski said:

    @catherder said:
    A CC message has two parameters, the CC number and its value. The number distinguishes the different CCs (11 in this case). The value is the actual data in the range of 0 to 127. This can be the position of a knob on a controller, or indication if a button is pressed or not. In our case we do expect MIDI from a button and the generic convention is that a value of 127 indicates pressed, and 0 released. That 63 is just a means to identify the pressed state (127 is greater than 63).
    So in order for the script to work you must send it CC messages on any channel, but with CC number 11 and a value > 63. If your controller button uses a different CC number, then use that.

    Thanks, I understand all those concepts but I didn’t understand stuff like what MidiByte2 and 3 mean so was confused. Please assume total ignorance of Mozaic code from my end. I adjusted your script to change the CC number and added in the rest of the original script. It now looks like below, but it is still not working, Mozaic is still not sending out any midi. I checked that my midi controller button is indeed sending CC 52, it is sending a value of 127 when pressed and 0 when released. Something is not right somewhere. Thnx for your patience and for attempting to help:

    OnMidiCC
    if MIDIByte2 = 52 // CC of sending button
    if MIDIByte3 > 63 // Momentary CC message (button pressed)
    Call @Step // Read knob and send CC message on CC 13
    Inc stepcounter
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    stepcounter = 0
    endif
    endif
    endif
    @End

    @Step
    if stepcounter < 8
    cc = GetKnobValue stepcounter // knobs 0-7
    else
    cc = GetKnobValue ( stepcounter + 3 ) // knobs 11-18
    endif
    SendMIDICC 0, 13, cc
    @End
    @OnLoad
    ShowLayout 1
    SetMetroPPQN 4 // 16th steps
    LabelKnobs {CC#13 Sequencer}
    LabelKnob 0, {1}
    LabelKnob 1, {2}
    LabelKnob 2, {3}
    LabelKnob 3, {4}
    LabelKnob 4, {5}
    LabelKnob 5, {6}
    LabelKnob 6, {7}
    LabelKnob 7, {8}
    LabelKnob 11, {9}
    LabelKnob 12, {10}
    LabelKnob 13, {11}
    LabelKnob 14, {12}
    LabelKnob 15, {13}
    LabelKnob 16, {14}
    LabelKnob 17, {15}
    LabelKnob 18, {16}

    LabelKnob 8, { }
    LabelKnob 9, { }
    LabelKnob 10, { }
    LabelKnob 19, { }
    LabelKnob 20, { }
    LabelKnob 21, { }
    @End

    @Description
    Use the 16 numbered knobs to sequence a MIDI CC pattern of 16th steps. The CC values are sent out to CC#52.
    @End

    Morning (or evening) @Gavinski . Give the attached script a try. It works on my system and is basically your code with an “@“ to complete @OnMidiCC. And I initialised the stepcounter variable in the @OnLoad section.

  • @catherder thanks - I still can’t get it working, despite trying to fiddle around with the values the first 6 Mozaic knobs are sending out, and I think tbh I’m going to give up, as it is eating into my time too much. The parameter I am trying to control btw is the Buffer Size (and also Division) in GRFX. If you are in the mood for solving this and have the app, you might want to see if you can get it working on that, but no pressure. I’ll just go back to controlling it with a knob on my midi controller rather than a button. Not as ideal, but at least it works lol. Thnx for your time anyway

  • @Gavinski said:
    @catherder thanks - I still can’t get it working, despite trying to fiddle around with the values the first 6 Mozaic knobs are sending out, and I think tbh I’m going to give up, as it is eating into my time too much. The parameter I am trying to control btw is the Buffer Size (and also Division) in GRFX. If you are in the mood for solving this and have the app, you might want to see if you can get it working on that, but no pressure. I’ll just go back to controlling it with a knob on my midi controller rather than a button. Not as ideal, but at least it works lol. Thnx for your time anyway

    Ok - I have kind of got it working. Not managing to get all the values but I have most of them. Bit confused on which values I have to send out exactly, I’m nearly there I think

  • edited May 2025

    Ok, I found out more what the problem is. To get this working I need to send out these values: 25, 26, 51, 77, 102, 127
    But the knobs in Mozaic are not reporting their value accurately, jeez. For example, I carefully dial in 25 on a Mozaic knob (this itself i quite a hassle, as the knobs move too quickly—it is impossible to dial things in quickly and accurately, you need to do things very slowly if you want accuracy). Worse yet though, when I set a knob in Mozaic at, say, 25, the knob is not always sending that value! Sometimes it does, but sometimes it is off by 1, so it is sending 24 or 26 instead. Absolute nightmare to work with.

    There must also be a problem with the script too though, because Mozaic is only sending out a cycle of 5 values - the 6th knob in the GUI I have set to 127, but no value is being sent out at all there. The cycle only includes the first 5 values.

  • edited May 2025

    @Gavinski said:
    Ok, I found out more what the problem is. To get this working I need to send out these values: 25, 26, 51, 77, 102, 127
    But the knobs in Mozaic are not reporting their value accurately, jeez. For example, I carefully dial in 25 on a Mozaic knob (this itself i quite a hassle, as the knobs move too quickly—it is impossible to dial things in quickly and accurately, you need to do things very slowly if you want accuracy). Worse yet though, when I set a knob in Mozaic at, say, 25, the knob is not always sending that value! Sometimes it does, but sometimes it is off by 1, so it is sending 24 or 26 instead. Absolute nightmare to work with.

    There must also be a problem with the script too though, because Mozaic is only sending out a cycle of 5 values - the 6th knob in the GUI I have set to 127, but no value is being sent out at all there. The cycle only includes the first 5 values.

    The 5 values cycle was my fault because I somehow was thinking you want just 5 values. It can be changed in this line:
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    The knob value problem is caused because they are actually floats. My suggestion would be to change that section like the following code. It rounds the value coming back from the knob. The @OnKnobChange bit shows you the value on the knob when you turn it.

    @Step
    if stepcounter < 8
      knobnumber = stepcounter // knobs 0-7
    else
      knobnumber = stepcounter + 3  // knobs 11-18
    endif
    cc = Round (GetKnobValue knobnumber) // get the value and round it
    SendMIDICC 0, 13, cc
    @End
    
    @OnKnobChange
      LabelKnob LastKnob, (Round (GetKnobValue LastKnob)) // get the value and show the rounded value
    @End
    
  • @catherder said:

    @Gavinski said:
    Ok, I found out more what the problem is. To get this working I need to send out these values: 25, 26, 51, 77, 102, 127
    But the knobs in Mozaic are not reporting their value accurately, jeez. For example, I carefully dial in 25 on a Mozaic knob (this itself i quite a hassle, as the knobs move too quickly—it is impossible to dial things in quickly and accurately, you need to do things very slowly if you want accuracy). Worse yet though, when I set a knob in Mozaic at, say, 25, the knob is not always sending that value! Sometimes it does, but sometimes it is off by 1, so it is sending 24 or 26 instead. Absolute nightmare to work with.

    There must also be a problem with the script too though, because Mozaic is only sending out a cycle of 5 values - the 6th knob in the GUI I have set to 127, but no value is being sent out at all there. The cycle only includes the first 5 values.

    The 5 values cycle was my fault because I somehow was thinking you want just 5 values. It can be changed in this line:
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    The knob value problem is caused because they are actually floats. My suggestion would be to change that section like the following code. It rounds the value coming back from the knob and put this value into the label to eliminate any possible discrepency:

    @Step
    if stepcounter < 8
      knobnumber = stepcounter // knobs 0-7
    else
      knobnumber = stepcounter + 3  // knobs 11-18
    endif
     cc = Round (GetKnobValue knobnumber) // get the value and round it
    LabelKnob knobnumber, cc
    SendMIDICC 0, 13, cc
    @End
    

    Please don't assume that I would not mess up changing this line myself, haha:

    'if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)'

    Should it be this? :

    if stepcounter > 5 // Maximum number os steps (5 steps = 0 to 5)

    What does 'os steps' mean btw? I wondered if that was a typo

  • @Gavinski said:

    @catherder said:

    @Gavinski said:
    Ok, I found out more what the problem is. To get this working I need to send out these values: 25, 26, 51, 77, 102, 127
    But the knobs in Mozaic are not reporting their value accurately, jeez. For example, I carefully dial in 25 on a Mozaic knob (this itself i quite a hassle, as the knobs move too quickly—it is impossible to dial things in quickly and accurately, you need to do things very slowly if you want accuracy). Worse yet though, when I set a knob in Mozaic at, say, 25, the knob is not always sending that value! Sometimes it does, but sometimes it is off by 1, so it is sending 24 or 26 instead. Absolute nightmare to work with.

    There must also be a problem with the script too though, because Mozaic is only sending out a cycle of 5 values - the 6th knob in the GUI I have set to 127, but no value is being sent out at all there. The cycle only includes the first 5 values.

    The 5 values cycle was my fault because I somehow was thinking you want just 5 values. It can be changed in this line:
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    The knob value problem is caused because they are actually floats. My suggestion would be to change that section like the following code. It rounds the value coming back from the knob and put this value into the label to eliminate any possible discrepency:

    @Step
    if stepcounter < 8
      knobnumber = stepcounter // knobs 0-7
    else
      knobnumber = stepcounter + 3  // knobs 11-18
    endif
     cc = Round (GetKnobValue knobnumber) // get the value and round it
    LabelKnob knobnumber, cc
    SendMIDICC 0, 13, cc
    @End
    

    Please don't assume that I would not mess up changing this line myself, haha:

    'if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)'

    Should it be this? :

    if stepcounter > 5 // Maximum number os steps (5 steps = 0 to 5)

    What does 'os steps' mean btw? I wondered if that was a typo

    it was: if stepcounter > 5 // Maximum number of steps (5 steps = 0 to 5)
    And BTW: I have just updated my last post. There was some crap in the code.

  • edited May 2025

    @catherder said:

    @Gavinski said:

    @catherder said:

    @Gavinski said:
    Ok, I found out more what the problem is. To get this working I need to send out these values: 25, 26, 51, 77, 102, 127
    But the knobs in Mozaic are not reporting their value accurately, jeez. For example, I carefully dial in 25 on a Mozaic knob (this itself i quite a hassle, as the knobs move too quickly—it is impossible to dial things in quickly and accurately, you need to do things very slowly if you want accuracy). Worse yet though, when I set a knob in Mozaic at, say, 25, the knob is not always sending that value! Sometimes it does, but sometimes it is off by 1, so it is sending 24 or 26 instead. Absolute nightmare to work with.

    There must also be a problem with the script too though, because Mozaic is only sending out a cycle of 5 values - the 6th knob in the GUI I have set to 127, but no value is being sent out at all there. The cycle only includes the first 5 values.

    The 5 values cycle was my fault because I somehow was thinking you want just 5 values. It can be changed in this line:
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    The knob value problem is caused because they are actually floats. My suggestion would be to change that section like the following code. It rounds the value coming back from the knob and put this value into the label to eliminate any possible discrepency:

    @Step
    if stepcounter < 8
      knobnumber = stepcounter // knobs 0-7
    else
      knobnumber = stepcounter + 3  // knobs 11-18
    endif
     cc = Round (GetKnobValue knobnumber) // get the value and round it
    LabelKnob knobnumber, cc
    SendMIDICC 0, 13, cc
    @End
    

    Please don't assume that I would not mess up changing this line myself, haha:

    'if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)'

    Should it be this? :

    if stepcounter > 5 // Maximum number os steps (5 steps = 0 to 5)

    What does 'os steps' mean btw? I wondered if that was a typo

    it was: if stepcounter > 5 // Maximum number of steps (5 steps = 0 to 5)
    And BTW: I have just updated my last post. There was some crap in the code.

    Thnx, I already twiddled with the knobs to get them sending out the right values, so I’ll maybe stick with that.
    Thing is, I have 2 buttons to map like this. Each will send out 6 values, cycling through them. But this script will accept any button press from any cc. So what do I need to do to set it up that I have 2 instances of Mozaic running this code, but each sends out a different cc number and—importantly—one only receives cc52, filtering out any other cc number, while another only receives cc53? Edit: for the filtering I can use AUM’s own cc filtering system. Tell u what - I look forward to the day when ai is integrated into hosts and works well enough to do this for me with just a voice prompt!

  • @Gavinski said:

    @catherder said:

    @Gavinski said:

    @catherder said:

    @Gavinski said:
    Ok, I found out more what the problem is. To get this working I need to send out these values: 25, 26, 51, 77, 102, 127
    But the knobs in Mozaic are not reporting their value accurately, jeez. For example, I carefully dial in 25 on a Mozaic knob (this itself i quite a hassle, as the knobs move too quickly—it is impossible to dial things in quickly and accurately, you need to do things very slowly if you want accuracy). Worse yet though, when I set a knob in Mozaic at, say, 25, the knob is not always sending that value! Sometimes it does, but sometimes it is off by 1, so it is sending 24 or 26 instead. Absolute nightmare to work with.

    There must also be a problem with the script too though, because Mozaic is only sending out a cycle of 5 values - the 6th knob in the GUI I have set to 127, but no value is being sent out at all there. The cycle only includes the first 5 values.

    The 5 values cycle was my fault because I somehow was thinking you want just 5 values. It can be changed in this line:
    if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)
    The knob value problem is caused because they are actually floats. My suggestion would be to change that section like the following code. It rounds the value coming back from the knob and put this value into the label to eliminate any possible discrepency:

    @Step
    if stepcounter < 8
      knobnumber = stepcounter // knobs 0-7
    else
      knobnumber = stepcounter + 3  // knobs 11-18
    endif
     cc = Round (GetKnobValue knobnumber) // get the value and round it
    LabelKnob knobnumber, cc
    SendMIDICC 0, 13, cc
    @End
    

    Please don't assume that I would not mess up changing this line myself, haha:

    'if stepcounter > 4 // Maximum number os steps (5 steps = 0 to 4)'

    Should it be this? :

    if stepcounter > 5 // Maximum number os steps (5 steps = 0 to 5)

    What does 'os steps' mean btw? I wondered if that was a typo

    it was: if stepcounter > 5 // Maximum number of steps (5 steps = 0 to 5)
    And BTW: I have just updated my last post. There was some crap in the code.

    Thnx, I already twiddled with the knobs to get them sending out the right values, so I’ll maybe stick with that.
    Thing is, I have 2 buttons to map like this. Each will send out 6 values, cycling through them. But this script will accept any button press from any cc. So what do I need to do to set it up that I have 2 instances of Mozaic running this code, but each sends out a different cc number and—importantly—one only receives cc52, filtering out any other cc number, while another only receives cc53? Edit: for the filtering I can use AUM’s own cc filtering system. Tell u what - I look forward to the day when ai is integrated into hosts and works well enough to do this for me with just a voice prompt!

    The script should only react on cc52 by default. If you wan to change that, you can do this here:
    if MIDIByte2 = 52 // CC of sending button

    And to change the outgoing CC you edit this line in the script:
    SendMIDICC 0, 13, cc // CC to send from script

Sign In or Register to comment.