public void ProcessOnNote(NoteEvent onNote) { if (openDelay) { return; } if (Properties.Settings.Default.AutoArpeggiate) { if (chordNotes.OnKey(onNote)) { // Chord detected and queued // Console.WriteLine("Delay " + onNote + " by 100ms"); } } if (!chordNotes.HasTimer(onNote)) { if (hotkeys.GetKeybindFromNoteByte(onNote.note) is FFXIVKeybindDat.Keybind keybind) { if (WantsHold) { hook.SendKeybindDown(keybind); } else { hook.SendAsyncKeybind(keybind); } } } }
// OnMidiVoice + OffMidiVoice is called with correct octave shift private void OnMidiVoice(Object o, NoteEvent onNote) { Statistics.AddNoteCount(); if (Properties.Settings.Default.Verbose) { FFXIVKeybindDat.Keybind keybind = FFXIV.hotkeys.GetKeybindFromNoteByte(onNote.note); if (keybind == null) { string ns = FFXIVKeybindDat.RawNoteByteToPianoKey(onNote.note); if (!string.IsNullOrEmpty(ns)) { string str = string.Format("Note {0} is out of range, it will not be played.", ns); ChatLogAll.AppendRtf(BmpChatParser.FormatRtf(str, "\\red255\\green200\\blue200")); } } } if (LocalOrchestra.OrchestraEnabled) { LocalOrchestra.ProcessOnNote(onNote); return; } if (Player.Status == PlayerStatus.Conducting) { return; } if (!Player.Player.IsPlaying) { return; } if (!FFXIV.IsPerformanceReady()) { return; } if (onNote.track != null) { // If from midi file if (onNote.track != Player.Player.LoadedTrack) { return; } } if (!FFXIV.memory.ChatInputOpen) { if (WantsSlow) { if (FFXIV.hotkeys.GetKeybindFromNoteByte(onNote.note) is FFXIVKeybindDat.Keybind keybind) { int delay = Decimal.ToInt32(Properties.Settings.Default.PlayHold); // Slow play Player.Player.InternalClock.Stop(); FFXIV.hook.SendSyncKey(keybind.GetKey(), true, true, false); //Bmp.Player.InternalClock.Sleep(delay); Thread.Sleep(delay); FFXIV.hook.SendSyncKey(keybind.GetKey(), true, false, true); Player.Player.InternalClock.Continue(); return; } } if (Properties.Settings.Default.AutoArpeggiate) { if (chordNotes.OnKey(onNote)) { // Chord detected and queued Console.WriteLine("Delay " + onNote + " by 100ms"); } } if (!chordNotes.HasTimer(onNote)) { if (FFXIV.hotkeys.GetKeybindFromNoteByte(onNote.note) is FFXIVKeybindDat.Keybind keybind) { if (WantsHold) { FFXIV.hook.SendKeybindDown(keybind); } else { FFXIV.hook.SendAsyncKeybind(keybind); } } } } }