How to create translator chains

I'm wanting to create a chain of translators so that one translator will respond to the original signal, and the next translator will respond to the translated signal. Basically translators working in serial. I've only been able to achieve translators working in parallel, where each translator responds to the original signal.

Any help would be greatly appreciated.

Thanks

Hi, although his would be possible if you use a MIDI pipe instead of a Bome MIDI Virtual port, this would not be advisable due to the strong possibility of creating a MIDI loop.

Generally the best way to do things serially is to use timers. The first translator takes the incoming MIDI and the outgoing action is a timer that in turn has a different outgoing action. In some cases you might have two translators, the first that sends a MIDI signal out and the second with the same incoming MIDI event that starts a timer with a delay for the second outgoing action and so forth.

If you can provide me an example of the application or device you are trying to control and what you what set of conditions you want to trigger and the desired outgoing actions, I can more than likely recommend a way of handling it. Timers are pretty powerful and in general are the best way to handle a sequence of outgoing events.

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 

Thanks for the response Steve.

So say I want to create a translator that swallows certain notes (IE any note that is not in the C major scale). And then I want to create a translator that transposes each note by two semitones (turning the C scale into a D scale). I can create both pretty well, but when I activate the second translator it essentially deactivates the first one.

Something like the attached should work. I initialized the global variable for transpose amount in translator 0.1

ga=2

Setting ga to 2 will transpose up 2 semitones. You can change this to a different number if you want to transpose differently and then restart the project.

 

There are two transpose translators. One for note-on and one for note off.

We first determine the incoming note number 0-12 of any octave

rr=pp%12

The above is a Modula operator and will result in rr being 0-11 C=0 c#=1 … B=11

Then we determine if we are to transpose or suppress if tt=1 then we transpose, otherwise we suppress the output.

// Set default to not transpose
tt=0
// Evaluate incoming note
rr=pp%12
// C
if rr==0 then tt=1
// D
if rr==2 then tt=1
// E
if rr==4 then tt=1
// F
if rr==5 then tt=1
// G
if rr==7 then tt=1
// A
if rr==9 then tt=1
// B
if rr==11 then tt=1
// Up 2 semitones
if tt==1 then pp=pp+ga
if tt==0 then exit rules, skip Outgoing Action

We then do the same for note-off

When open the project, set the Alias of My Keyboard to point to your actual keyboard. Set the alias of My Application to point to the virtual port monitored by your application (or synth).

Let me know if you have any questions.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz


Attachments:
1567541688890_transpose-example-2019-09-03.bmtp

I'd also like to be able to chain translators, and I was rather surprised that I could not. (at least, not the way I expected to be able to).
I have one translator that does a velocity curve for Note-Ons, and I want to feed the output of that into another translator that performs more processing. I expected to be able to easily send the output of the first translator to the input of the next one.

Forgot to add - I'll simply copy & paste the code, to combine both into one translator, rather than fiddle around with global variables or timers etc. This isn't very elegant though.

I'd also like to be able to chain translators, and I was rather surprised that I could not. (at least, not the way I expected to be able to).
I have one translator that does a velocity curve for Note-Ons, and I want to feed the output of that into another translator that performs more processing. I expected to be able to easily send the output of the first translator to the input of the next one.

SJC> Yes, as I said, right now you either need to use timers and global variables as I showed you or use an external MIDI pipe tool to feed MIDI messages from one translator to the next. You are not the first person to have this request though, so it has been teed up for consideration. Once Bome Network Unlimited Virtual Ports is released, however, you should be able to use that tool to create MIDI pipes between translators (taking into consideration the precautions I pointed out earlier regarding MIDI loops).

Forgot to add - I'll simply copy & paste the code, to combine both into one translator, rather than fiddle around with global variables or timers etc. This isn't very elegant though.

 

SJC> Yes, I often combine translators (less translators and more rules) as you suggested and then use local variables within the combined translator so that I don't use up more global variable space. There are constructs for goto with labels to help facilitate more complex operations.

 

Your request for piping capabilities in a future revision has been captured.

Steve Caldwell
Bome Customer Care


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

Thanks. The way I think I might like it to work, is sort of automatically connect adjacent translators, when the first one has it's output set to "next translator", and the next one has it's input set to "previous translator" - something like that. Of course, if/when a more comprehensive scripting language is provided, it will probably allow us to create functions/procedures etc - that would have been another way to better organise my code. Having said all that, I don't have much code, so it's not a big deal.