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.

Learn to Program the Mozaic Workshop to create MIDI FX and Controllers *you could learn something*

135678

Comments

  • @Brambos has disclosed his development process and it matches what I would like to
    present as a model for making a complex Mozaic script. It follows what many developers use and I have heard it called the "Agile Method". But it's works well for anyone... even someone with back pain and a bad hip.

    @Brambos wrote on the Mononoke thread:

    I've been working on it over the course of 3 months. But some periods are relatively slow (I take a long time to come to a concept, articulate the value proposition, vision and rough UI model) and other periods I work on it much more intensively (e.g. around Xmas and NY when I was off from work for 2 weeks).
    
    It's difficult to say how much work goes into a product though, because I take a Frankenstein approach to app development:
    
    I take a mature, stable product (in this case Ruismaker Noir)
    I rip out the DSP engine
    disconnect the UI
    Then start building the product from inside the corpse of the old product, replacing and reconnecting all the old bits with new bits one by one.
    This allows me to start with something that works and compiles immediately. But this fundament on which I'm building has been evolving since 2016 and countless months have gone into it already :)
    
    I don't prototype in another environment. I prototype in the actual product (very agile!). I build the DSP engine, and if bits don't work I change them (and the accompanying aspects of the UI). Once everything works I give the GUI one last brush-up to make everything feel coherent and polished.
    

    Let's break that down and implement it here in a series of Example Scripts.

  • McDMcD
    edited January 2020

    Ok. Let's make on outline of the @Brambos process:

    I take a long time to come to a concept, articulate the value proposition, vision and rough UI model)

    It's the Frankenstein (tm) approach to app development:

    1. Take a mature, stable piece of working code.
    2. Rip out internal functionality.
    3. Start building the from inside the corpse of the old script.
    4. Replacing and Reconnecting all the old bits with new bits one by one.

    Benefits of the @Brambos Frankestein (tm) Model?

    1. You start with something that works and compiles immediately.
    2. You prototype in the actual product (very agile!).
    3. You build the new functionality, and if commands don't work you change them.
    4. Once everything works polish the GUI.
    5. Accept feedback from the users that test the script and keep polishing, patching and adding features.
    6. Go to #1.

    That's really the key. The working code and "Go to #1" for any revisions. Save at every step. If a new feature brakes the app roll back and try again. Ask for help at any point in the process.

    This is a perfect description of Agile Coding and it can make the best apps, IMHO. It won't
    produce something massive but Mozaic is for prototyping in a sandbox with training wheels.

    Real programmers accept much more difficult challenges but the Agile method stills applies.
    It's just harder to scale up to something like Cubasis. Still, even a Team can use Agile methods and test the code daily to insure changes don't break it. Get stuck or hit a bug in the Operating System just roll back and try another path around the bug.

    So, let's get started making something as a group. I want you to write the app as a team.

    STEP ONE: Propose a working Mozaic script to load and test. Not every needs to do the testing. You can fiollowing the process and just keep practicing "Typing". I have requested code from some of my favorite script coders. I would like permission. Then we gut their baby and make
    a starter corpse in Step #2.

    What are your favorite Mozaic Scripts on Patch Storage? If you don't have an opinion just look for some demo's of the scripts and vote for good demos.

  • Gutting an existing project requires decent knowledge of the code base or you just end up with spaghetti code or cruft. There's also the concept of template/boilerplate/scaffolding to get the bare basic framework of a project up and running so that you don't waste time doing initial setup common code.

  • McDMcD
    edited January 2020

    @Liquidmantis said:
    Gutting an existing project requires decent knowledge of the code base.

    I'm probably going to start by gutting it to @Function @End lines and then
    refer back to the code to show how to read knobs, etc. So, the early versions will have the easiest Commands and iteratively we'll make a functioning script of 100+ lines.

    The code in a script like "The Chordulator" was my gateway to understanding Labeling of Knobs, using Functions and dozens of ideas. So, I really just borrow back sections of code that work. @wim adds a fair amount of // comments. He uses good programming practices so it's pretty readable. @_Ki as you would imagine writes great code to "borrow" from. His GUI designs are like an architect's blue prints.

    So, we can Frankenstein something we would never understand and still have a starting point. The trick is to "save the liver" (SNL, Dan Aykroyd's"Julia Childs" skit).

    @wim says we can hack up his script. I hope he doesn't watch the butchering of his baby. We'll "save the liver".

  • You wanna be careful with that ... The Chordulator was an early effort and I'm not a trained programmer. There is probably some OK code in there, but take it all with a huge grain of salt. :D

  • @wim said:
    You wanna be careful with that ... The Chordulator was an early effort and I'm not a trained programmer. There is probably some OK code in there, but take it all with a huge grain of salt. :D

    Well, I got a lot of benefit from seeing how you solved problems. Looking for working code
    is essential to learn to program. But at some point you need to make something.

    I will only use examples that I can understand and explain to a new Mozaic student and
    so far we have almost 10 here. So, the class size is manageable. I'm hoping 10 hang in there.

    But the thread will live for years and the good parts can be cleaned up in the Wiki.

    So, I refuse to be negative about this project. If we can make more users @Brambos might
    throw in new features. I doubt he got rich with this product.

    I would love to see a Port of the code to OS X or Linux. Not Windows. That's just me.

    I can use another scripting tool on OS X and that was my preferred coding platform.
    IOS for text is still just meh. You write IOS code on a Mac. Can't be done on IOS. So,
    coding Mozaic on IOS has created additional challenges and I'm learning how to be productive with Textastic and iVim for editing.

  • Lets' take a look and one of the favorite Mosaic scrips (written by @wim) on PatchStorage
    as ranked by User "Likes".

    @wim's Chordulator script is magical and competes well against many MIDI FX and Generator Apps for usefulness and it's current on sale for $0.00. The ability to sell
    Mozaic scripts has not been tested yet.

    Once you install a Mozaic Script the code is free to read and edit and (programmer's term here) "fork". Most Open Source apps can be download as source code and modified by anyone within the request rights of the develops. Mozaic scripts also have "licenses" and
    anyone forking the code should respect the rights of the code developer.

    @wim's script doesn't declare any specific rights so I PM'ed him here and he has granted permission to use his work for teaching purposes. He also had the reaction that he doesn't thing his work is a model of high quality programming and I contend that the user reviews speak well to the quality of the application.

    So here's some of the application code to start our journey to making a working application using the @brambos Agile Process:

    @Description
    THE CHORDULATOR v.1.0
    Play a huge variety of chords with just one note.
    @End
    
    @OnLoad
      //Knob positions
      rootknob = 0
      scaleknob = 1
      notesknob = 2
      bassknob = 3
      modeknob = 4
      strumknob = 5
      trandknob = 6
      vrandKnob = 7
      prandKnob = 8
      chknob = 9
      basschKnob = 10
      bypassknob = 11
      ccstartknob = 12
      ccendknob = 21
      offset = 8
    
      //Init if new load
      if Unassigned init
        init = YES
    
        //Set misc variables
        bass = 0
        top = 127
        bass = 0
        FillArray chords, -1
        FillArray chordsch, -1
        FillArray bassnotes, -1
        FillArray bassnotesch, -1
        knobchanges = NO
    
        //Scale root
        root = 0
        SetRootNote root
        knob = rootknob
        knobs[rootknob] = root
        SetKnobValue rootknob, (TranslateScale, root, 0, 11, 0, 127)
        Call @MyLabelKnob
    
        //Scale (1 = Major)
        scale = 1
        PresetScale scale 
        knob = scaleknob
        knobs[scaleknob] = scale
        SetKnobValue scaleknob, (TranslateScale, scale, 1, 24, 0, 127)
        Call @MyLabelKnob
    
        //Notes per chord 
        notes = 3
        knob = notesknob
        knobs[notesknob] = notes
        SetKnobValue notesknob, (TranslateScale, notes, 3, 7, 0, 127)
        Call @MyLabelKnob
    
        //Voice following
        mode = 1 //Voice following
        knob = modeknob
        knobs[modeknob] = mode
        Call @MyLabelKnob
    
        //Added bass notes
        addBass = 0
        knob = bassKnob
        knobs[bassknob] = addBass
        SetKnobValue bassKnob, (TranslateScale addBass, 0, 2, 0, 127) 
        Call @MyLabelKnob
    
        //Chord strumming
        strum = 0
        knob = strumknob
        knobs[strumknob] = strum
        SetKnobValue strumKnob, (TranslateScale strum, 0, 100, 0, 127)  
        Call @MyLabelKnob
    
        //Velocity humanization
        vrandom = 0
        knob = vrandknob
        knobs[vrandknob] = vrandom
        SetKnobValue vrandKnob, vrandom
        Call @MyLabelKnob 
    
        //Timing humanization
        trandom = 0
        knob = trandKnob
        knobs[trandknob] = trandom
        SetKnobValue trandKnob, trandom
        Call @MyLabelKnob
    
        //Probability of notes playing 
        prandom = 100
        knob = prandknob
        knobs[prandknob] = prandom
        SetKnobValue prandknob, (TranslateScale, prandom, 51, 100, 0, 127)
        Call @MyLabelKnob
    
        //Channel for chords (0 = PassThru)
        ch = 0
        knob = chknob
        knobs[chknob] = ch
        SetKnobValue chknob, (TranslateScale, ch, 0, 16, 0, 127)
        Call @MyLabelKnob
    
        //Channel for added bass notes (0 = PassThru)
        bassch = 0
        knob = basschknob
        knobs[basschknob] = bassch
        SetKnobValue basschknob, (TranslateScale, bassch, 0, 16, 0, 127)
        Call @MyLabelKnob
    
        //Bypass the Chordulator
        bypass = NO
        SetKnobValue bypassknob, (TranslateScale, bypass, 0, 1, 0, 127)
        knob = bypassknob
        knobs[bypassknob] = bypass
        Call @MyLabelKnob
    
        //cc send knobs
        for a = ccstartknob to ccendknob
          knob = a
          Call @MyLabelKnob
        endfor
      endif
    
      SetShortName {CrdUlatr} 
      LabelKnobs {Smart Chordulator (shift = panic)}
      ShowLayout 1
    @End
    
  • McDMcD
    edited January 2020

    OK. Let's review @brambos Agile App Development Process.
    It's the Frankenstein (tm) approach to app development:

    1. Take a mature, stable piece of working code.
    2. Rip out internal functionality.
    3. Start building the from inside the corpse of the old script.
    4. Replacing and Reconnecting all the old bits with new bits one by one.

    We should adapt this process to match the problems a beginner needs to confront:

    It's the Frankenstein (tm) approach to app development:

    "Take a mature, stable piece of working code."

    Let's change this for the beginner's version:

    1. Start with a working script.

    Let's start with "Ex 3: Sample and Hold Repeating" and add some more Commands to make the new version play a 16 note sequence.

    Before:

    @OnLoad
    
      SetMetroPPQN 4
    
    @End
    
    @OnMidiInput
    
      Log {MIDI Instruction+Channel: }, MIDIByte1, { Note: }, MIDIByte2, { Velocity: }, MIDIByte3
    
    @End
    
    @OnMetroPulse
    
      SendMidiOut MIDIByte1, MIDIByte2, 100
      SendMidiOut MIDIByte1, MIDIByte2, 0, 100
    
    @End
    

    After:

    @OnLoad
    
      SetMetroPPQN 4
    
      // NoteArray = [0,0,0,0,-12,3,3,3,-12,5,5,5,12,10,10,10]
    
      NoteArray =[0,0,3,3,-12,3,3,3,-12,5,5,5,-12,10,10,10]
    
      count = 0
    
    @End
    
    @OnMidiInput
    
      Log {MIDI Instruction+Channel: }, MIDIByte1, { Note: }, MIDIByte2, { Velocity: }, MIDIByte3
    
    @End
    
    @OnMetroPulse
    
      if count = 15
        count = 0
      endif
    
      NewNote = MIDIByte2 + NoteArray[count]
    
      SendMidiOut MIDIByte1, NewNote, 100
    
      count = count + 1
    
    @End
    
  • edited January 2020

    Having a Mozaic programming thread is a great idea.
    I've just started today writing a Mozaic script to use my hardware synths as physical controllers. What a total pain in the butt is it to write code on an iPad if you use its virtual keyboard, in the end I wrote it as a word document and emailed it to myself then copied and pasted it.
    Does anybody here know if/have experience of writing/running/testing Mozaic scripts in the Apple Xcode iPad emulator to make the process more sane instead of using an iPad?

  • The little work I've done I wrote in VS Code on my Mac, then copied it and used the native iCloud clipboard/pastboard sync to be able to paste into the Mozaic editor on my iPad. But yeah, having Mozaic on the Mac would be much nicer for iterative development and debugging.

  • wimwim
    edited January 2020

    @mungbeans said:
    Having a Mozaic programming thread is a great idea.
    I've just started today writing a Mozaic script to use my hardware synths as physical controllers. What a total pain in the butt is it to write code on an iPad if you use its virtual keyboard, in the end I wrote it as a word document and emailed it to myself then copied and pasted it.
    Does anybody here know if/have experience of writing/running/testing Mozaic scripts in the Apple Xcode iPad emulator to make the process more sane instead of using an iPad?

    The three best things you can do for yourself if you want to write Mozaic scripts are (in order of importance):

    1. (Essential) Get a BlueTooth keyboard. They're cheap and will make a world of difference.
    2. Get the Textastic Code Editor. This is especially helpful if you start to develop bigger projects.
    3. If you have Textastic, get @_ki 's fantastic Mozaic Language Support for it! It is amazing.

    But above all ... the BT keyboard. I don't even try to write scripts without it. With it, even in-app scripting is totally manageable once you get the hang of using a finger for navigation instead of a mouse. Be sure to get a BT keyboard with cursor keys and option keys like copy/paste, etc.

    The keyboard I have has keys for up/down/left/right, end of line/beginning of line, tab, cut/copy/paste, and switching between apps (especially helpful when using Textastic). I think it cost like $12?

    I've tried adding a mouse, and it's OK, but doesn't add enough for me really to bother with it.

  • @wim said:
    3. If you have Textastic, get @_ki 's fantastic Mozaic Language Support for it! It is amazing.

    Whoa, that's amazing! But it looks like Textastic doesn't have Vim keybindings. :( I haven't used Sublime for a while now but I might have to give Mozaic editing on it a go.

  • cool are there any sequencer codes that can be copied and pasted?

  • @eross said:
    cool are there any sequencer codes that can be copied and pasted?

    Humm? I don't understand this question...

  • @Liquidmantis said:

    @wim said:
    3. If you have Textastic, get @_ki 's fantastic Mozaic Language Support for it! It is amazing.

    Whoa, that's amazing! But it looks like Textastic doesn't have Vim keybindings. :( I haven't used Sublime for a while now but I might have to give Mozaic editing on it a go.

    https://apps.apple.com/app/ivim/id1266544660

  • @Liquidmantis said:

    @wim said:
    3. If you have Textastic, get @_ki 's fantastic Mozaic Language Support for it! It is amazing.

    Whoa, that's amazing! But it looks like Textastic doesn't have Vim keybindings. :( I haven't used Sublime for a while now but I might have to give Mozaic editing on it a go.

    Navigating large scripts in Textastic is a breeze if you have @_ki 's template. There's a drop-down where you can jump to any event with a single touch.

  • McDMcD
    edited January 2020

    @eross said:
    cool are there any sequencer codes that can be copied and pasted?

    I have modified the code above in the After section after running it a bit.

    That NoteArray can hold up to 16 numbers in the list.

    The sequence played is all relative to any Note played into the script.
    Play Middle C and the MIDIByte will be 60.

    So a NoteArray =[0,0,3,3,-12,3,3,3,-12,5,5,5,-12,10,10,10]
    will play these notes in a loop:

    C4 C4 Eb4 Eb4 C3 Eb4 Eb4 Eb4 C3 F4 F4 F4 C3 Bb4 Bb4 Bb4

    We can have dozens of different NoteArrays and switch between them with knob.
    We could even fill a NoteArray with Random numbers in some range.

    Try it. Get typing (or cut and pasting).

  • @Liquidmantis said:

    @wim said:
    3. If you have Textastic, get @_ki 's fantastic Mozaic Language Support for it! It is amazing.

    Whoa, that's amazing! But it looks like Textastic doesn't have Vim keybindings. :( I haven't used Sublime for a while now but I might have to give Mozaic editing on it a go.

    There's another thread where this question was also posed and many dev's provided advice:

    https://forum.audiob.us/discussion/36521/mozaic-what-is-your-workflow-when-it-comes-to-complex-scripts

  • McDMcD
    edited January 2020

    Let’s reverse “Frankenstein” Ex6 code with some “organs” from @Wim’s working Chordulator script.

    Here I have installed Wim’s Labling related events and custom events into the working Ex 6 Sequencer code.

    I want to use Wim’s labels to continue to add features that are tied to Knob adjustments:

    @MyLoad

      SetMetroPPQN 4
    
      // NoteArray = [0,0,0,0,-12,3,3,3,-12,5,5,5,12,10,10,10]
    
      NoteArray =[0,0,3,3,-12,3,3,3,-12,5,5,5,-12,10,10,10]
    
      count = 0
    
    @End
    
    @OnLoad
      //Knob positions
      rootknob = 0
      scaleknob = 1
      notesknob = 2
      bassknob = 3
      modeknob = 4
      strumknob = 5
      trandknob = 6
      vrandKnob = 7
      prandKnob = 8
      chknob = 9
      basschKnob = 10
      bypassknob = 11
      ccstartknob = 12
      ccendknob = 21
      offset = 8
    
      //Init if new load
      if Unassigned init
        init = YES
    
        //Set misc variables
        bass = 0
        top = 127
        bass = 0
        FillArray chords, -1
        FillArray chordsch, -1
        FillArray bassnotes, -1
        FillArray bassnotesch, -1
        knobchanges = NO
    
        //Scale root
        root = 0
        SetRootNote root
        knob = rootknob
        knobs[rootknob] = root
        SetKnobValue rootknob, (TranslateScale, root, 0, 11, 0, 127)
        Call @MyLabelKnob
    
        //Scale (1 = Major)
        scale = 1
        PresetScale scale 
        knob = scaleknob
        knobs[scaleknob] = scale
        SetKnobValue scaleknob, (TranslateScale, scale, 1, 24, 0, 127)
        Call @MyLabelKnob
    
        //Notes per chord 
        notes = 3
        knob = notesknob
        knobs[notesknob] = notes
        SetKnobValue notesknob, (TranslateScale, notes, 3, 7, 0, 127)
        Call @MyLabelKnob
    
        //Voice following
        mode = 1 //Voice following
        knob = modeknob
        knobs[modeknob] = mode
        Call @MyLabelKnob
    
        //Added bass notes
        addBass = 0
        knob = bassKnob
        knobs[bassknob] = addBass
        SetKnobValue bassKnob, (TranslateScale addBass, 0, 2, 0, 127) 
        Call @MyLabelKnob
    
        //Chord strumming
        strum = 0
        knob = strumknob
        knobs[strumknob] = strum
        SetKnobValue strumKnob, (TranslateScale strum, 0, 100, 0, 127)  
        Call @MyLabelKnob
    
        //Velocity humanization
        vrandom = 0
        knob = vrandknob
        knobs[vrandknob] = vrandom
        SetKnobValue vrandKnob, vrandom
        Call @MyLabelKnob 
    
        //Timing humanization
        trandom = 0
        knob = trandKnob
        knobs[trandknob] = trandom
        SetKnobValue trandKnob, trandom
        Call @MyLabelKnob
    
        //Probability of notes playing 
        prandom = 100
        knob = prandknob
        knobs[prandknob] = prandom
        SetKnobValue prandknob, (TranslateScale, prandom, 51, 100, 0, 127)
        Call @MyLabelKnob
    
        //Channel for chords (0 = PassThru)
        ch = 0
        knob = chknob
        knobs[chknob] = ch
        SetKnobValue chknob, (TranslateScale, ch, 0, 16, 0, 127)
        Call @MyLabelKnob
    
        //Channel for added bass notes (0 = PassThru)
        bassch = 0
        knob = basschknob
        knobs[basschknob] = bassch
        SetKnobValue basschknob, (TranslateScale, bassch, 0, 16, 0, 127)
        Call @MyLabelKnob
    
        //Bypass the Chordulator
        bypass = NO
        SetKnobValue bypassknob, (TranslateScale, bypass, 0, 1, 0, 127)
        knob = bypassknob
        knobs[bypassknob] = bypass
        Call @MyLabelKnob
    
        //cc send knobs
        for a = ccstartknob to ccendknob
          knob = a
          Call @MyLabelKnob
        endfor
        Call @MyLoad
      endif
    
      SetShortName {CrdUlatr} 
      LabelKnobs {Smart Chordulator (shift = panic)}
      ShowLayout 1
    @End
    @OnMidiInput
    
      Log {MIDI Instruction+Channel: }, MIDIByte1, { Note: }, MIDIByte2, { Velocity: }, MIDIByte3
    
    @End
    
    @OnMetroPulse
    
      if count = 15
        count = 0
      endif
    
      NewNote = MIDIByte2 + NoteArray[count]
    
      SendMidiOut MIDIByte1, NewNote, 100
    
      count = count + 1
    
    @End
    
    @MyLabelKnob
      if knob = modeknob
        if knobs[modeknob] = 0
          LabelKnob knob, {Follow Bass}
        elseif knobs[modeknob] = 2
          LabelKnob knob, {Follow High}
        else
          LabelKnob modeKnob, {No Follow}
        endif
      elseif knob = bassKnob
        if knobs[bassknob] = 0
          LabelKnob knob, {Chord Only}
        elseif knobs[bassknob] = 1
          LabelKnob knob, {Bass -12}
        elseif knobs[bassknob] = 2
          LabelKnob knob, {Bass -12,24}
        endif
      elseif knob = strumKnob
        LabelKnob knob, {Strum}
      elseif knob = vrandKnob
        LabelKnob knob, {Rand. Vel.}
      elseif knob = trandknob
        LabelKnob knob, {Rand. Time}
      elseif knob = notesknob
        if knobs[notesknob] = 3
          LabelKnob knob, {Triad}
        elseif knobs[notesknob] = 4
          LabelKnob knob, {7th}
        elseif knobs[notesknob] = 5
          LabelKnob knob, {9th}
        elseif knobs[notesknob] = 6
          LabelKnob knob, {11th}
        elseif knobs[notesknob] = 7
          LabelKnob knob, {13th}
        endif
      elseif knob = prandknob
        LabelKnob knob, {Probability}
      elseif knob = chknob
        if knobs[chknob] = 0
          labelKnob chknob, {Note Ch.}
        else
          LabelKnob chknob, {Note Ch.}, knobs[chknob]
        endif
      elseif knob = basschknob
        if knobs[basschknob] = 0
          LabelKnob basschknob, {Bass Ch.}
        else
          LabelKnob basschknob, {Bass Ch.}, knobs[basschknob]
        endif
      elseif knob = rootknob
        LabelKnob rootknob, {Root }, (NoteName knobs[rootknob]) 
      elseif knob = scaleknob
        LabelKnob scaleknob, (ScaleName knobs[scaleknob]) 
      elseif knob = bypassknob
        if knobs[bypassknob] = YES
          LabelKnob bypassknob, {Bypass ON}
        else
          LabelKnob bypassknob, {Bypass OFF}
        endif
      elseif (knob >= ccstartknob) and (knob <= ccendknob)
        LabelKnob, knob, {cc }, knob + offset
      endif
    @End
    
  • This is what the Ex6.1 version sounds like when cabled to a Bass Synth.
    NOTE: I poked around on the AUM keyboard to transpose the 16 note sequence.

  • Thanks a lot @McD this mite be the simple start I need to finally give Mozaic code a try

  • @Poppadocrock said:
    Thanks a lot @McD this mite be the simple start I need to finally give Mozaic code a try

    Great. There's a lot of help available. Ask any questions on the "Help" thread or here:

    https://forum.audiob.us/discussion/32930/mozaic-create-your-own-au-midi-plugins-out-now/p58

    The Mozaic Manual is really good. It reads like a great programming book:

    http://ruismaker.com/wp-content/uploads/Mozaic.pdf

  • "Is this mic on?"

    I think I might be documenting a path for future readers of the Forum.
    There's not much interest in the topic.

    I should give the effort to the Wiki and someday it will find a reader or 2.
    Or not.

    Programer's get the product and value the features... not that they wouldn't like
    more enhancements: text types, additional GUI types. But unless we find more
    people to "buy in" @Brambos is better off creating new products.

  • Thank you so much @McD I just wrote my first simple Mozaic code really fast thanks to your first exercise. This is awesome, I’m gonna keep going. Cheers mate.

    @OnMidiInput

    SendMIDIOut MIDIByte1, MIDIByte2, MIDIByte3, 0
    SendMIDIOut MIDIByte1, MIDIByte2 + 5, MIDIByte3, 1000
    SendMIDIOut MIDIByte1, MIDIByte2, MIDIByte3 - 15, 2000
    SendMIDIOut MIDIByte1, MIDIByte2 - 5, MIDIByte3 - 25, 2500

    @End

  • If anyone makes it this far and wants more just ask.

  • I've been thinking that a way to somehow draw the pitches or velocities of a sequence would be nice, especially when diddling about in the phone...

    I just thought maybe a way to do it would be to use an xy pad and simply dividing the X into as many divisions as in the sequence and applying any reading of Y as whatever parameter to the requisite knob/slider could work?

    Might it be possible to 'agile' this into one of the basic sequencer scripts? If so is there one that would be best to try it out on?

    Cheers

    Chris

  • Wow, I managed something!

    I started with the SQ8 preset and just swapped the layout number to 3 so that it was sliders instead of knobs, then added a function for the xy pad to change knob values to the y value based on abs(x value/16)... I also swapped the velocity to all be 78 just to test...

    So now to figure out ‘pages’ of these layouts so I can have other values (velocity mainly, but maybe others)

    `@Onload
    ShowLayout 3
    SetMetroPPQN 2
    PresetScale {minorpentatonic}
    LabelKnob 0, {pitch 1}
    LabelKnob 1, {pitch 2}
    LabelKnob 2, {pitch 3}
    LabelKnob 3, {pitch 4}
    LabelKnob 4, {pitch 5}
    LabelKnob 5, {pitch 6}
    LabelKnob 6, {pitch 7}
    LabelKnob 7, {pitch 8}
    LabelKnob 11, {velocity 1}
    LabelKnob 12, {velocity 2}
    LabelKnob 13, {velocity 3}
    LabelKnob 14, {velocity 4}
    LabelKnob 15, {velocity 5}
    LabelKnob 16, {velocity 6}
    LabelKnob 17, {velocity 7}
    LabelKnob 18, {velocity 8}

    LabelKnob 10, {maj <> min}
    LabelKnob 21, {gate}
    LabelKnob 9, {swing}
    LabelKnob 20, {mutate}

    LabelKnob 8, { }
    LabelKnob 19, { }
    LabelKnobs {SQ8 Sequencer}

    @End

    @OnKnobChange
    if LastKnob = 10
    // scale selection
    if (GetKnobValue 10) < 64
    PresetScale {majorpentatonic}
    else
    PresetScale {minorpentatonic}
    endif

    elseif LastKnob = 9
    // swing
    swing = (GetKnobValue 9) / 8
    SetMetroSwing swing

    endif
    @End

    @OnMetroPulse
    pulse = CurrentMetroPulse

    // mutate?
    chance = GetKnobValue 20
    if ( Random 0, 127 ) < chance
    pulse = random 0, 7 // mutate the metronome position
    endif

    // send notes
    pitch = GetKnobValue pulse // pitch
    // vel = GetKnobValue pulse + 11 // velocity
    vel=78
    gate = ( GetKnobValue 21 ) * 10 + 50 // gate
    pitch = ScaleQuantize pitch
    SendMIDINoteOn 0, pitch, vel
    SendMIDINoteOff 0, pitch, 0, gate
    @End

    @OnXYChange

    knobToSet = Abs (GetXValue/16)
    SetKnobValue knobToSet, GetYValue
    @End `

  • Couple of things - that code leaves notes hanging, not sure why, and as it is, extreme right manipulation of the pad moves the unlabelled mutate slider - I added a subtract 1 to the line that works out which knob to mess with but I won't subject you all too the whole code again...

  • edited February 2020

    Eek, I made the metroplex one do my bidding too! I’ve probably bugged it as there’s occasional log notes but it seems to work - basically instead of the xy pad changing global parameters, it changes the values of whichever set of sliders are currently visible...

    I’ve let the original writer of the script know and will see what he thinks of what I’ve done, perhaps put it on patchstorage if he’s cool with that...

  • On @McD 's suggestion I'm resurrecting this thread..... or not, we'll see what happens.......
    Spinoff of this thread:

    https://forum.audiob.us/discussion/37355/request-mozaic-help-midi-output-depend-on-chord-input/p2

    The concept I'm "studying" has to do with developing Mozaic scripting techniques for working with live played chord inputs.

    The most common example of what live played chord input can be used for would be things like an arpeggiator. But there certainly could be other creative applications that could work off of chord inputs!

    This is the crude script I posted to the above linked thread....

    Discussion to be continued in my Next Post.

    // Concept Script
    // Setup Variables and Timer
    
    @OnLoad
    SetTimerInterval 1
    counter = 0
    FillArray chordnote, -1, 10
    @End 
    
    // Record Played Notes to chordnote Array
    
    @OnMidiNoteOn
    
    if counter = 0
    chordnote[0] = MIDIByte2 
    endif 
    
    if counter = 1
    chordnote[1] = MIDIByte2
    endif
    
    if counter = 2
    chordnote[2] = MIDIByte2
    endif
    
    if counter = 3
    chordnote[3] = MIDIByte2
    endif
    
    Inc counter
    
    StartTimer 
    
    @End 
    
    //Use Timer event to Trigger "ifs"
    
    @OnTimer
    
    FillArray chord, -1, 10
    
    // Assign Played Notes to Array Named "Chord"
    
    Chord = [chordnote[0] , chordnote[1] , chordnote[2] , chordnote[3]]
    
    // List all the "if tests"
    // Play only two notes for each chord
    
    // CM
    if chord[0] = 60 & chord[1] = 64 & chord[2] = 67 & chord[3] = -1
    SendMIDIOut MIDIByte1 , 60 , MIDIByte3
    SendMIDIOut MIDIByte1 , 67 , MIDIByte3
    endif
    
    //Cm
    if chord[0] = 60 & chord[1] = 63 & chord[2] = 67 & chord[3] = -1
    SendMIDIOut MIDIByte1 , 60 , MIDIByte3
    SendMIDIOut MIDIByte1 , 63 , MIDIByte3
    endif
    
    //CM7
    if chord[0] = 60 & chord[1] = 64 & chord[2] = 67 & chord[3] = 71
    SendMIDIOut MIDIByte1 , 60 , MIDIByte3
    SendMIDIOut MIDIByte1 , 71, MIDIByte3
    endif
    
    stoptimer
    resettimer
    counter = 0
    FillArray chordnote, -1, 10
    @end
    
    // Send Thur the Off Notes
    @OnMidiNoteOff
    SendMIDIThru 
    
    @End 
    
Sign In or Register to comment.