// Use this for initialization
    void Start()
    {
        spectrumCheck = 0;
        spectrumVal = 0;
        spectrumI = 0;
        whichI = new List<int> ();
        freqCheck = new int[8192];
        flip = false;
        startBranch = 100000;
        beatRadiusChange = 0;
        storageStepper = 0;
        beatHappened = false;
        outputData = new float[8192];
        spectrumData = new float[8192];
        amp = 0;
        newRadius = 1;
        pxChanger = plane.GetComponent<PixelChanger> ();
        red = false;
        highest = 0;
        //		currentHighest = 0;
        newScale = new Vector3 (0, 0, 0);
        triggered = 1;
        myRigidbody = plane.GetComponent<Rigidbody> ();
        segmentCount = 0;
        segmentOrigin = new Vector3 (0, 0, 0);
        segmentRow = 0;
        segmentCol = 0;
        segmentJump = 0;
        floor = 0;

        modifyLine = line.GetComponent<ModifyLine> ();

        shiftRotation = false;
        lineRadius = 1;
        anglePerSegment = 1;

        offsetX = 0;
        offsetY = 0;

        tracks = GetComponentsInChildren<AudioSource> ();
        artifacts = GetComponentsInChildren<TrackArtifacts> ();
        audio = tracks [0];
        Debug.Log ("tracks: " + tracks);
        currentArtifact = 0;

        readyTransition = false;

        Debug.Log ("Sampling Rate: " + AudioSettings.outputSampleRate);
    }
    void Awake()
    {
        spectrumData = new float[8192];
        spectrumStorage = new float[108];
        outputData = new float[8192];
        newAngle = 0;
        pxChanger = plane.GetComponent<PixelChanger> ();
        radius=pxChanger.width/7;
        modifyLine = line.GetComponent<ModifyLine> ();
        rightCubes = GameObject.FindGameObjectsWithTag ("SpinMeRight");
        leftCubes = GameObject.FindGameObjectsWithTag ("SpinMeLeft");
        flip = false;
        tracks = GetComponentsInChildren<AudioSource> ();
        currentTrack = 0;
        newTrack = 1;
        audio = tracks [0];
        artifacts = GetComponentsInChildren<TrackArtifacts> ();
        readyTransition = false;
        highestCell = 0;
        tempSpectrumData = 0;
        topFour = new int[4];
        for (int i=0; i<topFour.Length; i++) {
            topFour[i] = 0;
        }
        topFourVals = new float[4];
        for (int i=0; i<topFourVals.Length; i++) {
            topFourVals[i] = 0;
        }
        transObjects = GameObject.FindGameObjectsWithTag ("TransitionButtons");

        for (int i=0; i<transObjects.Length; i++) {
        //			Debug.Log (i + ": " + transObjects[i]);
            if(transObjects[i].name.Equals ("01")){
                transButton01 = transObjects[i].GetComponent<Button>();
            }else if(transObjects[i].name.Equals ("02")){
                transButton02 = transObjects[i].GetComponent<Button>();
            }else if(transObjects[i].name.Equals ("10")){
                transButton10 = transObjects[i].GetComponent<Button>();
            }else if(transObjects[i].name.Equals ("12")){
                transButton12 = transObjects[i].GetComponent<Button>();
            }else if(transObjects[i].name.Equals ("20")){
                transButton20 = transObjects[i].GetComponent<Button>();
            }else if(transObjects[i].name.Equals ("21")){
                transButton21 = transObjects[i].GetComponent<Button>();
            }
        }

        transButton01.interactable = false;
        transButton02.interactable = false;
        transButton10.interactable = false;
        transButton12.interactable = false;
        transButton20.interactable = false;
        transButton21.interactable = false;

        beatBar = GameObject.Find ("Beat Bar").GetComponent<Rotate>();
    }