Пример #1
0
        public void StopNote(object sender, NoteEventArgs e)
        {
            char handId    = e.GetHandId();
            int  noteIndex = e.GetNoteIndex();

            if (handId == 'R')
            {
                isNotePlayingArray[1, noteIndex] = false;
                if (holdNote)
                {
                    outputDevice.SendNoteOff(Channel.Channel1, scale[noteIndex], 100);
                }

                noteIndexRight = -1;
            }
            else if (handId == 'L')
            {
                isNotePlayingArray[0, noteIndex] = false;
                if (holdNote)
                {
                    outputDevice.SendNoteOff(Channel.Channel1, scale[noteIndex], 100);
                }

                noteIndexLeft = -1;
            }
        }
Пример #2
0
        public void PlayNote(object sender, NoteEventArgs e)
        {
            char handId    = e.GetHandId();
            int  noteIndex = e.GetNoteIndex();

            if (handId == 'R')
            {
                noteIndexRight = noteIndex;
                new Thread(() => PlayRightHandNote(noteIndex)).Start();
                isNotePlayingArray[1, noteIndexRight] = true;
            }
            else if (handId == 'L')
            {
                noteIndexLeft = noteIndex;
                new Thread(() => PlayLeftHandNote(noteIndex)).Start();
                isNotePlayingArray[0, noteIndexLeft] = true;
            }
        }
Пример #3
0
        public void StopPerformanceNote(object sender, NoteEventArgs e)
        {
            char handId    = e.GetHandId();
            int  noteIndex = e.GetNoteIndex();

            if (handId == 'R')
            {
                isNotePlayingArray[1, noteIndex] = false;
                new Thread(() => PlayRightHandPerformanceNote(noteIndex, false)).Start();
                noteIndexRight = -1;
            }
            else if (handId == 'L')
            {
                isNotePlayingArray[0, noteIndex] = false;
                new Thread(() => PlayLeftHandPerformanceNote(noteIndex, false)).Start();
                noteIndexLeft = -1;
            }
        }