Audiobus: Use your music apps together.

What is Audiobus?Audiobus is an award-winning music app for iPhone and iPad which lets you use your other music apps together. Chain effects on your favourite synth, run the output of apps or Audio Units into an app like GarageBand or Loopy, or select a different audio interface output for each app. Route MIDI between apps — drive a synth from a MIDI sequencer, or add an arpeggiator to your MIDI keyboard — or sync with your external MIDI gear. And control your entire setup from a MIDI controller.

Download on the App Store

Audiobus is the app that makes the rest of your setup better.

MOZAIC Help Line

1235715

Comments

  • Most programming languages are not to be read like math equations (were a=b equals b= a). Instead the equal sign means „is set to the value of“. In Moazic there needs to be a single variable to the left side of the equal sign, on the right side you can put complex computation statements as long as it results in a single value.

    .

    To pickup the drawer explanation of @espiegel:

    notenum[3] = 56 could be read as ‚drawer number 3 of the array named notenum is set to the value of 56‘

    .

    The right side can contain more complex expression, also the index [ ] can be computed with an expression:

    notenum[ index*2 +1] = 56 * Round (index / 2) could be read as

    • left side: drawer with the number computed by „the content of cupboard named index at drawer zero times two plus one“ of the cupboard named notenum
    • equal sign: is set to the value of
    • right side: 56 times rounding the result of half of the content of the drawer zero of the cupboard named index

    .

    Attention: In comparison expressions of If, Elseif, While, Until Moazic statements, the equal sign behaves like in math equations, both side can contain complex computation statements and the result of both computations is compared for equality deciding about the next programming flow.
    Many programming languages use a different ‚sign‘ for the equal comparision operation (like ==) to distinguish it from the assignment operation that uses a single = sign. Some lanaguages use := for assignments.

  • @ki , Great, very nice 🙏.
    Can I please you, as you explained so clearly and excellently about (equal), also explain about for, because the case of for is still a bit confusing for me.
    For example, when I put endfor at the end of an expression, I get one result, and when I put endfor before that expression, I get another result.

    In the previous posts, @wim was kind enough to give me an explanation about Fore, but it's still confusing for me. I'm probably too confused.😅

    I can figure out what's going on with the examples I've given you below to some extent by experimenting, but in cases where there are a lot of layers and different commands like : @Onload, @OnPaddown , @onShiftdown , @xxxx , and the location of ( for ) in each of them, and affecting for in other commands it's very confusing to me.

    for p = 0 to 4
    p = LastPad
    Xxxxx
    Xxxx
    Xxx
    endfor

    Or

    p = LastPad
    for p = 0 to 4
    Xxxxx
    Xxxxx
    Xxxxx
    endfor

    Or

    for p = 0 to 4
    p = LastPad
    endfor
    Call @setknobposition

    Or

    for p = 0 to 4
    p = LastPad
    Call @ setknobposition
    endfor

    Or

    p = LastPad
    for p = 0 to 4
    endfor
    Call @setknobposition

    Or

    p = LastPad
    for p = 0 to 4
    Call @ setknobposition
    endfor

  • edited May 2023

    The issue is that I use for and endfor in relation to their location in the script by trial and error, and I do not use them based on full knowledge and complete nobility.

    And another thing is that

    I know that for is a type of looping, but I don't know how this looping happens

  • @pejman said:
    The issue is that I use for and endfor in relation to their location in the script by trial and error, and I do not use them based on full knowledge and complete nobility.

    And another thing is that

    I know that for is a type of looping, but I don't know how this looping happens

    @pejman : I suggest that you read and re-read the two or three pages about loops in the Mozaic manual. Enter each example there.

    Loops loop all the statements between a loop’s beginning and end statement. You only include instructions that you want to perform each time through the loop.

  • Tip! Generally, you should not change the value of the test/counter variable used for the loop inside the loop. Otherwise, you break the loop's logic.

    So, if you have

    for counter = 0 to 5
    ...stuff to do
    end for

    Don't put something like "counter = somevalue" inside the loop...unless you are advanced enough to understand how that breaks the normal behavior of the loop.

  • Can I ask you to give examples for both paragraphs that you have written ?

    @espiegel123 said:
    Tip! Generally, you should not change the value of the test/counter variable used for the loop inside the loop. Otherwise, you break the loop's logic.

    Don't put something like "counter = somevalue" inside the loop...unless you are advanced enough to understand how that breaks the normal behavior of the loop.

  • @pejman said:
    Can I ask you to give examples for both paragraphs that you have written ?

    @espiegel123 said:
    Tip! Generally, you should not change the value of the test/counter variable used for the loop inside the loop. Otherwise, you break the loop's logic.

    Don't put something like "counter = somevalue" inside the loop...unless you are advanced enough to understand how that breaks the normal behavior of the loop.

    You might want to go back and review this post: https://forum.audiob.us/discussion/comment/1197753/#Comment_1197753. I tried to explain what happens when you change the for counter there.

  • @espiegel.

    There is problem with label knob 1


    @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 padUsedFlag = 0 LabelKnob 0, {note #} LabelKnob 1, {color} p = LastPad for p = 0 to 7 ColorPad p, notecolors[p] LabelPad p, notenum[p] endfor @End @OnPadDown if LastPad < 8 nn = notenum[LastPad] nc = notecolors[LastPad] vel = LastPadVelocity SendMIDINoteOn 0, nn, vel SendMIDINoteOff 0, nn, 0, 100 SetKnobValue 0, nn LabelKnob 0, {note #} , nn col = Round TranslateScale ( GetKnobValue 1 ) , 0, 127, nc, nc SetKnobValue 1,col //*18.28 LabelKnob 1, {color } ,col endif @End @OnKnobChange g = GetKnobValue LastKnob noten = Round GetKnobValue 0 colorn = Round GetKnobValue 1 nn = notenum[LastPad] nc = notecolors[LastPad] colo = Round TranslateScale ( GetKnobValue 1 ) , 0, 127, 0, 7 for p = 0 to 7 if LastKnob = 0 CopyArray noten, notenum,8 SendMIDINoteOn 0, noten, 1 SendMIDINoteOff 0, noten, 0, 100 LabelPad p, noten elseif LastKnob = 1 CopyArray colorn, notecolors,8 ColorPad p, colo endif endfor if padUsedFlag = 0 LabelKnob 0, {error} LabelKnob 1, {error} endif @End
  • @wim said:

    @pejman said:
    Can I ask you to give examples for both paragraphs that you have written ?

    @espiegel123 said:
    Tip! Generally, you should not change the value of the test/counter variable used for the loop inside the loop. Otherwise, you break the loop's logic.

    Don't put something like "counter = somevalue" inside the loop...unless you are advanced enough to understand how that breaks the normal behavior of the loop.

    You might want to go back and review this post: https://forum.audiob.us/discussion/comment/1197753/#Comment_1197753. I tried to explain what happens when you change the for counter there.

    Thanks @wim , The first time I read your content, I didn't catch much, Or in some cases I did not understand what you meant. But now that I read it again, I completely understand what you mean.
    It is very interesting to me that now the subject is completely understandable for me, but it was not like this before.
    Maybe I have a problem with some of your words like ( counter ) 😅, or some of your sentences.

  • @pejman said:
    @espiegel.

    There is problem with label knob 1

    >

    What is the problem? Please give a detailed description of what you mean. In the description, include the steps to perform to see the problem and a description of what you think should happen.

    An important part of solving problems is describing them.

  • @pejman said:
    Can I ask you to give examples for both paragraphs that you have written ?

    @espiegel123 said:
    Tip! Generally, you should not change the value of the test/counter variable used for the loop inside the loop. Otherwise, you break the loop's logic.

    Don't put something like "counter = somevalue" inside the loop...unless you are advanced enough to understand how that breaks the normal behavior of the loop.

    Please write a little loop you understand then add the error I mentioned to see what happens.

    For example , write a script that prints to the log “ starting” and then logs the numbers from 0 to 20 using a for loop that starts

    for p = 0 to 20

    Write the loop so it works.

    After it works, add p = LastPad in your loop.

    Predict what will happen by tracing through the loop.

    Then run the loop and see what happens.

  • @espiegel . I didn't explain this because I thought you could easily understand the problem by reading the script.

    Everything works properly when the script is loaded, with knobs and pads.

    The problem starts when I turn knob number one.

    1, turn knob 1
    2, colorpads change properly
    3, touch one pad
    4, instead of showing the color number in lebelknob 1, it shows the number of Getknob value 1

  • @espiegel123 said:

    @pejman said:
    Can I ask you to give examples for both paragraphs that you have written ?

    @espiegel123 said:
    Tip! Generally, you should not change the value of the test/counter variable used for the loop inside the loop. Otherwise, you break the loop's logic.

    Don't put something like "counter = somevalue" inside the loop...unless you are advanced enough to understand how that breaks the normal behavior of the loop.

    Please write a little loop you understand then add the error I mentioned to see what happens.

    For example , write a script that prints to the log “ starting” and then logs the numbers from 0 to 20 using a for loop that starts

    for p = 0 to 20

    Write the loop so it works.

    After it works, add p = LastPad in your loop.

    Predict what will happen by tracing through the loop.

    Then run the loop and see what happens.

    Yes, you are right, I did what you said.

    If you says that ( endif of for p ) is not placed correctly in onknobchange section , I didn't know where to put it.

    I put it in different places but it caused other problems

  • @pejman : for the issue you mention, without even looking at your code, what you describe sounds like you forgot to translate scale somewhere. Ask yourself, why would it display the unscaled value.

    Before we discuss that further, I have questions.

    Did you write all this code from scratch or did you copy some from another script?

    It looks like you overlooked some of the instructions about the padUsedFlag. Take another look at the instructions..in particular when to assign a value to it after it has been initialized.

    What is the purpose of your calls to copyarray?

    Can you give an explanation of what is happening in onKnobChange?

    —-
    You wrote above about not being sure where to put an end if.

    If statements are just like loops. All the code between the if and endif or for and endfor is a block of code. Every line in it gets run.

    If you are having trouble predicting ahead of time what instructions are going to be executed, we might need to focus on helping you understand. That is a critical piece of foundational understanding.

  • @espiegel123 said:
    @pejman : for the issue you mention, without even looking at your code, what you describe sounds like you forgot to translate scale somewhere. Ask yourself, why would it display the unscaled value.

    Because I didn't know how to use translate in Onpaddown section . These are signs of what I could do:

    col = Round TranslateScale ( GetKnobValue 1 ) , 0, 127, nc, nc
    SetKnobValue 1,col //*18.28

    Before we discuss that further, I have questions.

    Did you write all this code from scratch or did you copy some from another script?

    No, I did not copy them from anywhere.

    It looks like you overlooked some of the instructions about the padUsedFlag. Take another look at the instructions..in particular when to assign a value to it after it has been initialized.

    I don't know exactly what role or roles ( paduseFlag ) is supposed to play

    What is the purpose of your calls to copyarray?

    Was I supposed to do something else?

    Shouldn't I have stored these values ​​that are created through two knobs in notenum and notecolors ?

    Can you give an explanation of what is happening in onKnobChange?

    Explain about the bug that happens?

    —-
    You wrote above about not being sure where to put an end if.

    If statements are just like loops. All the code between the if and endif or for and endfor is a block of code. Every line in it gets run.

    Yes, I understand this very well, but what I mean is that I don't know where I should have put it in this script, so that things would work correctly.

    If you are having trouble predicting ahead of time what instructions are going to be executed, we might need to focus on helping you understand. That is a critical piece of foundational understanding.

  • @pejman wrote:

    It looks like you overlooked some of the instructions about the padUsedFlag. Take another look at the instructions..in particular when to assign a value to it after it has been initialized.

    I don't know exactly what role or roles ( paduseFlag ) is supposed to play

    Please see the original instructions and post here each instruction related to padUsedFlag.

    And then let’s discuss any questions you have.

  • @pejman wrote:

    col = Round TranslateScale ( GetKnobValue 1 ) , 0, 127, nc, nc

    SetKnobValue 1,col //*18.28

    Take a look at the parameters you are using for translateScale. The last pair of numbers are supposed to define the value range you are translating to.

    You are translating from 0 to 127 to what range?

  • @pejman : I would like to understand why you think you need CopyArray. Can you explain what function it is playing in your script?

  • @pejman wrote:

    Can you give an explanation of what is happening in onKnobChange?

    Explain about the bug that happens?

    I mean : in your own words, what happens in onKnobChange when you turn a knob.

    As an example, here would be my explanation of your onPadDown handler.

    When a pad is pressed,

    • get the noteNumber associated with the pad from the notenum array
    • get the pad velocity
    • Get the color associated with the pad from the note color array
    • Send a midi note on/off for the notenumber using the pad velocity
    • Set knob 0 to to the notenumber
    • Set knob 1 to the associated pad color
  • @espiegel123 said:
    @pejman wrote:

    It looks like you overlooked some of the instructions about the padUsedFlag. Take another look at the instructions..in particular when to assign a value to it after it has been initialized.

    I don't know exactly what role or roles ( paduseFlag ) is supposed to play

    Please see the original instructions and post here each instruction related to padUsedFlag.

    And then let’s discuss any questions you have.

    in the load section assign 0 to a variable called padUsedFlag.
    What I'd like you to do is add this functionality:

    when a pad is touched, set padUsedFlag to 1.

        Why should it be set to 1?
    
        Do you mean something like this?
         If LastPad < 8 
         padUsedFlag = 1
         endif 
    

    And if this is the case, why should such a thing happen?

    if knob 0 or 1 is turned and padUsedFlag is 0, change the knobs area label to "Error"

        Under what conditions should it be 0 ?    If it was 0  change the knobs area label to "Error"
    
                 And why do you use the word error?     Why should there be an error on knob label if it was 0?
    
  • I wrote: "Please see the original instructions and post here each instruction related to padUsedFlag."

    Here were the instructions related to padUsedFlag

    • in the load section assign 0 to a variable called padUsedFlag.
    • when a pad is touched, set padUsedFlag to 1.
    • if knob 0 or 1 is turned and padUsedFlag is 0, change the knobs area label to "Error"

    See my comments in line

    @pejman wrote:

    Under what conditions should it be 0 ? If it was 0 change the knobs area label to "Error"

    Can you clarify your question? Under what conditions should what be 0?

    padUsedFlag is 0 until a user has tapped a pad. After that, it won't be 0 again.

    And why do you use the word error? Why should there be an error on knob label if it was 0?

    The reason that it should be an error if you turn a knob before you have tapped any pads is that the knobs are supposed to reflect the note number and color of whatever pad was tapped last -- and is going to be used to change the pad that was tapped last.

    So, the knobs don't mean anything until a pad has been tapped. We are using this as a way of knowing whether a pad has been tapped -- we can't use LastPad because lastPad returns 0 even if no pad has been tapped.

    There are other ways of accomplishing this, too. But this is a simple way to do it.

  • @espiegel123 said:
    @pejman wrote:

    col = Round TranslateScale ( GetKnobValue 1 ) , 0, 127, nc, nc

    SetKnobValue 1,col //*18.28

    Take a look at the parameters you are using for translateScale. The last pair of numbers are supposed to define the value range you are translating to.

    You are translating from 0 to 127 to what range?

    nc : This means the same color number. I already put 0 and 7 instead of nc,nc, but I did not get the correct result. which shows the correct color number by placing ( nc ) label knob 1

    Of course, these things are done before we turn the knob ourselves.

  • hello guys,

    I am wondering about two things, can this be done with Mozaic:

    1. I used to own a Roland R8M module, and this drum synth has a humanise setting specially for hihats and percussion. I don't know exactly anymore but it is a combination of a variation in velocity and timing. I wonder if Mozaic could transform incoming midi notes from a sequencer this way?

    2. I used to own a Roland MC505 (=JV1080 engine) and there was a setting to detune randomly a note, between pre-set boundaries. So if I send a C2 note for a kick drum, every new kick drum hit is slightly higher or lower, just a little bit. To simulate a more analogue kick drum, every hit is a bit different.

    Can this be done in Mozaic? If so I want to build this functionality.

    Thanks is advance.

  • @espiegel123 said:
    I wrote: "Please see the original instructions and post here each instruction related to padUsedFlag."

    Here were the instructions related to padUsedFlag

    • in the load section assign 0 to a variable called padUsedFlag.
    • when a pad is touched, set padUsedFlag to 1.
    • if knob 0 or 1 is turned and padUsedFlag is 0, change the knobs area label to "Error"

    See my comments in line

    @pejman wrote:

    Under what conditions should it be 0 ? If it was 0 change the knobs area label to "Error"

    Can you clarify your question? Under what conditions should what be 0?

    padUsedFlag is 0 until a user has tapped a pad. After that, it won't be 0 again.

    And why do you use the word error? Why should there be an error on knob label if it was 0?

    The reason that it should be an error if you turn a knob before you have tapped any pads is that the knobs are supposed to reflect the note number and color of whatever pad was tapped last -- and is going to be used to change the pad that was tapped last.

    So, the knobs don't mean anything until a pad has been tapped. We are using this as a way of knowing whether a pad has been tapped -- we can't use LastPad because lastPad returns 0 even if no pad has been tapped.

    There are other ways of accomplishing this, too. But this is a simple way to do it.

    Ok, I have done exactly what you expect in the script, nothing else. So is there a problem with this?

  • wimwim
    edited May 2023

    @raabje said:
    hello guys,

    I am wondering about two things, can this be done with Mozaic:

    1. I used to own a Roland R8M module, and this drum synth has a humanise setting specially for hihats and percussion. I don't know exactly anymore but it is a combination of a variation in velocity and timing. I wonder if Mozaic could transform incoming midi notes from a sequencer this way?

    Velocity is easy to vary. Timing is easy to vary, but can only be delayed, not adjusted to before the note arrives.

    There are already some scripts such as Ranbo that add random humanization. It sounds like the R8M module might have more going on than just randomization. If so then one would need to understand what's going on before saying how well that functionality could be implemented.

    1. I used to own a Roland MC505 (=JV1080 engine) and there was a setting to detune randomly a note, between pre-set boundaries. So if I send a C2 note for a kick drum, every new kick drum hit is slightly higher or lower, just a little bit. To simulate a more analogue kick drum, every hit is a bit different.

    Yes, you could send a random amount of pitch-bend with each note. As long as the target reacts to pitch bend (which is not always the case) it would work.

  • edited May 2023

    @pejman : let's take a look at TranslateScale. It translates from one number range to another one. The first pair of numbers should be range of numbers of the input. The second pair of numbers is the range of the output.

    When translating from a color value to a knob's range, you are translating from the range 0 thru 7 to the range 0 thru 127.

    In onPadDown, you should be setting the knob's value based on the I note color array. Please take a look onPadDown and go through carefully, line-by-line and see if you can spot the problem. Besides a translatescale problem, there is another problem. HINT: the value you set knob 1 to should have its origin in the note color array.

  • @raabje : one issue with using a script to humanize a midi input stream's timing is that you can only make notes later. Humanization sometimes involves shifting some things early. So, while you can create some randomization of the notes, the variation will always make things later in relation to the clock. The drum machine in question probably balanced things out so that the overall feel stayed centered around the pulse.

  • edited May 2023

    @wim said:

    @raabje said:
    hello guys,

    I am wondering about two things, can this be done with Mozaic:

    1. I used to own a Roland R8M module, and this drum synth has a humanise setting specially for hihats and percussion. I don't know exactly anymore but it is a combination of a variation in velocity and timing. I wonder if Mozaic could transform incoming midi notes from a sequencer this way?

    Velocity is easy to vary. Timing is easy to vary, but can only be delayed, not adjusted to before the note arrives.

    There are already some scripts such as Ranbo that add random humanization. It sounds like the R8M module might have more going on than just randomization. If so then one would need to understand what's going on before saying how well that functionality could be implemented.

    1. I used to own a Roland MC505 (=JV1080 engine) and there was a setting to detune randomly a note, between pre-set boundaries. So if I send a C2 note for a kick drum, every new kick drum hit is slightly higher or lower, just a little bit. To simulate a more analogue kick drum, every hit is a bit different.

    Yes, you could send a random amount of pitch-bend with each note. As long as the target reacts to pitch bend (which is not always the case) it would work.

    I checked the manual, it is called the Feel function

    It is a bit cryptic, it is called groove, but indeed you can not play a note earlier than coming in from a sequencer. I can't remember anymore what the effect is.

    And when it comes to detune, I want the note to be a little lower or higher in pitch but not a glide or pitch bend to it.

    I will make a start with the scripts from Patch storage to get there.

  • wimwim
    edited May 2023

    @raabje said:
    It is a bit cryptic, it is called groove, but indeed you can not play a note earlier than coming in from a sequencer. I can't remember anymore what the effect is.

    The description seems pretty complete. I didn't look carefully enough to see if any of it could not be implemented, but from first glance I'm sure you could get at least close. It would not be an easy "beginner" project in Mozaic by any means though.

    And when it comes to detune, I want the note to be a little lower or higher in pitch but not a glide or pitch bend to it.

    What I meant would not involve glide or any bending sound, but I should have explained more fully.

    The pitch bend would have to be sent just before the note that triggers the sound. It would also have to be sent while no other notes are playing. If that can be done then it would work. And that's the only it could work. Pitch bend is the only means of detuning a note via midi.

    This would have to be very limited. Pitch bend affects all notes playing on the target unless the target (and therefore the Mozaic script as well) supports MPE. So, the humanization would have to be strictly monophonic.

  • Another option would be to use a multi velocity layer sampler for the drum sounds, then load slightly detuned samples at different velocity layers. Digistix 2, Drambo, and AudioLayer come to mind.

    Not a very good option though since you also want to use velocity for ... velocity variations.

    In short ... detune through midi isn't too practical, but is technically possible in a limited sense.

Sign In or Register to comment.