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.

Request Mozaic help midi output depend on chord input

12346

Comments

  • heshes
    edited March 2020

    Regarding doublebass variable question, we are using 'doublebass' as a toggle. It will always have a value of 0 (off) or 1 (on). Given that restriction, we know that:

       doublebass = 1 - doublebass
    

    will always make exactly the same change as:

      if doublebass = 0
         doublebass = 1
      else
         doublebass = 0
      endif
    

    So the one-line version is effectively just a short-hand version of the if-structure.

  • I will try this but first,
    I don’t see the variable note defined.
    Wasn’t it note= MIDIByte 2?

  • heshes
    edited March 2020

    'note = midibyte2' should be first line after '@OnMidiNote'.

    That line stays the same.

    You want to break the single SendMidiOut line into two lines, one right before the other.

    @OnMIDINote
    
       note = MIDIByte2    ////  ******* this line is there now
    
      /// new lines below
      if MIDIChannel > 0
        SendMidiThru
        if doublebass = 1
          note = note + 12
          SendMIDIOut MIDIByte1, note, MIDIByte3
        endif
        exit
      endif
    
    // rest of current code 
    
  • Hes, I am posting the entire script as it stands now because I have a temporary good WiFi connection. This is often not so with the pandemic and us travelers.

    @OnLoad
    // v. 0.1 Hes latest March 13
    // fixed several remaining note pairs that
    // were sounding an octave too high,
    // revised logging
    // footswitch added
    Log {CC Event Logger}

    doublebass = 0
    @END

    @OnMidiCC
    Log {CC Event Captured. }, MIDIByte2 , {. Value. }, MIDIByte3 , {. Channel }, MIDIChannel
    if MidiByte3 = 127
    doublebass = 1 - doublebass
    Log {just changed doublebass to: }, doublebass
    endif
    @END

    @OnMidiNote

    note = MIDIByte2

    /// new lines below
    log {before if}
    if MIDIChannel > 0
    log {before midithru}
    SendMidiThru
    log {before if doublebass}
    if doublebass
    log {in if doublebass}
    SendMIDIOut MIDIByte1, note + 12, MIDIByte3
    endif
    log { after if doublebass }
    exit
    endif

    @End

    // rest of current code after this
    // notes in row 3 thru 5 have values
    // ranging from 40 to 99

    // first we will determine what row and column
    // of button we're dealing with, for FLY system

    // this will give us 1 - 20, left to right

    button_col = 1 + ( div (59-(note-40)), 3)

    note = note + 1 // Free Bass to FLY adjustment

    // gives us 0 to 2, which correspond to 3 to 5 on actual bank
    temp = note % 3

    // adjust b/c only middle row of
    // the three has correct FLY note right now
    if temp = 0
    row = 0
    dec note
    elseif temp=2
    row=1
    elseif temp=1
    row=2
    inc note
    endif

    // now all 3 notes in same column have same FLY note

    // let's get the base FLY note
    note = 4 + ((button_col-1) * 7)
    note = note % 12

    // and now we need to adjust octave register
    // to be what FLY system wants
    // based on what row and column it's in

    // current note value is 0 - 11, we want to
    // add 12 to get it up to the octave 0 register
    note = note + 12

    c = button_col // just to save typing

    if row = 1 // row 4 on actual bank

     if (c < 9) or (c = 12) or (c = 14) or (c = 20) or ( c = 10)
       note = note + ( 3 * 12 )
     else
       note = note + ( 4 * 12 )
     endif
    

    elseif row = 0 // row 3 on actual bank

     note = note + 4   // base FLY chord note is up major 3rd
     // now adjust register
     // start with default of 3rd octave and adjust from there
     note = note + (3 * 12)
     if (c = 1) or (c = 3) or (c = 2) or (c = 5) or (c = 7)
        note = note - 12    // adjust down
     elseif (c = 16) or (c = 18)
        note = note + 12    // adjust up
     endif
    

    elseif row = 2 // row 5 on an actual bank

     // start with default of 3rd octave and adjust from there
     note = note + (3 * 12)
     if (c < 4) or (c = 5) or (c = 7)
        note = note - 12    // adjust down
     elseif (c = 16) or (c = 18)
        note = note + 12    // adjust up
     endif
    

    endif

    // at this point the incoming note from Free Bass system
    // has been converted to a base note for FLY system
    // which we will voice according to the rules
    // for its button row

    chordnote1 = note
    if row = 0 // row 3 on actual bank
    chordnote2 = note + 3
    elseif row = 1 // row 4 ...
    chordnote2 = note + 3
    elseif row = 2 // row 5 ...
    chordnote2 = note + 4
    endif

    if MIDICommand = 144
    log {row: }, row, { column: }, c, { turning on base note: }, chordnote1, { and note 2: }, chordnote2
    endif

    // now we send the midi for the note pair
    // if note on cmd was received this will turn on
    // if note off cmd was received this will turn off
    SendMIDIOut MIDIByte1, chordnote1, MIDIByte3
    SendMIDIOut MIDIByte1, chordnote2, MIDIByte3

    @END

  • Latest change

    OnLoad
    // v. 0.1 Hes latest March 13
    // fixed several remaining note pairs that
    // were sounding an octave too high,
    // revised logging
    // footswitch added
    Log {CC Event Logger}

    doublebass = 0
    @END

    @OnMidiCC
    Log {CC Event Captured. }, MIDIByte2 , {. Value. }, MIDIByte3 , {. Channel }, MIDIChannel
    if MidiByte3 = 127
    doublebass = 1 - doublebass
    Log {just changed doublebass to: }, doublebass
    endif
    @END

    @OnMidiNote

    note = MIDIByte2

    /// new lines below
    log {before if}
    if MIDIChannel > 0
    log {before midithru}
    SendMidiThru
    log {before if doublebass}
    if doublebass
    log {in if doublebass}
    note = note + 12
    SendMIDIOut MIDIByte1, note, MIDIByte3
    endif
    log { after if doublebass }
    exit
    endif

    @End

    // rest of current code after this
    // notes in row 3 thru 5 have values
    // ranging from 40 to 99

    // first we will determine what row and column
    // of button we're dealing with, for FLY system

    // this will give us 1 - 20, left to right

    button_col = 1 + ( div (59-(note-40)), 3)

    note = note + 1 // Free Bass to FLY adjustment

    // gives us 0 to 2, which correspond to 3 to 5 on actual bank
    temp = note % 3

    // adjust b/c only middle row of
    // the three has correct FLY note right now
    if temp = 0
    row = 0
    dec note
    elseif temp=2
    row=1
    elseif temp=1
    row=2
    inc note
    endif

    // now all 3 notes in same column have same FLY note

    // let's get the base FLY note
    note = 4 + ((button_col-1) * 7)
    note = note % 12

    // and now we need to adjust octave register
    // to be what FLY system wants
    // based on what row and column it's in

    // current note value is 0 - 11, we want to
    // add 12 to get it up to the octave 0 register
    note = note + 12

    c = button_col // just to save typing

    if row = 1 // row 4 on actual bank

     if (c < 9) or (c = 12) or (c = 14) or (c = 20) or ( c = 10)
       note = note + ( 3 * 12 )
     else
       note = note + ( 4 * 12 )
     endif
    

    elseif row = 0 // row 3 on actual bank

     note = note + 4   // base FLY chord note is up major 3rd
     // now adjust register
     // start with default of 3rd octave and adjust from there
     note = note + (3 * 12)
     if (c = 1) or (c = 3) or (c = 2) or (c = 5) or (c = 7)
        note = note - 12    // adjust down
     elseif (c = 16) or (c = 18)
        note = note + 12    // adjust up
     endif
    

    elseif row = 2 // row 5 on an actual bank

     // start with default of 3rd octave and adjust from there
     note = note + (3 * 12)
     if (c < 4) or (c = 5) or (c = 7)
        note = note - 12    // adjust down
     elseif (c = 16) or (c = 18)
        note = note + 12    // adjust up
     endif
    

    endif

    // at this point the incoming note from Free Bass system
    // has been converted to a base note for FLY system
    // which we will voice according to the rules
    // for its button row

    chordnote1 = note
    if row = 0 // row 3 on actual bank
    chordnote2 = note + 3
    elseif row = 1 // row 4 ...
    chordnote2 = note + 3
    elseif row = 2 // row 5 ...
    chordnote2 = note + 4
    endif

    if MIDICommand = 144
    log {row: }, row, { column: }, c, { turning on base note: }, chordnote1, { and note 2: }, chordnote2
    endif

    // now we send the midi for the note pair
    // if note on cmd was received this will turn on
    // if note off cmd was received this will turn off
    SendMIDIOut MIDIByte1, chordnote1, MIDIByte3
    SendMIDIOut MIDIByte1, chordnote2, MIDIByte3

    @END

  • heshes
    edited March 2020

    Take out the @END at bottom of these lines. All lines below that point should be unchanged from what they were a few days ago.

    @MidiNote
    
    note = MIDIByte2
    
    /// new lines below
    log {before if}
    if MIDIChannel > 0
    log {before midithru}
    SendMidiThru
    log {before if doublebass}
    if doublebass
    log {in if doublebass}
    note = note + 12
    SendMIDIOut MIDIByte1, note, MIDIByte3
    endif
    log { after if doublebass }
    exit
    endif
    
    @End     ////******DELETE THIS LINE
    
    //  ALL LINES BELOW HERE SHOULD BE UNCHANGED IN LAST FEW DAYS
    

    Also, you may as well change the 'if doublebass' line to read 'if doublebass = 1'. Not sure that's necessary, but it's safest way to go.

    Also, the first line you have is 'OnLoad' and it should be '@OnLoad'. Maybe that was just a select/paste error.

  • Thank you so much. I have just been testing with the MidiFlow keyboard but appears to be working now. I get the single notes or chords depending on midi channel AND the footswitch controls the extra octave note on single notes.
    I need to make just CC#69 control the doublebass now that I know what I am sending from my footswitch.
    When I change my midi channels from the MidiFlow keyboard it shoots out a CC#11, value 127 which toggles the doublebass.
    Easy to see with the logger 👍🏼
    Next I will be trying with my accordion which also sends out a lot of CC#11 data.
    Thank you so much not only for solutions but for so much you have taught me. It is very much appreciated.
    We are moving to the East coast in the morning so I will be otherwise engaged for a day or so.
    Stay safe and well ❤️
    Bruce

  • I'm holed up at home in Seattle, doing okay. Good luck with your move.

    in @OnMidiCC, try changing this line:

    if MidiByte3 = 127
    

    to this:

    if (MidiByte3 = 127) and (MidiByte2 = 69)
    

    I expect that will work. But if not then use log data to see where discrepancy is.

  • Thanks.
    Will do
    Bruce

  • Worked out perfectly.
    Thanks

  • Hi Hes,
    I finally found my way back here. Will do more testing soon.
    Bruce

  • Bruce, good, let me know any ideas you have. Sounds like right now it's working as intended, but what we've intended so far isn't something that will play very well. Maybe some well thought out shifts in mapping prompted by one (or more) foot switch toggles could improve things.

    Also, right now the app doesn't differentiate between col1 and col2 bass buttons, because with just a note value there's no way to know which column's button is being pressed. I expect there is a way to add some logic to make good predictions at whether col1 or col2 buttons are being pressed, depending on what buttons in row 3 - 5 are being used. So if it's useful we could have col1 and col2 buttons behave different in different mappings (e.g., current doubling of bass could be restricted to just col2).

    -- Herb

  • Hi Hes,
    As far as playing accordion goes having col 1 and 2 working together but separate from 3,4,5,6 is very natural and almost necessary for someone trained in Stradella.The fact that it only encompasses one octave is its largest limitation. Maybe an octave footswitch shift could be used to extend it?
    I hope to experiment some more today.
    Thanks again

  • @Bellows said:
    Hi Hes,
    As far as playing accordion goes having col 1 and 2 working together but separate from 3,4,5,6 is very natural and almost necessary for someone trained in Stradella.

    My comment was solely about col 1 and 2 working together, and not being able to differentiate between them. For example, right now the bass doubling works on both col 1 and col 2, because it's not easy to differentiate and, e.g., only apply the doubling to the root in col 2, and have col 1 be unaffected. But I think it would be possible to do that, if desired. Or maybe it's not desired for the bass doubling, but would be for some other operation. Or maybe it's just not desired at all, which is the easy route.

  • Hi Hes,
    I am sorry I have been distracted the last few days. We are in the move again and will be home in NY with in the week. However, I wanted to share with you what a friend of mine has accomplished. He has made a Roland accordion play several octaves of bass notes using only one octave of buttons.👍
    BTW, his Roland has midi out as well as midi in simultaneously. I believe we could do this with Mozaic. The general idea is if you are playing in an upwards direction of a minor or major third and the next midi note on comes before the last note midi note off the next notes will be in the higher octave. Greg-V is a friend of mine and I believe he will explain more.
    Accordion bass idea
    Greg V-Accordion
    I hope this link works.

    https://www.facebook.com/groups/383122538854846/permalink/875389666294795/

  • @Bellows, that's a clever idea. Should be easy to implement, especially if your friend has list of rules he's using to decide when to play higher octave and/or code for it in whatever software he's using.

  • McDMcD
    edited April 2020

    @hes said:
    @Bellows, that's a clever idea. Should be easy to implement, especially if your friend has list of rules he's using to decide when to play higher octave and/or code for it in whatever software he's using.

    Mozaic is perfect for these variations of the original question/problem statement:

    **make a table of the MIDI event inputs and convert to groups of MIDI event outputs
    **

    It's possible for inputs to be defined as a short list of events in a short amount of time too
    for example.

    A lot of inputs... and a lot of commands.

    REMEMBER: You can capture the MIDI from the controller and paste the event text here and someone will look it over. Show what the buttons do and what you want to see happen for each press.

  • Here is what I learned from Greg-V

    I check to see if the interval between the current bass note and the previous bass note is a minor 3rd or less or a major 6th or more - if so, I assume a run is intended - as long as each subsequent note agrees with the above - I make sure the next note that is the played is higher than the previous note - if you break the pattern - I assume no run is intended and reset the conditions looking for the start of the run again. It was very tricky because since the bass range is only an octave - depending on where you start - some notes are above and some are below the current note played -

    Very interesting is it not? 🤔👀

  • heshes
    edited April 2020

    @Bellows, not sure I understand it exactly, but you can give this a try. You will want to load it in new Mozaic project. Also, it doesn't raise octave only when previous note is held (EDIT: version below now does require held note) and it doesn't differentiate between bass notes (columns 1 and 2) and the others (cols 3 thru 6), though those will both be easy to add if this works otherwise. EDIT: Most recent version is here:
    https://gist.github.com/hsitz/ca9c80f1093b39d134a308c638524e28

  • Hes,
    Thankyou very much for your interest and work. I cannot check it at the moment because we are on the road headed home. Should reach N.Y. in a couple of days.
    Stay safe my friend,
    Bruce

  • @Bellows said:
    Hes,
    Thankyou very much for your interest and work. I cannot check it at the moment because we are on the road headed home. Should reach N.Y. in a couple of days.
    Stay safe my friend,
    Bruce

    No problem, sounds like you need to get home.

    Changed the version above to only increase the octave if you're holding a note. Doesn't matter what note you're holding, could be unrelated bass note or even note in different channel in cols 3 thru 6. But seems like it may work as desired right now if you're just doing runs on the base notes.

  • Hi Hes,
    I am at a truck stop in VA. Be home tomorrow. I did try out the script though on AudioBus using an onscreen keyboard with a monophonic output. Very cool all that you made happen with so little script.
    What works:
    I can run up the scale diatonic or chromatic using only the 11 notes and the octave increases each time I start again as intended.This means the jump for example from B3 back down to C3 also works well.

    If I play an interval such as a major fifth which is between the min/max parameters the original notes are played as intended.

    Very nicely done !

    Here is what does not work yet and and I believe it has not yet been addressed:

    What doesn’t work is the MidiNoteOffs because there are not any yet.

    Also notes always go up. Intervals going down do not work . When you play intervals that should change octaves going down the octaves still go up.

    Also, the idea of using only legato connected notes to trigger the octave changes is not in that I can see.

    🙏
    Bruce

    BTW, I made a short screen video to illustrate these actions but my Net connection will not send it yet.
    Talk to you in a couple of days

  • Hi ,
    All of the above notes were in the original script. Did not see the changes til just now
    Thanks

  • heshes
    edited April 2020

    Whoops, left out a line when I revised to only work for held notes. This will make note off work as expected:

    @OnMidiNoteOff
      dec heldcount
      sendmidithru    //   this is a new line
    @END
    

    Yes, I thought this was only for upward direction runs, when notes are held. If you don't hold a note downward intervals should have their octave registers unchanged.

    Does Greg-V's also work for downward runs? It can be done easily, but it's not clear to me how you'd want it done at the same time as having upward runs enabled. There has to be some way of signalling to the script whether your interval step down with held previous note is intended to be part of (1) an upward run, or (2) a downward run. This could be done in different ways, e.g, maybe with (1) foot switch to change from upward run to downward run, or (2) maybe if your first interval step with a held note is down then that starts a downward run, if first step with a held note is upward then that starts an upward run. That second way sounds reasonable, maybe that's how Greg-V has it set up.

  • I believe the number 2 option above is what triggers up or down. I will review the video and give Greg a shout in a day or two.
    Thanks again
    Bruce

  • Gonna sign off now but the midinoteoffs work great for the original notes. They do not turn off the higher octave notes however.
    Bruce 🎶

  • @Bellows said:
    I believe the number 2 option above is what triggers up or down. I will review the video and give Greg a shout in a day or two.
    Thanks again
    Bruce

    That makes sense, already made some changes with that approach and it seems to work naturally. Here's link to what will always be most recent version, you can go to this link and click 'Raw' button to get clean text:
    https://gist.github.com/hsitz/ca9c80f1093b39d134a308c638524e28

  • Hi Hes,
    Made it back home safely.
    The script WAS working quite well. The main problem after an octave change the note would stick.
    I redownloaded the most recent script and now it does not work at all. Unfortunately I don’t have the script before this one anymore.
    I am getting these syntax errors.
    OnMidiNoteOn] Syntax Error: unknown or invalid argument "UP"
    [OnMidiNoteOn] Syntax Error: unknown or invalid argument "(HELDCOUNT > 1)"
    [OnMidiNoteOn] Syntax Error: unknown or invalid argument "HELDCOUNT"

    The script I am using is this one.

    https://gist.github.com/hsitz/ca9c80f1093b39d134a308c638524e28

    Thanks,
    Bruce

  • heshes
    edited April 2020

    @bellows, that version works for me with no errors. I can only think there's some kind of copy paste issue. The change in this version was to have downward runs as well as upward, works for me using virtual keyboard in AUM. Possibly still has stuck note problem if previous version did, but I haven't noticed it yet.

  • Hi Hes,
    Thank you for your patience. I redownloaded AudioBus and AUM as well as reloaded your script both as text and raw.
    I will use AUM and try to duplicate your set up so we are on an even field. I am not very familiar with AUM so I may need some help. I am attaching 2 pics to show how I set up AUM. I would like to match your set up. What app are you using as a destination?

Sign In or Register to comment.