using Buzzer with Processing
I have written a processing sketch that shows how to use the buzzer for the ps2. the sketch uses the proCONTROLL library and draws a rectangle for every button on the buzzer.
JInput uses a native component for every os, therefor i didn't export it as an applet
import procontroll.*;
import java.io.*;
ControllIO controll;
ControllDevice buzz;
int[] pos = {
0, 4, 3, 2, 1,
5, 9, 8, 7, 6,
10, 14, 13, 12, 11,
15, 19, 18, 17, 16 };
int[] col = {
color( 255, 0, 0 ),
color( 255, 255, 0 ),
color( 0, 255, 0 ),
color( 255, 128, 0 ),
color( 0, 0, 255 )
};
void setup(){
size(400,400);
controll = ControllIO.getInstance(this);
buzz = controll.getDevice( "Namtai Buzz" );
}
void draw() {
background( 0 );
for ( int i = 0; i < 20; i++) {
ControllButton b = buzz.getButton( i );
if (b.pressed()) {
fill( col[ i % 5 ] );
} else {
fill( 128 );
}
rect( int( pos[i] / 5 ) * width /4 , (pos[i] % 5) * height / 5, width/4, height/5);
}
}
See also:
sketch experiment 7 - osc events
nested cubes in processing
processing phaseflower
Time Perception
de jong attractor
nested cubes in processing
processing phaseflower
Time Perception
de jong attractor