The arrange view has a SnapToGrid API function, but the MIDI editor does not.
The MIDI editor's grid settings can be different from those of the arrange view, and the MIDI editors' settings are also somewhat more complicated, since it can use either "Source beats" or "Project beats".
It would therefore be useful to have a MIDIEditor_SnapToGrid API function:
Code:
Lua: number reaper.MIDIEditor_SnapToGrid(HWND midiEditor, number timePos)
Alternatively, instead of project time position, the function could use take ticks as argument.