I found this link of a guy who converted his scanner into a music player. I guess it has something to do with linking the pitch of the motor to the speed and controlling it from there. Here is the link, check out the video at the bottom of the page. I wonder if somebody can do this with their cnc machine.
http://www.ganjatron.net/misc/scanjet/scanjet.html