A few minor optimization issues still left, but this is good otherwise! Also, one thing to note is that note lengths that don't divide 192 (like 77, for example), will end up being rounded to the nearest number that does. It's nothing super problematic, but it's an important thing to keep in mind.