Our goal for this class was to generate a works-like model, which we planned to do by finishing the program for the other seven light sensors, then calibrating each sensor to play the appropriate note when it sensed a dark spot, then combining the music scrolling and sensing:
First we finished the code, and changed it to play a "melody" (one longer note) rather than the previous "note" in order to increase the time of each note and more easily determine the pitches. We based playing a note off of each photo cell's reading; we tested each cell to make sure that it played a note only when exposed to a spot of black marker on a sheet of paper, but would remain silent when the sensor was pointed at the white paper. Each photo cell was separately calibrated, since each was a different distance from the LED which provided the background illumination--sensors farther from the light read darker baseline values than sensors closer to the light, so sensors 1 and 8 had the highest baseline values in the first line of their programs, and sensors 4 and 5 had the lowest.
The program:
All of our sensors are working!
We set the key to D major and organized the sensors so they form a scale.
A calibration test:
We wanted all 8 notes to play when they were on a black mark (as shown initially), but none to play when on white paper (the second test). We noted that photo cell 6 was still sensitive to shadow (the third demonstration), so we added another Lego piece to improve the shading box a bit after this calibration.
Now that the photo cells were working, it was time to finesse the music scrolling. We drew guiding lines on a long strip of paper for the music, to make sure the notes were aligned properly:
Now that the photo cells were working, it was time to finesse the music scrolling. We drew guiding lines on a long strip of paper for the music, to make sure the notes were aligned properly:
We then simply snapped the photo cell array on top of our previously-assembled scrolling mechanism (hooray for Lego assembly!). Our works-like model, assembled and about to run:
The music reader reading the first music:
It...didn't quite work out like we had hoped. Time for debugging! We recalibrated the sensors and played around with the scrolling time.
The second round:
We were concerned that the paper wasn't feeding straight, so the photo cell alignment was off. We added some feeding shelves to help with the straightness issue.
The third round:
Still not really a recognizable melody... We realized then that we needed to write the music slightly farther down the paper, as the current version had already scrolled past the first notes during the initial setup. We'll be sure to fix that next class.
We played the music box for the presentation at the end of class, and it played something only a few notes off from the Beethoven's 9th Symphony melody we had transcribed. (Unfortunately we had some technical difficulties with filming and were unable to record this; next class we'll fully document the working player.)
Our goal next class is to make a SolidWorks looks-like model of an aesthetically-pleasing music box! The basic idea is to contain the "guts" of the music box (the motherboard and all the wires) an an appropriate housing which also supports the scrolls and motor; this will eventually be laser-cut out of Delrin and assembled (probably with small nails, possibly piano wire). Our current, rather haphazard-looking box, with a ruler for scale:
Goals for Friday:
We're excited to continue as "slowly, gently, light unfurls its splendor"!(quote from Andrew Lloyd Webber's famous song "Music of the Night")






No comments:
Post a Comment