SionTest
noteOn
/**
* Copyright aobyrne ( http://wonderfl.net/user/aobyrne )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/1WzW
*/
package
{
import com.bit101.components.HUISlider;
import com.bit101.components.PushButton;
import flash.display.Sprite;
import flash.events.Event;
import org.si.sion.SiONDriver;
/**
* ...
* @author sandcastles
*/
public class SionTest extends Sprite
{
private var v:Number=66;
private var siONDriver:SiONDriver;
public function SionTest()
{
siONDriver = new SiONDriver();
var hUISlider:HUISlider = new HUISlider(this, 0, 0, "note", doChangeNote);
hUISlider.tick = 1;
hUISlider.value = v;
new PushButton(this, 0, 20,'stop',doStop);
new PushButton(this, 0, 50,'play',doPlay);
}
private function doPlay(e:Event):void
{
siONDriver.play();
siONDriver.noteOn(v);
}
private function doStop(e:Event):void
{
siONDriver.stop();
}
private function doChangeNote(e:Event):void
{
v = HUISlider(e.target).value;
siONDriver.stop();
doPlay(e);
}
}
}