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.

MOZAIC - Create your own AU MIDI plugins - OUT NOW!

15657596162102

Comments

  • My longstanding wish is for a class compliant piece of hardware with all of Mozaic's controls, an embedded Mozaic script interpreter, and a facility in Mozaic to upload scripts to the controller. All it would require is the ability to run Mozaic scripts, not to create or edit them.

    Instant hardware dream controller.

    I've been trying to put that bug in Bram's ear since the day I became a Mozaic beta tester. He has politely, and wisely I'm sure, ignored me. o:)

  • @wim said:
    My longstanding wish is for a class compliant piece of hardware with all of Mozaic's controls, an embedded Mozaic script interpreter, and a facility in Mozaic to upload scripts to the controller. All it would require is the ability to run Mozaic scripts, not to create or edit them.

    @Brambos seems to be very good at knowing when users have good ideas.

    Just for conversational purposes: what would it take to make that hardware device possible?
    A Mosaic runtime environment. I'd love to have a Mac Mosaic runtime. I'd pay the typical $30 for it. I think it might be more successful on Mac than on IOS as a standalone app. Maybe Apple's plans to improve platform interoperability will make that more likely in future.

    I suspect Bram spends a lot of time in Apples Xcode using some C-variant low level language.
    While we're learning Mosaic he creates "Mononoke".

    But I also love openly programmable devices... like Raspberry Pi's and Higher level scripting environments like Python and Mosaic for hacking cool stuff.

  • @McD I just got a Launchpad X, and I'm definitely planning to make some scripts for it this year. I'll include support for the other Launchpads also. So far, I've only spent an hour or two, writing a simple script to have Programmer Mode send chromatic notes like Note Mode, and then experimenting with lighting the pads on beat and on MIDI note.

    One idea I have, is a customizable "main script" that can activate modes/menus. And then, ideally, my standalone scripts (and those of anyone else who likes the idea) can be turned into "modules".

    That way, without touching the iPad, I can switch between sequencer, faders, XY pad sequencer, chromatic, etc. I guess every compatible script would need to dedicate maybe four of the CC buttons to "Switch to another script slot".

    For scripts that aren't built for this system, as long as each script can be edited to include a way to enable/disable Programmer Mode with a MIDI message, another MIDI controller+Mozaic script could be used to switch between scripts.

    Special Mozaic hardware would be really cool.....but Mozaic does allow you to create scripts that automatically change the interface being shown, labels can include emojis, the virtual faders can be automated, etc. so I do understand Bram's reasoning. But if I could afford to create or buy a physical version of Layout 0, and write some scripts for it, I think I would do that.

  • edited January 2020

    @Skyblazer anticipating launchpad Mozaic scripts.
    I have some ideas for whoever want to collaborate.
    So far I used the script Channel splitter v0.8 (/8 ch launchpad)
    It’s Turning Launchpad into 8 channel keyboard channel 1-8

    https://www.dropbox.com/s/rovmvzkboilmyjv/ChannelSplitter0.8 8chLaunchpad.mozaic?dl=0

  • Cool to see this used @Tamir_Raz_Mataz - Do let me know if do have feedback or ideas on this. - Thx!

  • @Tamir_Raz_Mataz said:
    @Skyblazer anticipating launchpad Mozaic scripts.
    I have some ideas for whoever want to collaborate.
    So far I used the script Channel splitter v0.8 (/8 ch launchpad)
    It’s Turning Launchpad into 8 channel keyboard channel 1-8

    https://www.dropbox.com/s/rovmvzkboilmyjv/ChannelSplitter0.8 8chLaunchpad.mozaic?dl=0

    I'd certainly be interested in hearing your ideas, and I've never collaborated on any piece of code before, but I'd be interested in collaborating on anything that sounds fun and useful.

  • edited January 2020

    Is this the right thread to ask code questions?

    I'm attempting to learn some of the syntax for making some basic midi manipulation programs.

    This example is from the Mosaic Manual:

    @OnMidiNoteOn
      // store a random number for this note
      SetNoteState MIDIChannel, MIDINote, (Random 0, 5)
    @End
    @OnMidiNoteOff
      // recall the value we stored
      v = GetNoteState MIDIChannel, MIDINote
      Log {We stored: }, v
    @End
    

    I'm trying to understand:
    SetNoteState and GetNoteState

    What is the purpose of the "(Random 0, 5)" in the above example?

    In other words....

    SetNoteState MIDIChannel, MIDINote, "what is this here position for?"

    Also....

    Is it possible to use SetNoteState and GetNoteState to store multiple midi notes, and somehow tag each "SetNoteState container" with some kind of ID, so the data is any particular "SetNoteState container" can be recalled independently from others?

    Or...

    Is SetNoteState a data container that can only be used one "instance" at a time?

    If I wanted to store multiple "NoteStates", and SetNoteState is not meant for doing that, what function could/should I use instead?

  • The last position of the SetNoteState statement is what you want to store related to that particular midi note on that particular channel. It can be any number. In that example, a random number from 0 to 5 is being stored related to the incoming channel/note combination.

    You can only store one value per channel/note at a time. But you can store any number on any number of notes.

    If it helps, you can think of it like a file cabinet with 16 drawers, and 128 file folders per drawer. The only catch is you can only put one piece of paper in each folder. When you want to get that piece of paper out or put one in, you open the drawer (channel #) and the file (note #) and look at and/or replace the paper (the value).

    If you need to store other information about notes, you can create arrays. However, there aren’t any other “two dimensional” arrays like the NoteState structure. So, without resorting to tricks too complicated to explain here, you could, for instance store information about notes one one channel per array. An array in Mozaic is kind of like single file that can hold up to 1024 folders, again each with only one piece of paper each.

    Let’s say you only need to store something about notes on a single channel. You could create an array called “notes01”. If you wanted to save the number 16 related to note 36, it would just be notes01[36] = 16. Now you can retrieve that number by referencing the position in the array.

    I hope that helps. I’m not sure how to gear the answer, not knowing your level of knowledge about programming.

  • @horsetrainer said:
    Is this the right thread to ask code questions?

    I think it might be the only place.

    SetNoteState and GetNoteState

    They are functions to insert and retrieve 1 value from a 16x128 element array.

    What is the purpose of the "(Random 0, 5)" in the above example?

    Just a fast way to generate some values 0,1,2,3,4,5 for inserting.

    SetNoteState MIDIChannel, MIDINote, "what is this here position for?"

    The value to insert in the array.

    Is it possible to use SetNoteState and GetNoteState to store multiple midi notes

    No.

    Is SetNoteState a data container that can only be used one "instance" at a time?

    Yes.

    If I wanted to store multiple "NoteStates", and SetNoteState is not meant for doing that, what function could/should I use instead?

    You need to insert variables into an indexed array that will max at 1024 values. You will likely
    have to invent/design an encoding pattern in the data like:

    channel, note, velocity, time_code

    Go to PatchStorage.com and read some of the more sophisticated Mosaic scripts to benefit from the best Mosaic programmers creations and you'll solve a lot of problems by reading solutions that are more complex than the short code snippets in the manual.

    And keep asking questions because someone will learn something here too.

  • If you wanted to store two values (of limited range), say A and B (from 0 to 127) per note state you could set the note state to: 128 *A + B.
    When retrieving the state, say, as C you can reconstruct: B = C % 128 and A = Div (C - B ), 128

  • @wim @McD

    Thanks,

    The filing cabinet comparison was helpful for understanding how the SetNoteState stores data.

    I'm still having difficulty understanding what..... " variable = GetNoteState MIDIChannel, MIDINote"...
    Uses as the "unique Identifier", that allows retrieval from one desired file in the filing cabinet amongst many other files?

    The only thing I can think of is that the elements of "MIDIChannel" and "MIDINote" are actually variables, and it's the position these variables are located after the "GetNoteState function" that determines which variable gets assigned the "Channel Data" and the "Note Data".

    If that's the case, then it might be better to explain the function like this:

    SetNoteState (Some Variable for MIDI Channel goes here) , (Some Variable for MIDI Note goes here), (This is a space to store an optional variable that can be set some desired value)

    Am I right or am I wrong?

    Are all the following valid:

    1) SetNoteState ChannelFileLocation1, NoteFileLocation1, OptionalFileLocation1

    2) SetNoteState ChannelFileLocation2, NoteFileLocation2, OptionalFileLocation2

    3) SetNoteState ChannelFileLocation3, NoteFileLocation3, OptionalFileLocation3

    Then I can pinpoint a location for the program to find my stored Midi Data, by using the same variables I used to store the data:

    1) variable1 = GetNoteState ChannelFileLocation1, NoteFileLocation1

    2) variable2 = GetNoteState ChannelFileLocation2, NoteFileLocation2

    3) variable3 = GetNoteState ChannelFileLocation3, NoteFileLocation3

    But now I'm confused as to what happened to the "Optional File Location" on the end of the SetNoteState function?

    My programming level is... Basic on an Atari 800, circa 1980.

  • @wim said:
    My longstanding wish is for a class compliant piece of hardware with all of Mozaic's controls, an embedded Mozaic script interpreter, and a facility in Mozaic to upload scripts to the controller. All it would require is the ability to run Mozaic scripts, not to create or edit them.

    Instant hardware dream controller.

    I've been trying to put that bug in Bram's ear since the day I became a Mozaic beta tester. He has politely, and wisely I'm sure, ignored me. o:)

    I guess that such a controller would have its limitations, especially when using it in a DAW-like environment where you want your Mozaic script to run in sync with beats, bars and without the bandwidth limitations of the MIDI protocol.
    I can understand Bram not willing to go the hardware route, building such a box with an acceptable design that works reliably and conforms to all kinds of worldwide regulations certainly goes a bit further than writing code on a computer keyboard.
    It would think twice before doing something like that.
    Maybe a very active Eurorack module developer would be interested to pick up on the idea?

    Also, I could imagine a very ambitious developer building an ARM-based Mozaic engine for the Behringer BCx2000...
    http://willem.engen.nl/projects/bc2000-dev/

    The developer of the Zaquencer has already shown that such is perfectly possible:
    https://zaqaudio.com/

  • _ki_ki
    edited January 2020

    @horsetrainer

    Variables are like the storage drawers described above. You can put a number in using assignment varA = 100 The right part after the ‚assignment operator =‚ can be an expression containing computation with functions and mathematical or logical operations.
    You retrieve the number by ‚using‘ the variable in expressions like in varB = varA + 10 (where a variable named ‚varB’ is assigned the sum of the content of varA plus 10) or as parameter to a function like Log {varA is}, varA

    All Mozaic variables can only store numbers - and also each variable you ‚generate‘ always will generate a big storage container with 1024 drawers each. The drawers to pick from that container is selected by using the array operator [ ] - where the number in between the brackets specifies which Of the 1024 is used. If the [ ] are omitted, Mozaic will use the drawer with index 0. so varA is indeed varA[0]

    A function is something that returns a value. Functions may have parameters like Random, which has two of them specifying the minimum and maximum for the random number to be returned.

    MIDIChannel, MIDINote , LastPad etc are functions without parameters. They return a value. Like MIDIChannel will return the channel used in the current midi event, or LastPad will return the last pressed pad in @OnPadDown and @OnPadUp.

    .

    SetNoteState is a function with three parameters, it accesses a two dimensional container with 16 x 128 drawers. (So it contains 2048 elements, which makes it different from the variables). The first parameter is the row which is allowed to be between 0 and 15, and the second parameter the colum allowed to be between 0 and 127. The third parameter is the value to be put into this specific drawer

    GetNoteState retrieves the number from that specific two dimensional container. The two parameters specify the row and column.

    ResetNoteState sets the values of all 16x128 drawers to the value given as parameter at once.

  • edited January 2020

    @rs2000 said:
    I can understand Bram not willing to go the hardware route, building such a box with an acceptable design that works reliably and conforms to all kinds of worldwide regulations certainly goes a bit further than writing code on a computer keyboard.
    It would think twice before doing something like that.

    Before I released the original Ruismaker as a mobile plugin, I was planning to make it a hardware drum machine - via the Kickstarter route.

    I had already made the code work on the ARM processor of choice, including all the necessary USB and MIDI connections. Made the hardware designs, selected all the components, etc.

    But things eventually got stuck trying to find a manufacturing partner. I never got further than a few quotes on the plastic parts. Making hardware is quite a painful process, especially when you start thinking about worldwide support/shipping/returns/repairs and (when necessary) certifications... :/

    I managed to turn the project into something good though :D

  • edited January 2020

    @brambos I bet that one of the active Eurorack module manufacturers would be willing to do it, now that music hardware manufacturing has kinda seen a revival.
    Just hand over the designs and earn $20 for each sold box 😅

  • I have a question for the real programmers here that have created amazing tools using Mosaic as is but probably know where they'd like to see an extra feature or language construct.

    If you could add one language feature to the core Mosaic runtime what would it be?

    Multi-dimensional arrays?
    A GUI extension like a Logging terminal that can prompt the User and accept CSV numeric input

    Just curious what additional programming concepts would open additional potential for this
    great IOS Music toolset.

    As a community of users we could benefit from growing the user base which feeds @Brambos with additional revenue to consider implementing new features or porting to
    Mac/PC or licensing the code to a hardware mfg.

  • @McD said:
    I have a question for the real programmers here that have created amazing tools using Mosaic as is but probably know where they'd like to see an extra feature or language construct.

    If you could add one language feature to the core Mosaic runtime what would it be?

    Multi-dimensional arrays?
    A GUI extension like a Logging terminal that can prompt the User and accept CSV numeric input

    Just curious what additional programming concepts would open additional potential for this
    great IOS Music toolset.

    As a community of users we could benefit from growing the user base which feeds @Brambos with additional revenue to consider implementing new features or porting to
    Mac/PC or licensing the code to a hardware mfg.

    Access to the file system for a few basic operations such as including scripts into other scripts, reading, altering and saving MIDI files, reading and writing saved system states of a script (save presets to file). For the midi files, ideally, suitable extensions to work with the data as we do now with live data, but coming from and going to files instead.

  • wimwim
    edited January 2020

    @horsetrainer said:
    @wim @McD

    Thanks,

    The filing cabinet comparison was helpful for understanding how the SetNoteState stores data.

    I'm still having difficulty understanding what..... " variable = GetNoteState MIDIChannel, MIDINote"...
    Uses as the "unique Identifier", that allows retrieval from one desired file in the filing cabinet amongst many other files?

    The only thing I can think of is that the elements of "MIDIChannel" and "MIDINote" are actually variables, and it's the position these variables are located after the "GetNoteState function" that determines which variable gets assigned the "Channel Data" and the "Note Data".

    ^this.

    That’s exactly right, with a few added details. In the statement above, variable = GetNoteState MIDIChannel, MIDINote, MIDIChannel and MIDINote are two special variables that automatically represent the channel and note received inside a MIDI event if the received message was a note. So, if a note 60 was received on midi channel 1, then what that statement would really be saying is variable = GetNoteState 0, 60 and it would put whatever was stored by SetNoteState 0, 60 previously into “variable”.

    A common use for NoteState is to keep track of whether notes have been played or not. Here’s an example:

    @OnLoad
      //Start off with FALSE stored for all channels and notes
        //TRUE is a constant and equals the number 1. 
        //FALSE is a constant and equals 0
        //The statement below could also be written "ResetNoteStates 0"
    
      ResetNoteStates FALSE
    @End
    
    @OnMidiNoteOn
      //MIDIChannel = the channel the note was received on
      //MIDINote =  the note number
    
      Log {Received Note-ON: }, MIDINote, { on channel#: }, MIDIChannel
    
      if (GetNoteState MIDIChannel, MIDINote) = TRUE
        //uh-oh, we never got a note-off for the last note-on, better send one
        SendMIDINoteOff MIDIChannel,MIDINote,0
        SetNoteState MIDIChannel,MIDINote,FALSE
      endif
    
      SendMIDIThru 
      SetNoteState MIDIChannel, MIDINote, TRUE
    @End
    
    @OnMidiNoteOff
      Log {Received Note-OFF: }, MIDINote, { on channel#: }, MIDIChannel
      SetNoteState MIDIChannel, MIDINote, FALSE
    @End
    
  • McDMcD
    edited January 2020

    @horsetrainer said:
    Is SetNoteState a data container that can only be used one "instance" at a time?

    You can pack extra information into a single value using the Tips created by @_Ki and
    posted on the AudioBus Wiki:

    https://wiki.audiob.us/mozaic_tips_and_tricks

    Most MIDI variables fit in a byte and @_Ki shows how to pack 3 bytes into
    a tasty 24-bit sandwich and unpack it back to 3-bytes.

    This could make the 16x128 Notestate Matrix hold a lot more metadata.

    Thinking of a useful application that uses this might lead to something really powerful.

    Inquiring minds want to know if this technique could be extended to 4 bytes.
    I think the answer has been documented in this thread as "No" by @brambos.

    It's a bad idea to bother him so Mononoke isn't delayed any further.

  • @wim said:
    Access to the file system for a few basic operations such as including scripts into other scripts, reading, altering and saving MIDI files, reading and writing saved system states of a script (save presets to file). For the midi files, ideally, suitable extensions to work with the data as we do now with live data, but coming from and going to files instead.

    Good ideas.

    I can think of cases where writing and reading of arrays into a file might be handy to solve
    storage/state scaling constraints. @brambos primary focus is to insure he never misses an event by committing to additional work that might break things.

    You know how Fractal Bits lets a user drop in an 8 character plain text input? I'd like the ability to prompt for and accept valid variable text. Is there an AUv3 MIDI app that exposes a text field in it's GUI? Nothing comes to mind.

    I hacked out a way to let the user dial-in a 16-bit pattern across 4 knobs with the 4-bits indicated under the knob as a label (with @_ki's assistance of course) and it really opened up a lot of possibilities to have that range of user input.

  • @McD said:
    I have a question for the real programmers here that have created amazing tools using Mosaic as is but probably know where they'd like to see an extra feature or language construct.

    If you could add one language feature to the core Mosaic runtime what would it be?

    Multi-dimensional arrays?
    A GUI extension like a Logging terminal that can prompt the User and accept CSV numeric input

    Just curious what additional programming concepts would open additional potential for this
    great IOS Music toolset.

    As a community of users we could benefit from growing the user base which feeds @Brambos with additional revenue to consider implementing new features or porting to
    Mac/PC or licensing the code to a hardware mfg.

    Strings. Assigning them to variables and string concatenation would have saved me a bit of bother.

  • @wim @_ki @McD

    Thanks for your helpful explanations.
    I've managed to get a few experiments work in Mozaic.

    I'd like to find a more in-depth tutorial as close as possible to the Mozaic language.

    I think I read somewhere that Mozaic is based on Pascal? Is that right?

    Maybe I can find some youtube videos and/or websites that will help clarify these concepts for me. But I want to make sure I'm looking up the correct language to study.

  • @horsetrainer Mozaic is domain specific programming language, so several concepts of general purpose languages are missing:

    • There is only one data type: Numbers. But these can not only be used as floating point values, but also as integers, booleans and bitfields. And each defined variable is automatically an array of numbers, even if only the elem[0] is used in the script.
    • There is no ‚scope‘ concept, all variables are global to the script (and some even global to all script instances)
    • User defined functions don‘t support parameters, you have to carefully use the globals variables.
    • No IO functions (read a character or a file) - but the GUI elements fire events so that the user can interact with the script.

    BTW: I use a naming scheme: globalsAreCamelCase, CONSTANTS_ALL_UPPERCASE, function pParameters start with lowercase p and _localTemporary variables start with underscore.

  • @horsetrainer said:
    @wim @_ki @McD

    Thanks for your helpful explanations.
    I've managed to get a few experiments work in Mozaic.

    I'd like to find a more in-depth tutorial as close as possible to the Mozaic language.

    I think I read somewhere that Mozaic is based on Pascal? Is that right?

    Maybe I can find some youtube videos and/or websites that will help clarify these concepts for me. But I want to make sure I'm looking up the correct language to study.

    I’d more say Mozaic is inspired by Pascal than based on it. There are similarities in syntax, that’s all. So I don’t know of videos or tutorials thatbwould be specifically helpful.

    The best resource is the extremely helpful manual. It not only covers the usage of every function in detail, but also has great descriptions of basic programming concepts and MIDI specifics. There are also numerous demo and tutorial scripts included with the app. Just going through and understanding these is helpful.

    Best of all is to jump in and try to do something simple. It doesn’t take long to get a feel for how things work once you start digging in and figuring out how to do what you want the script to do.

  • @mbncp said:

    @MonkeyDrummer said:
    Curious, as I have not taken the plunge yet...How difficult would it be to code up a utility so that a momentary hardware button (ie blueboard) can be converted into a toggle that can send configurable note or cc within AUM... AAAAND, be set up so that regardless of the state of the toggle, whenever you restart AUM/Mosaic, the toggle is in the off state. The second part is important...

    I use this in my setup, may need some changes
    ? How is the code mark supposed to work ?

    // CC-Switch  (Mozaic v1.03)
    
    // Allows the use of a Controller to act like a switch 
    // Usefull with controllers that return to their initial position once you release them
    // The state is stored for each midi channel
    // Off course you can also use the pads 
    
    @OnLoad
      // Adjust to your needs
      TrigCC = 64         // Incoming CC to make it act like a switch
      OutCC = 64          // CC to send on switch change
      CCVal = [0,127]     // CC value on switch OFF, ON
      CCValRange = 15       // CC input value tolerance, for a knob use 64
      //    
      FillArray TrigState, 0,16   // keep state of all channels
      FillArray TrigReset, 1,16
      SetShortName {Switch}
      LabelPads {CC }, OutCC, { State for Chn 1-16}  
      ShowLayout 2
      for n = 0 to 15
        LabelPad n, n+1  
       endfor 
      Call @UpdateGUI
    @End
    
    @OnMidiInput
      If MIDICommand = 0xB0 And MIDIByte2 = TrigCC
        If MidiByte3 > (127 - CCValRange) And TrigReset[MIDIChannel]
          TrigState[MIDIChannel] = not TrigState[MIDIChannel]
          SendMIDICC MIDIChannel, OutCC, CCVal[TrigState[MIDIChannel]]
          TrigReset[MIDIChannel] = 0
          Call @UpdateGUI
        ElseIf MidiByte3 < CCValRange
          TrigReset[MIDIChannel] = 1
       EndIf  
      Else        
        SendMIDIThru  
      EndIf       
    @End
    
    @OnPadUp
      TrigState[LastPad] = not TrigState[LastPad]
      SendMIDICC LastPad, OutCC, CCVal[TrigState[LastPad]]
      TrigReset[LastPad] = 1
      Call @UpdateGUI
    @End 
    
    @UpdateGUI
      for n = 0 to 15
         LatchPad n, TrigState[n]
      endfor 
    @End
    

    Hi Mozaicsters,
    Any help would be appreciated.
    I'm a noob
    I tried editing the code and I'm puzzled - I only managed to change the cc value (hurray :)

    1.I would like to be able to have all pads on the same channel (possibly with a knob for channel selection)
    2.I would like to have a knob selecting cc number per pad

  • @_ki said:
    And Now for Something Completely Different:

    Wow. I totally missed this. This is amazing work @_ki. Thank you for sharing it!

    I'll try to take look at getting it work in Atom or VSCode since they're free. Most modern editor theme/bundle systems (on mac anyway) are based on the original TMBundle formats you already have going so maybe not too much work.

    For Sublime3, i found out that Tools/Developer/ShowScopeName display the current parser scope and so i started adding syntax-error descriptions as fake-contexts allowing to comunicate error messages :)

    Brilliant!

  • @syrupcore said:

    @_ki said:
    And Now for Something Completely Different:

    Wow. I totally missed this. This is amazing work @_ki. Thank you for sharing it!

    I'll try to take look at getting it work in Atom or VSCode since they're free. Most modern editor theme/bundle systems (on mac anyway) are based on the original TMBundle formats you already have going so maybe not too much work.

    For Sublime3, i found out that Tools/Developer/ShowScopeName display the current parser scope and so i started adding syntax-error descriptions as fake-contexts allowing to comunicate error messages :)

    Brilliant!

    I looked briefly into this and it looks like there are come command-line tools to import these kinds of syntax and formatting rules into Atom, but I didn't have a chance to follow-up. If you figure it out, I'd love to know how to do it as I really like Atom.

  • @Tamir_Raz_Mataz said:

    @mbncp said:

    @MonkeyDrummer said:
    Curious, as I have not taken the plunge yet...How difficult would it be to code up a utility so that a momentary hardware button (ie blueboard) can be converted into a toggle that can send configurable note or cc within AUM... AAAAND, be set up so that regardless of the state of the toggle, whenever you restart AUM/Mosaic, the toggle is in the off state. The second part is important...

    I use this in my setup, may need some changes
    ? How is the code mark supposed to work ?

    // CC-Switch  (Mozaic v1.03)
    
    // Allows the use of a Controller to act like a switch 
    // Usefull with controllers that return to their initial position once you release them
    // The state is stored for each midi channel
    // Off course you can also use the pads 
    
    @OnLoad
      // Adjust to your needs
      TrigCC = 64         // Incoming CC to make it act like a switch
      OutCC = 64          // CC to send on switch change
      CCVal = [0,127]     // CC value on switch OFF, ON
      CCValRange = 15       // CC input value tolerance, for a knob use 64
      //    
      FillArray TrigState, 0,16 // keep state of all channels
      FillArray TrigReset, 1,16
      SetShortName {Switch}
      LabelPads {CC }, OutCC, { State for Chn 1-16}  
      ShowLayout 2
      for n = 0 to 15
        LabelPad n, n+1  
       endfor 
      Call @UpdateGUI
    @End
    
    @OnMidiInput
      If MIDICommand = 0xB0 And MIDIByte2 = TrigCC
        If MidiByte3 > (127 - CCValRange) And TrigReset[MIDIChannel]
          TrigState[MIDIChannel] = not TrigState[MIDIChannel]
          SendMIDICC MIDIChannel, OutCC, CCVal[TrigState[MIDIChannel]]
          TrigReset[MIDIChannel] = 0
          Call @UpdateGUI
        ElseIf MidiByte3 < CCValRange
          TrigReset[MIDIChannel] = 1
         EndIf  
      Else      
        SendMIDIThru    
      EndIf     
    @End
    
    @OnPadUp
      TrigState[LastPad] = not TrigState[LastPad]
      SendMIDICC LastPad, OutCC, CCVal[TrigState[LastPad]]
      TrigReset[LastPad] = 1
      Call @UpdateGUI
    @End 
    
    @UpdateGUI
      for n = 0 to 15
         LatchPad n, TrigState[n]
      endfor 
    @End
    

    Hi Mozaicsters,
    Any help would be appreciated.
    I'm a noob
    I tried editing the code and I'm puzzled - I only managed to change the cc value (hurray :)

    1.I would like to be able to have all pads on the same channel (possibly with a knob for channel selection)
    2.I would like to have a knob selecting cc number per pad

    Have you gone through the Mozaic manual? It is very well written and gives some great examples of code to get you started.

    What were you trying to do to the code that couldn't manage to do?

    It will be much easier to help you if you have specific questions.

  • @espiegel123 said:

    @syrupcore said:

    @_ki said:
    And Now for Something Completely Different:

    Wow. I totally missed this. This is amazing work @_ki. Thank you for sharing it!

    I'll try to take look at getting it work in Atom or VSCode since they're free. Most modern editor theme/bundle systems (on mac anyway) are based on the original TMBundle formats you already have going so maybe not too much work.

    For Sublime3, i found out that Tools/Developer/ShowScopeName display the current parser scope and so i started adding syntax-error descriptions as fake-contexts allowing to comunicate error messages :)

    Brilliant!

    I looked briefly into this and it looks like there are come command-line tools to import these kinds of syntax and formatting rules into Atom, but I didn't have a chance to follow-up. If you figure it out, I'd love to know how to do it as I really like Atom.

    Will do. I haven't used it in years but Textmate is still free (mac only) and the TMbundles should work fine. https://macromates.com/download

Sign In or Register to comment.