noise wavelet

by arithma
♥0 | Line 24 | Modified 2010-07-14 23:19:55 | MIT License
play

ActionScript3 source code

/**
 * Copyright arithma ( http://wonderfl.net/user/arithma )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/4Xuy
 */

package {
    import flash.display.Sprite;
    public class Noise extends Sprite {
        private var jetSound:Vector.<Number>;
        public function Noise():void {
            jetSound = new Vector.<Number>();
            const N:int = 200;
            var x:Number = 0;
            for (var i:int = 0; i < N * 5; i++) {
                jetSound.push(3*Math.sin(2*x));
                x += Math.random() * .1 + Math.random() * .1;
                
            }
            
            graphics.lineStyle(1, 0x660000);
            graphics.moveTo(0, 0);
            graphics.lineTo(5 * N, 0);
            graphics.lineStyle(1, 0);
            graphics.moveTo(0, stage.stageWidth*.5-jetSound[0] * 10);
            for (i = 0; i < 5 * N; i++){
                graphics.lineTo(i, stage.stageWidth*.5-jetSound[i] * 10);
                trace(jetSound[i]);
            }
        }
    }
}