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.

Foot switch send midi note increments

Hi Folks,
I have received a great deal of help from this forum and I thank you.
Here is what I would like to accomplish.
I am using an AirTurn BT 2006 foot switch bank to send wireless Bluetooth to Audiobus. It can send most any midi message. It has 6 switches.
I am using the Hammond B-X3 in AB. I have mapped in some controls and it works great. I am using a script from Ki to remap some of the midi channels and it also works great.
The Hammond app has some drawbar configurations that respond to midi note inputs.
I can switch them properly by sending a midi note from a foot switch. The upper manual has 12 of these configurations per preset.If I could access 3 or 4 of them with one foot switch that would be very helpful.
What I would like to do is use ONE foot switch to access these configurations.
I could do this by repeatedly tapping on The foot switch and increment a midi note on each tap.
Perhaps they could recycle back to the first one after the last tap.
Or perhaps a long press would reset to the first configuration.
Does this make sense?
Without the specifics I am trying to tap a foot switch multiple times and each tap should increment the midi note out by one on each tap.
Thanks folks

«13

Comments

  • edited August 2020

    This is a good idea. It would be easy to do in StreamByter:

    • Use a variable to remember the current note value.
    • Detect the CC from the switch and increment the note, wrapping around.
    • Send a Note On, followed by a delayed Note Off.
      The note messages would be sent on the MIDI channel the instrument expects. It wouldn't see the CC from the switch at all.

    You might look on the SteeamByter forum https://audeonic.boards.net/board/10/stream-byter to see if it's already been done, but it should be pretty simple to do exactly what you need.

  • A Mozaic script would be easy to do as well. For someone else to write it for you, you'd need to be specific about exactly what you want it to do. It would also be necessary to have details about the midi messages output by the pedal switch that you want to press.

  • Thankyou both for your input. I would like to use Mozaic because I am trying to learn it even though it is complex. I am using Ki’s Midi Matrix Switch v10a already with the Hammond. It is very much overkill but does what I want. Channel 1 to 1, channel 2 to 3, and channel 3 to 3.
    I was not able to cull just these functions out of the Midi Matrix Switch even though I thought I could find them.

    If I could add the foot switch programming to the Matrix Script it would be ideal in the end.

    I would like to try the new footswitch programming by itself until proven.

    My footswitch can send almost any midi message but I will pick Channel 1, note on #24 (C),
    Velocity 127 as a convenient trigger followed by the same note off. I know this works already.

    The first press will send the same as the trigger, note #24 (C)
    The second press should send the same parameters except note on #25 (C#)
    The third press Should send the same parameters except note on #26 (D)
    The fourth press should send the same parameters except note #27 (D#)
    The fifth press should send the same as the 1st press returning to note #24 (C)

    I know it is always more complicated than it looks to me. I would consider it a plus if it was simple enough for me to understand so I could modify it when desired. Only after I played with it and refined my own desires would it be good to make it more efficient.
    Are you interested in writing it for me or at least pointing me in the right direction?
    Thanks

  • Hi,
    This Data was generated by pressing 4 separate switches. I wish to do it with 4 presses of 1 switch.

  • I forgot to add. At the moment these switches are sending two messages each. They can send three maximum. Pretty cool footswitch setup.

  • wimwim
    edited August 2020

    @Bellows said:
    Thankyou both for your input. I would like to use Mozaic because I am trying to learn it even though it is complex. I am using Ki’s Midi Matrix Switch v10a already with the Hammond. It is very much overkill but does what I want. Channel 1 to 1, channel 2 to 3, and channel 3 to 3.
    I was not able to cull just these functions out of the Midi Matrix Switch even though I thought I could find them.

    If I could add the foot switch programming to the Matrix Script it would be ideal in the end.

    I would like to try the new footswitch programming by itself until proven.

    My footswitch can send almost any midi message but I will pick Channel 1, note on #24 (C),
    Velocity 127 as a convenient trigger followed by the same note off. I know this works already.

    The first press will send the same as the trigger, note #24 (C)
    The second press should send the same parameters except note on #25 (C#)
    The third press Should send the same parameters except note on #26 (D)
    The fourth press should send the same parameters except note #27 (D#)
    The fifth press should send the same as the 1st press returning to note #24 (C)

    I know it is always more complicated than it looks to me. I would consider it a plus if it was simple enough for me to understand so I could modify it when desired. Only after I played with it and refined my own desires would it be good to make it more efficient.
    Are you interested in writing it for me or at least pointing me in the right direction?
    Thanks

    Sure, I think can write something simple and clear enough for you to modify and extend. I'll get back to you in a bit.

    On a side note, I'm working on a script that will be configurable without any programming and will be able to do lots more than this, but it's probably a week or two from being finished. It's being written with the iRig BlueBoard in mind, but will be able to work with any foot switch.

  • That output is kind of odd. Each foot press sends a CC and Note. But, I guess it doesn't matter. The script can just ignore the CC's.

    @Bellows said:
    Hi,
    This Data was generated by pressing 4 separate switches. I wish to do it with 4 presses of 1 switch.

  • @wim said:

    >

    On a side note, I'm working on a script that will be configurable without any programming and will be able to do lots more than this, but it's probably a week or two from being finished. It's being written with the iRig BlueBoard in mind, but will be able to work with any foot switch.

    Very cool. Best of luck with it. If you need a beta tester let me know. Nothing is foolproof to a sufficiently talented fool. 🤣

  • Here's something that should work @Bellows. Please let me know if you have questions or find it doesn't work as expected.

    @OnLoad
    
      // This is the incoming note and channel from the footswitch
      // 0 = MIDI channel 1
      noteIn = 24
      channelIn = 0
    
      // The channel (0-15) to send midi notes out on.
      channelOut = 0
    
      // List the notes to send out separated by commas. Leave -1 at the end
      // of the sequence to mark the end of the sequence
      notesOut = [24, 25, 26, 27, -1]
    
      counter = -1
    @End
    
    @OnMidiNoteOn
      if (MIDIChannel = channelIn) and (MIDINote = noteIn)
    
        if notesOut[counter+1] = -1
          counter = 0
        else
          Inc counter
        endif
    
        SendMIDINoteOn channelOut, notesOut[counter], 127
    
      else
        // Comment out the next line if you want to block other notes
        SendMIDIThru   
      endif
    @End
    
    @OnMidiNoteOff
      if (MIDIChannel = channelIn) and (MIDINote = NoteIn)
        SendMIDINoteOff channelOut, notesOut[counter], 0
      else
        //Comment out the next line if you want to block other notes
        SendMIDIThru
      endif
    @End
    
    @OnMidiInput
      // 0x90 and 0x80 are already handled by @OnMidiNoteOn and @OnMidiNoteOff
      if MIDICommand <> 0x90 and MIDICommand <> 0x80
        //Comment out the next line if you want to block CC's and other messages
        SendMIDIThru 
      endif
    @End
    
  • Thank you so very much wim.
    It works exactly as expected. Nice job!👍
    Even better, I can understand most of it.
    I am learning a lot from this.
    It is the middle of the night here now but tomorrow I will try to combine it with the MidiMatrix switch.

  • I am starting to look at combining this script to run with Ki’s Midi Matrix Switch v10a .
    Any suggestions as how to approach this would be appreciated.
    Good luck with your switching script.
    Thanks so much for your help.
    I think I will contact Ki about just using the small functionality I use from his script.👀

  • _ki_ki
    edited August 2020

    i‘m already listening :)
    The forum is just a small world...

    Perhaps describe the whole setup that you use the MMS script in, how is it configured ?
    And what exactly do you want to archieve - maybe a simpler, tailored script would be easier than to adapt the complex one.

    On this topic i only learned that you want to use a footcontroller to change settings of the MMS , right ?

    But 1 o 1, 2 to 3, and 3 to 3 is just a single mms setting - what are the incremented notes for ? Are these Rozeta pattern change notes ?

  • Hi Ki,
    Thanks for being here.
    I am using AudioBus for live performance. My controller is a Roland V-Accordion. It has basically three separate sections that each have a selectable midi channel as well as many parameters. I use the V-accordion and 6 switch footswitch for several apps in AB.

    I am using the Midi Matrix switch for only one app, the Hammond B-3X organ. The B-3X organ also has three midi channel inputs that apply to three sections (upper keyboard, lower keyboard and bass pedals). However they don’t line up well with my accordion channels.

    This is how I use the Midi Matrix

    Send channel 1 from my controller to channel 1 In the Hammond B-3X app
    Send channels 2 and 3 from my controller to channel 3 in the Hammond B-3X app

    It sounds so simple but I could not accomplish it other ways so the Matrix worked out fine.
    I tried to cull out only what I needed but could not understand your app well enough to do so.
    I also tried to write a script combining what I needed from scratch but was unsuccessful 😢

    The footswitch is a separate issue but used with the same gear and the Hammond B-3X app.
    It is changing parameters that can only be changed by midi note signals in the Hammond app.
    There are actually 24 of these configurations, 12 on 1 channel (upper keyboard) and 12 on another channel ( lower keyboard). This is too many for me to address while performing so I decided to just pick 4 to use at least at this time.

    I programmed my footswitch to test the idea and it worked fine sending midi note data (as well as other data when not playing the Hammond app). The midi notes sent are beyond the range used in my other apps and so are silent.

    The script wim wrote is for the purpose of not dedicating 4 foot switches to this but to use only one. It works great.

    Sorry for being so long winded.
    As always I appreciate your help greatly 🙏

  • _ki_ki
    edited August 2020

    So channel 2 is the only one re-directed (since 1 goes to 1 and 3 to 3) and you don‘t need to switch settings - then this should be enough as script:

    @OnMidiInput
      if MIDIChannel = 1
        SendMIDIThruOnCh 2
      else
        SendMIDIThru
      endif
    @End 
    

    Internally channels are numbered from 0 to 15, thats why the if test is versus 1 and not two - and also why in that case the redirection is to channel 2 instead of three

    There is no GUI, no setting just a static redirection.

    If you want to at least state in the GUI what the script is about, add the following code:

    @Description
    Redirects midi of input channel 2 to channel 3.
    All other channels pass through unmodified
    @End 
    
    @OnLoad
      ShowLayout 4          // Show description layout
      SetShortName {Map2>3} // Set AUM Icon name
      LabelKnobs { }        // Setup a clean GUI, clear labels and knob positions
      for knob = 0 to 3
        LabelKnob knob, { }  
        SetKnobValue knob, 0
      endfor
    @End
    
  • Thank you so very much Ki.
    This script worked perfectly and is what I needed for this portion.
    Also the added note about counting from zero was most helpful. I knew that but forgot it 🙄
    Also as with wim’s it is simple enough for me to understand to modify.
    In fact I will attempt to combine them now.
    Wish me luck.

    PS Mozaic is so powerful and versatile the simplest things are sometimes hard to figure out. As is normal for programming there are an infinite number of ways to make it work.
    Also an infinite +++ ways to do it wrong....🤪

  • Piece of cake with all your help.🙏
    I combined the two scripts and it worked the first time through👀
    You both have given me more confidence and a great starting point to build on when I need it.
    Thank you.

  • Wim,
    Let me know when you finish your blue board switching.
    I bet you have some interesting ideas.
    I’ll be on the lookout for it.

  • wimwim
    edited August 2020

    Sure, I've book marked this thread so that I remember to come back to it when ready for testing my new script. I'm glad you've gotten your setup working. I'm getting a kick out of picturing you ripping out Keith Emerson style B3 solos played with an accordion. B)

  • edited August 2020

    I thought I had it but it must of got lost somewhere down the line...
    Not working now. Here is my latest attempt to put ki’s script inside of wims.
    The foot switches still work but channel 2 does not go to channel 3
    The script above this is the same that wim wrote.

    @OnMidiInput

    if MIDIChannel = 1. //added from kis script
    SendMIDIThruOnCh 2. // added from kis script
    endif. //added from kis script

    // 0x90 and 0x80 are already handled by @OnMidiNoteOn and @OnMidiNoteOff
    if MIDICommand <> 0x90 and MIDICommand <> 0x80
    //Comment out the next line if you want to block CC's and other messages
    SendMIDIThru
    endif
    @end

    @End

    I am sure there is a rule broken here but I have been looking for it all day.
    Any help appreciated.

  • I suspect that the SendMIDIThru's in @wim 's script are stealing the notes before they reach your channel changer. He could suggest the best way to combine the two functions.

  • wimwim
    edited August 2020

    @Bellows - the "." before the comments in the first if statement should be causing an error and causing that condition not to execute. You should see these errors in the log. Actually, the . after the numbers is harmless because it's valid for a number, but the . after endif will cause an error:

    [OnMidiInput] Syntax Error: missing -1 closure(s) (endif, endfor, endwhile)
    

    Also, the notes will be processed twice. Once in the @OnMidiInput event, then again without the channel change in the @OnMidiNoteOn and @OnMidiNoteOff sections. You'll want to comment out the SendMIDIThru statements in those sections.

    I need to do something else for a bit, but will post a version I think will work shortly.

  • wimwim
    edited August 2020

    Here you go @Bellows.

    @OnLoad
    
      // This is the incoming note and channel from the footswitch
      // 0 = MIDI channel 1
      noteIn = 24
      channelIn = 0
    
      // The channel (0-15) to send midi notes out on.
      channelOut = 0
    
      // List the notes to send out separated by commas. Leave -1 at the end
      // of the sequence to mark the end of the sequence
      notesOut = [24, 25, 26, 27, -1]
    
      counter = -1
    @End
    
    @OnMidiNoteOn
      if (MIDIChannel = channelIn) and (MIDINote = noteIn)
    
        if notesOut[counter+1] = -1
          counter = 0
        else
          Inc counter
        endif
    
        SendMIDINoteOn channelOut, notesOut[counter], 127
    
      elseif MIDIChannel = 1
        SendMIDIThruOnCh 2
    
      else
        //Comment out the next line if you want to block notes on other channels
        SendMIDIThru 
      endif
    
    @End
    
    @OnMidiNoteOff
      if (MIDIChannel = channelIn) and (MIDINote = NoteIn)
        SendMIDINoteOff channelOut, notesOut[counter], 0
    
      elseif MIDIChannel = 1
        SendMIDIThruOnCh 2
    
      else
        //Comment out the next line if you want to block notes on other channels
        SendMIDIThru
      endif
    @End
    
    @OnMidiInput
    
      // 0x90 and 0x80 are already handled by @OnMidiNoteOn and @OnMidiNoteOff
      // so it's important not to duplicate here.
    
      if MIDICommand <> 0x90 and MIDICommand <> 0x80
        //Comment out the next line if you want to block CC's and other messages
        //Or, just delete the whole @OnMidiInput section.
        SendMIDIThru 
      endif
    
    @End
    
  • @Bellows

    It's important to understand the relationship between @OnMidiInput and the other events such as @OnMidiNoteOn, @OnMIDICC, etc.

    @OnMIDIInput processes all midi input. The other events process only subsets of midi events. So, if you do something in @OnMIDIInput you have to be careful not to repeat it in another event. In your case, if you didn't have the bug with the "." causing that if statement not to execute, midi notes would have been processed twice.

    This is why, since I placed code in the @OnMidiNoteOn and @OnMidiNoteOff events, I needed to exclude those from the @OnMidiInput section. 0x90 is a midi note ON command and 0x80 is midi note off. So, the if MIDICommand <> 0x90 and MIDICommand <> 0x80 statement is needed to make sure that notes aren't doubled up.

    If you don't want other MIDI commands such as CC's, sustain pedal, and program change to pass through, the whole @OnMidiInput event can be eliminated from the script. It's only in there in case you don't want to block other stuff.

    When you post code to the forum you can place three "`" marks on a line by themselves before and after the script. This will make it format as a code block and stop the forum software from interpreting special characters and doing weird formatting things.

  • Thanks for all your time and hard work wim.
    “.” were artifacts from cut and paste. I had forgotten about using the 3 quote marks.
    I am going to try your new code shortly. If it works I will use your description to understand it.

  • Just tried it out wim and so far 👍
    After I get tired of shredding (later) I will dig deep in your comments to understand this.
    Thank you so much.
    You are much appreciated.❤️🎶

  • wimwim
    edited August 2020

    Any time. Glad it helped. Scripting takes a bit to learn the basics, but you'll catch on.

  • Hi Wim,
    How are you doing?
    I am hoping you can show me how to make a modification to this script.
    The notes generated from channel 0 (notes 24,25,26,27) and sent out on channel 0 I would also like to send out on channel 3.
    This would make the drawbar configurations for both the upper and lower manuals change with each footswitch activation.
    Thanks, Bruce
    PS How is your footswitch script coming along?

  • Hi Wim,
    I added the “2” in this line in @OnLoad

    channelOut = 0, 2 //added 2 to send note to lower manual.

    I was hoping this would send the notes out on channel 2 as well as channel 0.
    It did not work. I put a midi monitor on the Mozaic output and channel 2 outputs note 24 every time the input note 24 from the footswitch is pressed.
    In other words, channel 0 increments properly but channel 2 does not increment at all.
    BTW, it does work in the Hammond app but will only change to the configuration for note 24.
    Your help is greatly appreciated.

  • wimwim
    edited September 2020

    Hi @Bellows,

    Summary:

    • change channelOut = 0, 2 to channelOut = [0, 2]
    • change SendMIDINoteOn channelOut, notesOut[counter], 127 to
    SendMIDINoteOn channelOut[0], notesOut[counter], 127
    SendMIDINoteOn channelOut[1], notesOut[counter], 127, 2 //slight delay to help some hosts
    
    • change SendMIDINoteOff channelOut, notesOut[counter], 0 to
    SendMIDINoteOff channelOut[0], notesOut[counter], 0
    SendMIDINoteOff channelOut[1], notesOut[counter], 0, 2 //slight delay to help some hosts
    
    • you're already sending notes from MIDI Channel 2 thru on MIDI Channel 3. Do you still want this behavior? If not, comment out the two SendMIDIThruOnCh 2 lines.

    Explanation:

    • channelOut = 0,2 is a syntax error. The values in an array need to be surrounded by brackets. This should have been shown in the log, which is always a good thing to check when things don't work as expected.
    • To refer to the contents of an array in Mozaic, you give the name of the variable followed by the position in the array, counting from zero. So, to print out those values for example: log {channelOut values = }, channelOut[0], {, }, channelOut[1] would print channelOut values = 0, 2.
    • If you refer to an array by only its name, you get only the first value. So, log {channelOut = }, channelOut would print channelOut = 0
    • Because of this, just changing the variable isn't enough as the existing commands sending the notes will only pick up the first value. So a separate command is needed for each value.
    • Some hosts may lose notes if they get too many at exactly the same time, so as a precaution I added a small delay to the second note. You may not need this, but 2ms isn't going to be noticeable so it's a good practice.
  • wimwim
    edited September 2020

    @Bellows said:
    Hi Wim,
    How are you doing?
    ...
    Thanks, Bruce
    PS How is your footswitch script coming along?

    Hi Bruce, thanks I'm doing fine. The world is a ghostly orange ocean of smoke and fog from the California wildfires, but thankfully we are in no way threatened.

    The BlueBoard script got set aside for several weeks while I took a break and then got massively distracted by miRack. But I picked it up again a few days ago. It's been through a couple of major redesigns due to things I've since learned people want. No timeline on competition at this time though.

    I can say that it would be able to handle your scenario above without the need for modifying code though. ;)

    cheers,
    Mike

Sign In or Register to comment.