Making a Musical Instrument

Starting this project, we were initially confused as what we wanted it to do to give the illusion of a musical instrument. We started by talking about different mechanisms we could use that would have a chain-reaction type set up so that eventually a part of the set up would trigger the tone.

Then we decided that we wanted to instead utilize the different parts we have as a group of three and the resources provided. We decided to make a band!

We collectively worked on these, but to start we each began by working on a part of the project that would in the end all come together . We decided on three methods of creating sounds: 1) using buttons that trigger the notes 2) using a servo to produce sound with a physical object 3) using a potentiometer to create different notes.

1)Piano though buttons:

First, we set up the circuit which contained 4 buttons and 2 speakers:

We then set up the following code so that each button would produce a different note (C4, D4, E4, F4).

We decided to use two speakers instead of one so that different notes could be played simultaneously. In one of our experiments, we tried to get two buttons played simultaneously to produce another note, but the sound that produced didn’t sound like a note, rather a bleak pitch.

Alone, this is how this part of the project works:

2)Macarena:

For this part of the project, we originally started by wanting to program the speed of the servos movement so that it would hit another object and create a repetitive sound, like a drum. However, we couldn’t find the material to attach to the servo which would hit another material to create a big enough impact to generate a sound, and so we decided use the servo to create sound through a physical movement. Our first thought was bells- it would work well enough and produce a ring sound. Then, we experimented with a variety of materials that would produce sound alone, like beads. In the end, we created a little box with beads inside and glued it to the servo with hot glue like this:

We then created the following code so that the potentiometer would control the speed of the servo and allow us to control the tempo of the instrument:

Alone, this is how this part of the project works:

3)DJ knob Crescendo:

Lastly, we originally wanted to create a crescendo of sounds using a photosensor. There were many difficulties with this, especially the coding. However, after a lot of struggling, it worked. Until it didn’t. To fix the problem we decided to replace the photosensor, which had too many unknown variables, with a knob. In the coding, we mapped out the 0-1023 range into eight different notes: C3-C4.

To play it one would place their finger on the speaker in order to control the volume of the notes while the other hand utilizes the knob to change the notes.

This is how this part works by itself:

4)As a whole:

This is how all three parts work together:

Though not completely in sync, theoretically, if one is willing enough, one could learn how to make these instruments sound like a band.

Leave a Reply

Your email address will not be published. Required fields are marked *