/**
* Copyright LawrieCape ( http://wonderfl.net/user/LawrieCape )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/gQPd
*/
package {
import flash.text.TextField;
import flash.display.Sprite;
public class FlashTest extends Sprite {
//Enter scale name -
private var scaleName:String="AdonaiMalakh(Israel)";
//Enter the notes in each octave to use - see - http://8.brm.sk/Scales_Chords.pdf
private var acceptedArray:Array = [0,1,2,3,5,7,9,10]
private var octaveStep:int=0;
private var finalArray:Array = [];
private var limitArray:int = 32;
// Make a text field -
private var TF:TextField = new TextField();
public function FlashTest() {
for(var i:int=0;i<12;i++){
for(var j:int=0;j<acceptedArray.length;j++){
finalArray.push(acceptedArray[j]+octaveStep)
}
octaveStep+=12;
}
addChild(TF);
TF.width = 450;
TF.multiline = true;
TF.wordWrap = true;
TF.text = "var "+scaleName+":Array =["+limitTo(finalArray)+"];";
}
private function limitTo(A:Array):Array{
if(A.length==limitArray){
return A;
}
else{
var aLength:int =A.length;
var diff:int = A.length-limitArray;
var diff2:int = Math.round(diff/2);
var ARR2:Array = A.slice(diff2,diff2+limitArray);
return ARR2;
}
}
}
}