Combine button press with encoder to perform function

ibanman555

2015-11-09 00:51:00

Hey All,

I'm getting into advanced programming and kind of stumped on one task, maybe someone with better knowledge of "rules" can help me understand if this is possible.

I have 1 encoder I would like to use to perform multiple functions. I have 8 channels with an available button for each channel. I would like to press/release that button and then turn the encoder and have it adjust it's specific task. Then, if I press/release that button again, it disables that encoder from the channel.

So I guess I'm trying to figure out how to combine a button (which always sends the same message) with the encoder, but to toggle on and off and also read from the encoder at the same time. I hope this makes sense to someone, it's a little cryptic. If anyone has an idea, I can give more details with the actual midi messages used.

Thanks in advance

DvlsAdvct

2015-11-09 01:10:19

Hi again

Some follow up questions...

Do you want the encoder to send out multiple messages, based on which buttons have been pressed/released?

Does the encoder have a function if NO buttons have been pressed?

Does the encoder only send on different channels, or different CC messages as well?

I'll give you a starting point, but this can get super complex if you want it to.

What we'll do is have a combination of button and encoder translators. The encoder translators will all have the same incoming message, but the rules will dictate whether or not the outgoing message gets triggered. That rule is set by the button. Here we go :)

Code: Select all

Translator 1: Channel 1
Incoming: MIDI Message - Note On
Channel: 0 - Channel 1
Note: [i]Whatever your MIDI Note is[/i]
Velocity: 127
Rules: g0=g0+1
if g0>1 then g0=0
Outgoing Message: None

Translator 2: Encoder Channel 1
Incoming: MIDI Message - Control Change
Channel: 0 - Channel 1
CC#: 64
Value: any
Rules: if g0!=1 then exit rules, skip outgoing action
Outgoing: MIDI Message - Control Change
Channel: 0 - Channel 1
CC#: 64
Value: Any

Translator 3: Channel 2
Incoming: MIDI Message - Note On
Channel: 1 - Channel 2
Note: [i]Whatever your MIDI Note is[/i]
Velocity: 127
Rules: g1=g1+1
if g1>1 then g1=0
Outgoing Message: None

Translator 2: Encoder Channel 1
Incoming: MIDI Message - Control Change
Channel: 0 - Channel 1
CC#: 64
Value: any
Rules: if g1!=1 then exit rules, skip outgoing action
Outgoing: MIDI Message - Control Change
Channel: 0 - Channel 1
CC#: 64
Value: Any
And on and on for each MIDI channel. Does that make sense?
Jared

ibanman555

2015-11-09 01:26:04

Thanks Jared,

I know this is possible but wasn't sure how to go about it. Thanks a lot for this, I'll start trying some things, most likely will Have to ask for help, but I'll rererereread over and over again to make sure I get it!

ibanman555

2015-11-09 22:49:23

Perfect! Thanks Jared! I'll post code soon for anyone looking to mimic this!