Track trombone slide position with ultrasonic sensors

Graynomad:
I've not use distance transducers but can't you just bounce the signal off an object on the moving slide?

It may come to that... I guess it depends on the width of the beam. It would have to be narrow enough to avoid bouncing off the bell. I also need to figure out what to put on the slide. Weight and air resistance are issues there. Also, I wouldn't want to track objects beyond the slide, but I guess I can account for that with the software.

robtillaart:
Can you tell about the precision you need?
Most (cheaper) distance sensors I know are in the order of 0.5 - 1 cm.

What is the maximal displacement of the slider?

I think 1 cm would be fine. Slide length is roughly 62 cm and extends by about the same length. I've been looking at these sensors to use with an arduino: Ultrasonic Range Finder - XL-MaxSonar-EZ4 - SEN-09495 - SparkFun Electronics
Precision is 1 cm from 20 cm to 765 cm. So I could stick something on the end of the slide to reflect the signal back.

Only worries would be signal bouncing off the bell and what to put on the end of the slide.