Brick Walled with Scaling values

I’ve successfully created my very first project that lets me adjust a controller knob (DJ Fighter) 0-127 to transpose values of 0-12

(for me this is valuable when using standalone VST’s that have no onboard transpose adjustment - Keyscape for example)

After being really quite pleased with myself I realized that I really wanted 0-12 semitones positive and 0-12 negative and ideally with the DJF knob in the center position.

I’ve tried multiple attempts with tweaking the offset amount, messing with the math and it’s clearly more complex than I can visualize. I would appreciate a smack in the right direction.

My project has a second issue in that I get note hangs when changing transposition. This is a minor niggle but any advice as well.

Jack

DJ Fighter Transpose Knob 2.bmtp (2.4 KB)

Hi and welcome to the Bome community!

First I use aliases instead of physical ports. It will make it much easier later if you want to use different ports.

Here is how my aliases are set up.

You can learn more about aliases from this tutorial.

Then I set up device selection at the preset level.

Preset 1 is set as follows:

And Preset 2 is set as follows:

For more information about device selection, see this tutorial.

Then I changed the rules as follows that allows a value of +12 to -12

// restrict controller bounds
if ga>127 then ga=127
if ga<0 then ga=0
// Scale controller..
// values to 24 semitones
gb=ga*25
gb=gb/128
// offset by 12 to go in both directions
gb=gb-12
Log "Incoming value =%ga% outgoing value =%gb%"

The outgoing action of translator 1.0 triggers timer 0.1 which sends an all-notes-off CC (125) message (if your DAW supports it).

If this message is not interpreteted correctly by your DAW, then, disable translators 0.0 and 0.1 and enable translators 0.2 and 0.3.

Timer 0.3 iterates note-by note to turn each note off on at a time using the global variable gc to determine each note number.

Here are the rules of 0.3

gc=gc-1
Log "Log note off note %gc%"

Where gc is the note-off we wish to send.

I’m assuming MIDI CH 1 for note messages for both timers.

I make sure the timers only trigger 100ms after you stop moving the knob.

DJ Fighter Transpose Knob 2-sjc.bmtp (3.6 KB)

Steve Caldwell
Bome Customer Care


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

Steve:

Ahh man… - Can’t believe I didn’t see scaling to 24 and then offset to 12. Makes perfect sense. I was thinking setting values for 0-63 and 64-127 from the knob with IF - THEN and then trying to scale each set to pos and neg semitone values. And the All Notes Off works fine. Wouldn’t have thought of the timer function for this.

Port Alias’ - I see that you gave Bome MIDI Translator 1 Virtual Out the alias of Application. Isn’t that redundant? I thought Bome MIDI Translator 1 Virtual Out was already an alias? There’s a video - the Introduction to BMT I think that says ‘Use these!’

Many thanks !
JH

Yes, the original alias was an ‘auto alias’ that is created to make Bome MIDI Translator Pro backward compatible from a previous version. I just like my alias names to make sense to me. It is more a matter of preference here.

I’m glad things are working for you!

Steve Caldwell
Bome Customer Care


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

Yep, makes sense. Great stuff - Thanks again,

J