I made a Reaper script to snap midi notes to chords.
There is also a Linux version of Reaper.
https://www.pgmusic.com/forums/ubbthreads.php?ubb=showflat&Number=648407