The Swan

My final assignment for PComp was something that came to mind after hearing about Carnival of the Animals by French composer Camille Saint-Saëns. I don’t recall what podcast or perhaps NPR station the program was on, but the show host talked of the imagery of the swan moving its neck up ad down according to the melody. I wanted to build a swan that would move its wings, tail, feet and neck to the rhythm and melody of the song.

But that was not to be yet, for this semester. It would take more fabrication, programming, and solving more bugs than I had time and tolerance for.

What I built was a box with buttons. The box contains an Arduino Uno, breadboard, the Emic 2 text to speech shield, and an MP3 shield.

When the software is loaded to the Arduino, The Swan plays, and text is read by a computer voice from the text to speech chip.

When fully loaded, the Arduino has software that is a combination of three different programs: The arduino IDE example on button state detection, Tom Igoe,s MP3 Shield Intro from his GitHub repo, and his Emic2_demo from the same repo.

After building the box, I made sure each new part of the program was working. I had the TTS and button working, and got errors after bringing in the MP3 shield code. I had most of the setup working after I got a little help from a fellow first year student with the MP3 code. 

I kept changing the code since it was too large for the Uno, and I had to experiment with which pin to put my button into on the Arduino. Many of the pins were being used by the MP3 shield, leaving little to work with besides it, and the TTS chip.

I put the project to rest, and went to do the same on Tuesday evening. When I eft it, the button wasn’t working very well. My text wasn’t reading in order. 

The next morning, I recalled that the button code called for a resistor on the breadboard. Putting the resistor in made a world of difference. Now my text read correctly more often.

I played the text and music through a mixer and small amplifier, allowing me to control how loudly each pard played.

The project works well most of the time. My next steps are to include debounce to the button, and to change things around to allow me to put more text through without running out of space on the Arduino.

Play-Testing Final Project

The piece you’re listening to is title The Swan. It was composed by French composer Camille Saint-Saëns in 1886 as part of the musical suite The Carnival of the Animals. A staple of the cello repertoire, this is one of the most well-known movements of the suite.

Saint-Saëns regarded The Carnival of the Animals as a piece of fun, and specified that it not be published during his lifetime, except for The Swan. He saw The bigger piece as detracting from his “serious” composer image. Carnival has since become one of Saint-Saëns’s best-known works, often played by the full string section of an orchestra. 

The most typical arrangement for this piece includes two pianos and cello: the lushly romantic cello solo (which evokes the swan elegantly gliding over the water) is played over rippling sixteenth notes in one piano and rolled chords in the other (said to represent the swan’s feet, hidden from view beneath the water, propelling it along[]).