Been programming on computers 8+ hrs/day for 30+ years and have had many ergo issues, so have studied this deeply. Input devices have had a slow and tortuous journey over the years.
It depends on you and the application. I’ll list what I’ve found to be the best, across the work I do in programming, 3D modeling and composing/producing.
Trackball: X-Keys Trackball (used to be Superior Computer Products trackball until he retired and sold to X-keys)
Logitech tries hard but IMHO does not make the best trackball. You really see what’s what in 3D work. The large X-keys ball is easier, more precise, better on your hands and the buttons and scroll are truly mechanical.
Mouse: These have been perfected, I like Razer (any variety depending on the switches you want)
Trackpad: Apple Magic Trackpad II
If you are on mac don’t bother with anything else. For music this is all I use and the most ergonomic for the motions you use here, such as moving around a score (pinch, swipe, etc).
PC’s have never figured out a decent trackpad.