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.

The Unofficial Mozaic User Helpline

12467

Comments

  • _ki_ki
    edited August 2020

    Your single line instruction was defenitivly too long with over 390 chars. here a ‚press any tab to crash’ variant of that line :)

    @OnPadDown
      a = [1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1]
    @End
    

    You need to scroll the code block to copy the full length

    .

    A split up variant with 254 ascii chars on the first line works:

    @OnPadDown
      a[0] = [1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,    0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0]
      a[130]  = [1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1]
      Log {Long Lines Test}
    @End
    

    You need to horizontal scroll to copy the full script

    When using unicode chars in the label strings the max line width limit is reached a lot earlier.

  • Ah that’s definitely good info, thanks @_ki

  • Yeah if I remember correctly, a Unicode character can be up to 6 bytes/ascii characters, so it adds up quickly

  • @_ki I've just added your mozaic definitions to sublime on windows and the example .moz files open as expected but mine don't - each line is eight sets of four hex numbers - do I need to do more than rename them with the .moz extension? Sorry if this has been answered elsewhere, done a fair sweep but can’t see anything...

  • _ki_ki
    edited August 2020

    The .mozaic files are binary files, the script is only a part of that. The file also contains all state saved variables values etc.

    You need to open the .mozaic in Mozaic, select all code and paste the ascii text into a file with a .moz extension. Then it should work

  • Ah, nice, should have thought of that, cheers ki

  • Is there a ‘sign’ type function in mozaic? I need to determine whether a variable is negative or positive, guess I can just ‘if less than zero’ make my result 1 or -1 but wanted to check in case there was a way to do it within another line of code/maths

  • If you want a one-liner, you could use the conditional expression val = 1 - 2*(a<0) to emulate val = sign(a) (or val = -1 + 2*(a>=0))

  • Cheers @_ki , that’s the kind of chops that pays, I could never do this for a living, somewhere between logic and intuition lies programming genius 🙌

  • Such constructs aren‘t really recommended because of their bad readability :)
    But they spare 4 lines of code which could make the outer algorithm more evident

  • To be honest i shouldn’t really be messing with this anymore - I had a dream time thought that I could morph between parameter settings quite easily but I’m getting into all sorts of negative/positive, forwards/backwards nightmares and thus getting sucked back into programming when I should be tuning/musicating instead... the script is usable as is, perfection can wait 😆

    Thanks, once again :)

  • edited August 2020

    I just can’t, in the immortal words of Vic Reeves and Bob Mortimer, let it lie... been struggling with this conundrum all day - I’m trying to get a knob to add a value to an array while spreading that value to nearby slots in the array. I’ve currently got a working version that reduces the far point to zero from whatever value set by the knob but want to try and send it smoothly from the new value on the edited step to the pre-assigned value on the target...

    //coarseknob carrier
      if LastKnob = 0 and layout = 2 and parSet = 2
        value = TranslateScale value, 0, 127, 0, 31
        targetVal = csSeq[idx+parSpread]
        diff = value - targetVal
    
        if diff < 0
          diff = 1
        else diff = -1
        endif
      Log diff
    
        valMorph = (Abs (value - targetVal)/Abs parSpread)*diff*spreadSign
    
     log {gap=},parSpread,{,target=},targetVal,{,change=},valMorph,{,sign=},spreadSign
    
    for i = 0 to parSpread
          csSeq[idx+i] = Round value
          value = value + valMorph
        endfor
    
      endif
    

    This the main loop on my test parameter, I did also have hope to use

    TranslateScale i,idx,parSpread,value,targetVal

    as a far simpler way of getting there but no biscuits. I think I’ve tried every combination (like a Shakespeare writing chimp 🤣) and this is probably way off the mark.

    If anyone can even follow this and point me in the right direction it’d be ace, thanks!

    Chris

    Ps I think I need to assign the targetVal before this, which is pretty simple, as if I don’t, it ends up changing the target as it works, unless there’s a way to limit the loop to one less than the length of the range - the target can be either before or after the start point...

  • I am a "Mozaic USER" (per the very first line at the very top of this thread). I need help with the sostenuto script by @Alfred.

    I'm struggling to get it to work. There isn't any help or instructions in the script that I can see. I did lots of trial and error, but no luck. The labels are pretty cryptic, which I know is typical of Mozaic, but I need at least some clues to go on. Can anybody help me, or point me to instruction?

    I have some experiencing implementing Mozaic scripts, including four instances of @_ki As-Played Arp, which is a major piece of my setup now and works fine. (_ki is promising to answer my feature requests with improvements in a new version which will make it even better.)

    I confirmed that the routing to the sostenuto is correct--at least the MIDI light goes on in Mozaic when I press the pedal.

    I'm driving it with a regular sustain pedal currently sending CC64 on channel 2. Hosting in AUM.

    Thanks,
    Steve

  • wimwim
    edited August 2020

    @ThinAirX - What app(s) are you sending the Mozaic output to? I could try to take a look if I have one of the apps. It could have as much to do with the target app as with routing or the script itself.

    Are you sure that your controller is being routed only to Mozaic, and not also to the app?

  • @wim, thanks for offering to help.

    I'm sure it's only routed through Mozaic, no connection to the app. I'm testing with Zeeon; when I get it to work I'll do it with 4 instances for 4 synths.

    For each instance, the signal flow is:
    keyboard input (2 keyboards, ch 1 and 2) > //Roland stage piano; K-Board
    mfxStrip (Mozaic) > // for filtering keyboard input (1,2,both,none)
    sustain (Mozaic) > // to apply sustain to hold arp patterns
    As-played arp (Mozaic) > // written by @_ki
    synth (1,2,3, or 4) //Ravenscroft, ThumbJam, Zeeon, Pure Platinum

    This kluge actually works really well. I'm controlling all the options with MIDI Designer and making weird music.

    Sustain pedal 1 plugs into the back of the Roland and works as expected, except only when playing from the Roland. i.e. the keys and the sustain are coming in on ch 1 and don't affect notes coming in on ch 2 from the K-board.

    I want to use sustain pedal 2 on channel 2. Because I use the K-board for special effects and arping, I want it to be sostenuto and not conventional sustain.

    That's the plan.

    I have the sostenuto Mozaic accepting and sending signals, but I can't control it because I don't know what the knobs do. Thus my original plea for a help screen, mini-manual, directions. Now, when in-line, the sostenuto is "leaking" notes from ch 2 to ch 1. Notes, not sustain signals.

    Sustain 2 is coming through an AudioFront pedal unit, so I can make it send any channel or CC. Now it's 2/64.

    If you're curious, here's what some of my music with this rig sounds like:
    https://soundcloud.com/user1699587

    Thanks for your help,

    Steve
    ThinAirX

    [If this should be done in a PM, let me know and I'll take it down and go that route.]

  • I'm having a real hard time understanding this setup and what you need from it. I thought I understood and wrote out an answer that doesn't require the sostenuto script, but then re-read your post and decided I really didn't get it.

    1) What does the "sustain" mozaic script do here?
    2) Do you want the first sustain pedal to affect notes coming from the K-Board?
    3) What is the sostenuto script supposed to be doing for you? Sostenuto is just midi cc66, isn't it? If so then can you set the AudioFront pedal to send cc66 instead of cc64?

    At first I thought this was just a matter of getting the as-played arp script to get notes, sustain, and sostenuto, as filtered by mfxStrip. But it seems like there's more to it than that?

    We can PM over this, or do it in a separate thread if you like, so that we don't derail this one.

  • _ki_ki
    edited August 2020

    @wim I though he meant the sustenuto script and already had a short peek into its souce to see what that one is doing.

    .

    The other sustain script used seems to be the SustainPedal script that i recommended to him.

    This sustain pedal script stores a list of held notes for all channels and if a note-off is received while sustain is active, that‘s supressed. If the sustain is released, the note-off for all held notes is send. (I just saw that the script has the issue, that this note-off is only done for the channel the sustain-off is received on...). There is no UI, sustain is switched using the CC 64

    .

    The sustenuto script works in a similar way (storing a list of active notes and either passing or supressing the note-off). It has a UI with 5 knobs, the retrigger toggle knob is only visible when shift is pressed.

    • The channel knob selects the input channel beteen 1-16 and OMNI mode
    • MidiEvents not on this channel are routed thru
    • The sustain knob selects the input for the switch: Fully left its ‚PitchBend Up‘, then the list of CCs up to 95. The default is CC 64 where the script uses ‚sustain’ as knob label
    • The input knob is an output of the sustain pedal state. The knob position is fully left when sustain is off and fully right, when sustain is on. It is positioned when the configured CC or PB is received on the configured channel
    • The latch knob toggles latching - i suspect that changes the sustain signal to a toggle instead an on/off switch.
    • When shift is held, the ‚input‘ knob changes to a ‚retrigger‘ knob. Here you specify, if new note-one for a sustained note will retrigger that note. The script first sends a note off (but using the 0x90+chan, note#, 0 midi syntax, so its a note-on velocity zero, not a note-off) and then lets the new note-on through

    The script also manages a note-on list and additonally a note-channel list and on sustain on copies those lists into sustenutoList and sustenutoChannel list. Notes from the latter list are the ones that will be released when sustain off is received.
    To me it seems that while the sustain pedal is held, no new notes are added to this list - it only helds the active notes that were active while sustain on is received. And thats the defintion of sustenuto :)

    BTW: The sustain trigger (CC or PB) does not check for the input channel. So in default it reacts to all CC-64 of all channels, even if the sustenuto is configured to work only on a specific channel.

    BTW-2: In OMNI modi the notes on the channels need to be destinct, otherwise the script will produce hanging notes on sustain-off as only one of them is released.

    .

    @ThinAirX What do you mean by leaking notes from ch2 to 1 ? That an input note on channel 2 is appearing on channel 1 after the script ? The sustenuto script mostly uses SendMidiThru, i didn‘t see a channel translation. Or did you mean the SustainPedal script ?

  • Thank you both for your further help. I'll dig into this today and answer your questions (had an emergency yesterday that took me off line).

    Maybe we should do this isn a new thread, since there are three of us in the conversation now? Can a mod move the last few posts into a separate thread? I don't want to be rude to the rest of the group.

    Steve

  • A new thread would be best. We could just copy/paste the posts, or link them for reference. I'd hate to bother Michael (the only mod here) with something that would only take one of us a few seconds to manage.

  • edited August 2020

    I'm going to give up on getting the sostenuto script to work. But for the sake of completeness and future lurkers, here's what I found out. (BTW, it is spelled "sostenuto" both in the script and in the PatchStorage list.)

    I went through all the settings (thanks, -ki) and couldn't get the sostenuto to work. I did this in a stripped-down test setup on AUM with the Ravenscroft piano. I routed Pedal2 (P2, sending on ch2) through it and also the input from the Roland piano and its dedicated sustain pedal (P1, sending on ch1). The sostenuto worked as a normal sustain only, but in a weird pattern (Input CC is 64):

    Channel set to 1, 2, 3-16, Omni

    P1: N Y Y N

    P2: Y N Y N

    Y = sustain effect; N = nothing (staccato).
    [EDIT: it looks like my attempt at a table doesn't work. Column headers = 1,2,etc. Rows = P1 and P2.]

    It looks like the sostenuto script is blocking anything that's coming in on the "proper" channel.

    WIM, what I was hoping to do was to use the sostenuto to control ONLY the notes coming from the K-board, channel 2. I had the idea of using it to latch the notes in the arp responding to ch 2--to set up a pattern and then play freely over it. I found another way to achieve this using the latch feature of the K-board, so that's what I'm going to do.

    I tried setting the pedal to CC66 but that did nothing, with or without the sostenuto script. The Ravenscroft doesn't see it as a sostenuto; it's only looking for CC64.

    I use the sustainpedal script to affect _ki's as-played arp. It works! Without it the arp only plays notes as they are held down on the keyboard. With the sustain the arming continues until I release the pedal. It's a cool effect, especially when I have 2 or 3 arps running at different speeds and driving different synths at the same time. It creates cross-rhythms that are stunning.

    Here's a sample. This is the first track I recorded after _ki turned me on to the sustain script and solved my problem. Thus the title "Sustained Interest." (I hope this works. This is the first time I've tried to post a track.)

    https://soundcloud.com/user1699587/sustained-interest-8-5-20?in=user1699587/sets/kandinsky-on-the-radio-new-ios

  • Ah, I finally did get the sostenuto to work. So there isn't any fault with the script.

    I ignored the problem for a couple days, went back to try one more time today, and, magic, it worked. Well, not really magic. I fiddled with some of the settings anew and realized that the CC selector needed to be on "sustain," which is the label for CC64. That's what threw me originally. I figured that "sustain" was what I DIDN'T want. (My pedal is CC64.)

    Now when I hold down some keys, press and hold the pedal connected to sostenuto, then any new keys I hit after depressing the pedal are unsustained, staccato--as a sostenuto should work.

    Thanks again for your patience. I hope these posts help somebody else looking for a sostenuto.

    Steve

  • Is there a way to get pitchbend input as a value? I can use 'if MIDICommand = 0xE0' to tell if it's being sent, but I'm not sure how to get the rest of the data out...

    cheers!

  • _ki_ki
    edited October 2020

    @Krupa

    bendvalue = MIDIByte2 + MIDIByte3 * 128
    

    No pitchbend is 8192 or Byte2=0, Byte3=0x40

  • @_ki said:
    @Krupa

    bendvalue = MIDIByte2 + MIDIByte3 * 128
    

    No pitchbend is 8192 or Byte2=0, Byte3=0x40

    Ah cheers ki, I got that hex value from the mosaic manual 😬

  • wimwim
    edited October 2020

    @Krupa, you're correct, MIDICommand = 0xE0 does detect pitch bend. That part is right. @_ki gave you the way to read the pitch bend value using MidiByte2 and MidiByte3.

    @OnMidiInput
      if MIDICommand = 0xE0
        // 8192 = 0 pitch bend, 0 = maximum downward bend, 16383 = maximum upward bend
        bendvalue = MIDIByte2 + (MIDIByte3 * 128)
      endif
    @End
    

    Will give you the pitch bend value

  • Ah cool, I wasn’t sure, the script I’ve concocted since this morning seems to work though, thanks for the confirmation @wim and the method @_ki . As a result, project dxShredda is now well underway 😁

  • Guys, any idea how to get rounded number with only 2 decimals and no trailing zeroes as a label on knob? I am doing something like this:

    labelBpm = (Round (bpm * 100)) / 100
    LabelKnob 0, labelBpm
    

    But I am getting displayed values with trailing zeroes, e.g “128.3400”
    Is there a way to cut those extra zeroes? I was thinking about splitting values into whole numbers and decimals (multiplied to get also whole numbers) and then putting them together. Seems quite overcomplicated, isn’t there more straightforward way?
    Thanks a lot!

  • _ki_ki
    edited November 2020

    Floats will always display 4 decimal places in Mozaic if there is a remainder.

    For fixed number display with two decimals i can offer the following trick:

      n = Round bpm * 100
    
      f = Div n, 100
      d = n-f*100
      r1 = Div d, 10
      r2 = d % 10
      LabelKnob 0, {B:},f,{.},r1,r2
    
  • @skrat Splitting is the way how i tackled the problem

  • @_ki said:
    Floats will always display 4 decimal places in Mozaic if there is a remainder.

    For fixed number display with two decimals i can offer the following trick:

      n = Round bpm * 100
      
      f = Div n, 100
      d = n-f*100
      r1 = Div d, 10
      r2 = d % 10
      LabelKnob 0, {B:},f,{.},r1,r2
    

    This is the splitting I had in my mind, thanks a lot for ready-to-use solution! :smile:

Sign In or Register to comment.