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

1568101116

Comments

  • @pejman said:

    @espiegel123 said:

    @pejman said:
    If I have a miscellaneous question (outside of the issue we are working on), where should I ask to get an answer?

    You can ask if here.

    @OnMidiNoteOn

    if MIDINote = 127 or MIDINote = 125
    SendMIDICC 1, 2, 3, 300
    endif

    @End

    This is ( or ) and it works properly .

    But with ( and ) it doesn’t work. WHY ???

    @OnMidiNoteOn
    if MIDINote = 127 and MIDINote = 125

    SendMIDICC 1, 2, 3, 300

    endif

    @End

    1, I want to if i press note 125 and 127 together, send midi cc . In this case, it doesn't matter which note is pressed first.

    2, And in another case , I want use subcondition for note 127 with note 125, thats mean , if i press note 125 first and then press note 127 , send midi cc.

    You need to set up variables to track when note 125 is down and note 127 is down. Down meaning a note on has been received but not a note off.

    Pseudo code (which I recommend using before coding):

    Create a notesDown array. Fill the first 128 slots with zero

    When a midi note on comes in, set notesDown[notenumber] to 1

    When a note off comes in set notesDown[notenumber] to 0

    When a midi note on for note 125 or 127 comes in, check to see if both 125 and 127 are currently down. If so, do ….

  • @espiegel123 said:

    @pejman said:

    @espiegel123 said:

    @pejman said:
    If I have a miscellaneous question (outside of the issue we are working on), where should I ask to get an answer?

    You can ask if here.

    @OnMidiNoteOn

    if MIDINote = 127 or MIDINote = 125
    SendMIDICC 1, 2, 3, 300
    endif

    @End

    This is ( or ) and it works properly .

    But with ( and ) it doesn’t work. WHY ???

    @OnMidiNoteOn
    if MIDINote = 127 and MIDINote = 125

    SendMIDICC 1, 2, 3, 300

    endif

    @End

    1, I want to if i press note 125 and 127 together, send midi cc . In this case, it doesn't matter which note is pressed first.

    2, And in another case , I want use subcondition for note 127 with note 125, thats mean , if i press note 125 first and then press note 127 , send midi cc.

    You need to set up variables to track when note 125 is down and note 127 is down. Down meaning a note on has been received but not a note off.

    Pseudo code (which I recommend using before coding):

    Create a notesDown array. Fill the first 128 slots with zero

    When a midi note on comes in, set notesDown[notenumber] to 1

    When a note off comes in set notesDown[notenumber] to 0

    When a midi note on for note 125 or 127 comes in, check to see if both 125 and 127 are currently down. If so, do ….

    Very Thanks spiegel ,

    But why ( and ) in this case doesn’t work , In case, I have used and in many cases and it has worked.

    And were the things you described about case number 1 or 2 ?

  • @pejman: case #2 you can use the same mechanism I described. The difference is just that you check when note 127 come in if notesDown[125] is 1

  • _ki_ki
    edited June 2023

    @pejman

    First of all - Mozaic handles every event sequentially, one by one in the order they arrive. So OnMidiNoteOn will never be called with several notes (chords) at the same time. The notes on events will arrive one note at a time and therefor to manage chords or simultanes note presses, one has to store this informatikn. And also to remove the ‚note is pressed‘ status in the OnMidiNoteOff event function.

    A variable will at any time only contain a single value - the same applies for Mozaics state functions like MIDINote, MIDICommand, LastKnob, LastPad etc.

    Therefor in

    @OnMidiNoteOn
      if MIDINote = 127 and MIDINote = 125
          SendMIDICC 1, 2, 3, 300
      endif
    @End 
    

    the combined if condition can never be true. If „midinote 127 on“ event is processed, the second condition =125 is not tue. And when processing the „midi note 125 on“ event, the first part =127 condition is not met.

    BTW: I suspect that you still don‘t use the correct backticks when posting code snippets. To add a code block, select the paragraph popup above your post and the select ‚codek - do this three times and you‘ll get six of the backticks. Now press enter two times after the third backtick and paste your script code right between the two groups of three backticks. This will also keep the indentation of the code which helps readability

  • @pejman : thanks to ki’s response I see your confusion. MIDI Note is just the most recently received note. You need to use variables to keep track of what notes are down besides the one that just came in.

    The reason I suggested using an array to track notes is so that you can check whether any particular note is down (meaning a note on for that has come in but not a note off). You could just use two variables (let’s say note125state and note127state) but using an array is more easily adaptable and generalizable.

  • edited June 2023

    Thanks @ki and Thanks @espiegel for your valuable advice.

    Based on @ki's tips and @espiegel's answer after that, do I need both @OnmidinoteOn and @OnMidinoteOff events Or not ?

  • @pejman said:
    Thanks @ki and Thanks @espiegel for your valuable advice.

    Based on @ki's tips and @espiegel's answer after that, do I need both @OnmidinoteOn and @OnMidinoteOff events Or not ?

    Yes. You need both.

    As I said earlier you can do something like the following:

    Create a notesDown array. Fill the first 128 slots (0-127) with zero

    When a midi note on comes in, set notesDown[notenumber] to 1

    When a note off comes in set notesDown[notenumber] to 0

    The notesDown array is something you can use to see if any particular note is down at the moment.

    There are other ways of doing it, too.

  • thanks @espiegel for repetition and transparency of cases. 🙏
    And thanks again to @ki for the attention.🙏

  • @espiegel123 said:
    @pejman : without writing code describe what should happen in order with words starting with. This will help you clarify your thinking or may communicate where you are stuck

    “When a new knob value is detected…”

    ———
    Here is an example of a description of what happens when a pad is pressed…

    When a pad is pressed,

    • check if the pad number is 7 or below. If it isn’t don’t do anything.
    • If the pad IS 7 or below , do the following
    • look up the notenumber for it in the notenumber array.
    • Get the velocity of the last pad.
    • Look up the pad’s color in the note color array.
    • Send a note on and off with the pad’s velocity using the note number we looked up.
    • Set knob 0 the note’s number.
    • Set knob 1 to the note’s color.
    • Set tbe padUsedFlag to 1

    @pejman , If you mean something that you yourself have already written, then I tried to write like you and this was my best effort that I could do.

    That's all I get ( narrative/description ) from onknobchange regarding knob 0.

    When knob 0 value is detected

    1, check if the padusedflag is 0 don’t do anything.

    2, If Lastknob = 0
    Noten = ( ROUNDED ) Value knob 0
    Number of note of lastpad = noten

    That is, the ROUNDED values ​​of knob 0 should be put in noten and the same noten should be put in notenum in the last touched pad

    3, If lastknob = 0
    Sendmidinote on and off via ROUNDED value of knob 0.
    Label knob and lastpad show number of note that is playing.

  • Turn noteknob , noteknob round the value.
    The rounded value will be converted to note and play notes .
    with turning knob creat different notes and play them with specific velocity .
    and the last note created ( last the rounded value ) , save to lastpad and label noteknob and label lastpad .

  • @pejman said:
    Turn noteknob , noteknob round the value.
    The rounded value will be converted to note and play notes .
    with turning knob creat different notes and play them with specific velocity .
    and the last note created ( last the rounded value ) , save to lastpad and label noteknob and label lastpad .

    Now, look at your description and recall that we said that when knobchange is called notenum[lastpad] has the value of the last note sent.

    What do we have to do (in words not in Mozaic scripting) once we have the rounded noteknob value to avoid sending a duplicate note? And where would we do it?

  • I could not find the solution based on my knowledge of the subject that I wrote to you above,
    I already knew about the issue and I've been looking for a solution for a few days now and still haven't found a solution.

  • @pejman said:
    I could not find the solution based on my knowledge of the subject that I wrote to you above,
    I already knew about the issue and I've been looking for a solution for a few days now and still haven't found a solution.

    Don’t think in programming terms. Describe to someone who doesn’t know programming what should happen.

    You turn the knob and get the note number.

    You know the last note that was sent.

    What would you do to avoid sending the same note again?

  • I really do not know, while I am very eager to know.
    Perhaps we should prevent the sound of repeated notes from playing.

  • @pejman said:
    I really do not know, while I am very eager to know.
    Perhaps we should prevent the sound of repeated notes from playing.

    Let’s say the new note is called newNote and the last note played is called last note.

    How do you decide whether or not to ignore the new note?

  • When a newnote is played, the lastnote doesn’t play again .

  • @pejman : I am not sure if I am understanding what you mean. Here would be my description of what should happen

    When the note knob is turned:

    • compare the new note number (the knob’s rounded value) to the last note sent ( which is notenumber[lastPad]
    • If the numbers are the same, don’t do anything
    • Otherwise:
    • send the new midi note
    • set notenumber[lastPad] to the new note
    • update the knob label to display the new note number
  • Ok , i have problem with this section :
    compare the new note number (the knob’s rounded value) to the last note sent ( which is notenumber[lastPad].

    If noten = nn or if nn = noten or noten = notenumber[lastPad]

    I have written each of these ifs, but it didn't work.

  • @pejman said:
    Ok , i have problem with this section :
    compare the new note number (the knob’s rounded value) to the last note sent ( which is notenumber[lastPad].

    If noten = nn or if nn = noten or noten = notenumber[lastPad]

    I have written each of these ifs, but it didn't work.

    You probably had things in the wrong place.

    Here is my suggestion. Take the version of your script that we agreed works.

    Put in a comment where you think the test goes.

  • edited June 2023

    This is the patch that works


    @OnLoad ShowLayout 2 // these are the 8 notenumbers for Ruismaker drums if Unassigned init init = 1 notenum = [49, 51, 54, 56, 58, 61, 63, 66] notecolors = [2,1,6,0,5,7,4,3] endif //nn = notenum[LastPad] //noten = Round GetKnobValue 0 padUsedFlag = 0 LabelKnob 0, {note #} LabelKnob 1, {color} for p = 0 to 7 ColorPad p, notecolors[p] LabelPad p, notenum[p] endfor @End @OnPadDown if LastPad > 7 padUsedFlag = 0 LabelKnob 0, {error} LabelKnob 1, {error} elseif LastPad < 8 nn = notenum[LastPad] nc = notecolors[LastPad] vel = LastPadVelocity padUsedFlag = 1 SendMIDINoteOn 0, nn, vel SendMIDINoteOff 0, nn, 0, 100 SetKnobValue 0, nn LabelKnob 0, {note #} , nn col = Round TranslateScale nc, 0, 7, 0, 127 SetKnobValue 1,col LabelKnob 1, {color } ,nc endif @End @OnKnobChange //nn = notenum[LastPad] //noten = Round GetKnobValue 0 if padUsedFlag = 0 LabelKnob 0, {error} LabelKnob 1, {error} elseif LastKnob = 0 noten = Round GetKnobValue 0 notenum[LastPad] = noten SendMIDINoteOn 0, noten, 127 SendMIDINoteOff 0, noten, 0, 100 LabelKnob 0, {note #}, noten LabelPad LastPad, noten elseif LastKnob = 1 colorn = Round GetKnobValue 1 colo = Round TranslateScale colorn , 0, 127, 0, 7 notecolors[LastPad] = colo ColorPad LastPad, colo LabelKnob 1, {color} , colo endif @End

    I am going to put this code line ( if noten = notenum[LastPad] ) in a place where unfortunately I will have problems every time I put it.

    For example :

    elseif LastKnob = 0
    if noten = notenum[LastPad]
    padUsedFlag = 0
    else
    noten = Round GetKnobValue 0
    notenum[LastPad] = noten
    SendMIDINoteOn 0, noten, 127
    SendMIDINoteOff 0, noten, 0, 100
    LabelKnob 0, {note #}, noten
    LabelPad LastPad, noten

    Or

    elseif LastKnob = 0
    noten = Round GetKnobValue 0
    notenum[LastPad] = noten
    if noten <> notenum[LastPad]


    SendMIDINoteOn 0, noten, 127
    SendMIDINoteOff 0, noten, 0, 100
    LabelKnob 0, {note #}, noten
    LabelPad LastPad, noten

  • edited June 2023

    @pejman : I suggested that instead of adding code, you just add a comment where the test should go (without putting in the test). So we could separate where to put the test and how to do it.

    I would like you to go through each of your examples line by line and tell yourself out loud what happens in each line to see if you can spot why they don’t work before reading on.

    version 1 doesn’t work because you do your test before you have actually gotten the new knob value. Version 2 doesn’t work because you change the notenum array without first checking if you should. You always end up changing notenum. So notenum and noten are the same when you test.

    Also, why in version 1 did you add
    padUsedFlag = 0?

  • @espiegel said : Also, why in version 1 did you add
    padUsedFlag = 0?

    Yes i put it now for test .

  • @pejman said:
    @espiegel said : Also, why in version 1 did you add
    padUsedFlag = 0?

    Yes i put it now for test .

    To test what?

  • edited June 2023

    For avoiding play of repeat notes

  • @pejman said:
    For avoiding play of repeat notes

    I am not sure how assigning padUsedFlag would help with that. Can you explain what information you hoped to get by setting it to 0?

    There might be another way to get the information without adding a confusing use of an existing variable. Maybe logging?

  • @espiegel123 said:

    @pejman said:
    For avoiding play of repeat notes

    I am not sure how assigning padUsedFlag would help with that. Can you explain what information you hoped to get by setting it to 0?

    You're right, it's stupid, I remember once I used sendmidinoteoff instead of padusedflag = 0 , maybe it would have been better to send it as an example, anyway, I tried many methods and these two examples were two of them.

    elseif LastKnob = 0
    if noten = notenum[LastPad]

    SendMIDINoteOff 0, noten, 0

    else
    noten = Round GetKnobValue 0
    notenum[LastPad] = noten
    SendMIDINoteOn 0, noten, 127
    SendMIDINoteOff 0, noten, 0, 100
    LabelKnob 0, {note #}, noten
    LabelPad LastPad, noten

    There might be another way to get the information without adding a confusing use of an existing variable. Maybe logging?

    Ok , It is confusing for me where and with what command should I create the log

  • @pejman : there is a log command in Mozaic that sends information to the log area. We have discussed this before.

    Can you explain precisely what information you were hoping to gain?

    I am not judging. I am trying to understand what specific information you were trying to get from your test in order to help you figure out a good method for getting that information.

  • I didn't remember at all, I used log before in this script, but I couldn't get help from it

    The numbers that the log shows me are correct but repeated numbers
    Log noten = 56 56 56 57 57 57 ….

  • @pejman : please go back to the two examples you posted and say out loud to yourself what happens in each line of code.

    And see if you can spot on your own logically why neither one works.

    Then read the explanation I provided about why they don’t work.

    I guess after that we need to discuss how to use logging and how to test productively.

  • edited June 2023

    My question is why when we round knob number 0, even though it is round, it still emits decimal numbers to generate repeated notes through decimal numbers, and then We put it in noten. ?

Sign In or Register to comment.