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 StoreAudiobus is the app that makes the rest of your setup better.
Moziac latch pad Help
Hello there,
I am not sure if this is the right place for this post but I was hoping to get some assistance with what I think is a pretty basic idea to achieve, but I am struggling with actually achieving it in the day or so since downloading the app
I would like to have a latchable pad that is triggered by a single SendMIDINoteOn , SendMIDICC, and/or sustain pedal (say from a bluetooth midi controller) that sends separate messages for latching and unlatching
My end goal is to use a single button to trigger “schedule loop 1” upon latching and “schedule stop” upon unlatching in the Helium AUv3 MIDI sequencer.
Any help would be appreciated
Adam
Comments
Well, latching or unlatching a pad doesn't send any midi messages, but you can do both actions separately in the code. Here's a basic example:
@wim I knew that you would probably have a useful answer, but I decided to try writing some code before refreshing the page, because when I started learning to code, I would have loved to see multiple variations of every function. And I've been getting back into writing Mozaic recently. So partially for my own practice, partially for you @GrizzlyATOM, I first wrote the main function, how I would have written it in my first month (Switch1), and then how I'd probably write it today (Switch2)...unless it was part of a larger project, then it would look more similar to wim's.
Another little design philosophy difference, I think it was @_ki who converted me to the practice of reformatting code before I share it, to remove the line breaks. The formatting of my version would have intimidated me more on day 1, but now, I prefer to read it this way, and then dissect it by constantly adding and removing my own line breaks, just to shift things around my visual field. So I don't see this as claustrophobic anymore. When the concepts become slightly more advanced, I have to read it line by line, and the line breaks trip me up.
Just a short remark: The Mozaic function
PadState <num>
returns the latchstate of a pad, so you don‘t have to store it in an own variable likeLatched
in your script.If i use that function in an
If
expression, i perfer to add brackets to make the functions parameter more visible/readable like inIf (PadState 1)
which is the same as
If (PadState 1) = TRUE
instead of
If PadState 1
which in my eyes looks like a comparison operator is missing
@_ki Thanks, I forgot about PadState. I'll use that from now on. I think it was added in an update?
I'll probably keep typing = TRUE, because I want my code to be as accessible as possible. I tried and gave up on learning to code at least three times, and now when I solve a difficult problem, I still wake up the next day with what almost feels like a hangover, or the brain equivalent of muscle soreness the day after a workout. I wonder if it's harder to code when you're only fluent in English, as I am.
Beautiful, this is exactly the kind of thing I was looking for!
Upon first upload I am unable to get it working but I am sure it is user error on my part,
Questions:
I attempted to hodgepodge together the code from the 3rd image from the user guide PDF in an attempt to more easily mirror the A and B Banks of my Akai LPD8 wireless controller. Could you help me incorporate the ideas (color scheme) from my hodgepodge into your code? It would be fantastic if the latched/unlatched pads displayed respective customizable labels.
I appreciate your speedy response and am excited to implement this into my live set up, I can post video if you’d like lol
Adam
Yes
No. C2 is note 36 in AUM. Octave naming varies in hardware and from app to app.
Also, the demo code specifies velocity 127 as the trigger. If you're really trying to do this with notes from the AUM keyboard, you probably don't want to check that value because it's not easy to get a velocity 127 from the AUM keyboard. To make it so that any note-on from the specified note will trigger, change the if clause ...
Yes. Check the section in the Mozaic manual that describes MIDI Messages to understand MIDI messages better. It's very well written. You just need to change the three bytes in the latchmsg and unlatchmsg arrays. The first number is the message type and channel. Examples:
The second number is the note or the CC number.
The third number is the note velocity or the CC value
Sustain is almost always cc 64. Values 64 and above turn it on, and Values 63 or below turn it off. So ...
You'll also need to change the if statement to check for any value greater than or equal to the CC value from the pedal.
I'm a little confused. Is this a different application that is using screen taps rather than messages from the LPD8? Or, are you wanting the LPD8 to send messages to toggle the pads? I think you'll need to choose one or the other. I don't see from the LPD manual that it can receive messages to turn the pad lights on and off. So, if you toggled a pad on using the controller, then toggled it off by touching the screen, the controller and the app would be out of sync.
It's possible that the LPD will respond to incoming midi to turn the lights on and off, but that would make for a more complicated app and routing scheme in AUM.
If you want to trigger from the LPD8, then it'll also be necessary to know the exact messages coming from the LPD8 for each pad per bank. The controller is customizable, so I can't assume what is coming from it.
I am experimenting with cutting AUM out and just running everything through AudioBus 3, so all the screen shots have AB3 as the host.
Does AB3 have the same octave naming conventions as AUM?
Thank you, this is very helpful. I am pretty new to MIDI protocol.
I am wanting to use the pads on the LPD8 to trigger the on screen toggling through Mozaic, with AudioBus as the host,
but I would also like to be able to use the sustain pedal from my LPK25 to trigger the onscreen toggling of a single pad
I don’t actually need to use screen taps on the respective toggling pads, though it would be cool to be able to do so for moments when my midi controllers aren’t handy.
I don’t actually want the lights on the LPD8 to latch along with the on screen latching, too much battery usage anyhow lol, I just need a single momentary pad to trigger the onscreen toggle pad that sends out two different cc’s (one to assign to the “schedule loop” parameter and one to assign to “schedule stop”.)
The separate specific cc’s sent out by Mozaic which will actually trigger the scheduling can be anything, as I can use MIDI-learn to assign them
This is my current standard set up for the LPD8
I mainly want to us the cc’s from the 8 pads of the A Bank, but I’m interested in being able to use the B bank pads as well.
I’d like to have it all in one instance, so in order to use the sustain pedal as a single trigger I imagine I would have to cut out one of the B bank pads to free up room for the sustain triggered toggle pad on Moziac
I’m only interested in being able to use notes as triggers as a learning exercise.
The notes assigned to the LPD8 are to control drum pads in an instance of BeatHawk, so I would like to leave those unused. That way I can switch from controlling drums to scheduling midi-loop starting /stopping easily, by holding the two buttons to change the controller to send cc’s instead of the notes that it sends on start up. Below is a screen shot of my current test AudioBus setup
I plan to get an iRig Blueboard soon, and would like to be able to use it in a similar fashion, to make it easier to control the scheduling of instances of the Helium midi loops that are controlling BeatHawk drums and BASSalicious synth bass while I play the ukulele and sing
Thank you again for your time and expertise
No, Note 36 is C1 in Audiobus.
OK then triggering from both the LPD and the screen will be fine.
Sure that's not a problem as you can configure them to whatever you want via the latchmsg and unlatchmsg array variables.
There can be other options, such as using colors rather than latching.
I would be happy to work on this, but I'm going to be traveling over the next week, so I'm not too likely to have time until I return. On the other hand, I might get some unexpected downtime. I can't say for sure.
I'd say if anyone else feels like taking this on that would be great - otherwise, I'll be happy to pick it up when my time frees up a bit.
You are both a gentleman and a scholar @wim
I completely understand and any help at all is appreciated
I am making my way through the Moziac pdf. I skipped to the chapter on MIDI messages (Understanding MIDI input) to get a better understanding of the very basics.
I am also very interested in learning to use the host’s time clock as a variable (<-yes?) to alter the function of a button.
So a button that would send a cc that normally just cues up a bass line could instead send out:
Thanks for your generous donation of your time and knowledge so far. The possibilities are so interesting
Thank you @Skyblazer, I will definitely be looking through this to try to better understand what’s actually going on here
You're welcome @GrizzlyATOM, hope it helps, looking forward to seeing what you build. The PDF should give you what you need to understand it, but I tried to rewrite it to be simpler.
And my code isn't working! @_ki, I guess I'm not understanding PadState. Switch is being called, but it's going to "else", yet when I use Log, it says PadState 0 = 0.
(Edit: Added parentheses around the PadState call, as ki suggested)
Just add the brackets like i initially suggested:
if (PadState 0) = 0
It seems the = has higher precedence than the function call - so without any brackets it computes something like
if PadState (0 = 0)
which is recalling and checking the latch state of pad 1 as (0=0) is TRUE, which equals 1.Therefore the brackets are not only better to read but mandatory around function calls with parameters.
Thanks! Added the brackets. (I think I vaguely remember you saying that not everyone calls them parentheses?)
You are right, the non-curly and non-square ones are called parentheses. Perhaps i used the term bracket because i had a british english teacher, but i think i derived it from ‚curly brackets‘ without curls
Ok, here is what I have so far, I think I figured out the basics of what’s going on.
Thank you for all of your help @Skyblazer, @wim, and @_ki!
Seriously, having two versions to compare really helped @Skyblazer.
I got it to work with 3 buttons, so I should be able to replicate what I did for the other 13 buttons
Tell me what you think? Any input is appreciated.
Hi @GrizzlyATOM - good job taking that on! Sorry, I've no time to review right now, but just a quick comment - If you edit your post to place three backticks on a line by themselves before and after the code, it'll format better on the forum. It's sometimes hard to locate the back tick with some locale settings, but you can copy/paste this: ```
Hi @GrizzlyATOM , after looking through the script i noticed that
Switch1
andSwitch2
are not called, these can be removed..
You can now either continue adding similar code for the remaining pads - or start to simplify and unify the code:
All your cases in
@OnMidiCC
and also the code inside each@ASwitch
Just differs in the CCs used - so these can be compacted into a single function taking a parameter that specifies which of the pads it should work on in combination with constant arrays containing the input CC and output CCs for each of the 16 pads..
In the below code i use the variable
pPad
as paramater to the new general@LatchSwitch
function.@OnPadDown
this variable is set to theLastPad
value specifiying which pad was pressed.@OnMidiCC
it is used as loop variable testing the current midi input for the 16 possible input CCs and then calling@LatchSwitch
for thatpPad
..
Here the full code for all 16 pads, you only need to add the constants for the remaining 13 pads, currently only the first 3 work. Hopefully i didn‘t make bigger mistakes - didn‘t test yet
I additionally simplified the code for pad colorization and added UI initialization for the main labels, unused knobs and Mozaic icon.
@_ki awesome! Thank you so much, everything seems to work great
Is there any way to play with the size of the pad labels?
From the screenshot i see there was a typo in the UI initialization part of th knobs inside
@OnLoad
- sorry, i really should have tested it at least onceInside the loop use
LabelKnob i, { }
, just remove the extra „s“ at the end of the command. This fixes the ‚visual bug‘ that there are still numbers used as knob labels and also removes the ‚3‘ above the knobs..
You can‘t change the pad label size.
The only sneaky way to cheat this limitation is to use Unicode characters, which come in a bit fatter variant in the Mathematical Alphanumeric Symbols page (1D400-1D7FF).
There are several drawback‘s
Thank you @_ki !
Now I just have to figure out why AudioBus won’t recognize the cc’s Moziac is sending out for the MIDI learn to control the loops in Helium 😅
One little step at a time lol…
EDIT: I guess it’s back to AUM as everything easily works correctly through AUM. Thanks for all your help
EDIT 2: never mind yay! I figured out how to connect Moziac to AB3’s MIDI learn. I think I’ll stick with AB3 alone after all.
@_ki is there a way to control and rotate the on screen knobs with a knob on my midi-controller?
Listen for the related MIDI events and then use SetKnobValue to set the knob to the corresponding value.
@GrizzlyATOM - you can also map to the Knob 0 ... Knob 21 AUv3 parameters. This doesn't require any coding, but is less portable because you have to map the parameters in each host / session.
Ok cool, thank you @espiegel123, What is code for grabbing that corresponding value to type into the “value” field?
I was also wondering if there was a simple way to exclude certain pads from the latch coding?
One way to accomplish this would be to add an 'if' statement (a conditional) in LatchSwitch (or alternately anywhere LatchSwitch is called) so that it only calls LatchSwitch if LastPad is in a certain range of pad numbers.
for example, along the lines of
if (LastPad>=0) and (LastPad<=11)
call @Latchswitch....
endif
The least amount of coding would put the test in LatchSwitch -- but the logic is less elegant.
@espiegel123 What is code for grabbing that corresponding value from my midi controller to type into the “value” field of Setknobvalue?
When a MIDI CC value is received, the value is in Midibyte3
here's some very basic code. There are more elegant ways to do it but this example is meant for simplicity and clarity.
Ok @espiegel123 ,
I don’t know how elegant this is, but everything seems to be in working order
@GrizzlyATOM The code looks ok.
In
@OnPadDown
you can simplify the longby ‚inverting‘ the expression - there are just two exceptions: Pad 3 and 11. So just test if the number differs from 3 AND differs from 11:
.
Another solution is to exchange the order of options tesed and use an
else
branch - this gets rid of any extra tests: