How do I toggle LEDs on controller?

PRKid

2017-01-04 08:45:48

Hi!

I have just started diving into the BOME MIDI Translator and was hoping to get some feedback on whether or not I am structuring my first "test" project for my learning curve. I have several controllers that I would like to map to Pioneer's Rekordbox software using Bome. Rekordbox's current midi implementation has many limitations, thus, the need for add'l external support. My practice run is with the simple Numark DJ2GO controller and I am currently focusing on the LED ON/OFF controls.

I have been able to turn the LEDs ON, yet they stay ON, or, I can turn then ON/OFF during one press of a pad. Yet, I want to be able to keep the LED ON when the first press (2 Note commands) the pad, then, turn the LED to OFF when I press the pad again and so forth. The controller has 4 functions per track (A and B) with LED feedback (CUE, SYNC, Play/Pause, and, Headphones/PFL). So, for the LED control section of my project, I've created 1 Preset (LED Controls) along with 16 Translators (4 functions x 2 tracks x 2 [On/Off]). Yet, I feel this can (and should) be simplified, yet, for now I just want to make sure it works within the logic of the Translators along with the Rules. I have tried various combinations of rules for the Note On and Note Off messages, yet, none appear to do what I'd like.

What rules are best suited to address this problem?

Attached is the current file which I've been editing.

Thank you in advance for the feedback.

.

Test No3.bmtp

PRKid

2017-01-04 13:08:45

Here is the test file for the project.
Test No3.bmtp
(5.98 KiB) Downloaded 401 times

sjcaldwell

2017-01-04 14:50:41

Hi,

You may want to remove the default routes as when you are releasing the button, it is possible that the default route is turning off the LED. Let BMT handle everything (all routing) through presets and translators. Then you use a global variable for each switch and set it on or off at each time you press the switch.

I added one new preset and translator to your file that inititalizes global variables for Cue One Headphones on and Sync on
ga gb and gc

I removed your default routes to avoid direct transmission of note-off through the default route. (which may or may not be a problem for your current config. I just do this because it trips me up all the time and I really like to control EVERY MESSAGE with translators and rules.)

I modified your first three translators to toggle the values of the global variables of each push and output different values depending
on switch state 3 is on and 0 is off.

This should be enough to get you in the right direction.

Here is some info on bitmap manipulation

One issue with the above approach is you may quickly use up many global variables. For one of my projects I use a single global variable with bit manipulation to reduce my use of global variables. IE bit 0 for one toggle, bit 1 etc. BMT variables I believe are 32 bit signed integers so you have 31 bits that you can use in a single variable (you can control 31 toggles in one variable). There is more logic involved in bit manipulation but once you get the hang of it it isn't too bad.

For instance to test if bit 0 is on on variable ga

Code: Select all

// test for bit zero
pp=ga&1
if pp==1 then do something
// test for bit 1
//Shift bit right
pg>>1
pp=ga&1
if pp==1 then do something
To set bit zero leaving all other bits untouched

Code: Select all

ga=ga|1
// To clear it
ga=ga&0
// To toggle its value
pp=ga&1
pp=pp^0
ga=ga|pp
Hopefully I got it all right (going from memory) and you will get the idea if you want to use bit map instead of consuming many
global variables.
Attachments
Test No3a.bmtp
(6.66 KiB) Downloaded 352 times

PRKid

2017-01-04 18:36:02

@ sjcaldwell - Thank you so much for the detailed feedback, the work on the file, and additional ways to configure this "test" project I embarked on. It's certainly appreciated! I just downloaded the file and I am in the process of going through my mental analysis of what the variables/rules are doing as I walk through these.

I am sure I'll have more questions and will try to research/read as much as possible to keep progressing in my midi-mapping learning curve. Again, thank you very much!

.

PRKid

2017-01-04 19:20:22

Just reviewed the Rules logic and realized that after initializing the variables (ga,gb..) to 0, then, evaluating the rules, it will always yield 0....thus, the LEDs will always be Off and confirmed with controller. I will play around with the first rule to see what I can come up with.

** No matter what I did with the MIDI Router and/or Ports, it behaved the same with the controller.

From your feedback/file for the CUE example turning on/off LED to Red(3)/nothing(0):
Init Global:
//Cue On
ga=0

A Cue On Translator:
Rules:
ga=ga^0
if ga !=0 then pp=3
if ga ==0 then pp=0

.

sjcaldwell

2017-01-04 19:23:20

Yes I believe toggle will be ga=ga^1 not ga=ga^0

Sorry

PRKid

2017-01-04 19:37:39

Perfect! Yes, I also went with 1 and it's working the way I intended. Thank you so much.

.

i@mJONNY

2017-01-29 20:19:12

I can't believe I stumbled on this.
I've just started trying to grasp this, saw some great help 'caldwell gave someone on Program Change variables ('check raw midi log' yielded the answer, re midi channels) and found this... just by post-stalking...

I have a DJ2GO!!!
Is this two-way? So, something (an event) at the DAW end (which the BMT spaghetti junction plugs into) can get BACK to the controller (sysEx required?) to update the LEDs (turn on/off) ?

Hope that makes sense...

Wondered how you were using the controller...

I wanted to have a config that, when active, adjust various cc's... to do this, I thought I'd need a 'controller mute' MODE - maybe I turn on caps lock and then all button-moves on the controller (resetting to default) get 'swallowed'...

is this easy to do?

Right now, I'm overwhelmed. how many virtual ports? (presume one per device / direction?)
& what's going on with aliases and translators?
it looks like these things come in 3's... need a '101 in virtual midi routing!
Image

Investigating, much appreciated!

PRKid

2017-01-29 23:44:08

i@mJONNY wrote:I can't believe I stumbled on this.
I've just started trying to grasp this, saw some great help 'caldwell gave someone on Program Change variables ('check raw midi log' yielded the answer, re midi channels) and found this... just by post-stalking...

I have a DJ2GO!!!
Is this two-way? So, something (an event) at the DAW end (which the BMT spaghetti junction plugs into) can get BACK to the controller (sysEx required?) to update the LEDs (turn on/off) ?

Hope that makes sense...

Wondered how you were using the controller...

I wanted to have a config that, when active, adjust various cc's... to do this, I thought I'd need a 'controller mute' MODE - maybe I turn on caps lock and then all button-moves on the controller (resetting to default) get 'swallowed'...

is this easy to do?

Right now, I'm overwhelmed. how many virtual ports? (presume one per device / direction?)
& what's going on with aliases and translators?
it looks like these things come in 3's... need a '101 in virtual midi routing!
Image

Investigating, much appreciated!
.
So, for my use, I currently use Bome to do the LEDs On/Off function while the DAW takes care of the controller functionality with the same pads being triggered.

On the VPs, I just used one Bome Virtual port. I can repost the latest file if you'd like.

I was also coming up the learning curve on MIDI, and, still have a long ways to feel comfortable with what I am actually trying to do with the controllers along with how it's reflected through the overall process (controller-BOME-DAW).

.

.

i@mJONNY

2017-01-30 23:18:03

Hi, I've got a long way to go before I can even read the forum contributions!
Determined though, so hopeful...

I've loaded your DJ2GO.bmtp and DJ2GO v1, maybe naive to think I can copy and paste bits, and frankenstein some setup.... but just wanting to peek, see one way it can be done at least..

I see the 7 translators (cue etc, swallow .. 5 rules) on preset 2 for LED controls, just wondering how I configure Bome and DJ2GO, so the device is expected to get the message (routing config necessary? Is this catered for already for project default ports?)

I enabled some extra 'ports',in case that allows me to achieve comms--->controller (device LEDs on), but, unsurprisingly, no dice

Image

can I (for example) replace your incoming trigger on the LED presets, and trigger your outgoing actions, which turn on LEDs? (that's how confused I am).


Looking for tutorials :) thanks

update: ok I noticed a correlation between the incoming/outgoing trigger and the dj2go midi specs..

Image


what I don't (yet) get is

- the difference between the on/off (aah... maybe in the 5 rules)
- what the guide means (how to build the required message, to turn LED a on etc... assuming that can be done!)

one baby step forward, but very grateful for the glimpse!

i even got alight on! can#t turn it off.. still, progress, no?

PRKid

2017-01-31 04:18:55

.
Let's make sure you have the latest (correct) file. Attached below... Load "as-is" with no mods and it should work for you.

Keep in mind that if your DAW is sending a Note On/Off back to Bome/DJ2GO, then, you would need to add add'l trigger to this version.

.
Attachments
Numark DJ2GO Working LEDs on Pads.bmtp
(9.45 KiB) Downloaded 296 times

i@mJONNY

2017-02-02 20:18:50

PR' thank you!

Total novice, I routed the DJ2GO as the in & out... (perhaps the most primitive routing required for the two-way communication necessary to get the LEDs to work?)

Image

and it works! Beautiful, first time I've illuminated this little dude...



OK, Question#1 -am I imagining that there are multiple states? I thought they (cue,play,sync,phones) would be binary, but it seems to behave differently!

I asked my (less colour-blind) flatmate, and he insists it's just bleed.


Question #2- the :LED only responds with the channel 1 actions. you've mapped several outgoing actions to channels 2,3,7... any reason? rekordbox/vst mappings? or just to illustrate a point?

Q.3 (any Bome users help a nooob?) I see lots of translators with the swallow option... so the incoming action is not transmitted via midi-thru...

IF I changed this... so it's NOT swallowed... and the output action = the incoming trigger (which will trigger the LED action?) ....

what would happen? (would it flicker between states? cancel each other out? break the config?!)
Image
Image
Thanks for all your help, looking forward to grasping (and implementing) lots of optimised timed triggers and crazy midi magic!

Cheers!

sjcaldwell

2017-02-02 23:20:56

OK, Question#1 -am I imagining that there are multiple states? I thought they (cue,play,sync,phones) would be binary, but it seems to behave differently!

I asked my (less colour-blind) flatmate, and he insists it's just bleed.


Question #2- the :LED only responds with the channel 1 actions. you've mapped several outgoing actions to channels 2,3,7... any reason? rekordbox/vst mappings? or just to illustrate a point?

Q.3 (any Bome users help a nooob?) I see lots of translators with the swallow option... so the incoming action is not transmitted via midi-thru...

IF I changed this... so it's NOT swallowed... and the output action = the incoming trigger (which will trigger the LED action?) ....
On question #1 from the manual it looks like they are single color buttons

Question 2 - It looks like the controls are used to send to your DAW assuming your DAW responds to those channels. They do not get routed back to the controller since they don't control LED's.

Question 3 - If you put default routes back in, it is highly likely the will interfere with any translators that do not have swallow.
Both the output of the translator will be output along with any default routing.

PRKid

2017-02-03 12:11:19

sjcaldwell wrote:
Question 2 - It looks like the controls are used to send to your DAW assuming your DAW responds to those channels. They do not get routed back to the controller since they don't control LED's.
Correct! I did so per the requirements of Rekordbox.
.