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!

19394969899106

Comments

  • edited August 2023

    Does mozaic have a limit on the number of variables in @OnTimer ? Because I sometimes encounter the message ontimer limit 250 variable’s .

  • @pejman All Mozaic variables are defined globally and there is a limit of around 250 possible variable names.

    A simple trick to overcome the limitation is to change the code to use different array indices of a single variable instead of independant variable names. So instead of

    a = 20
    b = 30
    c = a+b
    SetKnobValue 0,c
    

    Usage a single variable and different indices for all three of them:

    single_var[0] = 20
    single_var[1]  = 30
    single_var[2]  = single_var[0] + single_var[0]
    SetKnobValue 0, single_var[2]
    

    One probabbly needs to add comemnts describing what each of the indices is supposed to contain/do. And i also would add a debug function printing out the current values, like

    @DebugSingleVar
      Log {single_var  [0]:A =}, single_var[0], {   [1]:B = }, single_var[1],{   [2]:C=}, single_var[2]
    @End
    

    that will aid in debugging and can be called whenever needed . In that way, one can use up to 250*1024 variables (states) but the code is unreadable and kind of obfusicated.

    .

    Another thing i often do is re-use of variable names. My local variables names usually start with an underscore. I don‘t assume hat these persist between functions. So if i used a _tmp variable in one of the functions, i can re-use that name for function local computations in another function. _i, _pad, _knob, _val are common names that for re-usage.

    Applying naming conventions is kind of a helpfull mind-set used while programming - one can assign different naming schems for different intended use-cases of variables even though Mozaic treats all of them the same.

    My Mozaic language highlighter for Textastic shows different text styles for different groups of variable names. Conforming to this naming schemes this is quite helpfull for readability and debugging as it visually expresses the intended use-case (_local, CONSTANT, gGobal, pParamter for sub functions):

  • @pejman said:
    Does mozaic have a limit on the number of variables in @OnTimer ? Because I sometimes encounter the message ontimer limit 250 variable’s .

    I recommend taking a careful look to see if all those variables are necessary in your @onTimer routine. People often use intermediate variables to hold the results of calculations and those can often be eliminated.

  • @Birdpie said:
    hi guys,
    iam looking for a simple midi transpose plugin for cubasis 3.
    can i do this with mozaic? or is there a simpler solution?

    Rozeta Suite’s “Scalar” has 3 stages:

    transpose input transpose parameter
    force to scale (either up to next note or down)
    transpose output

    It comes with 9 other totally valuable apps for bass lines, x/y control, etc.

    it’s a @Brambos product as is Mozaic. The Mozaic script to transpose is simple. Just catch Note events and add or subtract
    a step value to MidiByte2 before passing the event through. This will give you a nice start. Add a knob:

    @OnLoad
    
    @End
    
    @OnMidiNote
    
      Transpose = 7
      Note = MIDIByte2 + Transpose
      SendMIDIOut MIDIByte1, Note, MIDIByte3
    
    @End 
    
  • @McD said:

    @Birdpie said:
    hi guys,
    iam looking for a simple midi transpose plugin for cubasis 3.
    can i do this with mozaic? or is there a simpler solution?

    Rozeta Suite’s “Scalar” has 3 stages:

    transpose input transpose parameter
    force to scale (either up to next note or down)
    transpose output

    It comes with 9 other totally valuable apps for bass lines, x/y control, etc.

    it’s a @Brambos product as is Mozaic. The Mozaic script to transpose is simple. Just catch Note events and add or subtract
    a step value to MidiByte2 before passing the event through. This will give you a nice start. Add a knob:

    @OnLoad
      
    @End
    
    @OnMidiNote
    
      Transpose = 7
      Note = MIDIByte2 + Transpose
      SendMIDIOut MIDIByte1, Note, MIDIByte3
    
    @End
    

    For what its worth, there are a number of Mozaic transposition and scaler patches on patchstorage:

    https://patchstorage.com/platform/mozaic/?search_query=transpose&tax_platform=mozaic&tax_post_tag=&orderby=modified&wpas_id=search_form&wpas_submit=1

  • wimwim
    edited August 2023

    @Birdpie said:
    hi guys,
    iam looking for a simple midi transpose plugin for cubasis 3.
    can i do this with mozaic? or is there a simpler solution?

    I recommend Rozeta Scaler from the excellent Rozeta Suite. It can also do scale quantization but has straight transpose by semitones as well.

    For Mozaic scripts there's this. I haven't tried it, but anything by @_ki is always solid. https://patchstorage.com/midi-cc-automatable-transposer-scaler-v1-0/

    For scale quantization rather than transpose, there's this: https://patchstorage.com/simple-scaler/

  • @_ki

    GREAT 👍 very thanks for useful informations.

    1, I used your first trick , And it works very well.

    1/1, i have for example 4 variables num, numa , numb , numc . If i convert to :
    num
    num[1]
    num[2]
    num[3]

    For the first num i did not put [0] , In this case, does mozaic count the variables as two or does it count them as one variable?

    Is “num” without the number 0 inside the bracket considered as [0] ?

    1/2, and if I have 4 variables for example “gate” “gateb” “gatec” “gated” with x and y variables together:

    gate[x[y]]
    gateb[x[y]]
    gatec[x[y]]
    gated[x[y]]

    How can they be numbered in brackets?
    gate[0][x[y]] ???

    2, you wrote: “Another thing i often do is re-use of variable names. My local variables names usually start with an underscore. I don‘t assume hat these persist between functions. So if i used a _tmp variable in one of the functions, i can re-use that name for function local computations in another function. _i, _pad, _knob, _val are common names that for re-usage.”

    2/1, What do you mean by local variables names ?

    2/2, What do you mean by “I don‘t assume hat these persist between functions” ?

    2/3, Can I ask you to give me an example about these last two lines you wrote ? : So if i used a _tmp variable in one of the functions, i can re-use that name for function local computations in another function. _i, _pad, _knob, _val are common names that for re-usage.

    3, The content you wrote in the spoiler that they want to show us in Mozaic language highlighter for Textastic, unfortunately, I did not understand what you meant by “different text styles for different groups of variable names”.

    Where exactly can they be used?

  • @espiegel123

    @espiegel123 said:

    @pejman said:
    Does mozaic have a limit on the number of variables in @OnTimer ? Because I sometimes encounter the message ontimer limit 250 variable’s .

    I recommend taking a careful look to see if all those variables are necessary in your @onTimer routine. People often use intermediate variables to hold the results of calculations and those can often be eliminated.

    Very thanks for recommending.

    Chances are I'm making the mistake of using variables @OnTimer that don't need to be there.

    But by moving some of them, I got the error of unknown variables , Of course, I need to experiment and research more.

    But What do you mean by ,” People often use intermediate variables to hold the results of calculations and those can often be eliminated.” ???

    intermediate variables ???

    to hold the results of calculations ???

  • can i make a negative midi delay with mozaic? must change the overall latency somehow.

  • @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

  • edited August 2023

    @pejman said:
    @espiegel123

    @espiegel123 said:

    @pejman said:
    Does mozaic have a limit on the number of variables in @OnTimer ? Because I sometimes encounter the message ontimer limit 250 variable’s .

    I recommend taking a careful look to see if all those variables are necessary in your @onTimer routine. People often use intermediate variables to hold the results of calculations and those can often be eliminated.

    Very thanks for recommending.

    Chances are I'm making the mistake of using variables @OnTimer that don't need to be there.

    But by moving some of them, I got the error of unknown variables , Of course, I need to experiment and research more.

    But What do you mean by ,” People often use intermediate variables to hold the results of calculations and those can often be eliminated.” ???

    intermediate variables ???

    to hold the results of calculations ???

    For instance ina case like this:

    knoba = round GetKnobValue 0 
    knobb = round GetKnobValue 1
    knobc = round GetKnobValue 2
    knobd = round GetKnobValue 3
    
    allPadknobs[p]  = knoba
    allPadknobs[q]  = knobb
    allPadknobs[r]  = knobc
    allPadknobs[s]  = knobd
    

    knoba ,knobb,knobc ,knobd aren’t really needed. They make the code a little easier to read but they can be eliminated by doing:

    allPadknobs[p] = round GetKnobValue 0

    You should also look at whether there are strategies for storing data in large arrays rather than a lot of smaller arrays to avoid having a lot of if/else cascades that determine where data gets stored . We’ve talked about those in DMs.

  • @espiegel123 said:

    @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

    nudge midi tracks in ticks or ms. either to whole track or just a choose trackfile.
    in cubasis 3

  • in other words, playing a midi file lets say 6ms earlier is it is. one could choose all notes and do it trail and error, but its more convenient went all tracks stay in their quanisation und i just do it for the whole channel. i logic you can do +\~ midi delay in the channelview.

  • edited August 2023

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

    nudge midi tracks in ticks or ms. either to whole track or just a choose trackfile.
    in cubasis 3

    You can delay anything that passes through Mozaic by whatever amount you want. I am not sure if delays can be fractions of a millisecond.

    So you could delay some notes more than others to do some sort of latency compensation [which shifts things later when necessary to make all notes subject to the same latency]

  • @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

    nudge midi tracks in ticks or ms. either to whole track or just a choose trackfile.
    in cubasis 3

    You I can delay anything that passes through Mozaic by whatever amount you want. I am not sure if delays can be fractions of a millisecond.

    So you could delay some notes more than others to do some sort of latency compensation [which shifts things later when necessary to make all notes subject to the same latency]

    problem is maybe the negative delay<
    playing something early than is ist writen must someone communicate with the delay compensation.

  • @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

    nudge midi tracks in ticks or ms. either to whole track or just a choose trackfile.
    in cubasis 3

    You I can delay anything that passes through Mozaic by whatever amount you want. I am not sure if delays can be fractions of a millisecond.

    So you could delay some notes more than others to do some sort of latency compensation [which shifts things later when necessary to make all notes subject to the same latency]

    problem is maybe the negative delay<
    playing something early than is ist writen must someone communicate with the delay compensation.

    I am not understanding what you mean by negative delay. You can delay some notes less than others (that is how latency compensation works) but you can’t send a note out before it has been received or cause a destination to receive it before it was sent.

  • @pejman

    2/1, What do you mean by local variables names ?

    Procedural programming languages (C, C++, Pascal, Java, Modula, Python, Javascript …) feature a concept called variable scope (with local scope, global scope) and function parameters and constants while Mozaic only offers globally scoped variables.

    But one still can programm in Mozaic with the mindset of these more advanced languages - and then thereby name the variables accordy to their intended scope or use-case. So it‘s all in your head - and helps experienced programmers a lot in understanding what the code does.

    2/2, What do you mean by “I don‘t assume hat these persist between functions” ?

    See scope definition above - when programming in Mozaic it‘s just a mindset.

    .

    2/3, Can I ask you to give me an example about these last two lines you wrote ? : So if i used a _tmp variable in one of the functions, i can re-use that name for function local computations in another function. _i, _pad, _knob, _val are common names that for re-usage.

    Here one programmed in the mindset of more advanced languages and used the concept of local variables.

    @OnLoad
      Call @ResetKnobValues
      Call @DrawKnobs
      
      calc_result = 0
      something = 0
      Call @CalcSomething
      Call @CalcOtherStuff
    @End 
    
    @ResetKnobValues
      for _knob = 0 to 3
        SetKnobValue _knob, 0
      endfor
    @End 
    
    @DrawKnobs
      for _knob = 0 to 3
        LabelKnob _knob,{Knob },_knob
      endfor
    @End 
    
    @CalcSomething
      _tmp = 0
      for _i = 1 to 7
        _tmp = _tmp + (Pow 2, _i)
      endfor
      calc_result = _tmp
    @End
    
    @CalcSomething
      _tmp = 0
      _i = 10
      while _i > 0
        _tmp = (_tmp + 11) *3
        Inc _i
      endwhile
      something = _tmp
    @End 
    

    The _i and _tmp are initialized inside the function and not expected to be used for exchanging information between functions. Also the _knob variable is marked as local, so one should never use it to transfer values betwen functions. Following that mindset, you can re-use the name in all the functions you want. With the name you show/explain yourself that the variable is meant to be valid inside that function only.

    .

    3, The content you wrote in the spoiler that they want to show us in Mozaic language highlighter for Textastic, unfortunately, I did not understand what you meant by “different text styles for different groups of variable names”.

    See explanation in 2/1 - the different kinds of vaiables use different text styles. In Mozaic still all variables are global, BUT one still can programm with the mindset of more adanced languages with scopes, parameters, constants etc. BUT you yourself are responsible to abide their rules, it‘s not enforced by Moazic.

    If you name a vaiable caps only since you want to express that this value will never change (maybe its just used as fixed index into an array or specifies the highest pad number used, or a CC index for something etc). You then self-impose that you that you will set that value only once in the whole script and never re-compute the value or asssign something. Reading/using that ‚constant‘ variable is allowed everywhere.
    When you two weeks later read your program, you will automatically see the variable name is caps only and just know ‚this value is a constant‘ without reading through the whole script to check what its used for.

    Same for local variables. You just know they will be intialized and used in the current function only. And when inspecting the code of another function, the same variable will be used for something else.

    For people with programming background this helps a lot with readability and makes the code easier to unserstand when developing and also when coming back to the code,

  • @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

    nudge midi tracks in ticks or ms. either to whole track or just a choose trackfile.
    in cubasis 3

    You I can delay anything that passes through Mozaic by whatever amount you want. I am not sure if delays can be fractions of a millisecond.

    So you could delay some notes more than others to do some sort of latency compensation [which shifts things later when necessary to make all notes subject to the same latency]

    problem is maybe the negative delay<
    playing something early than is ist writen must someone communicate with the delay compensation.

    I am not understanding what you mean by negative delay. You can delay some notes less than others (that is how latency compensation works) but you can’t send a note out before it has been received or cause a destination to receive it before it was sent.

    negative delay means to note is playing earlier than the file shows.
    in logics or cubase track inspector you can move the whole timing of that midi channel forwards (+6ms) or backwards (-6ms)
    somehow the daw must compensate that.
    natively this is not possible in cubasis 3,
    that's why iam asked.

  • @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

    nudge midi tracks in ticks or ms. either to whole track or just a choose trackfile.
    in cubasis 3

    You I can delay anything that passes through Mozaic by whatever amount you want. I am not sure if delays can be fractions of a millisecond.

    So you could delay some notes more than others to do some sort of latency compensation [which shifts things later when necessary to make all notes subject to the same latency]

    problem is maybe the negative delay<
    playing something early than is ist writen must someone communicate with the delay compensation.

    I am not understanding what you mean by negative delay. You can delay some notes less than others (that is how latency compensation works) but you can’t send a note out before it has been received or cause a destination to receive it before it was sent.

    negative delay means to note is playing earlier than the file shows.
    in logics or cubase track inspector you can move the whole timing of that midi channel forwards (+6ms) or backwards (-6ms)
    somehow the daw must compensate that.
    natively this is not possible in cubasis 3,
    that's why iam asked.

    Mozaic processes notes being sent through it. It doesn’t know anything about any events until they arrive at Mozaic’s input.

    Does that answer your question?

  • @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

    nudge midi tracks in ticks or ms. either to whole track or just a choose trackfile.
    in cubasis 3

    You I can delay anything that passes through Mozaic by whatever amount you want. I am not sure if delays can be fractions of a millisecond.

    So you could delay some notes more than others to do some sort of latency compensation [which shifts things later when necessary to make all notes subject to the same latency]

    problem is maybe the negative delay<
    playing something early than is ist writen must someone communicate with the delay compensation.

    I am not understanding what you mean by negative delay. You can delay some notes less than others (that is how latency compensation works) but you can’t send a note out before it has been received or cause a destination to receive it before it was sent.

    negative delay means to note is playing earlier than the file shows.
    in logics or cubase track inspector you can move the whole timing of that midi channel forwards (+6ms) or backwards (-6ms)
    somehow the daw must compensate that.
    natively this is not possible in cubasis 3,
    that's why iam asked.

    Mozaic processes notes being sent through it. It doesn’t know anything about any events until they arrive at Mozaic’s input.

    Does that answer your question?

    yes sir! thanks alot.

  • @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:

    @espiegel123 said:

    @Birdpie said:
    can i make a negative midi delay with mozaic? must change the overall latency somehow.

    What exactly do you mean?

    nudge midi tracks in ticks or ms. either to whole track or just a choose trackfile.
    in cubasis 3

    You I can delay anything that passes through Mozaic by whatever amount you want. I am not sure if delays can be fractions of a millisecond.

    So you could delay some notes more than others to do some sort of latency compensation [which shifts things later when necessary to make all notes subject to the same latency]

    problem is maybe the negative delay<
    playing something early than is ist writen must someone communicate with the delay compensation.

    I am not understanding what you mean by negative delay. You can delay some notes less than others (that is how latency compensation works) but you can’t send a note out before it has been received or cause a destination to receive it before it was sent.

    negative delay means to note is playing earlier than the file shows.
    in logics or cubase track inspector you can move the whole timing of that midi channel forwards (+6ms) or backwards (-6ms)
    somehow the daw must compensate that.
    natively this is not possible in cubasis 3,
    that's why iam asked.

    Mozaic processes notes being sent through it. It doesn’t know anything about any events until they arrive at Mozaic’s input.

    Does that answer your question?

    yes sir! thanks alot.

    if i remember correct, ableton live got this for every channel too.

  • @_ki

    Thanks for informations.

    Can I please answer these two questions?

    1/1, i have for example 4 variables num, numa , numb , numc . If i convert to :
    num
    num[1]
    num[2]
    num[3]

    For the first num i did not put [0] , In this case, does mozaic count the variables as two or does it count them as one variable?

    Is “num” without the number 0 inside the bracket considered as [0] ?

    1/2, and if I have 4 variables for example “gate” “gateb” “gatec” “gated” with x and y variables together:

    gate[x[y]]
    gateb[x[y]]
    gatec[x[y]]
    gated[x[y]]

    How can they be numbered in brackets?
    gate[0][x[y]] ???

  • @pejman

    For the first num i did not put [0] , In this case, does mozaic count the variables as two or does it count them as one variable?
    Is “num” without the number 0 inside the bracket considered as [0] ?

    num and num[0] are the same entry of the array ‚num‘ . All num, num[1], num[2], num[999] counts as single variable.

  • _ki_ki
    edited August 2023

    @pejman I don‘t understand the use case of question 1/2 - it looks too complicated to be really usefull or debuggable.

    It is not advisable to use the ‚use entries of an array as independant variables‘ work-around for all kimds of variables, especially not for variables that are used as index into other arrays.

    and yes, there‘s probabbly a notation that archieves what you intend - array nesting and indexing works without flaws in Mozaic.

  • wimwim
    edited August 2023

    @_ki Can you clarify what you mean by "array nesting" above, pretty please?

  • @wim array nesting propabbly wasn‘t the correct term, i meant a constructs like

      idx = [5, 4, 3, 2, 1, 0 ]
      other = [0, 5, 2, 4, 3, 1]
      arr = [6, 13, 4, 21, 42, 51]
    
      val = arr[ 1 + other[ idx[3] * 2 ] ] 
    

    Its an array indexed by a value read from an array that is indexed - in this example three ‚nestings’ of indexing.

    .

    Small riddle - what‘s assigned to val ?

    One has to work from inside out

    1) idx[3] is 2, as indices start with 0
    2) that times 2 is the index used for ‚other‘
    3) other[4] is 3
    4) that plus 1 is the index used for ‚arr‘
    5) arr[4] is 42, which is assigned to val ;-)

  • Thank you @_ki. That's what I thought. I had hope though that you'd found something I assumed wouldn't work such as:

    foo = [0, 5, 2, 4, 3, 1]
    bar = [8, 7, 9, 10, 20, 5, 22, 3]
    arr = [foo, bar]
    
    var = arr[1,3]      // = 10
    
  • _ki_ki
    edited August 2023

    @wim

    Deducting from the result 10, you meant the first index number selects ‚which‘ array is meant to be accessed and the index after the comma then selects the entry into that bar array. That’s like 2D array access but with swapped indices.

    But you probably know that one can flatten 2D arrays into a single dimension. Instead of arr[x,y] use arr[x+y*width_of_x] for access.

    .

    To get your code snippet (were x and y are swapped) working in Mozaic, change it to:

    WIDTH = 8
    arr[0*WIDTH]  = [0, 5, 2, 4, 3, 1]          // foo
    arr[1*WIDTH]  = [8, 7, 9, 10, 20, 5, 22, 3] // bar
    
    var = arr[1*WIDTH + 3]      // arr[1,3] => 10
    

    One is limited to a total length of 1024 elements, so 16 x 64 is one of the possible 2D array dimensions.

  • @_ki said:
    @wim

    Deducting from the result 10, you meant the first index number selects ‚which‘ array is meant to be accessed and the index after the comma then selects the entry into that bar array. That’s like 2D array access but with swapped indices.

    But you probably know that one can flatten 2D arrays into a single dimension. Instead of arr[x,y] use arr[x+y*width_of_x] for access.

    .

    To get your code snippet (were x and y are swapped) working in Mozaic, change it to:

    WIDTH = 8
    arr[0*WIDTH]  = [0, 5, 2, 4, 3, 1]          // foo
    arr[1*WIDTH]  = [8, 7, 9, 10, 20, 5, 22, 3] // bar
    
    var = arr[1*WIDTH + 3]      // arr[1,3] => 10
    

    One is limited to a total length of 1024 elements, so 16 x 64 is one of the possible 2D array dimensions.

    And let's not discuss how one can pack multiple integer values into a cell in an effort to overcome the 1024 element limit...its not pretty.

  • @espiegel123
    And let's not discuss how one can pack multiple integer values into a cell in an effort to overcome the 1024 element limit...its not pretty.

    🤪 Your right - it seems i‘m that old that i start repeating stories… i already documented all this on the Mozaic Tips & Tricks wiki page

Sign In or Register to comment.