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 Mozaic help midi output depend on chord input

I would appreciate any guidance you may provide.
I am trying to remap the midi output of chord buttons on an electric accordion.
The accordion chord buttons are on a separate midi channel from other outputs of the accordion. Each one is unique and sends either a 3 or 4 note chord. These notes span only a little more than an octave. There are 76 chord combinations.

I would like to via the script have control of the midi output by detecting which chord buttons are pushed. For example if the chord button for C maj is pushed instead of outputting C-E-G perhaps. I would program only C-G to sound.
I want the output to be only 2 notes instead of the original 3 or 4 notes. Also the new notes will not necessarily be from the original notes.

The possibility of pressing several buttons at once is a further complication.

«134567

Comments

  • @Bellows said:
    I would appreciate any guidance you may provide.
    I am trying to remap the midi output of chord buttons on an electric accordion.
    The accordion chord buttons are on a separate midi channel from other outputs of the accordion. Each one is unique and sends either a 3 or 4 note chord. These notes span only a little more than an octave. There are 76 chord combinations.

    I would like to via the script have control of the midi output by detecting which chord buttons are pushed. For example if the chord button for C maj is pushed instead of outputting C-E-G perhaps. I would program only C-G to sound.
    I want the output to be only 2 notes instead of the original 3 or 4 notes. Also the new notes will not necessarily be from the original notes.

    The possibility of pressing several buttons at once is a further complication.

    If a button or specific note pattern is always mapped to the same notes out this is not too hard.

    Can you make a table with note/notes in and the desired notes out.

    Then it’s a detection and matching for output list of “if” this “then” that. A lot of typing...

    But if there are other conditions to consider then the matching gets harder.

    Two buttons just get processed at the same time but if 2 buttons change the table matchups it gets a lot harder.

    There’s a scripted that does a lot of midi accordion problem solving and @_ki always has great ideas to find optimal solutions.

    But start making a table of notes in mapped to notes out. If the accordion can just send one note it’s really easy to create matching for every unique note.

  • heshes
    edited February 2020

    Interested in Mozaic, but haven't done anything with it yet. I suspect the OP would like guidance on the basic form of whatever function will translate the notes, maybe with two or three sample note translations. Expanding it with the full table info is then just typing/busywork. But I can see how things might look opaque until you get that basic form down.

  • Thanks for your help. I will look into how to make the table. A button always plays the same notes. There are roughly 70 chords included.

  • Is a table the same as an array? I see no mention of table in the Mozaic manual?
    Thanks

  • @Bellows said:
    Is a table the same as an array? I see no mention of table in the Mozaic manual?

    This would not be a trivial transformation in Mozaic if you want to change the chords
    on the output.

    To change the chords you must detect the group of notes that represent a precise button
    push.

    Once detected then you must use Mozaic logic to use the data in your table (which is just a road map for a developer really) to then output the specific chord notes you want to send like dropping a 3rd from a chord. The chords to be send up are being chose by you in this
    suggested table and then integrated into the Mozaic code's logic.

    At a high level the program:
    1. detects incoming chords (which is not trivial but is possible)
    2. uses if (chord_X1) then (chord_X2) logic which will be hundreds of lines of typing/coding.

    The precise description of chord_x1 to N and chord_X1 to N is up to you to define in a table.
    Tables are the best way to organize this type of 1 to 1 relationship.

    There maybe clever optimizations like all Major Chord with any root going out as just Root+5th. It's not clear how complex your mapping table is yet.

    Seeing that data will help.

  • heshes
    edited March 2020

    Hopefully someone can give you or point you to some actual Mozaic code. I have Mozaic, but haven't gotten around to opening it up quite yet. One helpful place to look might be at the mozaic patch called 'Chordial', which translates single notes into played chords. (I saw it mentioned on post in these forums a day or two ago.) Your little patch might operate somewhat similarly, but you would be translating chordbutton chords into played chords, instead of the single notes the Chordial patch translates. I'm not sure in what form the chordbuttons come into Mozaic via midi, but you have to have a handle on that. The Chordial patch can be found here: https://patchstorage.com/chordial/

    For someone who knew what they were doing, just modifying/extending the Chordial patch to translate incoming chords could be a labor-saving way of handling the accordion buttons. Or there may be an even simpler chord-creating patch on patchstorage you could use as a starting point. . . .

  • @hes said:
    Hopefully someone can give you or point you to some actual Mozaic code.

    This is going to be a "custom script" for reasons that I hope will be obvious after some
    additional details on how Mozaic does it's magic.

    Your pseudo code description does match the way Mozaic processes MIDI input.

    function playchord(buttonpressed)

    The button press send out 3-4 distinct MIDi Note On's and later Off's.

    So, a Mozaic coder must create event code blocks to save these notes into a array (Mozaic
    only offers one-dimensional arrays). So before we could even detect a specific Button was pressed we need to process 3-4 events.

    So, a code block like:

    NewNote
    index = 0
    chord_array[0] = note_in
    index = index + 1
    if index > 2
    Call Test_for_Chord
    endif
    End NewNote

    After 3 notes in we then test to see if we got a valid chord... now C+E+G would assume the C Major button was pressed when a B or Bb is yet to be processed. So, we must wait for 4 notes and deal with the ambiguities of a C Major followed by Bb Major which could be misidentified as a C7 followed by D minor. Arg. So we need to consider the timings between MIDI notes and add that to the Test_for_Chord logic.

    The complexity only increases.

    The only effective logic tool for this type of conversion is the if-then command so they get used a lot.

    Now one might ask why is Mozaic so primitive and the answer lies in the AUv3 promise by
    @Brambos to process every midi event and deliver reliable/dependable midi outs. This commitment to keep the code fast and effective in realtime requires him to limit coder logic to short blocks that get processed ASAP so he can continue to process time oriented outputs.

    I can write a script where one note triggers a logical machine that runs for hours and generates a million midi events like you'd expect from a massively complex random sequence generator app. Mozaic is great for that type of music generator.

    Echoes, transformations of single MIDI events are all trivial but a lot of music ideas like this
    proposed use case are harder to create a script for.

    Sometimes people want scripts that act like tape machine that can jump back in time to loop a set of notes: a script with an effective recording device which we see as trivial because so many apps can do this. But in Mozaic we have to manage the "memory" of events by saving notes and related events (channel, velocity, timing details) in One Dimensional Arrays.

    So, this script is possible but would like involve several days of coding/testing for the benefit of a few users.

    We could use this "problem" to teach the language and the group mind to propose the most
    effective solutions as the problem is described and shared in this thread.

    But to do that we need a Table of say 10 buttons with In/Out Notes. Then we could
    describe the code to provide that transformation and the direction towards a final answer
    would be easier to comprehend and implement by a fast typer that gets the new concepts of
    Mozaic coding.

    This code be done in phases and many of the concepts could be used as a starting point for many other types of Mozaic tools:

    Chord Detection is wanted by many users so they can use this logic to do a lot of interesting
    things, like detect C_Major and play a repeated arrpeggio sequence until a new chord is detected. Like a simple kids piano with a chord detector front-ending an Arp function.
    Know how that works would lift the fog over the amazing tool that Mozaic in for making
    automatic MIDI FX tools.

  • @McD said:

    @hes said:

    After 3 notes in we then test to see if we got a valid chord... now C+E+G would assume the C Major button was pressed when a B or Bb is yet to be processed. So, we must wait for 4 notes and deal with the ambiguities of a C Major followed by Bb Major which could be misidentified as a C7 followed by D minor. Arg. So we need to consider the timings between MIDI notes and add that to the Test_for_Chord logic.

    Yes, you're right, I was misunderstanding, didn't at first realize the accordion chordbuttons were actually sending multiple discrete midi notes. That is not a trivial task. At first blush, I'm not even sure it can be accurately done at all if two accordion chord buttons are pressed at the same time (because of ambiguity) as OP says he wants.

    One button chord identification would be difficult enough. I'm sure something similar has been implemented many times, so if OP is serious he might want to look at others who have done this, definitely not as simple as it might seem at first. Unfortunately, a quick check of patchstorage didn't seem to show anything specifically for Mozaic. Github has a number of projects you can look at that do chord identification. Here's a little web app that looks most similar to what OP wants:

    https://mnl.space/Chord-Finder/

    You can find the logic for the chord id part of the javascript program in the files here, which seem more complicated than you'd expect:
    https://github.com/ManuelVargas1251/Chord-Finder/tree/master/src/js

  • Hi,
    Thank you so much for your interest and help. I have handwritten out a table of the discrete midi note on/off sent from each unique chord button. I took a pic but am not sure how to post it yet.
    BTW, there are only midi note #s 50 through 71 used. The Smart Chord Bass v1.1 script identifies chords and outputs a bass root note over the entire midi range. I have a thought that a much simpler script could be used to identify this limited range of notes and chord types. If a simpler script is possible perhaps I could understand it and then address other issues such as 2 chords at once.
    I think a good starting point would to only identify major chords and filter out the third. This would be very useful for producing “power chords”

  • Hi, I found the post pic thing so here it id

  • Hi,
    Something I found by studying the table’s major chords. In every case the lowest number is the root of the chord. In fact all the chords seem to exhibit this quality.
    Thanks for your help.

  • heshes
    edited March 2020

    I took a quick look at Smart Chord Bass and it looks to me like the perfect thing for you to build on. I would copy it, give it your own name, and work by modifying the code on that complete project. Eventually you will see what can be deleted because you're not using it, but I would leave it all in at the start.

    Take all this with a grain of salt; I've never done any midi programming and just took my first look at mozaic code. Someone else may be able to provide you with better help, but I was curious about your problem and mozaic so it was interesting to check it out.

    I don't think the restriction of range from 50 to 71 simplifies much (same principle as it's not different to play a tune in lower register than it is in upper register, and Smart Chord Bass has things set up to restrict any one chord to a narrow range -- see note below**). What should simplify things is you have a limited set of input chords, and you'll be checking for each one individually and explicitly assigning the new translated note values. You will have less abstraction, more typing of explicit particularized instructions. So all the inversion checking code may be superfluous for you. I would ignore possibility of multiple chordbuttons at same time entirely, until you have something that works for single chordbuttons.

    (** Note, I think Smart Chord Bass may have trouble identifying chordbutton chords with too wide intervals,
    e.g, chordbutton E7 or Edim. Fixing this within Smart Chord Bass structure might not be easy, might need to roll your own chord identification procedure, not optimal, that's the main thing SCB could do for you.)

    Not sure, but I think you could tie in within the @OnMidiNoteOn procedure in the if structure with the comment "// Setup bass trigger". It looks like that's the point where all the notes for a chord have been identified. They will be stored at that point in the storeNotes[] array and numactive variable will have the number of notes. If the chord buttons always send the notes in the same order, then you could just call a procedure with your long if statement from there. E.g., instead of "call @InversionsCheck" you could do "call @TranslateChordButton".

    Your @TranslateChordButton might look something like this, not
    most elegant way but at least simple:

    ** Note, I could be wrong about lots of things,
    ** e.g., where/how the chord notes are stored,
    ** or from where you want to call your translation procedure,
    ** but this is the rough form of an example procedure
    ** you could call, after a chord has been identified . . .

    @TranslateChordButton
    
    if numactive=3  // if structure to translate 3 note chordbuttons
      myactivenotes=3
    
      if storedNotes[0] = 60 and storedNotes[1] = 64 and storedNotes[2] = 67  // CMaj
         newnote1= ?  // for new notes substitute whatever values you want
         newnote2 = ?
         newnote3 = ?
         // you could add more notes:
         newnote4 = ?
         myactivenotes = 4 // but then you want to record this change
      elseif storedNotes[0] = 61 and storedNotes[1] = 65 and storedNotes[2] = 68  //C#Maj
         newnote1= ?
         newnote2 = ?
         myactivenotes = 2 // use only two notes in this translation
      elseif ... .   // continue for all the rest of 3 note chords
      // lots of typing
      endif
    
    endif
    
    if numactive=4 // if structure to translate 4 note chordbuttons
      myactivenotes = 4
    
      if storedNotes[0] = 60 and storedNotes[1] = 64 and storedNotes[2] = 70 and storedNotes[3] = 67  // C7
         newnote1= ?  // for new notes substitute whatever values you want
         newnote2 = ?
         newnote3 = ?
         newnote4 = ?
      elseif storedNotes[0] = 61 and storedNotes[1] = 65 and storedNotes[2] = 71 and storedNotes[3] = 68  //C#7
         newnote1= ?
         newnote2 = ?
         newnote3 = ?  
         myactivenotes = 3 // just do 3 note translation for this 4 note chord
      elseif ... .   // continue for all the rest of 4 note chords
      // lots of typing
      endif
    
    endif
    
    // not sure where you'd change code to have these newnotes played
    // (or even of the command in mozaic that plays a note! SendMidiNoteOn?)
    // it would be at same spot wherever bass note is currently played
    // and note off commands wherever current bass note off command is sent
    // you could delete/skip the existing bass note on and off commands.
    // use myactivenotes to control how many of your notes are played
    
  • wimwim
    edited March 2020

    Hi @hes - if you put three “`” marks on a line by themselves before and after your code, the code will render in a code block:

    ```
    Here’s my code.
    ```

    Here’s my code.
    
  • To walk before you run...

    Don’t forget that MIDI FX apps like Mozaic scripts can be run in series in a DAW or AUM. First process your buttons into the Bass detection script that exists to get the bass notes and then run another Mozaic script you create to add the 5th and Octave and you will create power chords. This will still run with low latency.

    People might like a power chord script in it's own right. It's probably 10-20 lines of code max.
    Adding 2 notes to a bass note is trivial to start learning how things work.

    The chord detection is a lot more work... understanding one that does it might also be tricky.
    But someone with the right skill level could add the extra 2 notes using 5-10 lines if they can follow the logic or the source code.

    Try to credit the original author in any case for the heavy lifting.

  • Thanks very much. I will analyze your suggestions in detail.
    Just before I received your reply I did try to modify Smart Chord Bass.
    @ OnTimer
    (the event before@OnMidiNoteOn)
    where the line
    “SendMIDINoteOn bass channel,bassNoteOut,_vel” is I added a new line
    “SendMIDINoteOn Bass channel, bassNoteOut +7, _vel”

    To my surprise this worked playing just the bass note and the 5th above. Whoo Hoo!

    However I do not know how or where to send a MIDINoteOff command to turn the note off.

    I very much like your idea of eliminating things I do not need from this script. I will now go back and study your suggestions.
    Thank you very much. You have given me inspiration on a project I had already given up on several times.

  • @Bellows - One challenge with chord detection can be timing. If you have a way to measure the time (if any) between the notes sent then detecting the set of notes that make up the chord is easier. Also, looking at what happens when two buttons are pressed are sent to see if the note groups are separated by some minimum amount could be helpful.

    I decided myself not to try to do chord detection in Mozaic unless there is some guarantee that notes will always arrive within a certain timeframe (i.e. they won’t be “strummed”) that they will always arrive in the same order, and that no two chords’ note-on events will be mixed up together (i.e. there will be an identifiable gap between the last note of a chord and the first chord of the next.)

    Just some random thoughts from what I found considering one person’s request for a script that I declined because I didn’t feel like I could make it work well.

    If you can nail down how to reliably capture an individual chord even though theres a possibility of more than one button being pushed at a time, then you should be successful.

  • heshes
    edited March 2020

    @wim said:
    @Bellows - One challenge with chord detection can be timing. . . .

    I think that's one of the advantages of building off of Smart Chord Bass, using its chord detection logic, which among other things accounts for the timing subtleties. If SCB properly identifies a chordbutton's chord to output the bass note, then there is some not too difficult way to splice in and provide your own chord translation. (Except for the case of two chordbuttons at same time, where you'd need to figure out and apply your own timing checks, and further modify SCB, because SCB is set up to play only one chord's bass [or in Bellow's case, one chord] at a time.)

    SCB uses the Creative Commons 4.0 copyright license. So, using SCB like this, if Bellows were to release the code himself he would want to follow the attribution rules: https://creativecommons.org/licenses/by/4.0/

  • @McD said:
    To walk before you run...

    Don’t forget that MIDI FX apps like Mozaic scripts can be run in series in a DAW or AUM. First process your buttons into the Bass detection script that exists to get the bass notes and then run another Mozaic script you create to add the 5th and Octave and you will create power chords. This will still run with low latency.

    People might like a power chord script in it's own right. It's probably 10-20 lines of code max.
    Adding 2 notes to a bass note is trivial to start learning how things work.

    The chord detection is a lot more work... understanding one that does it might also be tricky.
    But someone with the right skill level could add the extra 2 notes using 5-10 lines if they can follow the logic or the source code.

    Try to credit the original author in any case for the heavy lifting.

    Thanks very much. The series idea will prove very useful. -Ki is the author of Smart Chord Bass.

  • First off, I'm not a programmer, so take this with a grain of salt....

    I think you all might be overthinking this. Creating a generalized tool for recognizing chords is tricky, but the solution to the ask could be simpler. It all depends on what the accordion outputs.

    Assuming the notes from each chord button are output consistently (e.g. always in the order that @Bellows listed in their chart), identification would simply a set of nested conditionals. You might not have to check beyond 3 notes; the only ambiguity is Major or 7th, but in the chart the 7th note is listed before the 5th. If that's how the notes are actually output, you would have your identity after 3 checks.

    No need for arrays, checking for inversions, etc.

    Again, this is assuming the notes are output consistently.

    And, to be clear, there would still be a lot of typing and conditional checks, but the logic is much simpler.

    Multiple chord button presses would be a lot harder. But assuming the chord notes are output as close to simultaneous as MIDI allows, it should still be easier than a generalized identification tool as you could set your check window to be very short.

  • heshes
    edited March 2020

    @Bellows said:
    Thanks very much. I will analyze your suggestions in detail.
    Just before I received your reply I did try to modify Smart Chord Bass.
    @ OnTimer
    (the event before@OnMidiNoteOn)
    where the line
    “SendMIDINoteOn bass channel,bassNoteOut,_vel” is I added a new line
    “SendMIDINoteOn Bass channel, bassNoteOut +7, _vel”

    Using something like @TranslateChordButton procedure I wrote above, you might
    modify things in @OnTimer like this:

    @ OnTimer
    [. . . ]
    //SendMIDINoteOn bass channel,bassNoteOut,_vel
    if myactivenotes=2
      SendMIDINoteOn bass channel,newnote1,_vel
      SendMIDINoteOn bass channel,newnote2,_vel
    elseif myactivenotes=3
      SendMIDINoteOn bass channel,newnote1,_vel
      SendMIDINoteOn bass channel,newnote2,_vel
      SendMIDINoteOn bass channel,newnote3,_vel
    elseif  myactivenotes=4
      SendMIDINoteOn bass channel,newnote1,_vel
      SendMIDINoteOn bass channel,newnote2,_vel
      SendMIDINoteOn bass channel,newnote3,_vel
      SendMIDINoteOn bass channel,newnote4,_vel
    endif
    [. . .]
    

    I assume bass channel controls which output synth the note is sent to,
    so you might want to change that.
    And add something analogous wherever the SendMidiNoteOff for the bass note is.

  • @aplourde said:
    First off, I'm not a programmer, so take this with a grain of salt....

    I think you all might be overthinking this. Creating a generalized tool for recognizing chords is tricky, but the solution to the ask could be simpler. It all depends on what the accordion outputs.

    Assuming the notes from each chord button are output consistently (e.g. always in the order that @Bellows listed in their chart), identification would simply a set of nested conditionals. You might not have to check beyond 3 notes; the only ambiguity is Major or 7th, but in the chart the 7th note is listed before the 5th. If that's how the notes are actually output, you would have your identity after 3 checks.

    No need for arrays, checking for inversions, etc.

    Again, this is assuming the notes are output consistently.

    And, to be clear, there would still be a lot of typing and conditional checks, but the logic is much simpler.

    Multiple chord button presses would be a lot harder. But assuming the chord notes are output as close to simultaneous as MIDI allows, it should still be easier than a generalized identification tool as you could set your check window to be very short.

    That’s the point I was trying to make. Ki’s script is brilliant. He did that to overcome the timing and overlap difficulties in detecting chords. He succeeded where I wasn’t even willing to try.

    But, all that can be avoided if the output is predictable. Determining the predictability by monitoring and looking at the output could lead to a more simple script.

    On the other hand, if Ki’s script works reliably for this situation (easy enough to test), then extending something already done could be a much easier path.

  • @wim said:
    @Bellows - One challenge with chord detection can be timing. If you have a way to measure the time (if any) between the notes sent then detecting the set of notes that make up the chord is easier. Also, looking at what happens when two buttons are pressed are sent to see if the note groups are separated by some minimum amount could be helpful.

    I decided myself not to try to do chord detection in Mozaic unless there is some guarantee that notes will always arrive within a certain timeframe (i.e. they won’t be “strummed”) that they will always arrive in the same order, and that no two chords’ note-on events will be mixed up together (i.e. there will be an identifiable gap between the last note of a chord and the first chord of the next.)

    Just some random thoughts from what I found considering one person’s request for a script that I declined because I didn’t feel like I could make it work well.

    If you can nail down how to reliably capture an individual chord even though theres a possibility of more than one button being pushed at a time, then you should be successful.

    Thanks so much for this info. I used -Ki’s Smart Chord Bass to verify that these bass buttons if pressed one at a time show 0 ms between the discrete notes. No strum effect on a single chord button.
    One of many simple things I don’t understand is why if I have midi notes on I cannot use simple if/then statements to detect a combination and then output a note or notes all before I send a midi note off type of command. Thank you for your patience.

  • @Bellows said:
    One of many simple things I don’t understand is why if I have midi notes on I cannot use simple if/then statements to detect a combination and then output a note or notes all before I send a midi note off type of command. Thank you for your patience.

    I’m not sure I understand what you’re saying, but I don’t see any problem doing what you are saying that you can’t do.

  • @Bellows said:
    One of many simple things I don’t understand is why if I have midi notes on I cannot use simple if/then statements to detect a combination and then output a note or notes all before I send a midi note off type of command. Thank you for your patience.

    The chords notes arrive one-by-one, and their order is not determined. The OnMidiInput is called for each of them - so you have to store the notes and when you have collected all of them you can start you if-cascade...

    Arriving with 0ms offset makes things easier. Together with the notes i then would store the SystemTime and if for the current call the SystemTime differs from the last stored systime, you can drop all stored notes and do a fresh start collecting notes. If you stored 3 or 4, start interpreting them to find which chord was send.

  • Assuming the notes from each chord >button are output consistently (e.g. always >in the order that @Bellows listed in their >chart), identification would simply a set of >nested conditionals.But assuming the >chord notes are output as close to >simultaneous as MIDI allows, it should still >be easier than a generalized identification >tool as you could set your check window to >be very short.

    Thanks again everyone. Since I could not see an order in -Ki’s SCB I input my accordion to MidiWrench. The order of discrete notes is always consistent on any single chord button press. It is exactly opposite what I wrote from left to right. In other words C major on my chart reads 60-64-67. In reality the order per MidiWrench is 67-64-60 and it is consistent.

  • @Bellows said:

    Assuming the notes from each chord >button are output consistently (e.g. always >in the order that @Bellows listed in their >chart), identification would simply a set of >nested conditionals.But assuming the >chord notes are output as close to >simultaneous as MIDI allows, it should still >be easier than a generalized identification >tool as you could set your check window to >be very short.

    Thanks again everyone. Since I could not see an order in -Ki’s SCB I input my accordion to MidiWrench. The order of discrete notes is always consistent on any single chord button press. It is exactly opposite what I wrote from left to right. In other words C major on my chart reads 60-64-67. In reality the order per MidiWrench is 67-64-60 and it is consistent.

    Are you sure the order in MidiWrench is being interpreted correctly? The oldest note (the first one played/sent) is on the bottom of the list. The top is always the most recent. I've made that mistake so many times when debugging MIDI issues.

  • I had another script in the works that did chord detection for 23 3&4 note chords including all their inversion and also two voicings for all 12 root notes with an updated and optimized detection algorithm (without the need of if-cascades due to pre-computation) . But i stopped working on it in mid january - other ideas surfaced and meanwhile i did several other scripts.

    .

    Four of them are ready since weeks, the only obstacle to their publishing is the feeling that i would have to do videos, because less and less people read instructions.
    And doing videos takes me at least two full days mainly doing nothing else. Having a stressful time at work results in the need for relaxed weekends without any pressure, i enjoy watching videos or jamming around with the scripts i made. But meanwhile it starts feeling bad that i do not manage to get any progress with needed videos.

    And two of the scripts were kind of dead-ends. Fully developed, debugged and optimized in about 70 hours development time in long evenings of two weeks plus weekends. Meant to solve a midi routing problem i had with audiobus.
    After everything was done and while writing the documentation and testing around for the planned video, i found a direct way without the need of scripts. That was a real bummer - now after trying around with other hosts, i found at least another simple use-case in Cubasis 2, but probably nobody will need this. Nevertheless i will probably publish the script pair since its at least technical interesting.

  • heshes
    edited March 2020

    @aplourde said:
    Assuming the notes from each chord button are output consistently (e.g. always in the order that @Bellows listed in their chart), identification would simply a set of nested conditionals. You might not have to check beyond 3 notes; the only ambiguity is Major or 7th, but in the chart the 7th note is listed before the 5th. If that's how the notes are actually output, you would have your identity after 3 checks.

    I like your idea, but I'm not sure.

    How would you handle a CMaj chord (C-E-G) followed by a Bb? C-E-G defines a chord, then how do you determine whether the following Bb is part of a C7 or the start of a new Bb chord? Seems you'd have to resort to timing. And are there more unforeseen issues like this? Not clear to me whether this approach would be better than hacking on to previously existing generalized chord detection. Maybe it would.

    [ EDIT: Whoops, just grasped your point about 7th note being listed before 5th. Yes, if that's consistent then you may be right. . . .]

    Just to clarify, @Bellows would likely not need to use any of the inversion checking in the existing Smart Chord Bass app, could just ignore it (can delete it once it's certain to be unnecessary). And the extension I offered did use an existing array (very straightforward one) but avoided creating any new arrays (which are actually a simplifying structure if used properly, not really a complicating one). Plus SCB has all the UI stuff in place, too, to be used if desired. Having said all that, I'm still not sure extending SCB would be all smooth sailing. Main problem I see is with two chordbuttons at once, but if first chord's notes are guaranteed to all arrive before the next chord's start (likely scenario given this sort of programming) then it fairly simple timing check might solve the problem.

  • @McD said:
    Are you sure the order in MidiWrench is being interpreted correctly? The oldest note (the first one played/sent) is on the bottom of the list. The top is always the most recent. I've made that mistake so many times when debugging MIDI issues.

    You are correct. I made that mistake just now. The order shown in MidWrench is as written on my table.
    Thanks for checking.

  • @Bellows said:

    @McD said:
    Are you sure the order in MidiWrench is being interpreted correctly? The oldest note (the first one played/sent) is on the bottom of the list. The top is always the most recent. I've made that mistake so many times when debugging MIDI issues.

    You are correct. I made that mistake just now. The order shown in MidWrench is as written on my table.
    Thanks for checking.

    FYI...

    When communicating on an old thread I think I discovered that the text window in MidiWrench allows for text cut and paste.
    So, you could press a row of buttons and paste the MidiWrench text into a window and for many programmers that's as good as an image of a hand written table. Text is generally preferred by programmer's sine they can often slice it into a useable form really fast in their editor of choice.

Sign In or Register to comment.