Beispiel #1
0
        protected virtual void HandleBeat()
        {
            currentBeat++;
            totalBeats++;
            if (currentBeat > timeSignature)
            {
                currentBeat = 0;
            }
            int noteIndex = 0;

            if (randomize)
            {
                noteIndex = Random.Range(0, NoteSequence.Length);
            }
            else
            {
                if (currNotePosition > NoteSequence.Length - 1)
                {
                    currNotePosition = 0;
                }

                noteIndex = currNotePosition;
                currNotePosition++;
            }
            instrument.PlayNote(NoteSequence[noteIndex]);

            if (debug)
            {
                print(currentBeat);
            }
        }