Jump to content

Events depending on multiple conditions


Marxon
 Share

Recommended Posts

Hi all,

 

To be short: :happy:

I have five leds. Each one controlled by a midi note.

EVENT_LED    id=1    type=NoteOn    key=1    chn=1
EVENT_LED    id=2    type=NoteOn    key=2    chn=1
EVENT_LED    id=3    type=NoteOn    key=3    chn=1
EVENT_LED    id=4    type=NoteOn    key=4    chn=1
EVENT_LED    id=5    type=NoteOn    key=5    chn=1


Now i want that led 1 - 4 only turn on if the appropriate key and key 5 are received at the same time.

I think the best way is to use Sender_ and Receiver_ instead of Led_events.

But i dont get it working. May someone can help me out?
Thanks a lot!

Best regards
Marxon

Link to comment
Share on other sites

The problem is, that events are never received at the same time. There is always a sequential order which is controlled by the MIDI device which sends the events, and this has to be considered when working with conditions.

If the order is randomly (e.g. because the keys are played by a human ;-)), then I don't see a proper way with the existing MBNG functions.

 

Therefore the question: is the order - and maybe also the events which are sent - under your control?

Resp. what is your exact use case?

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi Thorsten,

 

this is my situation:

led id=5 is a blinking "beat" led to visualize bpm which gets triggered with a repeating midi note Key=5.

Now, if i send midi note Key=1 then i want led id=1 to blink at the same speed like led id=5

and turn off if i release Key=1.

If i send midi note Key=2 then i want led id=2 to blink at the same speed like led id=5

and turn off if i release Key=2...

This should be no big "timing issue", right?

Edited by Marxon
Link to comment
Share on other sites

Sorry, I don't see a solution for this. It would require logic combinations in the EVENT conditions, and recalculations on each incoming event.

 

Such a customization would require a dedicated firmware enhancement, or (what I would prefer) direct control of the LEDs from the host side.

 

Best Regards, Thorsten.

Link to comment
Share on other sites

This could be done with some external IC's gates rather than software changes.  From the Dout board, connect 4 of these outputs to the input of 4 "OR" gates.  Then take the single BPM output (LED5) and connect it to each of the gate inputs.  Now take the output of the 4 gates and connect them to the LED's with resistors.  If you wanted to send Midi messages, just connect the gate outputs to 4 inputs of a Din board.  Its not an elegant solution but should work as you described.

 

Pete

Link to comment
Share on other sites

Thanks for your suggestion Pete!
Using a hardware workaround is a good idea.
Google will know it for sure.
But some minutes ago i ad this idea:
What if i use the BPM output to cycle between two banks?
 

EVENT_LED id=1  type=Meta   meta=CycleBank
EVENT_LED id=2 hw_id=2 bank=1 type=NoteOn key=2    chn=1    Rgb=15:0:0
EVENT_LED id=3 hw_id=2 bank=2 type=NoteOn key=2    chn=1    Rgb=0:0:0
Link to comment
Share on other sites

Yes, this should work as well! :)

But please take AND gates, otherwise the LED would be active if either key1 OR key5 is pressed.

 

Best Regards, Thorsten.



Clever!

But CycleBank is not the right meta event, because it could get out of sync with the key5 activation.

 

SetBank would be better

 

Best Regards, Thorsten.

Link to comment
Share on other sites

But please take AND gates, otherwise the LED would be active if either key1 OR key5 is pressed.

 

Best Regards, Thorsten..

The reason I indicated to use the OR gate was because I thought that the LED's turned ON when the shift register output went to 0 volts (active low).  My mistake here.

 

Pete

Link to comment
Share on other sites

Clever!

But CycleBank is not the right meta event, because it could get out of sync with the key5 activation.

 

SetBank would be better

 

Best Regards, Thorsten.

 

Ok i will give it a try.

Post results tomorrow.

By the way: Happy Christmas to all!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...