Section 1
//TinyActive (de.popforge.assets.tr909.button.TinyActive)
package de.popforge.assets.tr909.button {
import flash.display.*;
public dynamic class TinyActive extends BitmapData {
public function TinyActive(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.button
Section 2
//Digit (de.popforge.assets.tr909.lcd.Digit)
package de.popforge.assets.tr909.lcd {
import flash.display.*;
public dynamic class Digit extends MovieClip {
}
}//package de.popforge.assets.tr909.lcd
Section 3
//Active (de.popforge.assets.tr909.led.Active)
package de.popforge.assets.tr909.led {
import flash.display.*;
public dynamic class Active extends BitmapData {
public function Active(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.led
Section 4
//Active (de.popforge.assets.tr909.mute.button.Active)
package de.popforge.assets.tr909.mute.button {
import flash.display.*;
public dynamic class Active extends BitmapData {
public function Active(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.mute.button
Section 5
//ActiveDown (de.popforge.assets.tr909.start.button.ActiveDown)
package de.popforge.assets.tr909.start.button {
import flash.display.*;
public dynamic class ActiveDown extends BitmapData {
public function ActiveDown(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.start.button
Section 6
//ActiveUp (de.popforge.assets.tr909.start.button.ActiveUp)
package de.popforge.assets.tr909.start.button {
import flash.display.*;
public dynamic class ActiveUp extends BitmapData {
public function ActiveUp(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.start.button
Section 7
//NormalDown (de.popforge.assets.tr909.start.button.NormalDown)
package de.popforge.assets.tr909.start.button {
import flash.display.*;
public dynamic class NormalDown extends BitmapData {
public function NormalDown(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.start.button
Section 8
//NormalUp (de.popforge.assets.tr909.start.button.NormalUp)
package de.popforge.assets.tr909.start.button {
import flash.display.*;
public dynamic class NormalUp extends BitmapData {
public function NormalUp(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.start.button
Section 9
//AccentDown (de.popforge.assets.tr909.step.button.AccentDown)
package de.popforge.assets.tr909.step.button {
import flash.display.*;
public dynamic class AccentDown extends BitmapData {
public function AccentDown(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.step.button
Section 10
//AccentUp (de.popforge.assets.tr909.step.button.AccentUp)
package de.popforge.assets.tr909.step.button {
import flash.display.*;
public dynamic class AccentUp extends BitmapData {
public function AccentUp(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.step.button
Section 11
//MediumDown (de.popforge.assets.tr909.step.button.MediumDown)
package de.popforge.assets.tr909.step.button {
import flash.display.*;
public dynamic class MediumDown extends BitmapData {
public function MediumDown(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.step.button
Section 12
//MediumUp (de.popforge.assets.tr909.step.button.MediumUp)
package de.popforge.assets.tr909.step.button {
import flash.display.*;
public dynamic class MediumUp extends BitmapData {
public function MediumUp(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.step.button
Section 13
//NoneDown (de.popforge.assets.tr909.step.button.NoneDown)
package de.popforge.assets.tr909.step.button {
import flash.display.*;
public dynamic class NoneDown extends BitmapData {
public function NoneDown(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.step.button
Section 14
//NoneUp (de.popforge.assets.tr909.step.button.NoneUp)
package de.popforge.assets.tr909.step.button {
import flash.display.*;
public dynamic class NoneUp extends BitmapData {
public function NoneUp(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909.step.button
Section 15
//Chassis (de.popforge.assets.tr909.Chassis)
package de.popforge.assets.tr909 {
import flash.display.*;
public dynamic class Chassis extends BitmapData {
public function Chassis(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package de.popforge.assets.tr909
Section 16
//Audio (de.popforge.audio.output.Audio)
package de.popforge.audio.output {
public class Audio {
public static const RATE5512:uint = 5512;
public static const MONO:uint = 1;
public static const BIT8:uint = 8;
public static const RATE44100:uint = 44100;
public static const BIT16:uint = 16;
public static const RATE11025:uint = 11025;
public static const STEREO:uint = 2;
public static const RATE22050:uint = 22050;
public static function checkRate(_arg1:uint):void{
switch (_arg1){
case RATE44100:
case RATE22050:
case RATE11025:
case RATE5512:
break;
default:
throw (new Error((_arg1.toString() + "is not supported.")));
};
}
public static function checkBits(_arg1:uint):void{
switch (_arg1){
case BIT8:
case BIT16:
break;
default:
throw (new Error("Only 8 and 16 bit is supported."));
};
}
public static function checkAll(_arg1:uint, _arg2:uint, _arg3:uint):void{
checkChannels(_arg1);
checkBits(_arg2);
checkRate(_arg3);
}
public static function checkChannels(_arg1:uint):void{
switch (_arg1){
case MONO:
case STEREO:
break;
default:
throw (new Error("Only mono or stereo is supported."));
};
}
}
}//package de.popforge.audio.output
Section 17
//AudioBuffer (de.popforge.audio.output.AudioBuffer)
package de.popforge.audio.output {
import flash.utils.*;
import flash.media.*;
import flash.events.*;
public class AudioBuffer {
public var onStop:Function;
private var bits:uint;
public var onInit:Function;
private var multiple:uint;
private var sound:Sound;
private var samples:Array;
private var sync:Sound;
private var playing:Boolean;
public var onComplete:Function;
private var _numSamples:uint;
public var onStart:Function;
private var channels:uint;
private var firstrun:Boolean;
private var rate:uint;
private var _numBytes:uint;
private var syncChannel:SoundChannel;
private var bytes:ByteArray;
private var soundChannel:SoundChannel;
private var $isInit:Boolean;
public static const UNIT_SAMPLES_NUM:uint = 0x0800;
public function AudioBuffer(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint){
Audio.checkAll(_arg2, _arg3, _arg4);
this.multiple = _arg1;
this.channels = _arg2;
this.bits = _arg3;
this.rate = _arg4;
firstrun = true;
init();
}
public function get millisEachBuffer():Number{
return (((0x1F4000 / rate) * multiple));
}
public function setBits(_arg1:uint):void{
Audio.checkBits(_arg1);
if (_arg1 != this.bits){
this.stop();
this.bits = _arg1;
this.init();
};
}
public function stop():Boolean{
var _local1:Sample;
if (!playing){
return (false);
};
if (syncChannel != null){
syncChannel.stop();
syncChannel = null;
};
if (soundChannel != null){
soundChannel.stop();
soundChannel = null;
};
playing = false;
sound = null;
var _local2:int;
while (_local2 < _numSamples) {
_local1 = samples[_local2];
_local1.left = (_local1.right = 0);
_local2++;
};
if (onStop != null){
onStop(this);
};
return (true);
}
public function getMultiple():uint{
return (multiple);
}
private function init():void{
var _local1:int;
$isInit = false;
if (multiple == 0){
throw (new Error("Buffer must have a length greater than 0."));
};
bytes = new ByteArray();
bytes.endian = Endian.LITTLE_ENDIAN;
switch (rate){
case Audio.RATE44100:
_numSamples = (UNIT_SAMPLES_NUM * multiple);
break;
case Audio.RATE22050:
_numSamples = ((UNIT_SAMPLES_NUM * multiple) >> 1);
break;
case Audio.RATE11025:
_numSamples = ((UNIT_SAMPLES_NUM * multiple) >> 2);
break;
case Audio.RATE5512:
_numSamples = ((UNIT_SAMPLES_NUM * multiple) >> 3);
break;
};
_numBytes = _numSamples;
if (channels == Audio.STEREO){
_numBytes = (_numBytes << 1);
};
if (bits == Audio.BIT16){
_numBytes = (_numBytes << 1);
};
samples = new Array();
_local1 = 0;
while (_local1 < _numSamples) {
samples.push(new Sample());
_local1++;
};
var _local2:ByteArray = new ByteArray();
switch (bits){
case Audio.BIT16:
_local2.length = ((_numSamples - 1) << 1);
break;
case Audio.BIT8:
_local2.length = (_numSamples - 1);
_local1 = 0;
while (_local1 < _local2.length) {
_local2[_local1] = 128;
_local1++;
};
break;
};
SoundFactory.fromByteArray(_local2, 1, bits, rate, onGenerateSyncSound);
playing = false;
}
public function setMultiple(_arg1:uint):void{
if (_arg1 != this.multiple){
this.stop();
this.multiple = _arg1;
this.init();
};
}
public function get rightPeak():Number{
return (((soundChannel == null)) ? 0 : soundChannel.rightPeak);
}
public function get numSamples():uint{
return (_numSamples);
}
public function isPlaying():Boolean{
return (playing);
}
public function get leftPeak():Number{
return (((soundChannel == null)) ? 0 : soundChannel.leftPeak);
}
private function onGenerateSyncSound(_arg1:Sound):void{
sync = _arg1;
$isInit = true;
if (((!((onInit == null))) && (firstrun))){
onInit(this);
};
firstrun = false;
}
public function getChannels():uint{
return (channels);
}
private function onNewBufferCreated(_arg1:Sound):void{
if (playing){
this.sound = _arg1;
};
}
public function update():ByteArray{
var _local1:int;
var _local2:Sample;
var _local3:Number;
var _local4:Number;
bytes.length = 0;
switch (channels){
case Audio.MONO:
if (bits == Audio.BIT16){
_local1 = 0;
while (_local1 < _numSamples) {
_local2 = samples[_local1];
_local3 = ((_local2.left + _local2.right) / 2);
if (_local3 < -1){
bytes.writeShort(-32767);
} else {
if (_local3 > 1){
bytes.writeShort(32767);
} else {
bytes.writeShort((_local3 * 32767));
};
};
_local2.left = (_local2.right = 0);
_local1++;
};
} else {
_local1 = 0;
while (_local1 < _numSamples) {
_local2 = samples[_local1];
_local3 = ((_local2.left + _local2.right) / 2);
if (_local3 < -1){
bytes.writeByte(0);
} else {
if (_local3 > 1){
bytes.writeByte(0xFF);
} else {
bytes.writeByte((128 + (_local3 * 127)));
};
};
_local2.left = (_local2.right = 0);
_local1++;
};
};
break;
case Audio.STEREO:
if (bits == Audio.BIT16){
_local1 = 0;
while (_local1 < _numSamples) {
_local2 = samples[_local1];
_local3 = _local2.left;
_local4 = _local2.right;
if (_local3 < -1){
bytes.writeShort(-32767);
} else {
if (_local3 > 1){
bytes.writeShort(32767);
} else {
bytes.writeShort((_local3 * 32767));
};
};
if (_local4 < -1){
bytes.writeShort(-32767);
} else {
if (_local4 > 1){
bytes.writeShort(32767);
} else {
bytes.writeShort((_local4 * 32767));
};
};
_local2.left = (_local2.right = 0);
_local1++;
};
} else {
_local1 = 0;
while (_local1 < _numSamples) {
_local2 = samples[_local1];
_local3 = _local2.left;
_local4 = _local2.right;
if (_local3 < -1){
bytes.writeByte(0);
} else {
if (_local3 > 1){
bytes.writeByte(0xFF);
} else {
bytes.writeByte((128 + (_local3 * 127)));
};
};
if (_local4 < -1){
bytes.writeByte(0);
} else {
if (_local4 > 1){
bytes.writeByte(0xFF);
} else {
bytes.writeByte((128 + (_local4 * 127)));
};
};
_local2.left = (_local2.right = 0);
_local1++;
};
};
break;
};
SoundFactory.fromByteArray(bytes, channels, bits, rate, onNewBufferCreated);
return (bytes);
}
public function setChannels(_arg1:uint):void{
Audio.checkChannels(_arg1);
if (_arg1 != this.channels){
this.stop();
this.channels = _arg1;
this.init();
};
}
public function getSamples():Array{
return (samples);
}
public function get isInit():Boolean{
return ($isInit);
}
public function getRate():uint{
return (rate);
}
public function start():Boolean{
if (playing){
return (false);
};
if (sync != null){
syncChannel = sync.play(0, 1);
syncChannel.addEventListener(Event.SOUND_COMPLETE, onSyncComplete);
if (soundChannel != null){
soundChannel.stop();
};
if (sound != null){
soundChannel = sound.play(0, 1);
};
playing = true;
};
if (onStart != null){
onStart(this);
};
return (true);
}
public function setRate(_arg1:uint):void{
Audio.checkRate(_arg1);
if (_arg1 != this.rate){
this.stop();
this.rate = _arg1;
this.init();
};
}
private function onSyncComplete(_arg1:Event):void{
if (syncChannel != null){
syncChannel.stop();
};
syncChannel = sync.play(0, 1);
syncChannel.addEventListener(Event.SOUND_COMPLETE, onSyncComplete);
if (soundChannel != null){
soundChannel.stop();
};
if (sound != null){
soundChannel = sound.play(0, 1);
};
sound = null;
onComplete(this);
}
public function getBits():uint{
return (bits);
}
}
}//package de.popforge.audio.output
Section 18
//Sample (de.popforge.audio.output.Sample)
package de.popforge.audio.output {
public class Sample {
public var left:Number;
public var right:Number;
public function Sample(_arg1:Number=0, _arg2:Number=0){
this.left = _arg1;
this.right = _arg2;
}
public function toString():String{
return ((((("{ left: " + left) + " right: ") + right) + " }"));
}
public function clone():Sample{
return (new Sample(left, right));
}
}
}//package de.popforge.audio.output
Section 19
//SoundFactory (de.popforge.audio.output.SoundFactory)
package de.popforge.audio.output {
import flash.utils.*;
import flash.media.*;
import flash.events.*;
import flash.display.*;
public class SoundFactory {
private static const SWF:Class = SoundFactory_SWF;
public static function fromByteArray(_arg1:ByteArray, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:Function):void{
var loader:Loader;
var bytes = _arg1;
var channels = _arg2;
var bits = _arg3;
var rate = _arg4;
var onComplete = _arg5;
Audio.checkAll(channels, bits, rate);
var swf:ByteArray = ByteArray(new SWF());
swf.endian = Endian.LITTLE_ENDIAN;
swf.position = swf.length;
swf.writeShort(959);
swf.writeUnsignedInt((bytes.length + 7));
var byte2:uint = (3 << 4);
switch (rate){
case 44100:
byte2 = (byte2 | 12);
break;
case 22050:
byte2 = (byte2 | 8);
break;
case 11025:
byte2 = (byte2 | 4);
break;
};
var numSamples:int = bytes.length;
if (channels == 2){
byte2 = (byte2 | 1);
numSamples = (numSamples >> 1);
};
if (bits == 16){
byte2 = (byte2 | 2);
numSamples = (numSamples >> 1);
};
swf.writeShort(1);
swf.writeByte(byte2);
swf.writeUnsignedInt(numSamples);
swf.writeBytes(bytes);
swf.writeShort((1 << 6));
swf.position = 4;
swf.writeUnsignedInt(swf.length);
swf.position = 0;
var onSWFLoaded:Function = function (_arg1:Event):void{
onComplete(Sound(new ((loader.contentLoaderInfo.applicationDomain.getDefinition("SoundItem") as Class))));
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onSWFLoaded);
loader.loadBytes(swf);
}
public static function fromArray(_arg1:Array, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:Function):void{
var _local7:int;
var _local8:Sample;
var _local9:Number;
var _local10:Number;
var _local6:ByteArray = new ByteArray();
_local6.endian = Endian.LITTLE_ENDIAN;
var _local11:int = _arg1.length;
switch (_arg2){
case Audio.MONO:
if (_arg3 == Audio.BIT16){
_local7 = 0;
while (_local7 < _local11) {
_local8 = _arg1[_local7];
_local9 = _local8.left;
if (_local9 < -1){
_local6.writeShort(-32767);
} else {
if (_local9 > 1){
_local6.writeShort(32767);
} else {
_local6.writeShort((_local9 * 32767));
};
};
_local8.left = (_local8.right = 0);
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _local11) {
_local8 = _arg1[_local7];
_local9 = _local8.left;
if (_local9 < -1){
_local6.writeByte(0);
} else {
if (_local9 > 1){
_local6.writeByte(0xFF);
} else {
_local6.writeByte((128 + (_local9 * 127)));
};
};
_local8.left = (_local8.right = 0);
_local7++;
};
};
break;
case Audio.STEREO:
if (_arg3 == Audio.BIT16){
_local7 = 0;
while (_local7 < _local11) {
_local8 = _arg1[_local7];
_local9 = _local8.left;
_local10 = _local8.right;
if (_local9 < -1){
_local6.writeShort(-32767);
} else {
if (_local9 > 1){
_local6.writeShort(32767);
} else {
_local6.writeShort((_local9 * 32767));
};
};
if (_local10 < -1){
_local6.writeShort(-32767);
} else {
if (_local10 > 1){
_local6.writeShort(32767);
} else {
_local6.writeShort((_local10 * 32767));
};
};
_local8.left = (_local8.right = 0);
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _local11) {
_local8 = _arg1[_local7];
_local9 = _local8.left;
_local10 = _local8.right;
if (_local9 < -1){
_local6.writeByte(0);
} else {
if (_local9 > 1){
_local6.writeByte(0xFF);
} else {
_local6.writeByte((128 + (_local9 * 127)));
};
};
if (_local10 < -1){
_local6.writeByte(0);
} else {
if (_local10 > 1){
_local6.writeByte(0xFF);
} else {
_local6.writeByte((128 + (_local10 * 127)));
};
};
_local8.left = (_local8.right = 0);
_local7++;
};
};
break;
};
SoundFactory.fromByteArray(_local6, _arg2, _arg3, _arg4, _arg5);
}
}
}//package de.popforge.audio.output
Section 20
//SoundFactory_SWF (de.popforge.audio.output.SoundFactory_SWF)
package de.popforge.audio.output {
import mx.core.*;
public class SoundFactory_SWF extends ByteArrayAsset {
}
}//package de.popforge.audio.output
Section 21
//Memory (de.popforge.audio.processor.fl909.memory.Memory)
package de.popforge.audio.processor.fl909.memory {
import de.popforge.audio.processor.fl909.*;
import flash.utils.*;
import flash.net.*;
public final class Memory implements IExternalizable {
private var patternNext:Pattern;
private var patternBank:Array;
private var stepIndex:int;
private var patternRun:Pattern;
private var fl909:FL909;
public function Memory(_arg1:FL909){
this.fl909 = _arg1;
patternBank = [(patternRun = (patternNext = new Pattern()))];
stepIndex = 0;
}
public function getTriggers():Array{
return (patternRun.steps[stepIndex]);
}
public function readExternal(_arg1:IDataInput):void{
patternBank = _arg1.readObject();
patternRun = (patternNext = patternBank[0]);
}
public function rewind():void{
stepIndex = 0;
}
public function stepComplete():void{
if (++stepIndex >= patternRun.length){
patternRun = patternNext;
stepIndex = 0;
};
}
public function removeTriggerAt(_arg1:int, _arg2:int):void{
var _local3:Array = patternNext.steps[_arg1];
if (_local3 == null){
return;
};
var _local4:int = _local3.length;
while (--_local4 > -1) {
if (Trigger(_local3[_local4]).voiceIndex == _arg2){
_local3.splice(_local4, 1);
return;
};
};
}
public function getPatternRun():Pattern{
return (patternRun);
}
public function writeExternal(_arg1:IDataOutput):void{
_arg1.writeObject(patternBank);
}
public function copyPattern(_arg1:int, _arg2:int):void{
if (_arg1 == _arg2){
return;
};
if (patternBank[_arg1]){
patternBank[_arg2] = Pattern(patternBank[_arg1]).clone();
};
}
public function getPatternNext():Pattern{
return (patternNext);
}
public function clear():void{
patternBank = [(patternRun = (patternNext = new Pattern()))];
}
public function changePatternByIndex(_arg1:int):void{
if (patternBank[_arg1] == null){
patternBank[_arg1] = new Pattern();
};
patternNext = patternBank[_arg1];
if (fl909.pause.getValue()){
patternRun = patternNext;
};
}
public function createTriggerAt(_arg1:int, _arg2:int, _arg3:Boolean):void{
if (patternNext.steps[_arg1] == null){
patternNext.steps[_arg1] = new Array();
};
var _local4:Array = patternNext.steps[_arg1];
_local4.push(new Trigger(_arg2, _arg3));
}
registerClassAlias("Memory", Memory);
registerClassAlias("Pattern", Pattern);
registerClassAlias("Trigger", Trigger);
}
}//package de.popforge.audio.processor.fl909.memory
Section 22
//Pattern (de.popforge.audio.processor.fl909.memory.Pattern)
package de.popforge.audio.processor.fl909.memory {
import flash.utils.*;
public final class Pattern implements IExternalizable {
public var length:uint;
public var steps:Array;
public function Pattern(_arg1:uint=16){
this.length = _arg1;
this.steps = new Array();
}
public function readExternal(_arg1:IDataInput):void{
steps = _arg1.readObject();
length = _arg1.readByte();
}
public function writeExternal(_arg1:IDataOutput):void{
_arg1.writeObject(steps);
_arg1.writeByte(length);
}
public function clone():Pattern{
var _local2:Trigger;
var _local3:Array;
var _local1:Pattern = new Pattern(length);
var _local4:int;
while (_local4 < length) {
_local3 = (_local1.steps[_local4] = new Array());
for each (_local2 in steps[_local4]) {
_local3.push(_local2.clone());
};
_local4++;
};
return (_local1);
}
}
}//package de.popforge.audio.processor.fl909.memory
Section 23
//Trigger (de.popforge.audio.processor.fl909.memory.Trigger)
package de.popforge.audio.processor.fl909.memory {
import flash.utils.*;
public final class Trigger implements IExternalizable {
public var voiceIndex:int;
public var accent:Boolean;
public function Trigger(_arg1:int=-1, _arg2:Boolean=false){
this.voiceIndex = _arg1;
this.accent = _arg2;
}
public function readExternal(_arg1:IDataInput):void{
voiceIndex = _arg1.readByte();
accent = _arg1.readBoolean();
}
public function writeExternal(_arg1:IDataOutput):void{
_arg1.writeByte(voiceIndex);
_arg1.writeBoolean(accent);
}
public function clone():Trigger{
return (new Trigger(voiceIndex, accent));
}
}
}//package de.popforge.audio.processor.fl909.memory
Section 24
//ToneBase (de.popforge.audio.processor.fl909.tone.ToneBase)
package de.popforge.audio.processor.fl909.tone {
import flash.utils.*;
import de.popforge.parameter.*;
public class ToneBase implements IExternalizable {
public const level:Parameter;
public const mute:Parameter;
public const pan:Parameter;
public function ToneBase(){
level = new Parameter(new MappingNumberLinear(0, 1), 0.75);
mute = new Parameter(new MappingBoolean(), false);
pan = new Parameter(new MappingNumberLinear(-1, 1), 0);
super();
}
public function readExternal(_arg1:IDataInput):void{
level.readExternal(_arg1);
mute.readExternal(_arg1);
pan.readExternal(_arg1);
}
public function writeExternal(_arg1:IDataOutput):void{
level.writeExternal(_arg1);
mute.writeExternal(_arg1);
pan.writeExternal(_arg1);
}
public function reset():void{
level.reset();
mute.reset();
pan.reset();
}
}
}//package de.popforge.audio.processor.fl909.tone
Section 25
//ToneBassdrum (de.popforge.audio.processor.fl909.tone.ToneBassdrum)
package de.popforge.audio.processor.fl909.tone {
import flash.utils.*;
import de.popforge.parameter.*;
public class ToneBassdrum extends ToneBase implements IExternalizable {
public const attack:Parameter;
public const tune:Parameter;
public const decay:Parameter;
public function ToneBassdrum(){
tune = new Parameter(new MappingNumberLinear(1, 6), 3);
attack = new Parameter(new MappingNumberLinear(1, 0), 1);
decay = new Parameter(new MappingNumberExponential(0x0200, 0x2000), 0x1000);
super();
}
override public function readExternal(_arg1:IDataInput):void{
super.readExternal(_arg1);
tune.readExternal(_arg1);
attack.readExternal(_arg1);
decay.readExternal(_arg1);
}
override public function writeExternal(_arg1:IDataOutput):void{
super.writeExternal(_arg1);
tune.writeExternal(_arg1);
attack.writeExternal(_arg1);
decay.writeExternal(_arg1);
}
override public function reset():void{
super.reset();
tune.reset();
attack.reset();
decay.reset();
}
}
}//package de.popforge.audio.processor.fl909.tone
Section 26
//ToneCrash (de.popforge.audio.processor.fl909.tone.ToneCrash)
package de.popforge.audio.processor.fl909.tone {
import flash.utils.*;
import de.popforge.parameter.*;
public class ToneCrash extends ToneBase implements IExternalizable {
public const tune:Parameter;
public function ToneCrash(){
tune = new Parameter(new MappingNumberExponential(0.75, 1.3), 1);
super();
}
override public function readExternal(_arg1:IDataInput):void{
super.readExternal(_arg1);
tune.readExternal(_arg1);
}
override public function writeExternal(_arg1:IDataOutput):void{
super.writeExternal(_arg1);
tune.writeExternal(_arg1);
}
override public function reset():void{
super.reset();
tune.reset();
}
}
}//package de.popforge.audio.processor.fl909.tone
Section 27
//ToneHighHat (de.popforge.audio.processor.fl909.tone.ToneHighHat)
package de.popforge.audio.processor.fl909.tone {
import flash.utils.*;
import de.popforge.parameter.*;
public class ToneHighHat extends ToneBase implements IExternalizable {
public const decayCL:Parameter;
public const tune:Parameter;
public const decayOP:Parameter;
public function ToneHighHat(){
tune = new Parameter(new MappingNumberExponential(0.75, 1.3), 1);
decayCL = new Parameter(new MappingNumberLinear(0, 1), 0.2);
decayOP = new Parameter(new MappingNumberLinear(0.1, 1), 0.4);
super();
}
override public function readExternal(_arg1:IDataInput):void{
super.readExternal(_arg1);
tune.readExternal(_arg1);
decayCL.readExternal(_arg1);
decayOP.readExternal(_arg1);
}
override public function reset():void{
super.reset();
tune.reset();
decayCL.reset();
decayOP.reset();
}
override public function writeExternal(_arg1:IDataOutput):void{
super.writeExternal(_arg1);
tune.writeExternal(_arg1);
decayCL.writeExternal(_arg1);
tune.writeExternal(_arg1);
}
}
}//package de.popforge.audio.processor.fl909.tone
Section 28
//ToneRide (de.popforge.audio.processor.fl909.tone.ToneRide)
package de.popforge.audio.processor.fl909.tone {
import flash.utils.*;
import de.popforge.parameter.*;
public class ToneRide extends ToneBase implements IExternalizable {
public const tune:Parameter;
public function ToneRide(){
tune = new Parameter(new MappingNumberExponential(0.75, 1.3), 1);
super();
}
override public function readExternal(_arg1:IDataInput):void{
super.readExternal(_arg1);
tune.readExternal(_arg1);
}
override public function writeExternal(_arg1:IDataOutput):void{
super.writeExternal(_arg1);
tune.writeExternal(_arg1);
}
override public function reset():void{
super.reset();
tune.reset();
}
}
}//package de.popforge.audio.processor.fl909.tone
Section 29
//ToneSnaredrum (de.popforge.audio.processor.fl909.tone.ToneSnaredrum)
package de.popforge.audio.processor.fl909.tone {
import flash.utils.*;
import de.popforge.parameter.*;
public class ToneSnaredrum extends ToneBase implements IExternalizable {
public const tone:Parameter;
public const snappy:Parameter;
public const tune:Parameter;
public function ToneSnaredrum(){
tune = new Parameter(new MappingNumberExponential(0.75, 1.3), 1);
tone = new Parameter(new MappingNumberLinear(0.999, 0.9996), 0.9996);
snappy = new Parameter(new MappingNumberLinear(0, 1), 1);
super();
}
override public function readExternal(_arg1:IDataInput):void{
super.readExternal(_arg1);
tune.readExternal(_arg1);
tone.readExternal(_arg1);
snappy.readExternal(_arg1);
}
override public function reset():void{
super.reset();
tune.reset();
tone.reset();
snappy.reset();
}
override public function writeExternal(_arg1:IDataOutput):void{
super.writeExternal(_arg1);
tune.writeExternal(_arg1);
tone.writeExternal(_arg1);
snappy.writeExternal(_arg1);
}
}
}//package de.popforge.audio.processor.fl909.tone
Section 30
//ToneTom (de.popforge.audio.processor.fl909.tone.ToneTom)
package de.popforge.audio.processor.fl909.tone {
import flash.utils.*;
import de.popforge.parameter.*;
public final class ToneTom extends ToneBase implements IExternalizable {
public const decay:Parameter;
public const tune:Parameter;
public function ToneTom(){
tune = new Parameter(new MappingNumberExponential(0.75, 1.3), 1);
decay = new Parameter(new MappingNumberLinear(0.3, 1), 0.75);
super();
}
override public function readExternal(_arg1:IDataInput):void{
super.readExternal(_arg1);
tune.readExternal(_arg1);
decay.readExternal(_arg1);
}
override public function writeExternal(_arg1:IDataOutput):void{
super.writeExternal(_arg1);
tune.writeExternal(_arg1);
decay.writeExternal(_arg1);
}
override public function reset():void{
super.reset();
tune.reset();
decay.reset();
}
}
}//package de.popforge.audio.processor.fl909.tone
Section 31
//Rom (de.popforge.audio.processor.fl909.voices.Rom)
package de.popforge.audio.processor.fl909.voices {
import flash.utils.*;
import de.popforge.format.furnace.*;
public class Rom {
private static const Furnace:Class = Rom_Furnace;
private static const furnace:FurnaceFormat = new FurnaceFormat();
private static function convert8Bit(_arg1:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = _arg1.length;
var _local4:int;
while (_local4 < _local3) {
_local2.push(((127 - _arg1[_local4]) / 127));
_local4++;
};
return (_local2);
}
static function getAmplitudesByName(_arg1:String):Array{
switch (_arg1){
case "909.bd.noise.raw":
case "909.bd.grain.raw":
case "909.clap.raw":
case "909.rim.raw":
case "909.sd.raw":
case "909.tl.raw":
case "909.tm.raw":
case "909.th.raw":
case "909.ch.raw":
return (convert16Bit(furnace.fileByName(_arg1)));
case "909.cr.raw":
case "909.oh.raw":
case "909.ri.raw":
return (convert8Bit(furnace.fileByName(_arg1)));
};
return (null);
}
private static function convert16Bit(_arg1:ByteArray):Array{
_arg1.endian = Endian.LITTLE_ENDIAN;
var _local2:Array = new Array();
var _local3 = (_arg1.length >> 1);
var _local4:int;
while (_local4 < _local3) {
_local2.push((_arg1.readShort() / 32767));
_local4++;
};
return (_local2);
}
furnace.readExternal(new Furnace());
}
}//package de.popforge.audio.processor.fl909.voices
Section 32
//Rom_Furnace (de.popforge.audio.processor.fl909.voices.Rom_Furnace)
package de.popforge.audio.processor.fl909.voices {
import mx.core.*;
public class Rom_Furnace extends ByteArrayAsset {
}
}//package de.popforge.audio.processor.fl909.voices
Section 33
//Voice (de.popforge.audio.processor.fl909.voices.Voice)
package de.popforge.audio.processor.fl909.voices {
public class Voice {
protected var start:int;
protected var monophone:Boolean;
protected var length:int;
protected var position:int;
protected var stop:int;// = 2147483647
protected var volume:Number;
public function Voice(_arg1:int, _arg2:Number=0){
this.start = _arg1;
this.volume = _arg2;
position = 0;
length = int.MAX_VALUE;
}
public function processAudioAdd(_arg1:Array):Boolean{
throw (new Error("Override processAudioAdd()."));
}
public function isMonophone():Boolean{
return (monophone);
}
public function getChannel():int{
throw (new Error("Override getChannel()."));
}
public function cut(_arg1:int):void{
this.stop = _arg1;
}
}
}//package de.popforge.audio.processor.fl909.voices
Section 34
//VoiceBassdrum (de.popforge.audio.processor.fl909.voices.VoiceBassdrum)
package de.popforge.audio.processor.fl909.voices {
import de.popforge.audio.output.*;
import de.popforge.audio.processor.fl909.tone.*;
public final class VoiceBassdrum extends Voice {
private var tone:ToneBassdrum;
private var attackValue:Number;
private var bodyEnv:Number;
private var posBody:Number;
private var tuneValue:Number;
private var cutEnv:Number;
private static const sndNoise:Array = Rom.getAmplitudesByName("909.bd.noise.raw");
private static const sndBody:Array = Rom.getAmplitudesByName("909.bd.grain.raw");
private static var sndBodyNum:int = sndBody.length;
public function VoiceBassdrum(_arg1:int, _arg2:Number, _arg3:ToneBassdrum){
super(_arg1, _arg2);
this.tone = _arg3;
monophone = true;
cutEnv = 1;
bodyEnv = 1;
posBody = 0;
tuneValue = _arg3.tune.getValue();
attackValue = (_arg3.attack.getValue() * _arg2);
}
override public function getChannel():int{
return (0);
}
override public function processAudioAdd(_arg1:Array):Boolean{
var _local3:Sample;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local2:int = _arg1.length;
var _local7:Number = (tone.level.getValue() * volume);
var _local8:int = tone.decay.getValue();
var _local9:int = start;
while (_local9 < _local2) {
if (_local9 >= stop){
return (true);
};
_local3 = _arg1[_local9];
_local6 = posBody;
_local5 = (posBody - _local6);
_local4 = (sndBody[_local6] * (1 - _local5));
_local4 = (_local4 + (sndBody[int((_local6 + 1))] * _local5));
_local4 = (_local4 * ((bodyEnv * _local7) * cutEnv));
if (position < sndNoise.length){
_local4 = (_local4 + ((sndNoise[position] * attackValue) * _local7));
};
if (position++ > _local8){
bodyEnv = (bodyEnv * 0.9994);
if (bodyEnv < 0.001){
return (true);
};
};
_local3.left = (_local3.left + _local4);
_local3.right = (_local3.right + _local4);
posBody = (posBody + tuneValue);
while (posBody >= sndBodyNum) {
posBody = (posBody - sndBodyNum);
};
tuneValue = (tuneValue + ((1 - tuneValue) * 0.0011));
_local9++;
};
start = 0;
return (false);
}
sndBody.push(sndBody[0]);
}
}//package de.popforge.audio.processor.fl909.voices
Section 35
//VoiceClap (de.popforge.audio.processor.fl909.voices.VoiceClap)
package de.popforge.audio.processor.fl909.voices {
import de.popforge.audio.output.*;
import de.popforge.audio.processor.fl909.tone.*;
public final class VoiceClap extends Voice {
private var tone:ToneBase;
private static const snd:Array = Rom.getAmplitudesByName("909.clap.raw");
public function VoiceClap(_arg1:int, _arg2:Number, _arg3:ToneBase){
super(_arg1, _arg2);
this.tone = _arg3;
length = snd.length;
}
override public function processAudioAdd(_arg1:Array):Boolean{
var _local3:Sample;
var _local4:Number;
var _local2:int = _arg1.length;
var _local5:Number = (tone.level.getValue() * volume);
var _local6:int = start;
while (_local6 < _local2) {
if (_local6 >= stop){
return (true);
};
_local3 = _arg1[_local6];
_local4 = (snd[position] * _local5);
_local3.left = (_local3.left + _local4);
_local3.right = (_local3.right + _local4);
if (++position >= length){
return (true);
};
_local6++;
};
start = 0;
return (false);
}
override public function getChannel():int{
return (6);
}
}
}//package de.popforge.audio.processor.fl909.voices
Section 36
//VoiceCrash (de.popforge.audio.processor.fl909.voices.VoiceCrash)
package de.popforge.audio.processor.fl909.voices {
import de.popforge.audio.output.*;
import de.popforge.audio.processor.fl909.tone.*;
public final class VoiceCrash extends Voice {
private var tone:ToneCrash;
private static const snd:Array = Rom.getAmplitudesByName("909.cr.raw");
public function VoiceCrash(_arg1:int, _arg2:Number, _arg3:ToneCrash){
super(_arg1, _arg2);
this.tone = _arg3;
monophone = true;
length = snd.length;
}
override public function processAudioAdd(_arg1:Array):Boolean{
var _local3:Sample;
var _local4:Number;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local2:int = _arg1.length;
var _local5:Number = tone.tune.getValue();
var _local6:Number = (tone.level.getValue() * volume);
var _local10:int = start;
while (_local10 < _local2) {
if (_local10 >= stop){
return (true);
};
_local3 = _arg1[_local10];
_local7 = (position++ * _local5);
_local8 = _local7;
if (_local8 >= (length - 1)){
return (true);
};
_local9 = (_local7 - _local8);
_local4 = (snd[_local8] * (1 - _local9));
_local4 = (_local4 + (snd[int((_local8 + 1))] * _local9));
_local4 = (_local4 * _local6);
_local3.left = (_local3.left + _local4);
_local3.right = (_local3.right + _local4);
_local10++;
};
start = 0;
return (false);
}
override public function getChannel():int{
return (8);
}
}
}//package de.popforge.audio.processor.fl909.voices
Section 37
//VoiceHiHat (de.popforge.audio.processor.fl909.voices.VoiceHiHat)
package de.popforge.audio.processor.fl909.voices {
import de.popforge.audio.output.*;
import de.popforge.audio.processor.fl909.tone.*;
public final class VoiceHiHat extends Voice {
private var tone:ToneHighHat;
private var snd:Array;
private var volEnv:Number;
private var closed:Boolean;
private static const sndOP:Array = Rom.getAmplitudesByName("909.oh.raw");
private static const sndCL:Array = Rom.getAmplitudesByName("909.ch.raw");
public static const OPEN:Boolean = false;
public static const CLOSED:Boolean = true;
public function VoiceHiHat(_arg1:int, _arg2:Number, _arg3:ToneHighHat, _arg4:Boolean){
super(_arg1, _arg2);
this.tone = _arg3;
this.closed = _arg4;
snd = (_arg4) ? sndCL : sndOP;
length = snd.length;
monophone = true;
volEnv = 1;
}
override public function processAudioAdd(_arg1:Array):Boolean{
var _local3:Sample;
var _local4:Number;
var _local2:int = _arg1.length;
var _local5:Number = (tone.level.getValue() * volume);
var _local6:int = (length * (closed) ? tone.decayCL.getValue() : tone.decayOP.getValue());
var _local7:int = start;
while (_local7 < _local2) {
if (_local7 >= stop){
return (true);
};
_local3 = _arg1[_local7];
_local4 = ((snd[position] * _local5) * volEnv);
_local3.left = (_local3.left + _local4);
_local3.right = (_local3.right + _local4);
if (position > _local6){
volEnv = (volEnv * 0.999);
if (volEnv < 0.001){
return (true);
};
};
if (++position >= length){
return (true);
};
_local7++;
};
start = 0;
return (false);
}
override public function getChannel():int{
return (7);
}
}
}//package de.popforge.audio.processor.fl909.voices
Section 38
//VoiceRide (de.popforge.audio.processor.fl909.voices.VoiceRide)
package de.popforge.audio.processor.fl909.voices {
import de.popforge.audio.output.*;
import de.popforge.audio.processor.fl909.tone.*;
public final class VoiceRide extends Voice {
private var tone:ToneRide;
private static const snd:Array = Rom.getAmplitudesByName("909.ri.raw");
public function VoiceRide(_arg1:int, _arg2:Number, _arg3:ToneRide){
super(_arg1, _arg2);
this.tone = _arg3;
monophone = true;
length = snd.length;
}
override public function processAudioAdd(_arg1:Array):Boolean{
var _local3:Sample;
var _local4:Number;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local2:int = _arg1.length;
var _local5:Number = tone.tune.getValue();
var _local6:Number = (tone.level.getValue() * volume);
var _local10:int = start;
while (_local10 < _local2) {
if (_local10 >= stop){
return (true);
};
_local3 = _arg1[_local10];
_local7 = (position++ * _local5);
_local8 = _local7;
if (_local8 >= (length - 1)){
return (true);
};
_local9 = (_local7 - _local8);
_local4 = (snd[_local8] * (1 - _local9));
_local4 = (_local4 + (snd[int((_local8 + 1))] * _local9));
_local4 = (_local4 * _local6);
_local3.left = (_local3.left + _local4);
_local3.right = (_local3.right + _local4);
_local10++;
};
start = 0;
return (false);
}
override public function getChannel():int{
return (9);
}
}
}//package de.popforge.audio.processor.fl909.voices
Section 39
//VoiceRimshot (de.popforge.audio.processor.fl909.voices.VoiceRimshot)
package de.popforge.audio.processor.fl909.voices {
import de.popforge.audio.output.*;
import de.popforge.audio.processor.fl909.tone.*;
public final class VoiceRimshot extends Voice {
private var tone:ToneBase;
private static const snd:Array = Rom.getAmplitudesByName("909.rim.raw");
public function VoiceRimshot(_arg1:int, _arg2:Number, _arg3:ToneBase){
super(_arg1, _arg2);
this.tone = _arg3;
length = snd.length;
}
override public function processAudioAdd(_arg1:Array):Boolean{
var _local3:Sample;
var _local4:Number;
var _local2:int = _arg1.length;
var _local5:Number = (tone.level.getValue() * volume);
var _local6:int = start;
while (_local6 < _local2) {
if (_local6 >= stop){
return (true);
};
_local3 = _arg1[_local6];
_local4 = (snd[position] * _local5);
_local3.left = (_local3.left + _local4);
_local3.right = (_local3.right + _local4);
if (++position >= length){
return (true);
};
_local6++;
};
start = 0;
return (false);
}
override public function getChannel():int{
return (5);
}
}
}//package de.popforge.audio.processor.fl909.voices
Section 40
//VoiceSnaredrum (de.popforge.audio.processor.fl909.voices.VoiceSnaredrum)
package de.popforge.audio.processor.fl909.voices {
import de.popforge.audio.output.*;
import de.popforge.audio.processor.fl909.tone.*;
import de.popforge.math.*;
public class VoiceSnaredrum extends Voice {
private var bodyEnv:Number;
private var levelValue:Number;
private var noiseEnv:Number;
private var tuneValue:Number;
private var posBody:Number;
private var snappyValue:Number;
private var toneValue:Number;
private static const sndNoise:Array = createSnareNoise();
private static const sndNoiseNum:int = sndNoise.length;
private static const sndBodyNum:int = (sndBody.length - 1);
private static const sndBody:Array = Rom.getAmplitudesByName("909.sd.raw");
public function VoiceSnaredrum(_arg1:int, _arg2:Number, _arg3:ToneSnaredrum){
super(_arg1);
bodyEnv = 1;
noiseEnv = 1;
posBody = 0;
levelValue = (_arg3.level.getValue() * _arg2);
tuneValue = _arg3.tune.getValue();
snappyValue = _arg3.snappy.getValue();
toneValue = _arg3.tone.getValue();
}
override public function processAudioAdd(_arg1:Array):Boolean{
var _local3:Sample;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local2:int = _arg1.length;
var _local7:int = start;
while (_local7 < _local2) {
if (_local7 >= stop){
return (true);
};
_local3 = _arg1[_local7];
_local6 = posBody;
_local5 = (posBody - _local6);
_local4 = (sndBody[_local6] * (1 - _local5));
_local4 = (_local4 + (sndBody[(_local6 + 1)] * _local5));
_local4 = (_local4 * (bodyEnv * levelValue));
bodyEnv = (bodyEnv * 0.999);
if (position < 11025){
_local4 = (_local4 + (((sndNoise[position++] * levelValue) * noiseEnv) * snappyValue));
} else {
return (true);
};
noiseEnv = (noiseEnv * toneValue);
if (noiseEnv < 0.001){
return (true);
};
_local3.left = (_local3.left + _local4);
_local3.right = (_local3.right + _local4);
posBody = (posBody + tuneValue);
if (posBody >= sndBodyNum){
posBody = (posBody - sndBodyNum);
};
_local7++;
};
start = 0;
return (false);
}
override public function getChannel():int{
return (1);
}
private static function createSnareNoise():Array{
var _local3:Number;
var _local1:Array = new Array();
var _local2:Random = new Random(0xFFFF);
var _local4:Number = 0;
var _local5:Number = 0;
var _local6:Number = 0;
var _local7:Number = 0;
var _local8 = 11025;
while (--_local8 > -1) {
_local3 = _local2.getNumber(-5, 5);
_local5 = (_local5 + ((_local3 - _local5) * 0.2));
_local7 = (_local7 + (((_local3 - _local5) - _local7) * 0.5));
_local1[_local8] = _local7;
};
return (_local1);
}
}
}//package de.popforge.audio.processor.fl909.voices
Section 41
//VoiceTom (de.popforge.audio.processor.fl909.voices.VoiceTom)
package de.popforge.audio.processor.fl909.voices {
import de.popforge.audio.output.*;
import de.popforge.audio.processor.fl909.tone.*;
public final class VoiceTom extends Voice {
private var tuneValue:Number;
private var size:int;
private var posFloat:Number;
private var snd:Array;
private var cutEnv:Number;
private var tone:ToneTom;
private var volEnv:Number;
public static const SIZE_HIGH:int = 2;
private static const snd1:Array = Rom.getAmplitudesByName("909.tm.raw");
private static const snd2:Array = Rom.getAmplitudesByName("909.th.raw");
public static const SIZE_MED:int = 1;
public static const SIZE_LOW:int = 0;
private static const snd0:Array = Rom.getAmplitudesByName("909.tl.raw");
public function VoiceTom(_arg1:int, _arg2:Number, _arg3:ToneTom, _arg4:int){
super(_arg1, _arg2);
this.tone = _arg3;
switch (_arg4){
case SIZE_LOW:
snd = snd0;
break;
case SIZE_MED:
snd = snd1;
break;
case SIZE_HIGH:
snd = snd2;
break;
};
this.size = _arg4;
length = (snd.length - 1);
monophone = true;
tuneValue = _arg3.tune.getValue();
volEnv = 1;
cutEnv = 1;
posFloat = 0;
}
override public function getChannel():int{
return ((2 + size));
}
override public function processAudioAdd(_arg1:Array):Boolean{
var _local3:Sample;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:Number;
var _local2:int = _arg1.length;
var _local8:Number = (tone.level.getValue() * volume);
var _local9:Number = tone.tune.getValue();
var _local10:int = (length * tone.decay.getValue());
var _local11:int = start;
while (_local11 < _local2) {
_local3 = _arg1[_local11];
_local6 = posFloat;
if (_local6 >= (length - 1)){
return (true);
};
if (_local11 >= stop){
return (true);
};
_local7 = (posFloat - _local6);
_local4 = (snd[_local6] * (1 - _local7));
_local4 = (_local4 + (snd[int((_local6 + 1))] * _local7));
_local4 = (_local4 * ((_local8 * volEnv) * cutEnv));
if (position++ >= _local10){
volEnv = (volEnv * 0.9988);
if (volEnv < 0.001){
return (true);
};
};
_local3.left = (_local3.left + _local4);
_local3.right = (_local3.right + _local4);
posFloat = (posFloat + this.tuneValue);
this.tuneValue = (this.tuneValue + ((_local9 - this.tuneValue) * 0.001));
_local11++;
};
start = 0;
return (false);
}
snd0.push(snd0[0]);
snd1.push(snd1[0]);
snd2.push(snd2[0]);
}
}//package de.popforge.audio.processor.fl909.voices
Section 42
//FL909 (de.popforge.audio.processor.fl909.FL909)
package de.popforge.audio.processor.fl909 {
import flash.utils.*;
import de.popforge.audio.processor.fl909.voices.*;
import de.popforge.parameter.*;
import de.popforge.audio.processor.fl909.memory.*;
import de.popforge.audio.processor.fl909.tone.*;
import de.popforge.audio.processor.*;
public final class FL909 implements IAudioProcessor, IExternalizable {
public const toneRide:ToneRide;
public const toneBassdrum:ToneBassdrum;
public const volume:Parameter;
public const tempo:Parameter;
public const toneTomMid:ToneTom;
private const activeVoices:Array;
public const toneRimshot:ToneBase;
public const toneTomHigh:ToneTom;
public const toneHighHat:ToneHighHat;
public const accent:Parameter;
public const toneTomLow:ToneTom;
public const toneCrash:ToneCrash;
public const stepTimes:Array;
public const toneClap:ToneBase;
public const toneSnaredrum:ToneSnaredrum;
public const pause:Parameter;
public const shuffle:Parameter;
public var memory:Memory;
private var shuffleIndex:int;
private var sampleOffset:int;
private var timeElapsed:Number;
public function FL909(){
volume = new Parameter(new MappingNumberLinear(0, 1), 0.8);
accent = new Parameter(new MappingNumberLinear(0.2, 0.8), 0.5);
tempo = new Parameter(new MappingNumberLinear(30, 180), 127);
shuffle = new Parameter(new MappingNumberLinear(1, 1.5), 1);
pause = new Parameter(new MappingBoolean(), true);
toneBassdrum = new ToneBassdrum();
toneSnaredrum = new ToneSnaredrum();
toneTomLow = new ToneTom();
toneTomMid = new ToneTom();
toneTomHigh = new ToneTom();
toneRimshot = new ToneBase();
toneClap = new ToneBase();
toneHighHat = new ToneHighHat();
toneRide = new ToneRide();
toneCrash = new ToneCrash();
stepTimes = new Array();
activeVoices = new Array();
super();
memory = new Memory(this);
sampleOffset = 0;
shuffleIndex = 0;
timeElapsed = 0;
}
public function readExternal(_arg1:IDataInput):void{
memory.readExternal(_arg1);
volume.readExternal(_arg1);
accent.readExternal(_arg1);
tempo.readExternal(_arg1);
shuffle.readExternal(_arg1);
toneBassdrum.readExternal(_arg1);
toneSnaredrum.readExternal(_arg1);
toneTomLow.readExternal(_arg1);
toneTomMid.readExternal(_arg1);
toneTomHigh.readExternal(_arg1);
toneRimshot.readExternal(_arg1);
toneClap.readExternal(_arg1);
toneHighHat.readExternal(_arg1);
toneRide.readExternal(_arg1);
toneCrash.readExternal(_arg1);
}
private function addVoice(_arg1:Voice):void{
var _local2:Voice;
var _local3:int;
if (_arg1.isMonophone()){
_local3 = activeVoices.length;
while (--_local3 > -1) {
_local2 = Voice(activeVoices[_local3]);
if (_local2.getChannel() == _arg1.getChannel()){
_local2.cut(sampleOffset);
break;
};
};
};
activeVoices.push(_arg1);
}
private function advancePattern(_arg1:Array):void{
var _local5:Array;
var _local6:Trigger;
var _local7:Number;
var _local2:int = _arg1.length;
var _local3:int = ((15 * 44100) / tempo.getValue());
var _local4:Number = (15000 / tempo.getValue());
var _local8:Number = volume.getValue();
var _local9:Number = (accent.getValue() * _local8);
var _local10:Number = shuffle.getValue();
while (sampleOffset < _local2) {
_local5 = memory.getTriggers();
if (_local5){
for each (_local6 in _local5) {
_local7 = (_local6.accent) ? _local8 : _local9;
switch (_local6.voiceIndex){
case 0:
if (!toneBassdrum.mute.getValue()){
addVoice(new VoiceBassdrum(sampleOffset, _local7, toneBassdrum));
};
break;
case 1:
if (!toneSnaredrum.mute.getValue()){
addVoice(new VoiceSnaredrum(sampleOffset, _local7, toneSnaredrum));
};
break;
case 2:
if (!toneTomLow.mute.getValue()){
addVoice(new VoiceTom(sampleOffset, _local7, toneTomLow, VoiceTom.SIZE_LOW));
};
break;
case 3:
if (!toneTomMid.mute.getValue()){
addVoice(new VoiceTom(sampleOffset, _local7, toneTomMid, VoiceTom.SIZE_MED));
};
break;
case 4:
if (!toneTomHigh.mute.getValue()){
addVoice(new VoiceTom(sampleOffset, _local7, toneTomHigh, VoiceTom.SIZE_HIGH));
};
break;
case 5:
if (!toneRimshot.mute.getValue()){
addVoice(new VoiceRimshot(sampleOffset, _local7, toneRimshot));
};
break;
case 6:
if (!toneClap.mute.getValue()){
addVoice(new VoiceClap(sampleOffset, _local7, toneClap));
};
break;
case 7:
if (!toneHighHat.mute.getValue()){
addVoice(new VoiceHiHat(sampleOffset, _local7, toneHighHat, VoiceHiHat.CLOSED));
};
break;
case 8:
if (!toneHighHat.mute.getValue()){
addVoice(new VoiceHiHat(sampleOffset, _local7, toneHighHat, VoiceHiHat.OPEN));
};
break;
case 9:
if (!toneCrash.mute.getValue()){
addVoice(new VoiceCrash(sampleOffset, _local7, toneCrash));
};
break;
case 10:
if (!toneRide.mute.getValue()){
addVoice(new VoiceRide(sampleOffset, _local7, toneRide));
};
break;
};
};
};
timeElapsed = (timeElapsed + _local4);
stepTimes.push(timeElapsed);
memory.stepComplete();
if (shuffleIndex == 0){
sampleOffset = (sampleOffset + (_local3 * _local10));
} else {
sampleOffset = (sampleOffset + (_local3 * (2 - _local10)));
};
shuffleIndex = (1 - shuffleIndex);
};
sampleOffset = (sampleOffset - _local2);
}
public function processAudio(_arg1:Array):void{
if (!pause.getValue()){
advancePattern(_arg1);
};
advanceVoices(_arg1);
}
public function isBusy():Boolean{
return ((activeVoices.length > 0));
}
private function advanceVoices(_arg1:Array):void{
var _local2:Boolean;
var _local3:int = activeVoices.length;
while (--_local3 > -1) {
_local2 = Voice(activeVoices[_local3]).processAudioAdd(_arg1);
if (_local2){
activeVoices.splice(_local3, 1);
};
};
}
public function clear():void{
memory.clear();
volume.reset();
accent.reset();
tempo.reset();
shuffle.reset();
toneBassdrum.reset();
toneSnaredrum.reset();
toneTomLow.reset();
toneTomMid.reset();
toneTomHigh.reset();
toneRimshot.reset();
toneClap.reset();
toneHighHat.reset();
toneRide.reset();
toneCrash.reset();
}
public function reset():void{
activeVoices.splice(0, activeVoices.length);
stepTimes.splice(0, stepTimes.length);
memory.rewind();
sampleOffset = 0;
shuffleIndex = 0;
timeElapsed = 0;
}
public function writeExternal(_arg1:IDataOutput):void{
memory.writeExternal(_arg1);
volume.writeExternal(_arg1);
accent.writeExternal(_arg1);
tempo.writeExternal(_arg1);
shuffle.writeExternal(_arg1);
toneBassdrum.writeExternal(_arg1);
toneSnaredrum.writeExternal(_arg1);
toneTomLow.writeExternal(_arg1);
toneTomMid.writeExternal(_arg1);
toneTomHigh.writeExternal(_arg1);
toneRimshot.writeExternal(_arg1);
toneClap.writeExternal(_arg1);
toneHighHat.writeExternal(_arg1);
toneRide.writeExternal(_arg1);
toneCrash.writeExternal(_arg1);
}
}
}//package de.popforge.audio.processor.fl909
Section 43
//IAudioProcessor (de.popforge.audio.processor.IAudioProcessor)
package de.popforge.audio.processor {
public interface IAudioProcessor {
function reset():void;
function processAudio(_arg1:Array):void;
}
}//package de.popforge.audio.processor
Section 44
//FurnaceFormat (de.popforge.format.furnace.FurnaceFormat)
package de.popforge.format.furnace {
import flash.utils.*;
public class FurnaceFormat implements IExternalizable {
var _items:Array;
var _header:FurnaceHeader;
var _library:Array;
static const VERSION:Number = 1;
public function FurnaceFormat(){
_header = new FurnaceHeader();
_items = new Array();
_library = new Array();
}
protected function compressLibrary():void{
var _local1:uint;
var _local2:uint;
_local1 = 0;
_local2 = _library.length;
while (_local1 < _local2) {
ByteArray(_library[_local1]).compress();
_local1++;
};
}
public function fileName(_arg1:uint):String{
testBounds(_arg1);
return (FurnaceItem(_items[_arg1]).fileName);
}
public function readExternal(_arg1:IDataInput):void{
var _local2:uint;
var _local3:uint;
var _local4:FurnaceItem;
var _local5:ByteArray;
if (_arg1.bytesAvailable < _header.computeLength()){
throw (new Error("Can not read header (streaming not implemented yet)."));
};
_header.readExternal(_arg1);
if (_arg1.bytesAvailable < (_header.size - _header.computeLength())){
throw (new Error("Can not read body (streaming not implemented yet)."));
};
_local3 = _header.numFiles;
_items = new Array(_local3);
_library = new Array(_local3);
_local2 = 0;
while (_local2 < _local3) {
_local4 = new FurnaceItem();
_local4.readExternal(_arg1);
_items[_local2] = _local4;
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local5 = new ByteArray();
_arg1.readBytes(_local5, _items[_local2], FurnaceItem(_items[_local2])._size);
_library[_local2] = _local5;
_local2++;
};
uncompressLibrary();
}
public function writeExternal(_arg1:IDataOutput):void{
var _local2:uint;
var _local3:uint;
var _local6:FurnaceItem;
var _local7:ByteArray;
var _local8:uint;
var _local9:uint;
var _local4:uint;
var _local5:uint;
if (_items.length != _library.length){
throw (new Error("Items and data must have the same length."));
};
compressLibrary();
_local3 = _items.length;
_local4 = (_local4 + _header.computeLength());
_local2 = 0;
while (_local2 < _local3) {
_local4 = (_local4 + FurnaceItem(_items[_local2]).computeLength());
_local2++;
};
_local5 = _local4;
_local2 = 0;
while (_local2 < _local3) {
_local4 = (_local4 + ByteArray(_library[_local2]).length);
_local2++;
};
_header._size = _local4;
_header._numFiles = _local3;
_header.writeExternal(_arg1);
_local2 = 0;
while (_local2 < _local3) {
_local8 = _local5;
_local9 = 0;
while (_local9 < _local2) {
_local8 = (_local8 + ByteArray(_library[_local9]).length);
_local9++;
};
_local6 = _items[_local2];
_local6._index = _local8;
_local6._size = ByteArray(_library[_local2]).length;
_local6.writeExternal(_arg1);
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local7 = _library[_local2];
_local7.position = 0;
_arg1.writeBytes(_local7, 0, _local7.length);
_local2++;
};
}
public function fileById(_arg1:uint):ByteArray{
testBounds(_arg1);
return (_library[_arg1]);
}
protected function uncompressLibrary():void{
var _local1:uint;
var _local2:uint;
_local1 = 0;
_local2 = _library.length;
while (_local1 < _local2) {
ByteArray(_library[_local1]).uncompress();
ByteArray(_library[_local1]).position = 0;
_local1++;
};
}
public function get numFiles():uint{
return (_header.numFiles);
}
protected function testBounds(_arg1:uint):void{
if ((((_arg1 < 0)) || ((_arg1 >= _library.length)))){
throw (new RangeError("index is out of bounds."));
};
}
public function toString():String{
return ((("[FurnaceFormat header: " + _header.toString()) + "]"));
}
public function addFile(_arg1:ByteArray, _arg2:String):uint{
var _local3:FurnaceItem = new FurnaceItem();
_local3._fileName = _arg2;
var _local4:uint;
while (_local4 < _items.length) {
if (FurnaceItem(_items[_local4]).fileName == _arg2){
throw (new Error("A file with that name already exists."));
};
_local4++;
};
_items.push(_local3);
return ((_library.push(_arg1) - 1));
}
public function fileByName(_arg1:String):ByteArray{
var _local2:int;
var _local3:uint;
_local2 = -1;
_local3 = _items.length;
while (_local2 < _local3) {
if (_local2 == -1){
} else {
if (FurnaceItem(_items[_local2]).fileName == _arg1){
break;
};
};
_local2++;
};
if (_local2 == -1){
throw (new Error("File does not exist."));
};
return (_library[_local2]);
}
}
}//package de.popforge.format.furnace
Section 45
//FurnaceHeader (de.popforge.format.furnace.FurnaceHeader)
package de.popforge.format.furnace {
import flash.utils.*;
import de.popforge.format.furnace.*;
class FurnaceHeader implements IExternalizable {
var _size:uint;
var _numFiles:uint;
var _version:Number;
var _id:String;
public static const IDENTIFIER:String = "FUR";
public function get size():uint{
return (_size);
}
public function readExternal(_arg1:IDataInput):void{
if ((_id = _arg1.readUTFBytes(3)) != IDENTIFIER){
throw (new Error((("Can not parse FurnaceHeader (identifier \"" + _id) + "\" invalid)")));
};
_size = _arg1.readUnsignedInt();
if ((_version = _arg1.readFloat()) > FurnaceFormat.VERSION){
throw (new Error("Can not parse FurnaceHeader (unsupported version)"));
};
_numFiles = _arg1.readUnsignedInt();
}
public function writeExternal(_arg1:IDataOutput):void{
_arg1.writeUTFBytes(IDENTIFIER);
_arg1.writeUnsignedInt(_size);
_arg1.writeFloat(FurnaceFormat.VERSION);
_arg1.writeUnsignedInt(_numFiles);
}
public function toString():String{
return ((((((("[FurnaceHeader id:" + id) + ", size: ") + size) + ", numFiles: ") + numFiles) + "]"));
}
public function get numFiles():uint{
return (_numFiles);
}
public function get version():Number{
return (_version);
}
public function get id():String{
return (_id);
}
public function computeLength():uint{
return ((((3 + 4) + 4) + 4));
}
}
}//package de.popforge.format.furnace
Section 46
//FurnaceItem (de.popforge.format.furnace.FurnaceItem)
package de.popforge.format.furnace {
import flash.utils.*;
class FurnaceItem implements IExternalizable {
var _size:uint;
var _fileName:String;
var _index:uint;
public function readExternal(_arg1:IDataInput):void{
_fileName = _arg1.readUTFBytes(_arg1.readUnsignedShort());
_index = _arg1.readUnsignedInt();
_size = _arg1.readUnsignedInt();
}
public function computeLength():uint{
var _local1:ByteArray = new ByteArray();
_local1.writeUTFBytes(_fileName);
return ((((2 + _local1.length) + 4) + 4));
}
public function writeExternal(_arg1:IDataOutput):void{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_fileName);
_local2.position = 0;
_arg1.writeShort(_local2.length);
_arg1.writeBytes(_local2, 0, _local2.length);
_arg1.writeUnsignedInt(_index);
_arg1.writeUnsignedInt(_size);
}
public function get fileName():String{
return (_fileName);
}
public function get index():uint{
return (_index);
}
public function toString():String{
return ((((((("[FurnaceItem fileName: " + fileName) + ", index: 0x") + index.toString(16)) + ", size:") + fileSize) + "]"));
}
public function get fileSize():uint{
return (_size);
}
}
}//package de.popforge.format.furnace
Section 47
//Random (de.popforge.math.Random)
package de.popforge.math {
public class Random {
private var seed:uint;
public function Random(_arg1:uint){
this.seed = _arg1;
}
private function getNextInt():uint{
var _local1:uint = (16807 * (seed & 0xFFFF));
var _local2:uint = (16807 * (seed >> 16));
_local1 = (_local1 + ((_local2 & 32767) << 16));
_local1 = (_local1 + (_local2 >> 15));
if (_local1 > 4151801719){
_local1 = (_local1 - 4151801719);
};
return ((seed = _local1));
}
public function getNumber(_arg1:Number=0, _arg2:Number=1):Number{
return ((_arg1 + ((getNextInt() / 4151801719) * (_arg2 - _arg1))));
}
}
}//package de.popforge.math
Section 48
//IMapping (de.popforge.parameter.IMapping)
package de.popforge.parameter {
public interface IMapping {
function mapInverse(_arg1):Number;
function map(_arg1:Number);
}
}//package de.popforge.parameter
Section 49
//MappingBoolean (de.popforge.parameter.MappingBoolean)
package de.popforge.parameter {
public class MappingBoolean implements IMapping {
public function map(_arg1:Number){
return ((_arg1 > 0.5));
}
public function mapInverse(_arg1):Number{
return ((_arg1) ? 1 : 0);
}
}
}//package de.popforge.parameter
Section 50
//MappingNumberExponential (de.popforge.parameter.MappingNumberExponential)
package de.popforge.parameter {
public class MappingNumberExponential implements IMapping {
private var t0:Number;
private var max:Number;
private var min:Number;
private var t1:Number;
public function MappingNumberExponential(_arg1:Number, _arg2:Number){
this.min = _arg1;
this.max = _arg2;
t0 = Math.log((_arg2 / _arg1));
t1 = (1 / t0);
}
public function mapInverse(_arg1):Number{
return ((Math.log((_arg1 / min)) * t1));
}
public function map(_arg1:Number){
return ((min * Math.exp((_arg1 * t0))));
}
}
}//package de.popforge.parameter
Section 51
//MappingNumberLinear (de.popforge.parameter.MappingNumberLinear)
package de.popforge.parameter {
public class MappingNumberLinear implements IMapping {
private var min:Number;
private var max:Number;
public function MappingNumberLinear(_arg1:Number=0, _arg2:Number=1){
this.min = _arg1;
this.max = _arg2;
}
public function mapInverse(_arg1):Number{
return (((_arg1 - min) / (max - min)));
}
public function map(_arg1:Number){
return ((min + (_arg1 * (max - min))));
}
}
}//package de.popforge.parameter
Section 52
//Parameter (de.popforge.parameter.Parameter)
package de.popforge.parameter {
import flash.utils.*;
import flash.net.*;
public class Parameter implements IExternalizable {
private var mapping:IMapping;
private var defaultValue;
private var value;
private var changedCallbacks:Array;
public function Parameter(_arg1:IMapping=null, _arg2=null){
this.mapping = _arg1;
this.value = (defaultValue = _arg2);
changedCallbacks = new Array();
}
public function readExternal(_arg1:IDataInput):void{
setValue(_arg1.readObject());
defaultValue = _arg1.readObject();
}
private function valueChanged(_arg1):void{
var callback:Function;
var oldValue = _arg1;
if (oldValue == value){
return;
};
try {
for each (callback in changedCallbacks) {
callback(this, oldValue, value);
};
} catch(e:ArgumentError) {
throw (new ArgumentError("Make sure callbacks have the following signature: (parameter: Parameter, oldValue: *, newValue: *)"));
};
}
public function setValueNormalized(_arg1:Number):void{
var _local2:* = value;
value = mapping.map(_arg1);
valueChanged(_local2);
}
public function writeExternal(_arg1:IDataOutput):void{
_arg1.writeObject(value);
_arg1.writeObject(defaultValue);
}
public function setValue(_arg1):void{
var _local2:* = this.value;
this.value = _arg1;
valueChanged(_local2);
}
public function getValueNormalized():Number{
return (mapping.mapInverse(value));
}
public function reset():void{
setValue(defaultValue);
}
public function getValue(){
return (value);
}
public function addChangedCallbacks(_arg1:Function):void{
changedCallbacks.push(_arg1);
}
public function removeChangedCallbacks(_arg1:Function):void{
var _local2:int = changedCallbacks.indexOf(_arg1);
if (_local2 > -1){
changedCallbacks.splice(_local2, 1);
};
}
registerClassAlias("Parameter", Parameter);
}
}//package de.popforge.parameter
Section 53
//CopyPatternHandler (de.popforge.widget.fl909.CopyPatternHandler)
package de.popforge.widget.fl909 {
import flash.events.*;
import de.popforge.audio.processor.fl909.memory.*;
public class CopyPatternHandler {
private var memory:Memory;
private var gui:FL909GUI;
private var source:PatternButton;
public function CopyPatternHandler(_arg1:PatternButton, _arg2:Memory, _arg3:FL909GUI){
this.source = _arg1;
this.memory = _arg2;
this.gui = _arg3;
init();
}
private function init():void{
source.stage.addEventListener(MouseEvent.MOUSE_UP, onStageMouseUp);
}
private function onStageMouseUp(_arg1:MouseEvent):void{
var _local2:PatternButton = (_arg1.target as PatternButton);
if (_local2 != null){
if (source.getIndex() == _local2.getIndex()){
return;
};
memory.copyPattern(source.getIndex(), _local2.getIndex());
memory.changePatternByIndex(_local2.getIndex());
source.setValue(false);
_local2.setValue(true);
gui.lastPatternButton.setValue(false);
gui.lastPatternButton = _local2;
};
source.stage.removeEventListener(MouseEvent.MOUSE_UP, onStageMouseUp);
}
}
}//package de.popforge.widget.fl909
Section 54
//FL909GUI (de.popforge.widget.fl909.FL909GUI)
package de.popforge.widget.fl909 {
import de.popforge.audio.processor.fl909.*;
import flash.utils.*;
import flash.events.*;
import de.popforge.parameter.*;
import de.popforge.audio.processor.fl909.memory.*;
import flash.display.*;
import flash.net.*;
import de.popforge.assets.tr909.*;
public class FL909GUI extends Sprite {
private var fl909:FL909;
private var patternButtons:Array;
private var bar:LEDBar;
private var stepButtons:Array;
private var ram:SharedObject;
private var player:FL909Player;
var lastPatternButton:PatternButton;
private var voiceSwitchBar:VoiceSwitchBar;
private var startButton:StartButton;
public static const WIDTH:int = 580;
public static const HEIGHT:int = 262;
private static const FirstRun:Class = FL909GUI_FirstRun;
public function FL909GUI(_arg1:FL909Player){
this.player = _arg1;
fl909 = _arg1.getFL909();
fl909.readExternal(new FirstRun());
ram = SharedObject.getLocal("FL909.mem", "/");
build();
}
private function addMuteButtons():void{
createMuteButton(101, 77, fl909.toneBassdrum.mute);
createMuteButton(155, 77, fl909.toneSnaredrum.mute);
createMuteButton(209, 77, fl909.toneTomLow.mute);
createMuteButton(263, 77, fl909.toneTomMid.mute);
createMuteButton(317, 77, fl909.toneTomHigh.mute);
createMuteButton(371, 77, fl909.toneRimshot.mute);
createMuteButton(398, 77, fl909.toneClap.mute);
createMuteButton(425, 77, fl909.toneHighHat.mute);
createMuteButton(452, 77, fl909.toneHighHat.mute);
createMuteButton(479, 77, fl909.toneCrash.mute);
createMuteButton(506, 77, fl909.toneRide.mute);
}
private function proceedStepButtonClick(_arg1:StepButton):void{
var _local2:int = _arg1.getIndex();
var _local3:int = _arg1.getState();
var _local4:int = voiceSwitchBar.getIndex();
fl909.memory.removeTriggerAt(_local2, _local4);
if (_local3 > 0){
fl909.memory.createTriggerAt(_local2, _local4, ((_local3 == 1)) ? false : true);
};
}
private function updateStepButtons():void{
var _local1:StepButton;
var _local4:Array;
var _local5:Trigger;
var _local2:int = voiceSwitchBar.getIndex();
var _local3:Pattern = fl909.memory.getPatternNext();
var _local6:int;
while (_local6 < 16) {
_local4 = _local3.steps[_local6];
_local1 = stepButtons[_local6];
_local1.setState(0);
if (_local4 != null){
for each (_local5 in _local4) {
if (_local5.voiceIndex == _local2){
_local1.setState((_local5.accent) ? 2 : 1);
};
};
};
_local6++;
};
}
private function createMuteButton(_arg1:int, _arg2:int, _arg3:Parameter):void{
var _local4:MuteButton = new MuteButton(_arg3);
_local4.x = _arg1;
_local4.y = _arg2;
addChild(_local4);
}
private function createKnob(_arg1:int, _arg2:int, _arg3:Parameter, _arg4:Boolean):void{
var _local5:Knob = new Knob(_arg3, _arg4);
_local5.x = _arg1;
_local5.y = _arg2;
addChild(_local5);
}
private function proceedPatternButtonClick(_arg1:PatternButton):void{
var _local2:int = _arg1.getIndex();
lastPatternButton.setValue(false);
fl909.memory.changePatternByIndex(_local2);
updateStepButtons();
lastPatternButton = _arg1;
_arg1.setValue(true);
}
function startCopyPattern(_arg1:PatternButton):void{
new CopyPatternHandler(_arg1, fl909.memory, this);
}
private function addKnobs():void{
createKnob((114 + (27 * 0)), 102, fl909.toneBassdrum.tune, false);
createKnob((114 + (27 * 1)), 102, fl909.toneBassdrum.level, false);
createKnob((114 + (27 * 0)), 129, fl909.toneBassdrum.attack, false);
createKnob((114 + (27 * 1)), 129, fl909.toneBassdrum.decay, false);
createKnob((114 + (27 * 2)), 102, fl909.toneSnaredrum.tune, false);
createKnob((114 + (27 * 3)), 102, fl909.toneSnaredrum.level, false);
createKnob((114 + (27 * 2)), 129, fl909.toneSnaredrum.tone, false);
createKnob((114 + (27 * 3)), 129, fl909.toneSnaredrum.snappy, false);
createKnob((114 + (27 * 4)), 102, fl909.toneTomLow.tune, false);
createKnob((114 + (27 * 5)), 102, fl909.toneTomLow.level, false);
createKnob((114 + (27 * 4)), 129, fl909.toneTomLow.decay, false);
createKnob((114 + (27 * 6)), 102, fl909.toneTomMid.tune, false);
createKnob((114 + (27 * 7)), 102, fl909.toneTomMid.level, false);
createKnob((114 + (27 * 6)), 129, fl909.toneTomMid.decay, false);
createKnob((114 + (27 * 8)), 102, fl909.toneTomHigh.tune, false);
createKnob((114 + (27 * 9)), 102, fl909.toneTomHigh.level, false);
createKnob((114 + (27 * 8)), 129, fl909.toneTomHigh.decay, false);
createKnob((114 + (27 * 10)), 102, fl909.toneRimshot.level, false);
createKnob((114 + (27 * 11)), 102, fl909.toneClap.level, false);
createKnob((114 + (27 * 13)), 102, fl909.toneHighHat.level, false);
createKnob((114 + (27 * 12)), 129, fl909.toneHighHat.decayCL, false);
createKnob((114 + (27 * 13)), 129, fl909.toneHighHat.decayOP, false);
createKnob((114 + (27 * 14)), 102, fl909.toneCrash.level, false);
createKnob((114 + (27 * 15)), 102, fl909.toneRide.level, false);
createKnob((114 + (27 * 14)), 129, fl909.toneCrash.tune, false);
createKnob((114 + (27 * 15)), 129, fl909.toneRide.tune, false);
createKnob(73, 170, fl909.tempo, true);
createKnob(505, 170, fl909.volume, true);
createKnob(73, 129, fl909.accent, false);
createKnob(175, 170, fl909.shuffle, false);
}
private function addMemoryButtons():void{
var _local1:MemoryButton;
_local1 = new MemoryButton();
_local1.name = "save";
_local1.x = 239;
_local1.y = 167;
addChild(_local1);
_local1 = new MemoryButton();
_local1.name = "load";
_local1.x = 258;
_local1.y = 167;
addChild(_local1);
_local1 = new MemoryButton();
_local1.name = "clear";
_local1.x = 277;
_local1.y = 167;
addChild(_local1);
}
private function onMouseClick(_arg1:MouseEvent):void{
var _local2:Object = _arg1.target;
if ((_local2 is StepButton)){
proceedStepButtonClick((_local2 as StepButton));
} else {
if ((_local2 is PatternButton)){
proceedPatternButtonClick((_local2 as PatternButton));
} else {
if ((_local2 is MemoryButton)){
proceedMemoryButton((_local2 as MemoryButton));
};
};
};
}
private function addStartButton():void{
startButton = new StartButton(player);
startButton.x = 64;
startButton.y = 204;
addChild(startButton);
}
private function build():void{
addChild(new Bitmap(new Chassis(0, 0)));
hitArea = new Sprite();
hitArea.graphics.beginFill(0, 0);
hitArea.graphics.drawRect(0, 0, FL909GUI.WIDTH, FL909GUI.HEIGHT);
hitArea.graphics.endFill();
addChild(hitArea);
addKnobs();
addVoiceSwitchBar();
addStepButtons();
addTempoLCD();
addPatternButtons();
addMuteButtons();
addStartButton();
addMemoryButtons();
bar = new LEDBar(fl909);
addChild(bar);
addEventListener(MouseEvent.CLICK, onMouseClick);
}
private function proceedMemoryButton(_arg1:MemoryButton):void{
switch (_arg1.name){
case "save":
ram.data.all = new ByteArray();
fl909.writeExternal(ram.data.all);
ram.flush();
break;
case "load":
if (ram.data.all){
fl909.readExternal(ram.data.all);
ram.data.all.position = 0;
updateStepButtons();
};
break;
case "clear":
fl909.clear();
updateStepButtons();
break;
};
}
private function addTempoLCD():void{
var _local1:LCD = new LCD(fl909.tempo);
_local1.x = 108;
_local1.y = 160;
addChild(_local1);
}
private function addVoiceSwitchBar():void{
voiceSwitchBar = new VoiceSwitchBar(updateStepButtons);
addChild(voiceSwitchBar);
}
private function addStepButtons():void{
var _local1:StepButton;
stepButtons = new Array();
var _local2:int;
while (_local2 < 16) {
_local1 = new StepButton(_local2);
_local1.x = (104 + (_local2 * 27));
_local1.y = 204;
_local1.alpha = 0.75;
addChild(_local1);
stepButtons.push(_local1);
_local2++;
};
updateStepButtons();
}
private function addPatternButtons():void{
var _local1:PatternButton;
patternButtons = new Array();
var _local2 = 8;
while (--_local2 > -1) {
_local1 = new PatternButton(this, _local2);
_local1.setValue((_local2 == 0));
_local1.x = (392 + ((_local2 & 3) * 19));
_local1.y = (158 + (int((_local2 / 4)) * 16));
addChild(_local1);
patternButtons.push(_local1);
};
lastPatternButton = _local1;
}
}
}//package de.popforge.widget.fl909
Section 55
//FL909GUI_FirstRun (de.popforge.widget.fl909.FL909GUI_FirstRun)
package de.popforge.widget.fl909 {
import mx.core.*;
public class FL909GUI_FirstRun extends ByteArrayAsset {
}
}//package de.popforge.widget.fl909
Section 56
//FL909Player (de.popforge.widget.fl909.FL909Player)
package de.popforge.widget.fl909 {
import de.popforge.audio.processor.fl909.*;
import de.popforge.audio.output.*;
import flash.display.*;
public final class FL909Player extends Sprite {
private var buffer:AudioBuffer;
private var gui:FL909GUI;
private var fl909:FL909;
public function FL909Player(){
init();
}
private function init():void{
fl909 = new FL909();
gui = new FL909GUI(this);
addChild(gui);
buffer = new AudioBuffer(4, Audio.STEREO, Audio.BIT16, Audio.RATE44100);
buffer.onInit = onAudioBufferInit;
buffer.onComplete = onAudioBufferComplete;
}
private function onAudioBufferComplete(_arg1:AudioBuffer):void{
var _local2:Array = _arg1.getSamples();
fl909.processAudio(_local2);
_arg1.update();
}
public function getFL909():FL909{
return (fl909);
}
private function onAudioBufferInit(_arg1:AudioBuffer):void{
_arg1.start();
}
public function getAudioBuffer():AudioBuffer{
return (buffer);
}
}
}//package de.popforge.widget.fl909
Section 57
//Knob (de.popforge.widget.fl909.Knob)
package de.popforge.widget.fl909 {
import flash.events.*;
import de.popforge.parameter.*;
import flash.display.*;
public class Knob extends Sprite {
private var parameter:Parameter;
private var large:Boolean;
private var lastPosition:int;
public function Knob(_arg1:Parameter, _arg2:Boolean=false){
this.parameter = _arg1;
this.large = _arg2;
build();
}
private function onMouseUp(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
private function onMouseDown(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
lastPosition = mouseY;
}
private function onParameterChanged(_arg1:Parameter, _arg2, _arg3):void{
update();
}
private function build():void{
hitArea = new Sprite();
hitArea.graphics.beginFill(0xFF0000);
hitArea.graphics.drawCircle(0, 0, (large) ? 16 : 8);
hitArea.graphics.endFill();
hitArea.visible = false;
addChild(hitArea);
cacheAsBitmap = true;
update();
parameter.addChangedCallbacks(onParameterChanged);
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick);
doubleClickEnabled = true;
buttonMode = true;
}
private function update():void{
var _local1:Number = (((Math.PI / 4) * 3) + (parameter.getValueNormalized() * ((Math.PI / 4) * 6)));
var _local2:Number = Math.cos(_local1);
var _local3:Number = Math.sin(_local1);
var _local4:Number = (large) ? 11 : 4.5;
var _local5:Number = (large) ? 14 : 7.5;
graphics.clear();
graphics.lineStyle(1, 12222544);
graphics.moveTo((_local2 * _local4), (_local3 * _local4));
graphics.lineTo((_local2 * _local5), (_local3 * _local5));
}
private function onMouseMove(_arg1:MouseEvent):void{
var _local2:Number = parameter.getValueNormalized();
_local2 = (_local2 - ((mouseY - lastPosition) / (_arg1.shiftKey) ? 400 : 100));
if (_local2 < 0){
_local2 = 0;
} else {
if (_local2 > 1){
_local2 = 1;
};
};
parameter.setValueNormalized(_local2);
lastPosition = mouseY;
}
private function onDoubleClick(_arg1:MouseEvent):void{
parameter.reset();
update();
}
public function getParameter():Parameter{
return (parameter);
}
}
}//package de.popforge.widget.fl909
Section 58
//LCD (de.popforge.widget.fl909.LCD)
package de.popforge.widget.fl909 {
import de.popforge.parameter.*;
import flash.display.*;
import de.popforge.assets.tr909.lcd.*;
public class LCD extends Sprite {
private const digit0:Digit;
private const digit1:Digit;
private const digit2:Digit;
private var parameter:Parameter;
public function LCD(_arg1:Parameter){
digit0 = new Digit();
digit1 = new Digit();
digit2 = new Digit();
super();
this.parameter = _arg1;
build();
_arg1.addChangedCallbacks(onParameterChanged);
update();
}
public function update():void{
var _local1:int = parameter.getValue();
var _local2:int = (int((_local1 / 10)) * 10);
var _local3:int = (_local1 / 100);
digit2.gotoAndStop(((_local1 - _local2) + 1));
digit1.gotoAndStop((((_local2 - (_local3 * 100)) / 10) + 1));
digit0.gotoAndStop((_local3 + 1));
}
private function onParameterChanged(_arg1:Parameter, _arg2, _arg3):void{
update();
}
private function build():void{
digit0.x = 0;
addChild(digit0);
digit1.x = 13;
addChild(digit1);
digit2.x = 26;
addChild(digit2);
}
}
}//package de.popforge.widget.fl909
Section 59
//LED (de.popforge.widget.fl909.LED)
package de.popforge.widget.fl909 {
import flash.display.*;
import de.popforge.assets.tr909.led.*;
public class LED extends Sprite {
private const active:BitmapData;
private const bitmap:Bitmap;
var index:int;
public function LED(_arg1:int){
active = new Active(0, 0);
bitmap = new Bitmap(null);
super();
this.index = _arg1;
addChild(bitmap);
hitArea = new Sprite();
hitArea.graphics.beginFill(0);
hitArea.graphics.drawRect(-2, -2, (active.width + 4), (active.height + 4));
hitArea.graphics.endFill();
hitArea.visible = false;
addChild(hitArea);
buttonMode = true;
}
public function setValue(_arg1:Boolean):void{
bitmap.bitmapData = (_arg1) ? active : null;
}
}
}//package de.popforge.widget.fl909
Section 60
//LEDBar (de.popforge.widget.fl909.LEDBar)
package de.popforge.widget.fl909 {
import de.popforge.audio.processor.fl909.*;
import flash.utils.*;
import flash.events.*;
import de.popforge.parameter.*;
import flash.display.*;
public class LEDBar extends Sprite {
private var startTimer:int;
private var leds:Array;
private var last:LED;
private var step:int;
private var fl909:FL909;
public function LEDBar(_arg1:FL909){
this.fl909 = _arg1;
_arg1.pause.addChangedCallbacks(onParameterChanged);
build();
}
public function onParameterChanged(_arg1:Parameter, _arg2, _arg3):void{
if (!_arg1.getValue()){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
step = 0;
startTimer = getTimer();
} else {
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
private function build():void{
var _local1:LED;
leds = new Array();
var _local2:int;
while (_local2 < 16) {
_local1 = new LED(_local2);
_local1.x = (112 + (_local2 * 27));
_local1.y = 231;
addChild(_local1);
leds.push(_local1);
_local2++;
};
}
private function onEnterFrame(_arg1:Event):void{
if (fl909.stepTimes.length == 0){
return;
};
var _local2:int = fl909.stepTimes[0];
if (((((getTimer() - startTimer) > _local2)) && ((fl909.stepTimes.length > 0)))){
fl909.stepTimes.shift();
if (last != null){
last.setValue(false);
};
(last = LED(leds[(step & 15)])).setValue(true);
step++;
_local2 = fl909.stepTimes[0];
};
}
}
}//package de.popforge.widget.fl909
Section 61
//MemoryButton (de.popforge.widget.fl909.MemoryButton)
package de.popforge.widget.fl909 {
import flash.events.*;
import flash.display.*;
import de.popforge.assets.tr909.button.*;
public class MemoryButton extends Sprite {
private const active:BitmapData;
private const bitmap:Bitmap;
public function MemoryButton(){
active = new TinyActive(0, 0);
bitmap = new Bitmap(active);
super();
build();
}
private function onStageMouseUp(_arg1:MouseEvent):void{
removeChild(bitmap);
stage.removeEventListener(MouseEvent.MOUSE_UP, onStageMouseUp);
}
private function onMouseDown(_arg1:MouseEvent):void{
addChild(bitmap);
stage.addEventListener(MouseEvent.MOUSE_UP, onStageMouseUp);
}
private function build():void{
hitArea = new Sprite();
hitArea.graphics.beginFill(0xFFCC00);
hitArea.graphics.drawRect(0, 0, 10, 10);
hitArea.graphics.endFill();
hitArea.visible = false;
addChild(hitArea);
buttonMode = true;
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
}
}//package de.popforge.widget.fl909
Section 62
//MuteButton (de.popforge.widget.fl909.MuteButton)
package de.popforge.widget.fl909 {
import flash.events.*;
import de.popforge.parameter.*;
import flash.display.*;
import de.popforge.assets.tr909.mute.button.*;
public class MuteButton extends Sprite {
private const active:Bitmap;
private var parameter:Parameter;
public function MuteButton(_arg1:Parameter){
active = new Bitmap(new Active(0, 0));
super();
this.parameter = _arg1;
_arg1.addChangedCallbacks(onParameterChanged);
build();
update();
}
private function onClick(_arg1:MouseEvent):void{
parameter.setValue(!(parameter.getValue()));
}
private function update():void{
if (parameter.getValue()){
if (!contains(active)){
addChild(active);
};
} else {
if (contains(active)){
removeChild(active);
};
};
}
private function onParameterChanged(_arg1:Parameter, _arg2, _arg3):void{
update();
}
private function build():void{
hitArea = new Sprite();
hitArea.graphics.beginFill(0xFFCC00);
hitArea.graphics.drawRect(0, 0, 12, 12);
hitArea.graphics.endFill();
hitArea.visible = false;
addChild(hitArea);
buttonMode = true;
addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package de.popforge.widget.fl909
Section 63
//PatternButton (de.popforge.widget.fl909.PatternButton)
package de.popforge.widget.fl909 {
import flash.events.*;
import flash.display.*;
import de.popforge.assets.tr909.button.*;
public class PatternButton extends Sprite {
private const active:Bitmap;
private var gui:FL909GUI;
private var value:Boolean;
private var index:int;
public function PatternButton(_arg1:FL909GUI, _arg2:int){
active = new Bitmap(new TinyActive(0, 0));
super();
this.gui = _arg1;
this.index = _arg2;
build();
}
private function onMouseOut(_arg1:MouseEvent):void{
if (((_arg1.buttonDown) && ((stage.focus == this)))){
gui.startCopyPattern(this);
};
}
private function update():void{
if (value){
if (!contains(active)){
addChild(active);
};
} else {
if (contains(active)){
removeChild(active);
};
};
}
private function build():void{
hitArea = new Sprite();
hitArea.graphics.beginFill(0xFFCC00);
hitArea.graphics.drawRect(0, 0, 12, 12);
hitArea.graphics.endFill();
hitArea.visible = false;
addChild(hitArea);
value = false;
buttonMode = true;
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
public function setValue(_arg1:Boolean):void{
this.value = _arg1;
update();
}
public function getValue():Boolean{
return (value);
}
public function getIndex():int{
return (index);
}
}
}//package de.popforge.widget.fl909
Section 64
//StartButton (de.popforge.widget.fl909.StartButton)
package de.popforge.widget.fl909 {
import de.popforge.audio.processor.fl909.*;
import flash.events.*;
import de.popforge.parameter.*;
import flash.display.*;
import de.popforge.assets.tr909.start.button.*;
public class StartButton extends Sprite {
private const activeUp:BitmapData;
private const normalUp:BitmapData;
private const normalDown:BitmapData;
private const bitmap:Bitmap;
private const activeDown:BitmapData;
private var player:FL909Player;
private var parameter:Parameter;
private var fl909:FL909;
public function StartButton(_arg1:FL909Player){
normalUp = new NormalUp(0, 0);
normalDown = new NormalDown(0, 0);
activeUp = new ActiveUp(0, 0);
activeDown = new ActiveDown(0, 0);
bitmap = new Bitmap(normalUp);
super();
this.player = _arg1;
fl909 = _arg1.getFL909();
parameter = fl909.pause;
build();
}
private function onMouseDown(_arg1:MouseEvent):void{
bitmap.bitmapData = (parameter.getValue()) ? normalDown : activeDown;
}
private function onMouseUp(_arg1:MouseEvent):void{
if (stage.focus == this){
if (parameter.getValue()){
fl909.reset();
};
parameter.setValue(!(parameter.getValue()));
bitmap.bitmapData = (parameter.getValue()) ? normalUp : activeUp;
};
}
private function onMouseOver(_arg1:MouseEvent):void{
if (((_arg1.buttonDown) && ((stage.focus == this)))){
bitmap.bitmapData = (parameter.getValue()) ? normalDown : activeDown;
};
}
private function onMouseOut(_arg1:MouseEvent):void{
if (_arg1.buttonDown){
bitmap.bitmapData = (parameter.getValue()) ? normalUp : activeUp;
};
}
private function build():void{
addChild(bitmap);
alpha = 0.75;
buttonMode = true;
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
}
}
}//package de.popforge.widget.fl909
Section 65
//StepButton (de.popforge.widget.fl909.StepButton)
package de.popforge.widget.fl909 {
import flash.events.*;
import flash.display.*;
import de.popforge.assets.tr909.step.button.*;
public class StepButton extends Sprite {
private const noneDown:BitmapData;
private const accentUp:BitmapData;
private const accentDown:BitmapData;
private const bitmap:Bitmap;
private const mediumUp:BitmapData;
private const mediumDown:BitmapData;
private const noneUp:BitmapData;
private var state:int;
private var index:int;
public function StepButton(_arg1:int){
noneUp = new NoneUp(0, 0);
noneDown = new NoneDown(0, 0);
mediumUp = new MediumUp(0, 0);
mediumDown = new MediumDown(0, 0);
accentUp = new AccentUp(0, 0);
accentDown = new AccentDown(0, 0);
bitmap = new Bitmap(noneUp);
super();
this.index = _arg1;
build();
}
private function onMouseDown(_arg1:MouseEvent):void{
switch (state){
case 0:
bitmap.bitmapData = noneDown;
break;
case 1:
bitmap.bitmapData = mediumDown;
break;
case 2:
bitmap.bitmapData = accentDown;
break;
};
}
private function onMouseOver(_arg1:MouseEvent):void{
if (((!(_arg1.buttonDown)) || (!((stage.focus is _slot1))))){
return;
};
switch (state){
case 0:
bitmap.bitmapData = noneDown;
break;
case 1:
bitmap.bitmapData = mediumDown;
break;
case 2:
bitmap.bitmapData = accentDown;
break;
};
}
public function setState(_arg1:int):void{
switch (_arg1){
case 0:
bitmap.bitmapData = noneUp;
break;
case 1:
bitmap.bitmapData = mediumUp;
break;
case 2:
bitmap.bitmapData = accentUp;
break;
};
this.state = _arg1;
}
private function onMouseUp(_arg1:MouseEvent):void{
if (!(stage.focus is _slot1)){
return;
};
switch (state){
case 0:
if (((((_arg1.shiftKey) || (_arg1.altKey))) || (_arg1.ctrlKey))){
bitmap.bitmapData = accentUp;
state = 2;
} else {
bitmap.bitmapData = mediumUp;
state = 1;
};
break;
case 1:
if (_arg1.shiftKey){
bitmap.bitmapData = accentUp;
state = 2;
} else {
bitmap.bitmapData = noneUp;
state = 0;
};
break;
case 2:
if (_arg1.shiftKey){
bitmap.bitmapData = noneUp;
state = 0;
} else {
bitmap.bitmapData = mediumUp;
state = 1;
};
break;
};
}
public function getState():int{
return (state);
}
public function getIndex():int{
return (index);
}
private function onMouseOut(_arg1:MouseEvent):void{
switch (state){
case 0:
bitmap.bitmapData = noneUp;
break;
case 1:
bitmap.bitmapData = mediumUp;
break;
case 2:
bitmap.bitmapData = accentUp;
break;
};
}
private function build():void{
addChild(bitmap);
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
buttonMode = true;
state = 0;
}
}
}//package de.popforge.widget.fl909
Section 66
//VoiceSwitchBar (de.popforge.widget.fl909.VoiceSwitchBar)
package de.popforge.widget.fl909 {
import flash.events.*;
import flash.display.*;
public class VoiceSwitchBar extends Sprite {
private var index:int;
private var onVoiceSwitched:Function;
private var marker:Shape;
public function VoiceSwitchBar(_arg1:Function){
this.onVoiceSwitched = _arg1;
build();
}
private function createHitButton(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
var _local5:Sprite = new Sprite();
_local5.x = _arg1;
_local5.y = _arg2;
_local5.hitArea = new Sprite();
_local5.hitArea.graphics.beginFill(0xFF0000);
_local5.hitArea.graphics.drawRect(0, 0, _arg3, _arg4);
_local5.hitArea.graphics.endFill();
_local5.hitArea.visible = false;
_local5.addChild(_local5.hitArea);
addChild(_local5);
}
private function build():void{
createHitButton(101, 68, 53, 9);
createHitButton(155, 68, 53, 9);
createHitButton(209, 68, 53, 9);
createHitButton(263, 68, 53, 9);
createHitButton(317, 68, 53, 9);
createHitButton(371, 68, 26, 9);
createHitButton(398, 68, 26, 9);
createHitButton(425, 68, 26, 9);
createHitButton(452, 68, 26, 9);
createHitButton(479, 68, 26, 9);
createHitButton(506, 68, 26, 9);
marker = new Shape();
marker.blendMode = BlendMode.MULTIPLY;
addChild(marker);
buttonMode = true;
index = 0;
positionMaker(index);
addEventListener(MouseEvent.CLICK, onMouseClick);
}
private function onMouseClick(_arg1:MouseEvent):void{
var _local2:Sprite = (_arg1.target as Sprite);
if ((_local2 is _slot1)){
return;
};
var _local3:int = getChildIndex(_local2);
if (_local3 != index){
index = _local3;
positionMaker(index);
onVoiceSwitched();
};
}
private function positionMaker(_arg1:int):void{
var _local2:Sprite = Sprite(getChildAt(_arg1));
marker.x = (_local2.x + ((_local2.width - 6) >> 1));
marker.y = (_local2.y - 3);
marker.graphics.clear();
marker.graphics.beginFill(13527328);
marker.graphics.drawRect(0, 0, 6, 2);
marker.graphics.endFill();
}
public function getIndex():int{
return (index);
}
}
}//package de.popforge.widget.fl909
Section 67
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 68
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 69
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 70
//FL909App (FL909App)
package {
import de.popforge.widget.fl909.*;
import flash.display.*;
public class FL909App extends Sprite {
private var player:FL909Player;
public function FL909App(){
player = new FL909Player();
addChild(player);
}
}
}//package