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 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
@OnKnobChangeyou do successfully set the value to 90 here:But right after that you call
@SetKnobPositionwhich 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
@SetKnobPositionblock in the same way you check it in the@SetKnobLabelblock.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
@SetKnobPositionand@SetKnobLabelblocks.@SetKnobPositionyou're usingsvalue[selection]andsum[selection].@setKnobLabelyou're usingvalueandnumSo, you should be asking yourself the question, "Why do
numandvaluehave 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
@OnLoadsection, 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.
@pejman, I noticed right away that you have a syntax error in
@OnKnobChange.value = GetKnobValuerequires a 2nd argument to tell it which knob to get the value from. So, value isn't getting set properly. You need to change it to either:value = GetKnobValue LastKnoborvalue = GetKnobValue knob(since you already setknob = LastKnobin the previous line)You should have seen a syntax error in the log. Always check the logs, especially when things don't work as you expect. But really, you should check the log even when you don't notice any errors.
Next you have a critical error in the
forloop. p is supposed to be a counter that goes from 0 to 3. But each time the loop executes, you override p withp = LastPad. This throws the loop off. When the loop returns to the top, it's expecting p to have the same value that it started with. It then adds 1 and re-executes the loop.You're messing that up by changing
p. Let's say you last touched pad 14. The loop starts with p = 0. You changepto 14. The next time the loop starts, p was supposed to be 0 and increment to 1. But that won't happen because p is already greater than 3. Your loop won't repeat.Or, let's say you last touched pad 0. I didn't try, but as far as I can tell that should put you in an infinite loop. The loop will start with
p = 0. You set p = 0, so no problem on the first loop. On the second loop, p is incremented to 1. But you set p back to 0. So the next time the loop executes it increments it to 1 - but you set it back to 0. Infinite loop.Try fixing those things first and see how things go.
[edit] you make the same mistake in the
forloop in@SetKnobLabeland@SetKnobPosition. Those need to be fixed too.I was able to find something like this, which still has a problem and p is unknown in the syntax. That is, I had to solve the problem after removing the loop with [p]. But the issue here is that this patch only works for one knob and if I add another knob or knobs it won't work. Because I couldn't link or connect ( p ) to some knobs ones
Unfortunately, no, because I don't know exactly where and for what purpose I should use the log in order to find out the errors in the code. I only use an external CC monitor.
The log command prints information to the log section of Mozaic’s display. See the manual for more information. It is a valuable part of Mozaic debugging.
@pejman - now you're working on a different script rather than debugging the one you have? Honestly, this troubleshooting effort is just too haphazard. You need to find some way to be more methodical.
I described a methodical next step in my previous post, but instead you jumped to a different script and introduced new issues. You should pick one and tackle the problems one at a time, not moving on to anything else until that issue is solved, and not pasting snippets from other scripts until you fully understand what they're doing.