Forums > MaxMSP

LED and bang question

November 18, 2008 | 11:48 pm

Hi. I have an LED setup in my patcher, which will be on and off at different times, depending on what’s happening in my ‘game’. I want to make it so when the LED is lit, you can click a button, and it will trigger a groove~ but when it’s off, and you click the button, nothing will happen.

Thing is, I can’t just hook it up to the groove as it will obviously output a bang whenever it’s turned on or off, and that’s not what I’m after…

Sorry if this is confusing, but any help would be appreciated.


November 19, 2008 | 12:30 am

If you want to block every other bang then use [cycle 2]. It will send bangs out in sequence so you need only use the first outlet.

lh


November 19, 2008 | 1:19 am

When LED is lit, you can have a gate open…close it when it’s not lit.


November 19, 2008 | 3:41 am

Also you can script the button to ignore clicks, or disappear, so the user won’t be tempted to click it. Or you can gray it out like most apps do in menus etc. For scripting look into helpfile for thispatcher, send it commands to show/hide or ignoreclick etc., using the Scripting Name of the button (which you need to set first). Scripting is also very helpful in other situations and is straightforward, this might be a good time to experiment with it a bit.

To gray out the button use the fgcolor and/or bgcolor commands directly to it (check inspector for attribute names). Also you can send these commands to the button via thispatcher.


November 19, 2008 | 10:36 am

On 19 Nov 2008, at 03:41, Seejay James wrote:

> To gray out the button use the fgcolor and/or bgcolor commands
> directly to it (check inspector for attribute names).

Have some free secret sauce: I visually disable controls by overlaying
a panel, the same colour as the patcher background but with a partial
alpha value. Much easier, and it guarantees colour consistency.

– N.

Nick Rothwell / Cassiel.com Limited
http://www.cassiel.com
http://www.myspace.com/cassieldotcom
http://www.last.fm/music/cassiel
http://www.reverbnation.com/cassiel
http://www.linkedin.com/in/cassiel
http://www.loadbang.net


November 19, 2008 | 6:46 pm

Thanks, worked great.

Now I was just wondering. In the LED help, there’s a little device called "fun meter effects". I’m trying to do this but counting to 8000 milliseconds. But the blink time only goes upto 2000 milliseconds. Is there any way around this at all? Thanks.


November 19, 2008 | 11:00 pm


Viewing 7 posts - 1 through 7 (of 7 total)