Skip to content

Automatic Self Playing Slide Whistle

  • Whistle
  • Music
  • Instrument
  • Electronics
  • Arduino
  • Intermediate
  • Automatic
  • Self Playing
  • Stepper Motor

May 15, 2020





Intro

I am going to perform the greatest magic trick ever. This trick only works with High IQ people, so it may fail if you aren’t that bright. PAUSE! What is the dumbest sounding instrument that you have ever heard. Take a couple moments to really think about it. Alright, do you have it in your head? You were thinking of the Slide Whistle. If you were thinking about a different instrument, then I’m sorry you must have a small brain.

lookingUp

Yes, the slide whistle is the worst instrument in existence. It is only rivaled in stupidity by it’s cousin, the recorder. For all intents and purposes, they are pretty much the same instrument because they both sound equally terrible. There is an ancient meme of a man attempting to play “My Heart Will Go On” on the recorder. He absolutely butchers the entire song and it's positively hilarious to watch. My goal is to recreate this meme gold, but this time with a robotic twist.

introduce

Design

Introducing the Automatic Self Playing Slide Whistle. This contraption contains 3 primary sections. The First section is the fan to pump air into the whistle. When I attempted to play the whistle, I realized that the amount of airflow required was pretty low. This was great news because it meant that I could use a low powered fan to blow air. I settled on using a fan that is often used in 3D printers to cool the hot nozzle. An added benefit was that the fans form factor almost fits the slide whistle’s mouthpiece. To create a perfect connection between the two, I designed and printed a small adapter. I then hot glued it in place to bond the two together and seal any air gaps.

adapter

The Second section deals with manipulating the slide portion of the whistle. To move the piston of the slide whistle up and down, I attached a stepper motor controlled rack and pinion. I copied the rack and pinion linear actuator model of the Self Playing Kalimba project, but modified it to fit this form factor. My original thought was to use a servo to control the movement of the slide whistles piston. I soon realized that the servo motor does not have enough range of motion to play the more than 3 notes. This is why I decided to go for a stepper motor instead.

stepper

Once I designed and printed the parts to hold the stepper motor, rack, and pinion in place, I could begin testing different notes. A downside to using a stepper motor is that it does not have a controller board mechanism built inside it to track its position, like a servo. This meant that every time I restarted the code I was blind to the current position of the piston. I was able to combat this issue by tracking the internal position of the stepper motor in code. I made sure to return the piston back to its original position before stopping the code

wide

Another major issue, that I realized in construction, was the great amount of glide between each note. The fan would take far too long to shut off and turn back on between notes, so it kept pumping air into the whistle. One thought, to halt air flow, was to use an h-bridge to momentarily spin the fan in the opposite direction. This would forcibly stop the blades of the fan from spinning in the same direction. I didn’t proceed with this solution because I was worried that reversing the blades, so suddenly, would break the fan in the process. Instead, I decided upon leaving the fan on the whole time and instead muting the note.

soundHole

The third primary section is how I solved the separation between notes. The slide whistle can only produce sound if the air can pass over the sharp section of the sound hole. The structure of the sound hole allows the air to vibrate in such a manner that it produces a note. If I block or modify the structure, then the whistle would not produce sound. I attached a servo to the slide whistle, below the mouth piece, to block and open the sound hole. This was successful in creating separation between notes. If I wanted to maintain glide between notes, then I could set the servo to open the sound hole.

Tuning and Programming.

Programming the automatic slide whistle was pretty straightforward. I finished creating the Self Playing Kalimba V2 a few weeks ago, so I adopted a similar method to coding that project. I created functions to open the sound hole, play a note for a certain length of time, and close the sound hole. The length of time was a parameter for the function, and the note was a hard-coded value that I figured out from the tuning process.

tuning

Tuning the whistle to play the correct notes was a simple, yet annoying, process. I created code to alter the position of the servo via the number I enter through the Arduino Serial Monitor. I figured out the highest in-tune playable note, and then progressively moved the stepper motor down to play lower and lower notes. I wrote down the position relative to the starting note as the offset to play each note. Tuning was a bit annoying because the pitch was constantly played, while I slowly adjusted each note. To stop the screeching sound of the slide whistle I would either plug the sound hole, so I did not lose my position, or I would completely turn the system off. I made sure to reset the starting position every time I stopped to break.

After properly tuning and testing to make sure that all notes were working fine, I could finally get to programming the song. As I mentioned above, the main inspiration for this project is to play “My Heart Will Go On” on this slide whistle. I already created functions that handled playing each note, so all that remained was reading the piano sheet music and converting it into Arduino code to control the Self Playing Slide Whistle.





I plan on adding MIDI to this project in the future. However, before I implement MIDI I need to obtain a faster stepper motor and create a proper self calibration system. The current stepper motor moves far too slowly to keep up with the pace of any song, so a faster stepper will greatly improve the performance ability. Also, the current stepper is blind to its starting position, so I plan on adding an encoder and a calibration button to the piston movement section. The encoder will monitor the position of the stepper to ensure its accuracy. The calibration button will allow us to figure out the starting position of the piston on startup by moving the piston up until it hits the button. Once I implement these features, I will create two more Self Playing Slide Whistles to have a full TRIO!! (video coming soon… hopefully)

Next Post

Automatic Self Playing Kalimba V2

© 2020 ODD RISER