Translator Pro note proximity filtering?

Good evening Gentlemen,

is it possible to do the following with MTP:

  • chord on midi in
  • one note nearest midi note number X is forwarded to the output
  • all note offs are forwarded (to prevent stuck notes)

Cheers!
Markus

Hi and welcome to the Bome community!

For chord on midi in do you mean one note in to output a midi chord? Yes this is possible. For chord off we would use note-off to send note off messages for the entire chord.

If you mean for a given chord in, send a single MIDI note. Yes this is also possible. but a bit more complex to setup. Basically you have to look to see that each of x targeted notes (x being how many notes makes the chord) and only fire a note if all targeted notes are depressed at the same time.

Note off to prevent stuck notes. Yes, his is very easy. We just look for note-off any note any channel and send out the same note-off that came in.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Hi Steve,

thanks for the quick response.

It’s the second scenario you mentioned. Sort of, anyway - not sure we’re talking about the same thing regarding the output.
I’m trying to determine whatever note of the incoming chord that is closest to e.g. D#-4 and only send that one out again.

Thank you
Markus

OK so for instance if you strike 2 notes D-4 and F#-4 at the same time you want to suppress the chord and only send D-4 since it is the closest? If so what do you want if the two notes are the same distance, one being say 2 semitones above and the other being 2 semitones below? Sounds like some sort of “harmonizer” algorithm.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Correct :+1:
If 2 notes are the same distance I don’t mind which is picked.

I’m trying to have instruments that all are fed the same chords pick the one note that is closest to their musical sweet spot.

Thank you
Markus

OK, how do you want to pick the target note of a given chord? I can show you an example with D#-4 hard coded but I assume the target note for the chord may change throughout the song?

The exercise will be a math exercise using rules, where we evaluate the notes pressed and then using math, determine which of the notes is the least distance from the target note. The more notes you want to evaluate in the chord, the more complex it gets because we have to go through them one by one to determine which is closest. I suggest the notes are the same distance in the opposite direction we pick the lower of the two (for simplicity).

We set up global variables ga-gd as bitmaps to track current notes pressed. Global variables are 32 bit signed integers so 4 global variables will yield tracking of 128 notes (0-127). Input chord, we iterate through the notes pressed and use math rules to determine which of the 128 notes is closest to the target and send only that note. We might need to give 10 ms or so for the chord to settle as fingers might not be that precise (you may not hit all of the notes in the chord at the exact same instant). If you end up receiving a single note only then only that note will sound (as it would be the closest).

Make sense?

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Steve,

that sounds fantastic. The sweet-spot note will be unique per translator and ultimately midi channel (one instrument per midi channel).
The max number of notes will be 10.

The 10ms delay sounds good… I’m thrilled MTP can accommodate for that.

Thank you
Markus

Well there would be multiple translators to pull this off so not sure if we could determine the target note per translator as you say. If you have multiple MIDI channels, I assume you don’t care what MIDI channel the note comes in on? We need a reliable method to determine the target note at any given time to compare the chord against.

The way it would work is

  1. Look at current notes pressed
  2. Determine the target note
  3. Identify which note is closest
  4. Send the closest note

There is one translator that sets the note bit map and another one that clears the bit map.
There needs to be another translator that sets the target note
There needs to be another timer translator to iterate through the notes and determine the closest note.
There is another timer that is called by the translator above to send the note.
When the note is released there needs to be a translator to send the note-off message on the note played and on the same channel.
You didn’t indicate which MIDI Channel you wanted the note played. If this is also going to vary, it will be more complex. My initial assumption was that it would always be on a single set MIDI Channel.

The way the iterator would work is to go from top to bottom to see what notes are being played, if the current iteration is closer than the last iteration, we save that for later. When all 128 notes are completed we take the note we saved and send it.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

For starters one port per sweet-spot note works. So channel 1 in, 1 out?

Thanks for taking the time to answer my greenhorn questions.
Markus

OK, the attached should get you close.

The target note in this case is set in the “Initialize Global Variables” translator as the global variable “gh”.

Init Preset handles the initialization of global variables either by project start or hitting computer ESC key.
Not Tracking preset has 2 translators. Note on, sets a bit in global variables ga-gd depending on the note number. Note of clears the same bit.

Note-on also calls a repeating “Evaluate Chord” timer with 50ms delay . This timer iterates through all notes pressed and determines the closes note to the target not. When it is finished iterating, it sends the note on note number gi at velocity 127.

Note-off will simply send a note off of the evaluated note (gi). It also sets the closest note gi to -1 which means no notes are being pressed. It only does this if no notes are currently being pressed.

All global variables used are in the “Initialize Global Variables” rules of the “Init” preset.

So really what you need to do is figure a better way to set the “target” note. Keep in mind, that doing this with a note-on message may be difficult since this is also the action the triggers the Chord Evaluator.

Closest-Note-2021-04-20.bmtp (4.4 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

I just noticed there is one error in the last file.

In translator chord evaluator change

// Is the new note closer?
if ss<tt then gi=pp

to

// Is the new note closer?
if tt<ss then gi=pp

Wow. Thank you kindly Steve.

Going through it to understand what’s going on.

Thank you!
Markus