MIDI Latch LED button on and off


#1

Hi. I'm really late to the game, I just got my Axoloti. It is an incredible platform and a helpful community. I've been reading this forum for a while but only got to buying it now...

I'm having trouble with something that seems trivial. I have a Behringer X-touch mini... I want to implement "groups" or "pages" of controls with the encoders, using the led illuminated buttons. The idea is to click on the osc1 button and the variables for oscillator 1 will appear on the encoders. While on this page, I would like the said button's LED to remain illuminated. By default, the LEDs on the xtouch are momentary, and turn off when you release the button. I want them to stay on, until another one is pressed.

In max, I would just do this:

(and it works, i tried).

That is my intuitive way of approaching this, but Axo works differently... When I try to translate this approach with objects in Axo, for instance using mux 2 and constants and change object, it does not work... The led just turns off as soon as you take your finger off.

Does anyone have any tips for how to do this on the Axoloti platform?

thanks!


#2

By the way: i already know that midi is handled differently in Axo: -64 - 64... notes, velocities, etc...

The led can be turned on by a midi velocity of 1 and off with a velocity of zero. So i've tried sending velocity -63 to note -56 (instead of velocity 1 to note 8) to turn it on... but that doesn't work either.

I've also tried placing some parts inside a subpatcher and some outside, moving things around in terms of execution priority, but I'm finding that this is just trial and error, i would love to know the proper way to approach this.


#3

Hello everyone, can I get some help on this one?

I still have not figured it out. I wonder if I'm missing something about how Axo handles midi in and out.

When I try to update the status of an led by sending velocity 1 to the appropriate note, I sometimes see just a flash of light from the LED, indicating that the message is getting through but being immediately turned off again. This does not happen in max, only in Axoloti.

Here is a simple example: if I turn the toggle on, it should send a velocity of 1 to the note -56 (note 8) and turn on its led. But it does not.


#4

I've tried it also like this:

I send a velocity of -64 (velocity 0) or velocity -63 (velocity 1). I realized that I should also, like the note number, be scaling back the velocity so that it is between -64 and +63.5. Unfortunately this also does not work.

any suggestions?


#5

as you can see the velocity input has a + sign only. this means that it is unipolar and you therefore need to send a value of 0 for velocity 0. for 1 you would send 0.5 (128/64 equals stepsize 0.5)


#6

in addition, mixing up green, yellow and blue signals tends to get messy. try with two dials and a mux for a start


#7

Ok this is very helpful! Thanks for pointing that out.
=

I've now tried it this way, but still doesn't work: I'm sending a value of 0 for note off, and 0.5 for velocity 1.

Still doesn't work though...

I've also tried it with two dials and a mux, as you suggested, but also does not react.


#8

theres a couple of problems...
as @lokki says , you really want to send in a unipolar signal into velocity
(if you actually care about the velocity value sent)

but the other problem, is kind of a bug/mislabelling on midi/out/note...
the trig input is actually acting more like a 'gate' than a trig.
you can see this by changing to the following.

tip: to test, I suggest you send to the usb device port, then you can easily monitor the midi messages going out :wink:

if we look at the midi/out/code we can see this pretty clearly

if ((inlet_trig>0) && !ntrig) {
lastnote = (64+(inlet_note>>21))&0x7F;
MidiSend3((midi_device_t) attr_device, MIDI_NOTE_ON + (attr_channel-1),lastnote,inlet_velo>>20);  ntrig=1;
}
if (!(inlet_trig>0) && ntrig) {MidiSend3((midi_device_t) attr_device, MIDI_NOTE_OFF + (attr_channel-1),lastnote,__USAT(inlet_velo>>20,7)); ntrig=0;}

see the condition !(inlet_trig>0) && ntrig
this means, IF the inlet is low (false) and we have previously sent a note on, now sent a note off.

when you use a change object, this sends a quick pulse of true/false , and so quickly sends an on/off , hence the behaviour your seeing.


#9

Thank you! that works... Super helpful... I had no idea the trig worked that way.

Thanks Lokki and Technobear.


#10

yeah, its unfortunately misleading...i think it should perhaps be marked as a gate rather than trig.

in this context, usually a trig means to output the new state on transition from lo-hi,
you would not normally expect a transition, back from hi-lo to do anything for a trig input.

unfortunately, changing (/fixing) the behaviour of such a widely used object now, would break too many users patches... so it is what it is.

anyway, glad you have it work now :slight_smile: