MIDI-OX User Forum (http://www.midiox.com/cgi-bin/yabb/YaBB.pl)
MIDI-OX >> Mapping Questions >> Led on/off mapping
(Message started by: Davo on Apr 10th, 2015, 8:53am)

Title: Led on/off mapping
Post by Davo on Apr 10th, 2015, 8:53am
Hi there!

I have the following problem that's buggin'me for day's now :(

On my controller are a bunch leds that i can control..
I managed it to control it, when u push the button the led lights up and when u release the the led turns out...

But i can't get it to work like: When u push 1 time (inc. releasing the button) the led turns and stays on until u push the second time the led turns out...

I think it has to do something with the note-off message when u release the button,
the button works like, as u push it in, it sends on note-on message & when u release it, it sends a note-off message

I tried everything in the translation map... but it's make frusty haha

If i insert in the trasnlation map a line:
Input:
Channel: Any
Eventype: NoteOn
Min: 102
Max: 102
Min: 1
Max:127

Output:
Channel: Match input
Even Type: NoteOn
Min: 53
Max: 0
Min: -1
Max -1

With this config the led stays constantly on

When i add this extra line :
Input:
Channel: Any
Eventype: NoteOff
Min: 102
Max: 102
Min: 1
Max:127

Output:
Channel: Match input
Even Type: NoteOff
Min: 53
Max: 0
Min: -1
Max -1

If you push the button the led turns on & when u release the button the led turns off

Is it so hard to program it when u push the button the led turns on & push it the second time & it turns off

What i'm doing wrong??
it looks simple but somehow.. :-X



Any thouhts?

Title: Re: Led on/off mapping
Post by Breath on Apr 10th, 2015, 9:45pm
Hi
Basically what you are trying to ask MidOx to do is...
Here is a Midi  message -> Turn on LED
Here is a the same Midi message -> Turn off LED

How does MidiOx know which message (as they are the same) to use for the turn on and which one  for the turn off.
What you need is ...
Here is a Midi  message -> if the LED is off then Turn on LED otherwise Turn off the LED
The only way MidiOx can do this is if it made a note "OK the LED is on" or it looked through a list of the messages it had received to see weather the LED was on.

Or if it counted the number of times that message came in and turned On the LED for odd count and turned off the LED for even count.
In short, it needs to remember something and  it doesn't have this logic built in to remember and make a choice.

The only way MidiOx can do this is if you program the filter and to do this MidiOx uses scripting.
See the help for scripting.

All the best
Royce



MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.