Bubbles on Monome 100h with SkyMonome API and accelerometer

  • il y a 14 ans
Another demo of the SkyMonome API I developped especially for my needs (http://skymonome.org ). An ADXL203 accelerometer permits the "fall" of the bubbles. This Monome 100h is in construction. It will be a quad 40h in a plexiglas package.
Music : an unpublished track of PJ Skyman ( http://www.pjskyman.fr )
Code used to do this :
Monome monome=new Monome("Monome",MonomeSize.MONOME_256,"localhost","/40h",8000,8080);
/*the following variable is declared as a class member in order to be accessed by the two next listeners*/
inertiaMirroredFrameWindow=new InertiaMirroredFrameWindow(new PictureFrame(ImageIO.read(new File("C:\\...bmp")),false));
monome.addComponent(new FrameGroup("Bubbles",0,0,16,16,inertiaMirroredFrameWindow));
Analog analogX=new Analog("X-axis",0);
analogX.addAnalogListener(new AnalogListener()
{
public void analogMoved(AnalogEvent analogEvent)
{
inertiaMirroredFrameWindow.setXIncrement((analogEvent.getValue()-.5f)*25f);
}
});
monome.addComponent(analogX);
Analog analogY=new Analog("Y-axis",1);
analogY.addAnalogListener(new AnalogListener()
{
public void analogMoved(AnalogEvent analogEvent)
{
inertiaMirroredFrameWindow.setYIncrement((-analogEvent.getValue()+.5f)*25f);
}
});
monome.addComponent(analogY);
monome.refresh();

Recommandée