Exemple #1
0
    void Spawn()
    {
        int line;

        line = notesInChord[Random.Range(0, notesInChord.Length - 1)] % 12;
        Debug.Log(line);
        Vector3 pos = transform.position;

        pos.y = (line) - DoDistance;

        GameObject nt = Instantiate(note, pos, Quaternion.identity) as GameObject;
        micNote    mc = nt.GetComponent <micNote> ();

        mc.note      = ChordNames.Mayor [line % ChordNames.Mayor.Length];
        mc.nota.text = Tuner.notes [mc.note % 12];
        Debug.Log(line);
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        notas = GameObject.FindGameObjectsWithTag("Good");

        int mid = mic.FrequencyToMidi(mic.GetPrincipalFrecuency());

        nota.text = Tuner.notes [mid % 12];

        for (int i = 0; i < notas.Length; i++)
        {
            micNote mn = notas[i].GetComponent <micNote>();
            if (mn.note == mid % 12)
            {
                Destroy(notas[i]);
            }
        }
    }