#pragma strict

var note : GameObject;
var bgvisualizer : GameObject;
var pos : Vector3;
//var rot : Vector3;
public var origsize : float;
public var amount : float;

function Start () {

	origsize = Camera.main.orthographicSize;
}

function Update () {

	var spectrum : float[] = AudioListener.GetSpectrumData(1024, 0, FFTWindow.Hamming);
	
	/* 
	c1 = 64
	c3 = 256
	c4 = 512
	c5 = 1024
	*/
	
	var c1 : float = spectrum[2] + spectrum[3] + spectrum[4];
	var c3 : float = spectrum[11] + spectrum[12] + spectrum[13];
	var c4 : float = spectrum[22] + spectrum[23] + spectrum[24];
	var c5 : float = spectrum[44] + spectrum[45] + spectrum[46] + spectrum[47] + spectrum[48] + spectrum[49]; 
	
	/*var visualizers : GameObject[] = GameObject.FindGameObjectsWithTag("Visualizer");
	
	for (var i =0; i < visualizers.length; i++)
	{
		visualizers[i].transform.localScale = new Vector2(1.75f + c1, 1.75f + c1);
	}*/
	
	
	Camera.main.orthographicSize = origsize - (c1 * amount);
	


}