Jump to content

Configuration of toggle-switch for AINSER


Recommended Posts

Posted

Hey,

 

here is the situation:
I've a keyboard which has a AINSER8 inside. I soldered a jack to it for a switch. The switch works flawlessly. I configured ain_mode=switch. So it sends 127 when pressed and 0 when depressed.

What I want to achieve is, to send 127 when I press it the first time.... release it... press again and it should send 0. 

 

I tried various things with NGR-commands... but I didn't get it to work.

 

Any suggestions here?

 

Thanks,

Chris

Posted

Hi Chris,

 

I haven't checked this by myself, but it could work by forwarding the event to a BUTTON in toggle mode

 

Best Regards, Thorsten.

Posted (edited)

Hi Thorsten,

 

I tried this:

 

EVENT_AINSER   id=65     ain_mode=Switch fwd_id=BUTTON:1001

EVENT_BUTTON id=1001 button_mode=Toggle    type=cc cc=1

 

without success. MIOS doesn't monitor anything.

You already wrote in this thread:

that only a value is forwarded with fwd_id but it won't trigger a midi event. Maybe that's there is the problem?

Edited by FantomXR
Posted

You are right, looking into the source code I can confirm that I even commented this behaviour ;-)

 

Seems that we've finally found a use case where it makes sense to think about a generic way to trigger the MIDI event during forwarding.

However, as always it will take some time until such a new feature will be available.

 

Until then you could just execute a .NGR section with the AINSER event in addition, and from there you can send the current button value (which toggles between min and max) with the "TRIGGER BUTTON:<button-id>" command.

 

Best Regards, Thorsten.

Posted (edited)

Hey TK,

 

thanks! I will try this.

 

Maybe it's easier for you to implement another ain_mode named "toggle" so adding a MIDI trigger wouldn't be necessary.

Edited by FantomXR
Posted (edited)

Hey Thorsten,

 

I tried the following NGR:

 

 

### Leslie Switch ###
if ^section == 6
 if AINSER:67 == 127
 trigger BUTTON:17
endif
endif

 

and NGC:

 

EVENT_BUTTON id=17 button_mode=Toggle fwd_id=LED:17 type=cc cc=1

EVENT_AINSER id=67 ain_mode=Switch type=meta meta=runsection:6

 

If I now press the sustain switch, it just sends out CC 1 with value 0. But not 127.

Where is my mistake?

Edited by FantomXR
Posted

I added "ain_mode=Toggle", because it was easier to implement this than troubleshooting your experiment ;)

 

The new feature is available in v1.032

 

Best Regards, Thorsten.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...