Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 4
0
 private void PlayLeaveAnimation(object sender, NoteEventArgs e)
 {
     handLeaveStoryboards[e.GetNoteIndex()].Begin(this);
 }
Ejemplo n.º 5
0
        private void PlayStopAnimation(object sender, NoteEventArgs e)
        {
            int c = e.GetNoteIndex();

            stopPlayingStoryboards[c].Begin(this);
        }