コード例 #1
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (midiNote > -1)
     {
         midiManager.PlayMidiNote(midiNote);
     }
 }
コード例 #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);
        }
    }
コード例 #3
0
 private void PlayMidiNote()
 {
     StopMidiNote();
     if (midiNote > -1)
     {
         midiManager.PlayMidiNote(midiNote);
     }
 }
コード例 #4
0
ファイル: EditorUiNote.cs プロジェクト: SirLangley/Play
 public void OnPointerDown(PointerEventData eventData)
 {
     // Play midi sound via Ctrl
     if (!isPlayingMidiSound && InputUtils.IsKeyboardControlPressed())
     {
         isPlayingMidiSound = true;
         midiManager.PlayMidiNote(Note.MidiNote);
     }
 }