private void SendNoteString(SimpleMidiNote note) { var noteId = GetNoteId(note); foreach (var character in noteId.ToString()) { var pitchKey = Enum.Parse(typeof(DirectXKey), $"DIK_NUMPAD{character}"); SendInput.SendDirectXKey((DirectXKey)pitchKey, false); } }
public void Play(SimpleMidiNote note) { if (MordhauIsActive()) { OpenConsole(); SendPlayNoteCommand(); SendNoteString(note); SubmitConsoleCommand(); } }
private int GetNoteId(SimpleMidiNote note) { Debug.Assert(Pitch.C == 0); var noteId = noteTable[(int)note.Pitch].Item2; if (note.Octave > 2) { noteId += 12; } return(noteId); }