Example #1
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (midiNote > -1)
     {
         midiManager.PlayMidiNote(midiNote);
     }
 }
Example #2
0
    private void StartMidiSoundForEnteredNotes(double positionInSongInMillis)
    {
        int newlyEnteredNoteCount = 0;

        foreach (Note note in upcomingSortedNotes)
        {
            double startMillis = BpmUtils.BeatToMillisecondsInSong(songMeta, note.StartBeat);

            if (positionInSongInMillis < startMillis)
            {
                // The list is sorted, thus we did not reach any of the following notes in the list as well.
                break;
            }
            else
            {
                newlyEnteredNoteCount++;
                midiManager.PlayMidiNote(note.MidiNote);
                currentlyPlayingNotes.Add(note);
            }
        }
        if (newlyEnteredNoteCount > 0)
        {
            upcomingSortedNotes.RemoveRange(0, newlyEnteredNoteCount);
        }
    }
Example #3
0
 private void PlayMidiNote()
 {
     StopMidiNote();
     if (midiNote > -1)
     {
         midiManager.PlayMidiNote(midiNote);
     }
 }
Example #4
0
 public void OnPointerDown(PointerEventData eventData)
 {
     // Play midi sound via Ctrl
     if (!isPlayingMidiSound && InputUtils.IsKeyboardControlPressed())
     {
         isPlayingMidiSound = true;
         midiManager.PlayMidiNote(Note.MidiNote);
     }
 }