TOP > ACTIONSCRIPT3,FLASH SEARCH RESULT FOR gain
sort : match | new | page view
- private function _logIndex(n:Number) : int {
- return (n<0) ? ((n<-0.00390625) ? (((int(Math.log(-n) * -184.66496523 + 0.5) + 1) << 1) + 1) : 2047)
- : ((n> 0.00390625) ? (( int(Math.log( n) * -184.66496523 + 0.5) + 1) << 1) : 2046);
- }
- public function buffer(data:ByteArray) : void {
- var n:Note, rep:int, i:int, imax:int, dph:int, lout:int, v:int;
- for (imax=1024; imax<=bufferSize; imax+=1024) {
- for (n=term.next; n!=term; n=n.next) {
- for (dph=pitchTable[n.pitch], i=imax-1024; i<imax; n.ph=(n.ph+dph)&0x3ffffff, i++) {
- lout=n.table[n.ph>>n.shift]+n.gain; pipe[i]+=logTable[lout];
- }
- if (!n.inc()) n = n.remove();
- }
- }
- for (i=0; i<bufferSize; i++) { data.writeFloat(pipe[i]); data.writeFloat(pipe[i]); pipe[i]=0; }
- }
- public function noteOn(pitch:int, velocity:int=64, tone:int=0, decay:int=4, sweep:int=0) : void {
- Note.alloc().reset(tone, pitch, _logIndex(velocity*0.0078125), sweep, (decay<<2)).into(term);
- }
- }
- private function _log(n:Number) : int {
- return (n<0) ? ((n<-0.00390625) ? (((int(Math.log(-n) * -184.66496523 + 0.5) + 1) << 1) + 1) : 2047)
- : ((n> 0.00390625) ? (( int(Math.log( n) * -184.66496523 + 0.5) + 1) << 1) : 2046);
- }
- public function buffer(data:ByteArray) : void {
- var n:Note, rep:int, i:int, imax:int, dph:int, lout:int, v:int;
- for (imax=1024; imax<=_s; imax+=1024) for (n=_t.next; n!=_t; n=n.step())
- for (dph=_p[n.pitch], i=imax-1024; i<imax; n.ph=(n.ph+dph)&0x3ffffff, i++)
- { lout=n.wave[n.ph>>n.shift]+n.gain; _o[i]+=_l[lout]; }
- for (i=0; i<_s; i++) { data.writeFloat(_o[i]); data.writeFloat(_o[i]); _o[i]=0; }
- }
- public function noteOn(pitch:int, velocity:int=64, tone:int=0, decay:int=4, sweep:int=0) : Note {
- return Note.alloc().reset(pitch, _log(velocity*0.0078125), tone, (decay<<2), sweep).into(_t);
- }
- }
- class Note {
- public var prev:Note, next:Note, ph:int, pitch:int, gain:int, sweep:int, decay:int, wave:Vector.<int>, shift:int;
- static private var _w:Array=[], _s:Array=[], _fl:Note = new Note();
- }
- private function _log(n:Number) : int {
- return (n<0) ? ((n<-0.00390625) ? (((int(Math.log(-n) * -184.66496523 + 0.5) + 1) << 1) + 1) : 2047)
- : ((n> 0.00390625) ? (( int(Math.log( n) * -184.66496523 + 0.5) + 1) << 1) : 2046);
- }
- public function buffer(data:ByteArray) : void {
- var n:Note, rep:int, i:int, imax:int, dph:int, lout:int, v:int;
- for (imax=1024; imax<=_s; imax+=1024) for (n=_t.next; n!=_t; n=n.step())
- for (dph=_p[n.pitch], i=imax-1024; i<imax; n.ph=(n.ph+dph)&0x3ffffff, i++)
- { lout=n.wave[n.ph>>n.shift]+n.gain; _o[i]+=_l[lout]; }
- for (i=0; i<_s; i++) { data.writeFloat(_o[i]); data.writeFloat(_o[i]); _o[i]=0; }
- }
- public function noteOn(pitch:int, velocity:int=64, tone:int=0, decay:int=4, sweep:int=0) : Note {
- return Note.alloc().reset(pitch, _log(velocity*0.0078125), tone, (decay<<2), sweep).into(_t);
- }
- }
- class Note {
- public var prev:Note, next:Note, ph:int, pitch:int, gain:int, sweep:int, decay:int, wave:Vector.<int>, shift:int;
- static private var _w:Array=[], _s:Array=[], _fl:Note = new Note();
- }
- private function _log(n:Number) : int {
- return (n<0) ? ((n<-0.00390625) ? (((int(Math.log(-n) * -184.66496523 + 0.5) + 1) << 1) + 1) : 2047)
- : ((n> 0.00390625) ? (( int(Math.log( n) * -184.66496523 + 0.5) + 1) << 1) : 2046);
- }
- public function buffer(data:ByteArray) : void {
- var n:Note, rep:int, i:int, imax:int, dph:int, lout:int, v:int;
- for (imax=1024; imax<=_s; imax+=1024) for (n=_t.next; n!=_t; n=n.step())
- for (dph=_p[n.pitch], i=imax-1024; i<imax; n.ph=(n.ph+dph)&0x3ffffff, i++)
- { lout=n.wave[n.ph>>n.shift]+n.gain; _o[i]+=_l[lout]; }
- for (i=0; i<_s; i++) { data.writeFloat(_o[i]); data.writeFloat(_o[i]); _o[i]=0; }
- }
- public function noteOn(pitch:int, velocity:int=64, tone:int=0, decay:int=4, sweep:int=0) : Note {
- return Note.alloc().reset(pitch, _log(velocity*0.0078125), tone, (decay<<2), sweep).into(_t);
- }
- }
- class Note {
- public var prev:Note, next:Note, ph:int, pitch:int, gain:int, sweep:int, decay:int, wave:Vector.<int>, shift:int;
- static private var _w:Array=[], _s:Array=[], _fl:Note = new Note();
- }
- class Voice {
- private const PI2:Number = Math.PI * 2;
- private const SAMPLE_RATE:Number = 44100;
- private var phase:Number = 0
- public var frequency:Number
- public var volume:Number;
- public var gain:Number;
- public var attack:int;
- public var decay:int;
- public var sustain:int;
- public var modFrequency:Number;
- public var fmIndex:Number;
- public var fmDecay:Number;
- private var position:int = 0
- private var amplifier:Number = 0;
- private var fmAmplifier:Number = 0;
- {
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.events.MouseEvent;
- public class PathDrop extends Sprite
- {
- protected var ballColor:Number = 0xFFFFFF;
- protected var ballSize:Number = 10;
- protected var gain:Number = .02;
- protected var spkratio:Number = 0.3;
- protected var bg:Sprite= new Sprite();
- protected var container:Sprite= new Sprite();
- protected var count:Number = 0;
- protected var xLength:int = 20;
- protected var yLength:int = xLength;
- protected var margin:int = 2;
- }
- private function _log(n:Number) : int {
- return (n<0) ? ((n<-0.00390625) ? (((int(Math.log(-n) * -184.66496523 + 0.5) + 1) << 1) + 1) : 2047)
- : ((n> 0.00390625) ? (( int(Math.log( n) * -184.66496523 + 0.5) + 1) << 1) : 2046);
- }
- public function buffer(data:ByteArray) : void {
- var n:Note, rep:int, i:int, imax:int, dph:int, lout:int, v:int;
- for (imax=1024; imax<=_s; imax+=1024) for (n=_t.next; n!=_t; n=n.step())
- for (dph=_p[n.pitch], i=imax-1024; i<imax; n.ph=(n.ph+dph)&0x3ffffff, i++)
- { lout=n.wave[n.ph>>n.shift]+n.gain; _o[i]+=_l[lout]; }
- for (i=0; i<_s; i++) { data.writeFloat(_o[i]); data.writeFloat(_o[i]); _o[i]=0; }
- }
- public function noteOn(pitch:int, velocity:int=64, tone:int=0, decay:int=4, sweep:int=0) : Note {
- return Note.alloc().reset(pitch, _log(velocity*0.0078125), tone, (decay<<2), sweep).into(_t);
- }
- }
- class Note {
- public var prev:Note, next:Note, ph:int, pitch:int, gain:int, sweep:int, decay:int, wave:Vector.<int>, shift:int;
- static private var _w:Array=[], _s:Array=[], _fl:Note = new Note();
- return 2046;
- }
- }
- }
- public function buffer(data:ByteArray) : void {
- var n:Note, rep:int, i:int, imax:int, dph:int, lout:int, v:int;
- for (imax=1024; imax<=bufferSize; imax+=1024) {
- for (n=term.next; n!=term; n=n.next) {
- for (dph=pitchTable[n.pitch], i=imax-1024; i<imax; n.ph=(n.ph+dph)&0x3ffffff, i++) {
- lout=n.table[n.ph>>n.shift]+n.gain;
- pipe[i]+=logTable[lout];
- }
- if (!n.inc()) n = n.remove();
- }
- }
- for (i=0; i<bufferSize; i++) { data.writeFloat(pipe[i]); data.writeFloat(pipe[i]); pipe[i]=0; }
- }
- public function noteOn(pitch:int, velocity:int=64, tone:int=0, decay:int=4, sweep:int=0) : void {
- Note.alloc().reset(tone, pitch, _logIndex(velocity*0.0078125), sweep, (decay<<2)).into(term);
- private function _logIndex(n:Number) : int {
- return (n<0) ? ((n<-0.00390625) ? (((int(Math.log(-n) * -184.66496523 + 0.5) + 1) << 1) + 1) : 2047)
- : ((n> 0.00390625) ? (( int(Math.log( n) * -184.66496523 + 0.5) + 1) << 1) : 2046);
- }
- public function buffer(data:ByteArray) : void {
- var n:Note, rep:int, i:int, imax:int, dph:int, lout:int, v:int;
- for (imax=1024; imax<=bufferSize; imax+=1024) {
- for (n=term.next; n!=term; n=n.next) {
- for (dph=pitchTable[n.pitch], i=imax-1024; i<imax; n.ph=(n.ph+dph)&0x3ffffff, i++) {
- lout=n.table[n.ph>>n.shift]+n.gain; pipe[i]+=logTable[lout];
- }
- if (!n.inc()) n = n.remove();
- }
- }
- for (i=0; i<bufferSize; i++) { data.writeFloat(pipe[i]); data.writeFloat(pipe[i]); pipe[i]=0; }
- }
- public function noteOn(pitch:int, velocity:int=64, tone:int=0, decay:int=4, sweep:int=0) : void {
- Note.alloc().reset(tone, pitch, _logIndex(velocity*0.0078125), sweep, (decay<<2)).into(term);
- }
- private function _logIndex(n:Number) : int {
- return (n<0) ? ((n<-0.00390625) ? (((int(Math.log(-n) * -184.66496523 + 0.5) + 1) << 1) + 1) : 2047)
- : ((n> 0.00390625) ? (( int(Math.log( n) * -184.66496523 + 0.5) + 1) << 1) : 2046);
- }
- public function buffer(data:ByteArray) : void {
- var n:Note, rep:int, i:int, imax:int, dph:int, lout:int, v:int;
- for (imax=1024; imax<=bufferSize; imax+=1024) {
- for (n=term.next; n!=term; n=n.next) {
- for (dph=pitchTable[n.pitch], i=imax-1024; i<imax; n.ph=(n.ph+dph)&0x3ffffff, i++) {
- lout=n.table[n.ph>>n.shift]+n.gain; pipe[i]+=logTable[lout];
- }
- if (!n.inc()) n = n.remove();
- }
- }
- for (i=0; i<bufferSize; i++) { data.writeFloat(pipe[i]); data.writeFloat(pipe[i]); pipe[i]=0; }
- }
- public function noteOn(pitch:int, velocity:int=64, tone:int=0, decay:int=4, sweep:int=0) : void {
- Note.alloc().reset(tone, pitch, _logIndex(velocity*0.0078125), sweep, (decay<<2)).into(term);
- }


