Thursday, April 14, 2011

SCRIPTING

Im currently looking for a script that can be used for the project and I found a beat detection script.
Here is the script :

import beat.BeatEngine;   import beat.BeatEvent;    var sound:Sound = new YourSound();   sound.play();    var engine:BeatEngine = new BeatEngine();   engine.addEventListener(BeatEvent.LOW_BEAT, lowHandler);   engine.addEventListener(BeatEvent.MED_BEAT, medHandler);   engine.addEventListener(BeatEvent.HI_BEAT, hiHandler);    function lowHandler(e:BeatEvent):void {     doSemethingLow(e.power);//action for low frequency beat detection   }    function medHandler(e:BeatEvent):void {     doSemethingMedium(e.power); //action for medium frequency beat detection   }    function hiHandler(e:BeatEvent):void {     doSemethingHigh(e.power); //action for high frequency beat detection   }

No comments:

Post a Comment