Kyma Forum
  Kyma Support
  switches as controllers

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   switches as controllers
Bill Meadows
Member
posted 07 April 2009 00:24         Edit/Delete Message   Reply w/Quote
Would someone figure out how to do this?

I'm using buttons on a WiiMote to send MIDI controller messages to another program. I want two buttons to turn ON & OFF two different processes, so I have used e.g.: "!Button1 asToggle" in the value field of a MIDIOutputController. This works fine.

The problem is that the two buttons must have the following relationship with each other:

If the Button1 is ON, then Button2 can send ON/OFF messages.
If the Button1 is OFF, then Button2 also turns OFF.

The part I can't figure out is if Button2 is ON and I turn OFF Button1, then when I turn Button1 back ON, Button2 is still ON. (I want Button2 to be OFF everytime Button1 turns ON.)

The asToggle operator has memory, so hasChangedReset may be the better choice, but I can't make it behave as I want.

(btw - I should also mention that the buttons must behave as toggles - press once for ON, press again for OFF - since they are on a WiiMote and I can only use my thumb.)

[This message has been edited by Bill Meadows (edited 07 April 2009).]

IP: Logged

SSC
Administrator
posted 07 April 2009 09:04         Edit/Delete Message   Reply w/Quote
Would this do it?

!b1 asToggle

(!b1 asToggle * !b2 asToggle)

If the Button1 is ON, then Button2 can send ON/OFF messages.
If the Button1 is OFF, then Button2 also turns OFF.

IP: Logged

Bill Meadows
Member
posted 07 April 2009 10:08         Edit/Delete Message   Reply w/Quote
quote:
Originally posted by SSC:
Would this do it?

!b1 asToggle

(!b1 asToggle * !b2 asToggle)

If the Button1 is ON, then Button2 can send ON/OFF messages.
If the Button1 is OFF, then Button2 also turns OFF.


I got that far. The problem is that asToggle remembers the last state of b2. So if b2 is ON when b1 turns ON, it re-triggers the b2 process.

It's hard to describe without being too wordy - the two buttons control two different processes. Here are the conditions:

If process 1 is OFF, process 2 can NOT be turned ON.
If process 1 is ON, process 2 can be turned ON & OFF.
When process 1 is turned ON, process 2 is always OFF. (So I can decide if I want to turn it on or not.)

Meeting that last condition is what throws me.

IP: Logged

pete
Member
posted 07 April 2009 15:18         Edit/Delete Message   Reply w/Quote
Hi Bill
It's a bit involved but I think this is what you are looking for

(!Trig2 +(1-!Trig1 asToggle)) countTriggersMod: ((!Trig1 asToggle)+1)

and button one would be simply

!Trig1 asToggle

----------------------------------------------------
I think what you mean is
if B1s toggle is in on state, B2 will toggle on and off.
if B1s toggle state is off B2s state is always off.
When B1s toggle changes from off to on state B2 will be off regardless of the state it was when B1s toggle state turned off. B2 will then be free to toggle again starting from the off state.

Is this what you meant?

hope it helps

Pete

[This message has been edited by pete (edited 07 April 2009).]

IP: Logged

pete
Member
posted 07 April 2009 15:35         Edit/Delete Message   Reply w/Quote

toggelybuttons.kym

 
I've attached a test bed sound if it helps

IP: Logged

Bill Meadows
Member
posted 08 April 2009 13:32         Edit/Delete Message   Reply w/Quote
Brilliant!

Thanks Pete, that works perfectly.

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c