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
I managed to solve the Send Midi cc issue last night, But until now, I am solving the problem of saving highlight and un-highlight pads in layers, which unfortunately I did not succeed,.
But before I try to solve this problem, I want to ask you a small bug about the highlight and un-highlight pads.
This patch is related to highlighting and un-highlighting pads in two series :for pads 0 to 3 and for pads 4 to 15.
1, upload the codes via green color upload button of mozaic.
2, touch pad num 0 : result Highlighting or turning the pad red.
3, touch one of 12 pads of second series ,from pad num 4 to num 15 . Result: The blue color of that pad AND ,
4, result bug : Pad number 0 will be un-highlighted unwanted. While it should not be discolored at all.
5, again touch the pad num 0 and then touch the one of 12 pads of second series.
6, result: The problem of pad No. 0 becoming discolored will no longer be repeated. And along the way, the bug is completely fixed.
1: The interesting thing is that if we repeat the same steps from the beginning, but instead of step 2, we touch pad num 1 or 2 or 3, this problem does not exist at all.
2: if i replace num 0 with num 1, in this code : if LastPad >= 0 and LastPad <= 3 , This bug does not occur for pad number one.
Is the problem with the number 0 or is the problem from somewhere else?
Because this patch has no problem with any number other than 0.
@pejman - I only looked at it briefly, but I think I see what the problem may be.
You're setting padrevert and padrev to
LastPad
in the@OnLoad
section.@OnLoad
fires when the script first loads, but at that time no pads have been touched soLastPad
is invalid. Try setting them directly to whatever number they should be when the script first loads.Before you make that change, it might be a good idea to check the Log screen to see if any informative errors show there when you load the previous script. That's always a good idea when things don't work the way you expect.
Ok i will try,
Yes i always check the log. No error is presented in this patch.
The problem was solved with your suggestion, thank you very much.🙏
But my question is why this problem does not exist in relation to pad number 1, 2 and 3 ?
Probably because when you tried to assign padrevert and padrev to LastPad in
@OnLoad
, they were both set to zero. I'm not sure though since I haven't taken the time to look closely at your code. Normally the first thing I do when troubleshooting is to fix anything that's obviously wrong and see what happens. After that I try to understand why.I would be asking the question, "How would my code work if I assign 0 to those two variables?" If that doesn't shake loose some answers for you, and you still need to understand why, I'll take a closer look.
I assigned 0 and 4 to solve my problem, but when i assigned 0 and 0 , The same problem occurs again. Of course, I tried these numbers myself to understand the issue, but unfortunately it is still not understandable for me clearly.
Grab a pencil and paper and simulate what is happening by going through the code line by line (in the order executed by the program) and writing down what the values of your variables after each line
Do that for the various actions you might take.
Then add log statements that print out the variable values and compare to your paper simulation.
It is a valuable exercise for checking your understanding of your code. I find and fix a lot of errors this way as it makes you very aware of how each step contributes.
@espiegel123 , your right. I always do the same thing, which is to analyze the events.
But sometimes the topic becomes very confusing for me for certain reasons, maybe because I expect something else from it.
Regarding the previous issue, I have come to the conclusion that the number that I determine for each series of pads should not exceed their limits, that is, it should not exceed the limits of others.🙂
Post your current code. Explain what you expect to happen and what does happen.
If the results are surprising you, use the log to print out variables at the beginning of onPadDown and at the end, to see if they were what you expect.
@spiegel , thanks for attention.
this is my patch about send cc value with selectable cc# num
Via same knob in second layer through shift button.
In which I have put the code related to setknobvalue the knob to value 90 , only for layer 1 ( send cc value ) , not cc # num .
I want to with double tap on knob 0 in first layer ( send cc value ) knob set to 90 , even After every time I change the knob.
But this patch has bug .
1, load patch .
2, change knob to value 40 for example.
3, double tap on knob.
4, bug issues: knob sets to 40 instead of 90.
5 , with double tap again, knob sets to 90 this time.
Hi @pejman
First, to make things easier for everyone going forward let's clear up how to post code blocks correctly so that the formatting doesn't go so badly.
To make a code block, place three back-tick marks together on a line by themselves before and after the code. The lines should look like this:
```
Your code goes here
Note: don't simply copy the ``` above because it may not work that way. Find the
"back-tick" character on your keyboard and type it in three times.
```
And it should appear formatted as a code block like this:
You don't need to bother trying to nest that in a "spoiler" block as it will only complicate things. If you're interested in knowing how to do that then ask once you're comfortable with posting code blocks cleanly.
I'll tell you what went wrong with your code in the next post.
@pejman - there are some other problems with your code, which I'll explain in a bit. But first:
In your
@OnKnobChange
you do successfully set the value to 90 here:But right after that you call
@SetKnobPosition
which sets the knob tosvalue[selection]
.@SetKnobPosition
, which sets the knob using svalue[selection] which is still at 40.I've embedded some comments about other issues with your code. Some are actual syntax errors, others are just suggestions for improvement.
I hope it helps.
Are any of the AI code tools of any use with Mozaic? (ChatGPT et al)
I keep wanting to complete the Dixie sequencer I made yonks ago but don’t have the chops to get the more complicated bits done, so I’ve been wondering if even some generic blocks could be done by one of those things…
I asked chatGPT if it could code in Mozaic or Streambyter a few months ago. At that time it could not - though it thought it could until I pointed out it was giving me code in C++, JavaScript, or Python.
I just asked again and it told me that it can't right programs in any language, that it's just a text AI model. To which I replied:
I’ll give it a whirl and see 🙏
Hi @wim , thank a lot.🙏🙏🙏
I did what you suggested for the correct way to post the codes and I'm interested in learning the spoiler too if you have time to explain as I don't want it to take up too much space in the posts.
But if this issue is not very important and there is no problem (in terms of occupying space in the post), then we will ignore it
I did what you said and I remove by my own ( call @ setknobposition ) of @onknobchange , and my problem is fixed. But again a new problem arose.
1, load patch
2, move knob to value 40
3, double tap on knob
4, this time knob skip to value 90 properly.
5, press shift button: go to next layer and press shift again return back to previous layer ( sending cc ) .
6, the knob is on value 40 instead 90, but label knob shows value 90.
Should I create a new( call @ xxx ) for this double tap on knob for set specific value and save in layer ?
Hi @pejman
If you want to enclose a code block in a "Spoiler", then after you have added the three back-ticks at the beginning and the end, highlight all the lines from the first line with the back-ticks all the way down to the last line with the back-ticks. Then click the paragraph formatter at the top of the editor and select Spoiler. That will put the characters ">! " at the beginning of every line, which is what hides those lines in a spoiler block.
Adding a new event to call for a specific sequence of events like you described isn't a good idea. You want the knobs to be positioned differently when shift is 0 or shift is 1. So, check that in the
@SetKnobPosition
block in the same way you check it in the@SetKnobLabel
block.I think this is may be because virtually nobody uses Github for Mozaic (probably because Mozaic makes that cumbersome to do).
There are quite obscure languages that ChatGPT is trained on and provides good code for. E.g., I think there are a decent number of people using it with Reaper, for programming with Reaper's proprietary "ReaperScript" language. It's pretty cool, can see examples of its use on youtube.
Then by all means post Mozaic code on this forum. More code and these AI tools will have text to study and integrate into its data sets. I think a couple million examples should work wonders. Maybe a site called NakedMozaic would be better.
On 60 Minutes they said that DeepMind’s AI learned Bangladesh (or the language spoken there) just by scanning the web.
Unfortunately, I do not succeed in every change and every move i make.
Hi @pejman
See if this helps. Rather than keep iterating back and forth trying to understand what might be going wrong, I wrote something similar but in the ways that I would do it. Note that this is based on my understanding of what you're trying to do. I could have it wrong since it's a little hard to sort out at times. There could be bugs too, if so I apologize. I only tested very lightly. I'll post the example with and without comments below.
I almost didn't want to do this because in order to move forward you really need to learn to do as @espiegel123 suggests and follow your code step by step, writing down what variables are equal to each step of the way. But, that's a skill that can be hard to develop if you're really lost in the weeds with a particular piece of code. You'll get better at it with practice.
With comments:
Comments removed:
@wim .
There are no bugs or problems in the code you sent. All the codes were written very well and are very informative for me. I learn much better and easier this way. Thank you very much for the detailed explanation you gave me in the codes. But I don't know why the end of some lines related to the description are hidden.
Unfortunately, I still have problems in writing the codes in terms of where exactly to write them and, for example, where ( endif ) should be placed.😅. It means that I have understood many concepts, but I have a problem with how to write them and where exactly I should put them. That's why I can't apply your tips exactly.
I adapted this patch for layering from patch ( luanch key mk3 ). So you see signs of the words used in that patch. Like svalue[selection] , …
Just because I wanted to learn through this patch how I can save the position of the knobs through different pads . Or, for example, I use your patch ( Basic midi controller ) so that I can create new layers through shift.
Maybe that's why some of the examples or tips you give I can't create them in my own patch.
For example, I asked you a question about pad layers through pads, but I still couldn't save their color in pads. I will explain more about it.
Therefore, if possible, please show me the exact error in my patch that causes the bug I described to you.
@pejman : I hope you won't mind some advice. For beginners (and this is also true for advanced coders -- doing anything non-trivial), it is very beneficial before you write your actual script/code that you write out a fairly detailed pseudo-code description of what you are doing as a sort of specification of what you are doing -- without worrying about the actual code that implements it.
This will force you to clarify your thinking AND if you do it, translating the pseudo-code into the actual script is usually faster and easier than if you start without doing that.
Then implement one chunk of pseudocode at a time.
A pseudocode example:
Implement just one bullet point at a time. And test it before moving on to the next bullet point. You may find that you don't need to implement in the order you wrote it down. For example, the 'at startup' pseudocode might be the first thing that I implement
You asked about where the ENDIFs go. The IF/ENDIF block contains instructions that you only want to happen when the IF statement is true. Sometimes, it will be obvious -- sometimes you will realize after you started writing that you need to move things into or out of the block.
The important thing, is you should be able to walk through your code line by line and predict what can happen when a line is executed.
I can't emphasize enough that if this doesn't come naturally (and it doesn't to most people), print out or write out the code and use a pencil and go through line by line predicting what will happen and how variable values will change.
Sorry, I'm not going to let you off that easily. 😉
Look at your
@SetKnobPosition
and@SetKnobLabel
blocks.@SetKnobPosition
you're usingsvalue[selection]
andsum[selection]
.@setKnobLabel
you're usingvalue
andnum
So, you should be asking yourself the question, "Why do
num
andvalue
have the right value when I hit shift to return to the previous layer butsvalue[selection]
andsnum[selection]
do not?"Or, more importantly, "Why am I using different variables to label the knob than I am to position it?" (Hint: you shouldn't be.)
Hopefully that hint will help you narrow the problem down.
[edit] my answer in the Spoiler block above is based on the last code you posted. However, I'm no longer sure that is the code you're now referring to.
I was going to point out that there are still some syntax errors in the
@OnLoad
section, which makes me wonder if I'm answering off of the same version of code that you're referring to.@spiegel thanks for clear explanation. This info are very useful for me . Thank you for your time. I would like to talk more about your post.
Thank you again for your kind guides.@espiegel, @wim
Dear Espiegel, I'm not at all upset with your advice. I totally understand what your purpose is.
@wim said;
Sorry, I'm not going to let you off that easily. 😉
It makes me happy and encouraging that you won't leave me🙏😍.
I have to say about the mistake in my code in @setknobposision, I did not think svalue[selection] would cause this bug because I was content with the luanch key mk3 patch. ( An uninformed imitation ).
And I thought this was the only way to code when we wanted to save the position of Knobs ( knob layers ) via Shift or Pad.
But if you want, I will send you the patch I wrote this way to see that they have no problem saving Knobs position via shift or pad. The only thing is that when an option like Double Tap Knob for reset, or maybe any other option I want to add to the patch, it gets bugged. I'm so glad to understand this.
So I started deleting X[Selection] in my main patch, which I am evolving with your help.
And again, I came across a problem similar to the previous one, which is related to the SetKnobposition being saved through the pads.
Label knobs and send ccs works properly with [p] , means lastPad, I used it in front of cc and for labe knobs. But when I put [p] in front of the gate for setknobvalue kgate, in @Setknobpositsion , Knobs get in trouble.
I checked everything line by line and word by word, as @spiegel suggests, but unfortunately I could not discover the problem.
I even tried [p] in different places.
The point is that [p] can be identified in setknoblable and send cc but not in setknobposition
@pejman : have you added log lines liberally to your code to watch the variable values to see if they match your expectations?
Look at your for loops. Do a written simulation of what happens to p in each iteration of the loop when they are triggered.