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 StoreLoopy Pro is your all-in-one musical toolkit. Try it for free today.
Comments
You can't do that without a loop. A
whileloop, 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.
here's an example @OscarSouth :
[edit] I get an error in the final
if - elseif 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.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.
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@OnMidiNoteOffcan 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.
@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?
@wim
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.
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
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
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:
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
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
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
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.
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