Exemplo n.º 1
0
    // TODO Fix and move to filter class
    private IEnumerator Echo(KeyboardKey key)
    {
        int echoAmount = 2;

        while (echoAmount-- > 0)
        {
            key.AudioNote.volume *= 0.25f;
            yield return(new WaitForSecondsRealtime(0.025f));

            key.PlayNote();
        }

        key.AudioNote.volume = 1;
    }
Exemplo n.º 2
0
    private IEnumerator Play()
    {
        // TODO Check for filter toggle and apply it
        Debug.Log(song.Count + "---------");
        float lastPlayedTime = startTime;

        for (int i = 0; i < song.Count; ++i)
        {
            KeyboardKey key = song[i];
            Debug.Log(key.Name + " times");
            Debug.Log(key.PlayedAt + "/" + lastPlayedTime);
            Debug.Log(key.PlayedAt - lastPlayedTime);
            yield return(new WaitForSecondsRealtime(key.PlayedAt - lastPlayedTime));

            key.PlayNote();
            lastPlayedTime = key.PlayedAt;
        }

        if (DonePlaying != null)
        {
            DonePlaying();
        }
    }