[chuck-users] mouse up/down controlling signal path
Jascha Narveson
jnarveson at wesleyan.edu
Sun Nov 11 03:20:48 EST 2007
hello again, chuckists -
I'd like to alter signal flow in response to input from HID devices.
In this small example, i want mouse down to result in reverb, and
mouse up to result in dry signal. The problem is that the reverb
persists after the first mouse down - i tried unchucking in the mouse
up "else if" statement, but that didn't work...
thanks, all,
j
----code----
adc => dac;
NRev rev;
Hid hi;
HidMsg msg;
if( !hi.openMouse( 0 ) ) me.exit();
<<< "mouse '" + hi.name() + "' ready...", "" >>>;
while( true )
{
// wait on event
hi => now;
// loop over messages
while( hi.recv( msg ) )
{
if( msg.isButtonDown() )
{
<<<"down">>>;
adc => rev => dac;
}
else if( msg.isButtonUp() )
{
<<<"up">>>;
adc => dac;
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20071111/6136c9e6/attachment-0001.htm
More information about the chuck-users
mailing list