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 - Create your own AU MIDI plugins - OUT NOW!

18889919394104

Comments

  • Mozaic Standalone is useful for a few things but to do its work there must be a MIDI master providing clock and BPM signals.

    Developing the habit of hitting save in code editors is so important.

    I am curious about warning pop-up… it’s probably some aspect of AUv3 apps communicating with its host that isn’t there. Most AUv3 apps post a help screen and don’t do general preset functions in standalone, do they?

  • @McD said:
    Mozaic Standalone is useful for a few things but to do its work there must be a MIDI master providing clock and BPM signals.

    Developing the habit of hitting save in code editors is so important.

    I am curious about warning pop-up… it’s probably some aspect of AUv3 apps communicating with its host that isn’t there. Most AUv3 apps post a help screen and don’t do general preset functions in standalone, do they?

    My impression is that Mozaic wasn't really intended to be run as a standalone. When you start it up, it tells you to run as an AUv3 if you want to use it with MIDI input or output.

    If I recall correctly, Bram put in the standalone mode to make app store rejection less likely -- since some AUv3 only releases get rejected by the App Store team if the review is done by someone unfamiliar with AUv3

  • edited April 2023

    Very Thank wim , espiegel and McD for replay .

    I want to use layers with pads for pads for specific case . For example : layout = 2 ( all pads ) .
    pad num 0 = preset 1 . and pad num 1 = preset 2 .
    Preset 1 has 13 pads for sending cc #40 but with different values via 13 pads ,and preset 2 has 13 pads for sending cc #41 but with different values via 13 pads . So ( I am only allowed to touch one of 13 pads at a time to send a specific value ).

    Question: how can I create layers pads with pads.
    I can create layers knobs with pads or shift , but pad with pads not.
    Problem is that, I can’t write : if last pad = 0 and last pad = 2 send midi cc x for example . I think we can’t create conditions for pads with pads , At least I can say that I don't know. Of course, I tried a lot to be able to create the layers in some way, for example with latchpad or color pad , but I didn't succeed.

    Problem 2 : how can I create state saving for layers ? I don’t mean AU state saving. I mean state saving for active last pad for each preset .
    For example i am in preset 1 = ( with touch pad 0 ) and touch pad num 6 ( color pad num 6 is blue, for example ) and then i go to the preset 2 = ( touch pad 1 ) ,and touch pad num 8 ( to be blue ) .

    So I expect : pad #6 to be colorless and pad #8 to be blue automatically , when I go back to preset one, pad num 8 to be colorless and pad num 6 to be blue . ( state saving for layers).

  • @pejman said:
    Very Thank wim , espiegel and McD for replay .

    I want to use layers with pads for pads for specific case . For example : layout = 2 ( all pads ) .
    pad num 0 = preset 1 . and pad num 1 = preset 2 .
    Preset 1 has 13 pads for sending cc #40 but with different values via 13 pads ,and preset 2 has 13 pads for sending cc #41 but with different values via 13 pads . So ( I am only allowed to touch one of 13 pads at a time to send a specific value ).

    Question: how can I create layers pads with pads.
    I can create layers knobs with pads or shift , but pad with pads not.
    Problem is that, I can’t write : if last pad = 0 and last pad = 2 send midi cc x for example . I think we can’t create conditions for pads with pads , At least I can say that I don't know. Of course, I tried a lot to be able to create the layers in some way, for example with latchpad or color pad , but I didn't succeed.

    Problem 2 : how can I create state saving for layers ? I don’t mean AU state saving. I mean state saving for active last pad for each preset .
    For example i am in preset 1 = ( with touch pad 0 ) and touch pad num 6 ( color pad num 6 is blue, for example ) and then i go to the preset 2 = ( touch pad 1 ) ,and touch pad num 8 ( to be blue ) .

    So I expect : pad #6 to be colorless and pad #8 to be blue automatically , when I go back to preset one, pad num 8 to be colorless and pad num 6 to be blue . ( state saving for layers).

    Can you explain what you mean. Rather than tell us the problems, it might be easier to say:

    when I press pad 1 i want X to happen. I then want to be able to ...

    etc

    re state-saving. have variables that hold the desired state. update them as needed and then update FROM them when needed. you may want arrays that track the various states and defaults that you want to track.

  • edited April 2023

    Yes, my problems are exactly what you wrote in a very concise way. I gave detailed explanations because I felt that if my explanations were too short and concise, someone would tell me why your explanations are insufficient and incomplete, and what exactly you want, and explain more. .

    Regarding re state saving, I don't know exactly what to write. I have done this for knobs when we change layers with shift or pad, but I don't know about pad with pad.

  • @pejman, you're going to need to learn to get away from thinking of pads as holders of values. They do not. You are going to need to learn to use pad touches to store variables and recall variables.

    You need to step back and learn some more of the basics before you launch into solving difficult problems all at once. Talk of layers and presets is premature until you have the mechanics of using variables.

  • wimwim
    edited April 2023

    @pejman, here's a quick example of using pad touches to first store something in an array when a pad is touched, then recall it to be used for something else.

    @Description
    Example of using an array variable to count how many times a pad has been touched
    @End
    
    @OnLoad
      // start with 0 touches for each pad
      FillArray touches, 0, 16
      
      // Label each pad for the first time.
      for pad = 0 to 15
        Call @SetPadLabel
      endfor
      
      LabelPads {Tap some pads, then press Shift to reset counters.}
      ShowLayout 2
    @End
    
    @OnPadDown
      // it's a good practice to first store LastPad in a variable rather than calling it each time.
      pad = LastPad
      
      // increase the counter for the pad that was touched and keep it in an array
      Inc touches[pad]
      
      Call @SetPadLabel
    @End
    
    @SetPadLabel
      // Note how we re-use the "pad" variable here.
      LabelPad pad, {Touches: }, touches[pad]
    @End
    
    @OnShiftDown
      for pad = 0 to 15
        touches[pad] = 0
        Call @SetPadLabel
      endfor
    @End
    
  • @wim . Yes, I am familiar with the knob, shift, and pad function mechanism, but I have a problem with creating a layer by the pad through the pad itself, and I also wrote in the previous post that I can create layers and make a re state saving for them, but in the case of the pad with pad I have a problem .

    It is interesting to know that I learned layer creation and re state saving through your own patch called Basic Midi Controller. I also know the use of Call@ xxxx from your patch .

  • I suggest taking a dive into the Simple Scaler script to get a feeling for one way to store and recall presets. There may be better examples out there, but that's one I'm familiar with, which might make it easier for me to respond to any questions that come up as you learn more about storing and recalling variables representing pad states.

  • Very thanks wim for Example and suggest into the Simple scaler . 🙏
    I start to research more.

  • wimwim
    edited April 2023

    @pejman said:
    @wim . Yes, I am familiar with the knob, shift, and pad function mechanism, but I have a problem with creating a layer by the pad through the pad itself, and I also wrote in the previous post that I can create layers and make a re state saving for them, but in the case of the pad with pad I have a problem .

    It is interesting to know that I learned layer creation and re state saving through your own patch called Basic Midi Controller. I also know the use of Call@ xxxx from your patch .

    OK, but there's no concept of "Layers" to pads. They don't hold any value at all other than whether they're "Latched" or not. You've got to store any values you need into variables. If you want multiple "layers" then you need multiple variables (or a more complicated single variable - forget that idea for now).

    @OnLoad
      // variables used to store 13 values that could correspond to 13 pads.
      layer01 = [0,1,2,3,4,5,6,7,8,9,10,11,12]
      layer02 = [1,2,3,4,5,6,7,8,9,10,11,12,0]
      layer03 = [2,3,4,5,6,7,8,9,10,11,12,0,1]
      layer03 = [3,4,5,6,7,8,9,10,11,12,0,1,2]
    @end
    
  • wimwim
    edited April 2023

    @pejman said:
    Very thanks wim for Example and suggest into the Simple scaler . 🙏
    I start to research more.

    Once you get the idea, you'll be able to do a lot with pads 👍🏼. The main thing is they aren't like knobs, they don't store values.

  • McDMcD
    edited April 2023

    @pejman said:
    Very Thank wim , espiegel and McD for replay .

    I want to use layers with pads for pads for specific case . For example : layout = 2 ( all pads ) .
    pad num 0 = preset 1 . and pad num 1 = preset 2 .
    Preset 1 has 13 pads for sending cc #40 but with different values via 13 pads ,and preset 2 has 13 pads for sending cc #41 but with different values via 13 pads . So ( I am only allowed to touch one of 13 pads at a time to send a specific value ).

    Question: how can I create layers pads with pads.
    I can create layers knobs with pads or shift , but pad with pads not.
    Problem is that, I can’t write : if last pad = 0 and last pad = 2 send midi cc x for example . I think we can’t create conditions for pads with pads , At least I can say that I don't know. Of course, I tried a lot to be able to create the layers in some way, for example with latchpad or color pad , but I didn't succeed.

    Problem 2 : how can I create state saving for layers ? I don’t mean AU state saving. I mean state saving for active last pad for each preset .
    For example i am in preset 1 = ( with touch pad 0 ) and touch pad num 6 ( color pad num 6 is blue, for example ) and then i go to the preset 2 = ( touch pad 1 ) ,and touch pad num 8 ( to be blue ) .

    So I expect : pad #6 to be colorless and pad #8 to be blue automatically , when I go back to preset one, pad num 8 to be colorless and pad num 6 to be blue . ( state saving for layers).

    You can code for multiple PAD touch events. I just tested what happens with this code running:

    @OnPadDown
    
       log {Down}, LastPad
    
    @End
    
    @OnPadUp
    
      log {Up}, LastPad
    
     @End
    

    I touched all 4 PADs at the same time and then lifted my fingers up one at a time and the script logged these statements. NOTE: The bottom line is the first statement logged and so on up the list. It proves I touched 3 before 2 and 0 and lifted 3 first.

    Up0
    Up2
    Up1
    Up3
    Down0
    Down2
    Down3
    Down1

    You can see that every touch generates a OnPad event for the touch (Down) and release (Up). So, you can test to see if more than one pad is currently “Down” and detect double, triple, etc events and do something with that unique series of events.

    Just save a list of “LastPad” numbers into an array and increment a counter of active PADS. Then scrub the number on the Up event for that LastPad. Using Lastpad as the index makes sense with another variable storing the current number of active PADs.

    “Problem is that, I can’t write : if last pad = 0 and last pad = 2 send midi cc x for example”

    Well, if the ActivePad array shows 0 and 2 are active then send CC x. This will all happen immediately after the second pad is touched if you check for this situation with every OnPadDown event handler.
    Don’t worry about dozens and dozens of status tests… Mozaic can keep up with humans pushing a few PADs even at master drummer speeds.

    Basically, the PAD has no “storage” but as a programmer you can create variables to store events that are like you mention… “states” that the PADS experience as touch sequences that you store into little recordings, lists, arrays, etc.

    Everytime you ask a question there’s an opportunity to change the programming of your brain and teach you how to think about an event driven programming language. Computer Graphics code tends to follow these concepts of responding to events.

  • @McD. Thanks 🙏 for all explanations ,and help . This infos is very useful for me.

  • @wim said:
    @pejman, here's a quick example of using pad touches to first store something in an array when a pad is touched, then recall it to be used for something else.

    ```
    @Description
    Example of using an array variable to count how many times a pad has been touched
    @End …..

    @wim , I can understand the patch you wrote, but I don't understand how it relates to what I want and mentioned.

    And you even sent a code after that, which was related to,, layer01, layer02 and...

    I can request you to explain the question I asked earlier in a simpler and clearer way or write the code

    I can now write code that corresponds to layers related to knobs via shifts or via pads.
    But I really have a problem in this regard, ( layer pads with pads ) no matter how much I study help, I don't get much.

    Even analyzing ( simple scaler patch ) is difficult for me

  • @pejman : I don’t know if others are in the same boat, but I have no idea what you mean by layers in this context. Can you give a step by step explanation of what you want to have happen in that would help someone to understand the functionality you want to implement.

  • @espiegel123 said:
    @pejman : I don’t know if others are in the same boat, but I have no idea what you mean by layers in this context. Can you give a step by step explanation of what you want to have happen in that would help someone to understand the functionality you want to implement.

  • When you touch pads 1-4:

    Reset the colors of all pads to default/white/neutral
    And for that PAD change the colors of any pads that have a “history” being active of colored
    “History” means you made a variable to save the PAD’s state of active PAD’s or CC or whatever.

    Mozaic handles the presentation of a user interface. The Model or Layers as you call it just be coded by you to have a set of “behaviors”. You can do this. As you explain what you want it shows where you want
    This to be presented in the GUI and how behaviors like CC’s output need to change as well. Everything is trigged by the user touching something on the screen and you having code ready to fulfill your wishes.

    You are creating a new approach for Mozaic that only the best programmers can capable of writing but that doesn’t mean you can’t become a better programmer too. It’s just another summit to be targeted and conquered. Good luck.

    Keep asking questions too.

  • edited May 2023

    >

     @OnLoad
    
      ShowLayout 2
    
        for pad = 2 to 15
    
       selection = LastPad
       padrevert = LastPad
       padrev = LastPad
       padr = LastPad 
    
       Call @padstate
      endfor
    
     @End
    
    @OnPadDown
    
        selection = LastPad
    
       for pad = 2 to 15
    
      Call @padstate
    
      endfor
    
      spad[selection] = LastPad 
      scol[selection] = LastPad 
      spadrev[selection] = LastPad 
    
      if LastPad >=0 and LastPad <=1
    
          LatchPad padr, NO
          LatchPad LastPad, YES
          padr = LastPad   
    
    if LastPad = 0 and LastPadVelocity > 20
    ColorPad 0, 5
    LabelPad 0, {1} 
    LabelKnobs {CREAM TRACK 1} 
    SendMIDICC 1, 0, 0
    
    elseif LastPad = 1 and LastPadVelocity > 20
    ColorPad 1, 5
    LabelPad 1, {2} 
    LabelKnobs {CREAM TRACK 2} 
    SendMIDICC 1, 0, 45
    
    else
    ColorPad LastPad , 1
    LabelPad LastPad , {RANDOM} 
    SendMIDICC 1, 50, 127
    
    endif
    
       elseif LastPad >=0 and LastPad <=1
    
          LatchPad padr, NO
          LatchPad LastPad, YES
          padr = LastPad
    
       elseif LastPad >= 2
    
                 ColorPad padrev, 0
                 ColorPad LastPad, 7
                 padrev = LastPad
    
          endif
    
          for pad = 2 to 15
    
          if LastPad = 0
          LabelPad pad, {track 1},{            },pad-1
    
          elseif LastPad = 1 
            LabelPad pad, {track 2},{            },pad-1
    
               endif
    
           endfor
    
           if LastPad >=0 and LastPad <=1
    
          LatchPad padr, NO
          LatchPad LastPad, YES
          padr = LastPad
    
          endif
    
             if LastPad = 2
            SendMIDICC 0, 22, 20
    
             elseif  LastPad = 3
              SendMIDICC 0, 22, 60
    
             if LastPad = 2
            SendMIDICC 0, 23, 20
             elseif LastPad = 3
              SendMIDICC 0, 23, 60
    
            endif
           endif
    
    @End 
    
    @padstate
    
    @End
    
    
  • edited April 2023

    This is a simple exercise just for the graphic UI or changing the colors state in the pads. With 2 series of pads : pad 1 and 2 are blue and other pads are pink. And trying to create layers with only two tracks.

  • wimwim
    edited April 2023

    @pejman said:

    @wim said:
    @pejman, here's a quick example of using pad touches to first store something in an array when a pad is touched, then recall it to be used for something else.

    ```
    @Description
    Example of using an array variable to count how many times a pad has been touched
    @End …..

    @wim , I can understand the patch you wrote, but I don't understand how it relates to what I want and mentioned.

    In order to get to the concept of storing and recalling what you refer to as "layers", you first needed to understand storing the values related to pads in array variables. I didn't want to complicate the example by including more than just that until sure you understood that concept. Now you do. 👍🏼

    And you even sent a code after that, which was related to,, layer01, layer02 and...

    I was hoping that would be enough to get you started understanding the Simple Scaler preset code but was also aware that it can be difficult to understand things when surrounded by a lot of complex code that does other things.

    I can request you to explain the question I asked earlier in a simpler and clearer way or write the code

    Sure. Here's an example intended to explain how to use an "active" set of variables to hold the values you're currently working with and then to copy in other sets of values as you need them.

    I can now write code that corresponds to layers related to knobs via shifts or via pads.
    But I really have a problem in this regard, ( layer pads with pads ) no matter how much I study help, I don't get much.

    Yes, the manual is excellent, but it doesn't go take things at that level. You've also introduced an abstraction, "layers," that makes sense to you but isn't easy to translate into Mozaic compatible terms for others.

    Even analyzing ( simple scaler patch ) is difficult for me

    It'll get easier to understand other people's code over time. You're making steady progress. 👍🏼

    @Description
    Example for @pejman: Recalling sets of pad values (referred to as "layers").
    Basic concept: 
    - Create array variables to hold the actively used values.
    - Create array variables to hold the layer values.
    - Copy layer values to the active values in response to pad touches.
    - Use the active layer values to do something.
    
    Storing pad values (not shown in this example):
    - Make changes to the variables that hold the active values.
    - When ready, copy the active variables to the needed layer variables to store them.
    - Basically just the opposite "CopyArray" action of the @LoadLayer event below.
    - Try making a @SaveLayer event and calling it by doing something like holding shift when tapping a pad.
    @End
    
    @OnLoad
      Call @InitializeLayers
      layer = 1
      Call @LoadLayer
      Call @SetPads
      ShowLayout 2
    @End
    
    @OnPadDown
    // When we tap one of the first four pads, recall the layer associated with it
      pad = LastPad
      if pad < 4
        layer = pad+1
        Call @LoadLayer
        Call @SetPads
      endif
    @End
    
    @InitializeLayers
    // This could be any code you want. We'll just load random values here.
      for idx = 0 to 11
        layer01_value[idx] = Random 1,127
        layer02_value[idx] = Random 1,127
        layer03_value[idx] = Random 1,127
        layer04_value[idx] = Random 1,127
        
        layer01_color[idx] = Random 0,7
        layer02_color[idx] = Random 0,7
        layer03_color[idx] = Random 0,7
        layer04_color[idx] = Random 0,7
      endfor  
    @End
    
    @LoadLayer
    // This is where we copy a selected layer to the active value set
    // The "layer" value must be set before calling this event
    // (There are more elegant ways of doing this, but they require more explanation so
    //  we'll keep it simple here.)
    
      if layer = 1
        CopyArray layer01_value, active_value
        CopyArray layer01_color, active_color
      elseif layer = 2
        CopyArray layer02_value, active_value
        CopyArray layer02_color, active_color
      elseif layer = 3
        CopyArray layer03_value, active_value
        CopyArray layer03_color, active_color
      elseif layer = 4
        CopyArray layer04_value, active_value
        CopyArray layer04_color, active_color
      endif
    @End
    
    @SetPads
      LabelPad 0,{1️⃣}
      LabelPad 1,{2️⃣}
      LabelPad 2,{3️⃣}
      LabelPad 3,{4️⃣}
      
      // use the active_value and active_color arrays to set up the pads
      for pad = 4 to 15
        LabelPad pad, {Value: }, active_value[pad-4]
        ColorPad pad, active_color[pad-4]
      endfor
    @End
    
  • @pejman : there are several ways to do what you want. one way is to build an array for each track. the array slots will represent patterns. Have a 1 in any slot where the pattern is on and a 0 where it is off.

    So, if the current track is track 2 and the user taps a pattern pad, set the pattern slot to 0 or 1 as appropriate.

    Pseudo-code:

    • each track number has an array: track1, track2, track3, track4
    • each array as a slot for each pattern
    • an array slot set to 1 means the pattern is active for that track otherwise it is 0
    • when a pattern pad is tapped, update the associated slot in the proper track array.
    • when a track pad is tapped, set the pattern colors/highlighting using the values in its array.

    Hopefully that made sense

  • edited April 2023

    @wim , and @espiegel, Thank you very much. I will study and research your instructions, I hope I will be able to solve my challenges with them.
    Thank you for taking the time for me. For codes and explanations.

  • I found the code you provided very interesting and informative, and I have some questions about it that I will ask you at the appropriate time.

    Where should I put the SendMidicc command for 12 pads of each track separately ,now?
    I know that this command should be executed under @OnPadDown , But I don't know how to associate SendMidicc under @OnPadDown with other commands or Array.

  • @pejman said:
    I found the code you provided very interesting and informative, and I have some questions about it that I will ask you at the appropriate time.

    Where should I put the SendMidicc command for 12 pads of each track separately ,now?
    I know that this command should be executed under @OnPadDown , But I don't know how to associate SendMidicc under @OnPadDown with other commands or Array.

    Here's the same example but now also sending out CC's in @OnPadDown. I added an array to keep a CC number for each layer just so there would be something available to use, and to demonstrate using two lookups in the same SendMidiCC command. Chew on that one for a bit and let me know if you have specific questions about anything you don't understand. 😉

    @Description
    Example for @pejman: See @OnPadDown for how to use SendMidiCC in response to touching pads.
    @End
    
    @OnLoad
      Call @InitializeLayers
      layer = 1
      Call @LoadLayer
      Call @SetPads
      delay = 2
      ShowLayout 2
    @End
    
    @OnPadDown
    // When we tap one of the first four pads, recall the layer associated with it
      pad = LastPad
      Log cc[pad]
      
      if pad < 4
        layer = pad+1
        Call @LoadLayer
        Call @SetPads
        
        // Now loop through the pads, sending cc # and value combinations stored for the layer
        // We get the CC# from what we set in the cc array. The last touched pad tells
        // us which CC to get. 
      
        for idx = 0 to 11
          SendMIDICC 0, cc[pad], active_value[idx], delay
          // I like to set a small delay between midi messages in case hosts have trouble
          // processing too many messages at once.
        endfor
      endif
      
    @End
    
    @InitializeLayers
    // This could be any code you want. We'll just load random values here.
      for idx = 0 to 11
        layer01_value[idx] = Random 1,127
        layer02_value[idx] = Random 1,127
        layer03_value[idx] = Random 1,127
        layer04_value[idx] = Random 1,127
    
        layer01_color[idx] = Random 0,7
        layer02_color[idx] = Random 0,7
        layer03_color[idx] = Random 0,7
        layer04_color[idx] = Random 0,7
      endfor  
      
    // I added some CC #s to use for this example    
        cc = [20, 20, 21, 21]
    @End
    
    @LoadLayer
    // This is where we copy a selected layer to the active value set
    // The "layer" value must be set before calling this event
    // (There are more elegant ways of doing this, but they require more explanation so
    //  we'll keep it simple here.)
    
      if layer = 1
        CopyArray layer01_value, active_value
        CopyArray layer01_color, active_color
      elseif layer = 2
        CopyArray layer02_value, active_value
        CopyArray layer02_color, active_color
      elseif layer = 3
        CopyArray layer03_value, active_value
        CopyArray layer03_color, active_color
      elseif layer = 4
        CopyArray layer04_value, active_value
        CopyArray layer04_color, active_color
      endif
    @End
    
    @SetPads
      LabelPad 0,{1️⃣}
      LabelPad 1,{2️⃣}
      LabelPad 2,{3️⃣}
      LabelPad 3,{4️⃣}
      
      // use the active_value and active_color arrays to set up the pads
      for p = 4 to 15
        LabelPad p, {Value: }, active_value[p-4]
        ColorPad p, active_color[p-4]
      endfor
      @End
    
  • @pejman - Once you've understood the example above, take a look at this one. It's the same thing, but with the code that does the midi sending moved out into its own event. This helps keep the code easier to follow.

    @Description
    Example for @pejman: See @OnPadDown for how to use SendMidiCC in response to touching pads.
    This example demonstrates how to clean up the code a little by moving the CC sending out
    to a separate event.
    @End
    
    @OnLoad
      Call @InitializeLayers
      layer = 1
      Call @LoadLayer
      Call @SetPads
      delay = 2
      ShowLayout 2
    @End
    
    @OnPadDown
    // When we tap one of the first four pads, recall the layer associated with it
      pad = LastPad
      Log cc[pad]
      
      if pad < 4
        layer = pad+1
        Call @LoadLayer
        Call @SetPads
        Call @SendLayer
      endif
    @End
    
    @SendLayer
    // Loop through the pads, sending cc # and value combinations stored for the layer.
    // We get the CC# from what we set in the cc array. The last touched pad, stored in "pad"
    // in @OnPadDown event, tells which CC to use. 
    
      for idx = 0 to 11
        SendMIDICC 0, cc[pad], active_value[idx], delay
        // I like to set a small delay between midi messages in case hosts have trouble
        // processing too many messages at once.
      endfor
    @End
    
    @InitializeLayers
    // This could be any code you want. We'll just load random values here.
      for idx = 0 to 11
        layer01_value[idx] = Random 1,127
        layer02_value[idx] = Random 1,127
        layer03_value[idx] = Random 1,127
        layer04_value[idx] = Random 1,127
    
        layer01_color[idx] = Random 0,7
        layer02_color[idx] = Random 0,7
        layer03_color[idx] = Random 0,7
        layer04_color[idx] = Random 0,7
      endfor  
      
    // I added some CC #s to use for this example    
        cc = [20, 20, 21, 21]
    @End
    
    @LoadLayer
    // This is where we copy a selected layer to the active value set
    // The "layer" value must be set before calling this event
    // (There are more elegant ways of doing this, but they require more explanation so
    //  we'll keep it simple here.)
    
      if layer = 1
        CopyArray layer01_value, active_value
        CopyArray layer01_color, active_color
      elseif layer = 2
        CopyArray layer02_value, active_value
        CopyArray layer02_color, active_color
      elseif layer = 3
        CopyArray layer03_value, active_value
        CopyArray layer03_color, active_color
      elseif layer = 4
        CopyArray layer04_value, active_value
        CopyArray layer04_color, active_color
      endif
    @End
    
    @SetPads
      LabelPad 0,{1️⃣}
      LabelPad 1,{2️⃣}
      LabelPad 2,{3️⃣}
      LabelPad 3,{4️⃣}
      
      // use the active_value and active_color arrays to set up the pads
      for p = 4 to 15
        LabelPad p, {Value: }, active_value[p-4]
        ColorPad p, active_color[p-4]
      endfor
    @End
    
  • Thanks wim again. But none of the 12 pads send cc values. Only trackpads ( The first four pads ) send CC values instead

  • Of course, I mean by touching each of those 12 pads.

  • wimwim
    edited May 2023

    @pejman said:
    Thanks wim again. But none of the 12 pads send cc values. Only trackpads ( The first four pads ) send CC values instead

    Yes. That's the way I made the example. It's not to implement whatever your idea is, it's to give you an example of how to send Midi from the OnPadDown event, building on the previous example. Its to help you to develop the knowledge to apply to your own scripting efforts.

    If you are developing a script and need help with specific pieces of code that aren't working then show what you've done and describe in detail what isn't working or what you don't understand. 👍🏼

  • @wim said:

    If you are developing a script and need help with specific pieces of code that aren't working then show what you've done and describe in detail what isn't working or what you don't understand. 👍🏼

    Yes, I will try my best and if I encounter a problem again, I will ask for your help. Very thanks.

Sign In or Register to comment.