My approach to wrestling with iTunes to make it (barely) usable for classical music collections.
Rotary encoders are notoriously difficult to get right.
Although I haven’t used this new encoder class yet, it looks very interesting. From active Teensy forum user Theremingenieur, it allows initialization with upper and/or lower limits.
You can find the code in this thread.