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.

Request new Mozaic Scripts *HERE*

15657585961

Comments

  • With sustain you will also be holding any future notes.
    @HotStrange The sostenuto script seems to be functional.
    You can use the sustain pedal to activate it, you can also use pb up.

  • @Alfred said:
    With sustain you will also be holding any future notes.
    @HotStrange The sostenuto script seems to be functional.
    You can use the sustain pedal to activate it, you can also use pb up.

    Right I realize. I don’t have a working midi controller atm nor do I have or use a sustain pedal period. So that doesn’t really work for me, as mentioned earlier.

    Also the point is to hold all notes. I’m using it for drones so want it to hold all notes played. It’s not really a matter of it being functional, I never insinuated it wasn’t.

  • edited September 2023

    @HotStrange I guess you are using the build in keyboard in Aum.
    Maybe you could use velocity keyboard, wich has a sustain button.

  • @HotStrange said:

    @McD said:

    @wim said:

    @HotStrange said:
    Is there a Moziac script for latching a note? I know there’s a Sustenuto script but it requires separate routings of CC or a pedal. I’m looking for one that simply latches the notes you play and let’s them drone on.

    How would the notes eventually get turned off? It's bad, bad juju to leave hanging notes forever.

    One option is to “off” a latched note when a new note on arrives. This creates a continuous stream of single latched notes.

    Another option is to Hold a specific note until that note arrives the 2nd time. This is the toggle behavior that the AUM keyboard exhibits when HOLD is enabled. But the AUM keyboard provides a visual clue which notes might need to be turned off and a Mozaic script would make you remember so this could be a nightmare option.

    I was updated probably add a MIDI Panic enable by some extreme note rarely used to turn off all notes.

    The second option is exactly what I had in mind but without any indication of the last note played it’ll be a chore to turn them off. Midi panic could definitely work. But since it’ll mostly be for a single drone hopefully it wouldn’t be too hard to remember the note that pressed 😂

    Doesn’t seem to be any solutions though. There’s one for Streambyter but it’s been hit and miss with me.

    What is the problem with the streambyter script. If you already have a script that mostly works, fixing it is probably simple.

    What you want would be simple in either streambyter or Mozaic. You need to specify details like how the script should now when to release the held notes.

  • It seems to me that maybe solving this one with Mozaic is as simple as sending Sustain On/Off on a pad press. If I understand what's needed correctly.

  • @Alfred said:
    With sustain you will also be holding any future notes.

    I think that's what is wanted. But maybe I'm misunderstanding.

  • GREETINGS:
    Hello WIM, Hope you are well. First of all thank you for the SustainNuto code you wrote for me. It’s been doing wonders.
    I come this time to request another code I’ve been wrapping my head around. I was trying to modify without success the code that I will reference down here, that basically let’s you select either the lower or the higher notes of any chord you play.

    LIMITATIONS:
    Now… there are this SWAM plugins that models Violins, Cellos, etc. but this models are prepared like in real world to play only 2 notes at maximum at the same time. And the main mode of the instrument allows to play only one note glding and sliding whenever you play a second note at the same time.

    REQUEST:
    I was wondering if it would be possible to expand the code to allow to select the 1st or 2nd or 3rd or… etc, etc… until the 6th or the 8th note position of any chord and filter out the rest of the notes. And maybe allow the code to select simultaneously like the 2nd and the 5th note of a specific chord to get advantage of the plugin capacity to play up to 2 notes at the same time.
    Another observation is that in some cases it would be VERY useful to allow the code to select the 1st, 2nd, 3rd… 8th highest note on a chord, but also there would be a mode to allow to select the 1st, 2nd, 3rd… 8th lowest note, in order to allow a bass plugin. In that way I could play arpegios on the high notes while holding the funky lowest notes.

    It would be useful too if you could incorporate a note on note off velocity UP and LOW remaping knob feature, because the slide speed on the plugin depends on note-on note-off velocities, and sometimes I want to minimize them.

    PURPOSE:
    You see, I managed to make some kind of Strings ensemble with multiple SWAM plugins, but I had to make several key splits and multiple instances of the low and or high note code. And at the end it only works of one specific song. For other songs I have to take different approaches and combinations of key ranges to make it barely work. With this (possible in the future) code everything would be way simpler to implement and to play too

    EXAMPLE CODE:

    There is this one which is the one use and the one I was trying to modify with my poor programing skills, this one works very cool because when I hit single notes it stops holding the other old lower or higher notes so it allows me to play arpegios.
    https://patchstorage.com/mononotepriority/

    There is this one
    https://patchstorage.com/force-monophonic/

    This one I haven’t tested yet for some reason… Looks cool but more complex to implement in my ensemble setup. This could be a good basis to check how they choose the note positions on a chord.
    https://patchstorage.com/smart-chord-bass/

    NOTE: Remember that my case is simpler and at this moment I don’t want the plugin to detect if it is an inversion or a root, just select the positions and filter the rest

    Once again, thank you very much in advance ethier if this is possible or not. Thanks for all the good plugins you put out.

  • wimwim
    edited September 2023

    Hi @jjpl2001 - thanks for the very clear and thorough description of what you would like.

    Unfortunately my first thoughts are that this isn't very practical in Mozaic without some way of signaling to the script, such as with a sustain pedal or pad press, that a chord is "complete" and to take action.

    Detecting a completed chord live in Mozaic is problematic. One can't know when the notes of a chord that may arrive at slightly different times are all present without waiting for some timeout period. This wait would introduce latency. When you play a chord, a series of Note-ON messages are received, but they normally won't all arrive at exactly the same time. The script has no way of knowing when all the notes have arrived. Also sometimes notes can be held between two chords and that notes or even whole chords can overlap other chords.

    This type of request comes up often and each time I can never visualize a way to implement it. Others have tried as well, but there are always tradeoffs. @_ki made the most ambitious attempt (I think Smart Chord Bass is the script). @_ki is a far better programmer than me, so maybe he found some tricks I don't know of. But to me, this is a challenge I don't think Mozaic is suited to overcoming reliably.

    That said, if there was some signal, such as Sustain Pedal being held down, that would tell the script to collect the notes of a chord, and released to tell it all notes have arrived, then it seems like it could be possible implement your ideas, at least so far as I've understood them after a cursory read.

    Of course, if someone else reading this is inspired, maybe they could implement it in some way that I don't see.

  • @wim said:
    Hi @jjpl2001 - thanks for the very clear and thorough description of what you would like.

    Unfortunately my first thoughts are that this isn't very practical in Mozaic without some way of signaling to the script, such as with a sustain pedal or pad press, that a chord is "complete" and to take action.

    Detecting a completed chord live in Mozaic is problematic. One can't know when the notes of a chord that may arrive at slightly different times are all present without waiting for some timeout period. This wait would introduce latency. When you play a chord, a series of Note-ON messages are received, but they normally won't all arrive at exactly the same time. The script has no way of knowing when all the notes have arrived. Also sometimes notes can be held between two chords and that notes or even whole chords can overlap other chords.

    This type of request comes up often and each time I can never visualize a way to implement it. Others have tried as well, but there are always tradeoffs. @_ki made the most ambitious attempt (I think Smart Chord Bass is the script). @_ki is a far better programmer than me, so maybe he found some tricks I don't know of. But to me, this is a challenge I don't think Mozaic is suited to overcoming reliably.

    That said, if there was some signal, such as Sustain Pedal being held down, that would tell the script to collect the notes of a chord, and released to tell it all notes have arrived, then it seems like it could be possible implement your ideas, at least so far as I've understood them after a cursory read.

    Of course, if someone else reading this is inspired, maybe they could implement it in some way that I don't see.

    Thank you for your answer. I knew that this is kind of complicated to implement as it might lead to many many conditionals, etc.

    As far as I’ve seen, MonoNotePriority makes some kind of simpler prioritizing over the notes arriving, like:

    If high lower note priority is selected Then:
    1st note? = send ti.
    A 2nd note? If higher pass, if lower then send it.
    A 3rd note? If higher than previous second then pass, if lower than previous, then send it, and so on.

    Now what I noticed that the algorithm, if the sustain is activated, kind of bypasses momentarily the sustain pedal to kill any higher note previously held then activates again the sustain on that note.

    If you play random notes then it starts to check every time a new note arrives, if lower than previously, then kill all other and held or sustain the lower one. It still let pass very shortly the previous notes, but keeps killing the higher notes while allowing to stay the lower and lower notes arriving.

    Now I understand that it becomes kind of tricky when one want to make the algorythm select the 2nd notes, because you need to keep like some kind of array constantly checking all notes that are pressed to see which one is the second. It would be good to introduce a very small latency as a knob or something like that….

    Ok. I know I know… it’s getting complicated xD. thanks in any case. I will see if I can come up with something in near future

  • @jjpl2001 said:

    Now I understand that it becomes kind of tricky when one want to make the algorythm select the 2nd notes, because you need to keep like some kind of array constantly checking all notes that are pressed to see which one is the second. It would be good to introduce a very small latency as a knob or something like that….

    Ok. I know I know… it’s getting complicated xD. thanks in any case. I will see if I can come up with something in near future

    Thanks for listening. I'm glad I was able to explain it in a way that made some sense.

    My mental makeup just won't let me work on scripts that require fudge factors or that might not work consistently under all scenarios. The only way I would want to work with detecting chords live is if the user defined exactly when the chord begins and ends. Kind of like, "OK, there's my chord, now act on it according to the setting of the knobs." Then, "Alright, now we're starting input of a new chord ...".

    tbh, I think I would sooner work with two keyboards for this kind of playing. I'd play the notes I want sustained on one and the notes I wan't arpeggiated on another. Maybe using KB1 with one keyboard row routed through the arp and one not. I would go to the trouble to set up separate hardware devices if not using the screen. But that's just me.

  • @jjpl2001 said:
    As far as I’ve seen, MonoNotePriority makes some kind of simpler prioritizing over the notes arriving, like:
    If high lower note priority is selected Then:
    1st note? = send ti.
    A 2nd note? If higher pass, if lower then send it.
    A 3rd note? If higher than previous second then pass, if lower than previous, then send it, and so on.

    This simple algorythm will run into problems not only with percussive sounds, but also with some synth. If you press several notes at the same time or within maybe 3msec (which you can‘t prevent with normal mechanical keyboards), the first note is acutally payed and send to the synth/instrument. Then 3msec later, a note-off will be send for the first note. For percussive sounds, not only their start but also their release phase will be audible resulting in a glitch of two notes that can be heared. For percussive sounds, their startphase has the most harmonics, so this is really an anoying problem. And there are also synth that will just click since they don‘t like such super-short note on/off combinations, even when used with longer attacks.

    .

    To check for the lowest note, you need to store all incoming notes and in a parallel timer thread analyse the stored notes if a ‚grace‘ time run out and when the grace time is reached send the Note-On out the lowest of them. As a side-effect this will delay all issued notes by the grace time.

    .

    That‘s how Smart-Chord-Bass solves this problem without creating clicks with percussive sounds.

    In my most complex Multi-Divisi script i perfected that store & process-later handling, as i didn‘t want to introduce any ‚lag‘ when played from a sequencer with chords arriving in the same time-frame (ie same msec in SystemTime, but the notes still arrive in destinct, separated OnNoteOn events). It took several tricks and month of testing to make it work lag-free in 97% of the time. The wait-default for MuliDivis is 0msec, output notes are issued in the same midi-processing-timeslot of Mozaic as the incomming notes - one only needs to raise the scripts grace-time for manual playing :)

  • @wim said:
    It seems to me that maybe solving this one with Mozaic is as simple as sending Sustain On/Off on a pad press. If I understand what's needed correctly.

    Exactly. I just want a script to sustain/latch whatever note(s) played and turn off by touching the same note again.

  • @espiegel123 said:

    @HotStrange said:

    @McD said:

    @wim said:

    @HotStrange said:
    Is there a Moziac script for latching a note? I know there’s a Sustenuto script but it requires separate routings of CC or a pedal. I’m looking for one that simply latches the notes you play and let’s them drone on.

    How would the notes eventually get turned off? It's bad, bad juju to leave hanging notes forever.

    One option is to “off” a latched note when a new note on arrives. This creates a continuous stream of single latched notes.

    Another option is to Hold a specific note until that note arrives the 2nd time. This is the toggle behavior that the AUM keyboard exhibits when HOLD is enabled. But the AUM keyboard provides a visual clue which notes might need to be turned off and a Mozaic script would make you remember so this could be a nightmare option.

    I was updated probably add a MIDI Panic enable by some extreme note rarely used to turn off all notes.

    The second option is exactly what I had in mind but without any indication of the last note played it’ll be a chore to turn them off. Midi panic could definitely work. But since it’ll mostly be for a single drone hopefully it wouldn’t be too hard to remember the note that pressed 😂

    Doesn’t seem to be any solutions though. There’s one for Streambyter but it’s been hit and miss with me.

    What is the problem with the streambyter script. If you already have a script that mostly works, fixing it is probably simple.

    What you want would be simple in either streambyter or Mozaic. You need to specify details like how the script should now when to release the held notes.

    I’m not at all privy to coding, even simple stuff. And as I mentioned the Streambyter script seems to be hit and miss as to when it will work or not. Not sure why, usually reloading it works but this requires uploading the code all over again every time and even then it sometimes has issues.

    I thought this thread was for requesting or trying to find Moziac scripts so that’s what I’m doing, am I wrong? Or not following the rules correctly?

    As far as specifics I just want to be able to press a note or notes and have them latched until the same note(s) is pressed again to turn it off.

  • wimwim
    edited September 2023

    @HotStrange said:

    @wim said:
    It seems to me that maybe solving this one with Mozaic is as simple as sending Sustain On/Off on a pad press. If I understand what's needed correctly.

    Exactly. I just want a script to sustain/latch whatever note(s) played and turn off by touching the same note again.

    Ahh. OK, now it's clear what you need. Sometimes it's difficult to understand right off from someone's initial description of what's needed. That's the reason for all the questions ... to help draw out the details. If we don't do that then the resulting solution will be off the mark.

    I can easily write a script to do what you want. I can also include a button to stop any remaining playing notes if needed. The problem with doing this in Mozaic is there's no keyboard that would help visualize which notes are playing. You'll have to mentally keep track of that.

    That said, KB-1's latch mode does exactly what you've described, while providing helpful visual feedback. Might be a better solution if you're open to it.

  • @wim said:

    @HotStrange said:

    @wim said:
    It seems to me that maybe solving this one with Mozaic is as simple as sending Sustain On/Off on a pad press. If I understand what's needed correctly.

    Exactly. I just want a script to sustain/latch whatever note(s) played and turn off by touching the same note again.

    Ahh. OK, now it's clear what you need. Sometimes it's difficult to understand right off from someone's initial description of what's needed. That's the reason for all the questions ... to help draw out the details. If we don't do that then the resulting solution will be off the mark.

    I can easily write a script to do what you want. I can also include a button to stop any remaining playing notes if needed. The problem with doing this in Mozaic is there's no keyboard that would help visualize which notes are playing. You'll have to mentally keep track of that.

    That said, KB-1's latch mode does exactly what you've described, while providing helpful visual feedback. Might be a better solution if you're open to it.

    Ah yeah you’re right. I could probably keep track of the notes but I wouldn’t want to waste someone’s time if it sends up not work. I generally use Xequence Keys and Velocity Keyboard but they both lack proper latch modes unfortunately. Should’ve picked up KB-1 while it was on sale but as usual I convinced myself to wait 😂

  • @_ki said:

    @jjpl2001 said:
    As far as I’ve seen, MonoNotePriority makes some kind of simpler prioritizing over the notes arriving, like:
    If high lower note priority is selected Then:
    1st note? = send ti.
    A 2nd note? If higher pass, if lower then send it.
    A 3rd note? If higher than previous second then pass, if lower than previous, then send it, and so on.

    This simple algorythm will run into problems not only with percussive sounds, but also with some synth. If you press several notes at the same time or within maybe 3msec (which you can‘t prevent with normal mechanical keyboards), the first note is acutally payed and send to the synth/instrument. Then 3msec later, a note-off will be send for the first note. For percussive sounds, not only their start but also their release phase will be audible resulting in a glitch of two notes that can be heared. For percussive sounds, their startphase has the most harmonics, so this is really an anoying problem. And there are also synth that will just click since they don‘t like such super-short note on/off combinations, even when used with longer attacks.

    .

    To check for the lowest note, you need to store all incoming notes and in a parallel timer thread analyse the stored notes if a ‚grace‘ time run out and when the grace time is reached send the Note-On out the lowest of them. As a side-effect this will delay all issued notes by the grace time.

    .

    That‘s how Smart-Chord-Bass solves this problem without creating clicks with percussive sounds.

    In my most complex Multi-Divisi script i perfected that store & process-later handling, as i didn‘t want to introduce any ‚lag‘ when played from a sequencer with chords arriving in the same time-frame (ie same msec in SystemTime, but the notes still arrive in destinct, separated OnNoteOn events). It took several tricks and month of testing to make it work lag-free in 97% of the time. The wait-default for MuliDivis is 0msec, output notes are issued in the same midi-processing-timeslot of Mozaic as the incomming notes - one only needs to raise the scripts grace-time for manual playing :)

    Thank you very very much for your answers @_ki @wim … I feel like a moron, after realizing that I forgot something uber important… search. I realized that searching for the keyword SWAM could provide a good amount of codes related to what I wanted to do.

    At the end I went for the https://patchstorage.com/polymono-midi-router/ code. This made the midi routing I needed, not without making some key splits, but right now it makes more sense, and I can easily expand the code to include more Violins/Cellos to the ensemble by changing just a number.

    Thanks for all the good work.

  • @HotStrange said:

    @wim said:

    @HotStrange said:

    @wim said:
    It seems to me that maybe solving this one with Mozaic is as simple as sending Sustain On/Off on a pad press. If I understand what's needed correctly.

    Exactly. I just want a script to sustain/latch whatever note(s) played and turn off by touching the same note again.

    Ahh. OK, now it's clear what you need. Sometimes it's difficult to understand right off from someone's initial description of what's needed. That's the reason for all the questions ... to help draw out the details. If we don't do that then the resulting solution will be off the mark.

    I can easily write a script to do what you want. I can also include a button to stop any remaining playing notes if needed. The problem with doing this in Mozaic is there's no keyboard that would help visualize which notes are playing. You'll have to mentally keep track of that.

    That said, KB-1's latch mode does exactly what you've described, while providing helpful visual feedback. Might be a better solution if you're open to it.

    Ah yeah you’re right. I could probably keep track of the notes but I wouldn’t want to waste someone’s time if it sends up not work. I generally use Xequence Keys and Velocity Keyboard but they both lack proper latch modes unfortunately. Should’ve picked up KB-1 while it was on sale but as usual I convinced myself to wait 😂

    No problem. I'm up for a little diversion. I'll write something for you to try. 👍🏼

  • @wim said:

    @HotStrange said:

    @wim said:

    @HotStrange said:

    @wim said:
    It seems to me that maybe solving this one with Mozaic is as simple as sending Sustain On/Off on a pad press. If I understand what's needed correctly.

    Exactly. I just want a script to sustain/latch whatever note(s) played and turn off by touching the same note again.

    Ahh. OK, now it's clear what you need. Sometimes it's difficult to understand right off from someone's initial description of what's needed. That's the reason for all the questions ... to help draw out the details. If we don't do that then the resulting solution will be off the mark.

    I can easily write a script to do what you want. I can also include a button to stop any remaining playing notes if needed. The problem with doing this in Mozaic is there's no keyboard that would help visualize which notes are playing. You'll have to mentally keep track of that.

    That said, KB-1's latch mode does exactly what you've described, while providing helpful visual feedback. Might be a better solution if you're open to it.

    Ah yeah you’re right. I could probably keep track of the notes but I wouldn’t want to waste someone’s time if it sends up not work. I generally use Xequence Keys and Velocity Keyboard but they both lack proper latch modes unfortunately. Should’ve picked up KB-1 while it was on sale but as usual I convinced myself to wait 😂

    No problem. I'm up for a little diversion. I'll write something for you to try. 👍🏼

    Oh cool! Much appreciated my friend 🙏

  • wimwim
    edited September 2023

    @HotStrange said:

    @wim said:

    @HotStrange said:

    @wim said:

    @HotStrange said:

    @wim said:
    It seems to me that maybe solving this one with Mozaic is as simple as sending Sustain On/Off on a pad press. If I understand what's needed correctly.

    Exactly. I just want a script to sustain/latch whatever note(s) played and turn off by touching the same note again.

    Ahh. OK, now it's clear what you need. Sometimes it's difficult to understand right off from someone's initial description of what's needed. That's the reason for all the questions ... to help draw out the details. If we don't do that then the resulting solution will be off the mark.

    I can easily write a script to do what you want. I can also include a button to stop any remaining playing notes if needed. The problem with doing this in Mozaic is there's no keyboard that would help visualize which notes are playing. You'll have to mentally keep track of that.

    That said, KB-1's latch mode does exactly what you've described, while providing helpful visual feedback. Might be a better solution if you're open to it.

    Ah yeah you’re right. I could probably keep track of the notes but I wouldn’t want to waste someone’s time if it sends up not work. I generally use Xequence Keys and Velocity Keyboard but they both lack proper latch modes unfortunately. Should’ve picked up KB-1 while it was on sale but as usual I convinced myself to wait 😂

    No problem. I'm up for a little diversion. I'll write something for you to try. 👍🏼

    Oh cool! Much appreciated my friend 🙏

    Try this out. I only tested it lightly, so apologies in advance for any bugs you may find.

    @Description
    Latch incoming notes on until the same note is received again.
    @End
    
    @OnLoad
      FillArray notes,-1
      lastNote = -1
      ResetNoteStates NO
      LabelPad 0,{Stop All}
      LabelKnobs {Latch Notes}
      SetShortName {LATCH}
    @End
    
    @OnMidiInput
      // Pass non-note midi through
      if MIDICommand <> 0x90 and MIDICommand <> 0x80
        SendMIDIThru
      endif
    @End
    
    @OnSysex
      SendSysexThru
    @End
    
    @OnMidiNoteOn
      noteState = GetNoteState MIDIChannel,MIDINote
      
      if noteState
        SendMIDINoteOff MIDIChannel,MIDINote,0
        SetNoteState MIDIChannel,MIDINote,NO
        Call @RemoveNote
      else
        SendMIDIThru
        SetNoteState MIDIChannel,MIDINote,YES
        Call @AddNote
      endif
    @End
    
    @AddNote
      // Add the note to the stack
      Inc lastNote
      notes[lastNote] = (MIDIChannel * 0x100) + MIDINote  
    @End
    
    @SearchStack
      searchIndex = 0
      found = NO
      
      while notes[searchIndex] <> -1 and searchIndex < 1024 and (not found)
        if notes[searchIndex] = (MIDIChannel * 0x100) + MIDINote
          found = YES
        else
          Inc searchIndex
        endif
      endwhile
    @End
    
    @RemoveNote
      Call @SearchStack
      if found
        // Remove a note from the stack
        repeat
          notes[searchIndex] = notes[searchIndex+1]
          if notes[searchIndex] = -1
            lastNote = searchIndex - 1
          endif
          Inc searchIndex
        until notes[searchIndex] = -1 or searchIndex = 1024  
      endif
    @End
    
    @OnPadDown
      if LastPad = 0
        Call @KillAll
      endif
    @End
    
    @KillAll
      if lastNote <> -1
        for n = 0 to lastNote
          channel = Div (notes[n] & 0xFF00), 0x100
          note = notes[n] & 0x00FF
          SendMIDINoteOff channel,note,0
          SetNoteState channel,note,NO
        endfor
      endif
      lastNote = -1
      FillArray note,-1
      ResetNoteStates NO
    @End
    
  • @wim said:

    @HotStrange said:

    @wim said:

    @HotStrange said:

    @wim said:

    @HotStrange said:

    @wim said:
    It seems to me that maybe solving this one with Mozaic is as simple as sending Sustain On/Off on a pad press. If I understand what's needed correctly.

    Exactly. I just want a script to sustain/latch whatever note(s) played and turn off by touching the same note again.

    Ahh. OK, now it's clear what you need. Sometimes it's difficult to understand right off from someone's initial description of what's needed. That's the reason for all the questions ... to help draw out the details. If we don't do that then the resulting solution will be off the mark.

    I can easily write a script to do what you want. I can also include a button to stop any remaining playing notes if needed. The problem with doing this in Mozaic is there's no keyboard that would help visualize which notes are playing. You'll have to mentally keep track of that.

    That said, KB-1's latch mode does exactly what you've described, while providing helpful visual feedback. Might be a better solution if you're open to it.

    Ah yeah you’re right. I could probably keep track of the notes but I wouldn’t want to waste someone’s time if it sends up not work. I generally use Xequence Keys and Velocity Keyboard but they both lack proper latch modes unfortunately. Should’ve picked up KB-1 while it was on sale but as usual I convinced myself to wait 😂

    No problem. I'm up for a little diversion. I'll write something for you to try. 👍🏼

    Oh cool! Much appreciated my friend 🙏

    Try this out. I only tested it lightly, so apologies in advance for any bugs you may find.

    @Description
    Latch incoming notes on until the same note is received again.
    @End
    
    @OnLoad
      FillArray notes,-1
      lastNote = -1
      ResetNoteStates NO
      LabelPad 0,{Stop All}
      LabelKnobs {Latch Notes}
      SetShortName {LATCH}
    @End
    
    @OnMidiInput
      // Pass non-note midi through
      if MIDICommand <> 0x90 and MIDICommand <> 0x80
        SendMIDIThru
      endif
    @End
    
    @OnSysex
      SendSysexThru
    @End
    
    @OnMidiNoteOn
      noteState = GetNoteState MIDIChannel,MIDINote
      
      if noteState
        SendMIDINoteOff MIDIChannel,MIDINote,0
        SetNoteState MIDIChannel,MIDINote,NO
        Call @RemoveNote
      else
        SendMIDIThru
        SetNoteState MIDIChannel,MIDINote,YES
        Call @AddNote
      endif
    @End
    
    @AddNote
      // Add the note to the stack
      Inc lastNote
      notes[lastNote] = (MIDIChannel * 0x100) + MIDINote  
    @End
    
    @SearchStack
      searchIndex = 0
      found = NO
      
      while notes[searchIndex] <> -1 and searchIndex < 1024 and (not found)
        if notes[searchIndex] = (MIDIChannel * 0x100) + MIDINote
          found = YES
        else
          Inc searchIndex
        endif
      endwhile
    @End
    
    @RemoveNote
      Call @SearchStack
      if found
        // Remove a note from the stack
        repeat
          notes[searchIndex] = notes[searchIndex+1]
          if notes[searchIndex] = -1
            lastNote = searchIndex - 1
          endif
          Inc searchIndex
        until notes[searchIndex] = -1 or searchIndex = 1024  
      endif
    @End
    
    @OnPadDown
      if LastPad = 0
        Call @KillAll
      endif
    @End
    
    @KillAll
      if lastNote <> -1
        for n = 0 to lastNote
          channel = Div (notes[n] & 0xFF00), 0x100
          note = notes[n] & 0x00FF
          SendMIDINoteOff channel,note,0
          SetNoteState channel,note,NO
        endfor
      endif
      lastNote = -1
      FillArray note,-1
      ResetNoteStates NO
    @End
    

    Working perfectly so far! Notes hold until I tap again and stop all functions as it should. Thanks a ton for this, you just saved me $10 haha 🤝 much appreciated

  • wimwim
    edited September 2023

    Great! I'm glad it's working out @HotStrange.

  • Hello @wim thanks for the update on the sustainuto code.
    This time I would like to ask you if you can make the code to also let the code pass through the sustain pedal messages. Maybe this could be enabled an disabled by changing a value of a variable in the code, you say I am using the keystage DAW, and there is some unexpected behavior with this code to make the long story short, when the play button is active and the activated, they sent the note of messages. I am not sure if it is an issue of the code, or if there is some issue in key stage, but I think that the way to solve it, or at least to bypass it could be to allow sustain messages to also pass through.

    I made a silly modification in the code and tried to fold the code to allow also to pass through the sustain pedal messages but I think that in the point that I made the modification, it introduce some artifacts so this time I asked your help to make the proper changes on the code.

    I think that the code needs to consume the sustain pedal messages in order to work properly, so maybe you at the end of the program could send a faked sustain pedal message, or something like that.
    Thanks in advance

  • @jjpl2001 said:
    Hello @wim thanks for the update on the sustainuto code.
    This time I would like to ask you if you can make the code to also let the code pass through the sustain pedal messages. Maybe this could be enabled an disabled by changing a value of a variable in the code, you say I am using the keystage DAW, and there is some unexpected behavior with this code to make the long story short, when the play button is active and the activated, they sent the note of messages. I am not sure if it is an issue of the code, or if there is some issue in key stage, but I think that the way to solve it, or at least to bypass it could be to allow sustain messages to also pass through.

    I made a silly modification in the code and tried to fold the code to allow also to pass through the sustain pedal messages but I think that in the point that I made the modification, it introduce some artifacts so this time I asked your help to make the proper changes on the code.

    I think that the code needs to consume the sustain pedal messages in order to work properly, so maybe you at the end of the program could send a faked sustain pedal message, or something like that.
    Thanks in advance

    I'm not sure what passing the sustain messages through will accomplish, but to do so is just a matter of moving a few lines of code. I'll PM you a changed version for you to try out.

  • @wim said:

    @jjpl2001 said:
    Hello @wim thanks for the update on the sustainuto code.
    This time I would like to ask you if you can make the code to also let the code pass through the sustain pedal messages. Maybe this could be enabled an disabled by changing a value of a variable in the code, you say I am using the keystage DAW, and there is some unexpected behavior with this code to make the long story short, when the play button is active and the activated, they sent the note of messages. I am not sure if it is an issue of the code, or if there is some issue in key stage, but I think that the way to solve it, or at least to bypass it could be to allow sustain messages to also pass through.

    I made a silly modification in the code and tried to fold the code to allow also to pass through the sustain pedal messages but I think that in the point that I made the modification, it introduce some artifacts so this time I asked your help to make the proper changes on the code.

    I think that the code needs to consume the sustain pedal messages in order to work properly, so maybe you at the end of the program could send a faked sustain pedal message, or something like that.
    Thanks in advance

    I'm not sure what passing the sustain messages through will accomplish, but to do so is just a matter of moving a few lines of code. I'll PM you a changed version for you to try out.

    In my case served as a redundancy measure. If for some reason, the Note Hold function fails, the sustain message still takes place. For some reason, keystage under a very specific situation triggers the note off on mozaic, but with the sustain pedal message in place, the script goal is still accomplished

  • edited December 2023

    Hello fellow Mozaic hackers.

    I’m finding Textastic to be an indispensable part of developing scripts longer than a screen or two. Coupled with the code completion package supplied by @_ki (https://patchstorage.com/mozaic-language-support-for-code-text-editors/) it’s a really nifty IDE for iPads with an external keyboard.

    I reached out to the developer of Textastic to ask how to support CMD+/ for commenting/uncommenting blocks of code, and he supplied me with the attached (zipped) file, and these instructions:

    You need an additional Comments.tmPreferences file that contains information about supported comment strings. See https://sublime-text-unofficial-documentation.readthedocs.io/en/latest/reference/comments.html

    Put the file in the same directory as mozaic.sublime-syntax and reload customizations. (see https://www.textasticapp.com/v10/manual/customization/custom_syntax_themes_templates.html#reload-customizations)

    I hope that anyone else using a similar setup finds this useful.

    Happy New Year!

  • What?! Thanks @GRiker! That's going to be so useful. 😎

  • _ki_ki
    edited December 2023

    @GRiker That‘s a cool find, thanks a lot !

    If one uses a non-english version of Textastic or non-english bluetooth keyboard the actual command may differ from CMD /
    Just long press CMD to get a popup with all supported keyboard commands and try the block comment key combination.

    For the german version it‘s CMD ß :)

  • edited January 2

    May be someone will need it - my version of 'translate relative encoders to absolute ones' script. Can be configured to different CC, inc/dec step and relative modes. Easy to add filter/change channel, etc. Absolute encoder values are saved/stored in auv3 state

    @OnLoad
      NUM_ENCODERS = 8
      if Unassigned values
       values = [64, 64, 64, 64, 64, 64, 64, 64]
      endif
      cc_map_in = [ 16, 17, 18, 19, 20, 21, 22, 23]
      cc_map_out = [16, 17, 18, 19, 20, 21, 22, 23]
      STEP = 2
      ENC_LEFT = 127
      ENC_RIGHT = 1
    @End
    
    @OnMidiCC
      for i = 0 to NUM_ENCODERS-1
        if MIDIByte2 = cc_map_in[i]
          if MIDIByte3 = ENC_RIGHT
            values[i] = values[i] + STEP
          elseif MIDIByte3 = ENC_LEFT
            values[i] = values[i] - STEP
          endif
          values[i] = Clip values[i], 0, 127
          SendMIDICC MIDIChannel , cc_map_out[i], values[i]
          Exit 
        endif
      endfor  
      SendMIDIThru
    @End  
    
  • wimwim
    edited January 1

    Very nice @Dante777. Thanks for that. 😎

    I think values[i] = Clip values[i], 0, 127 could replace calling @clamp if you want to save a few lines of code.

    I really like how you used Exit in the for loop. I've always resorted a while loop, which is more cumbersome and risks an infinite loop if I'm not careful. Yours is a much better approach.

  • @GRiker said:
    Hello fellow Mozaic hackers.

    I’m finding Textastic to be an indispensable part of developing scripts longer than a screen or two. Coupled with the code completion package supplied by @_ki (https://patchstorage.com/mozaic-language-support-for-code-text-editors/) it’s a really nifty IDE for iPads with an external keyboard.

    I reached out to the developer of Textastic to ask how to support CMD+/ for commenting/uncommenting blocks of code, and he supplied me with the attached (zipped) file, and these instructions:

    You need an additional Comments.tmPreferences file that contains information about supported comment strings. See https://sublime-text-unofficial-documentation.readthedocs.io/en/latest/reference/comments.html

    Put the file in the same directory as mozaic.sublime-syntax and reload customizations. (see https://www.textasticapp.com/v10/manual/customization/custom_syntax_themes_templates.html#reload-customizations)

    I hope that anyone else using a similar setup finds this useful.

    Happy New Year!

    Works great! Thanks!

    Just a note in case it happens to anyone else. Reload Preferences caused my Mozaic syntax extensions to no longer work. Quitting Mozaic (not just reloading the file) and re-entering fixed it.

Sign In or Register to comment.