In my country, Brazil, its very common for children to play clapping games, where they clap in different ways and rhythms, like some kind of choreography. To dictate the rhythm, these games are played while they sing some song.
In this project, we will actually make these games play real music, using a MakeyMakey and some python code.
Step 1: You Will Need:
1-) A MakeyMakey
2-) Python 2.7 installed. You can download it here.
3-) PyGame and Numpy python libraries.
If you use Windows, you download in the Unofficial Windows Binaries for Python Extension Packages
In Ubuntu, for pygame use:
sudo apt-get install python-pygame
and for numpy use:
pip install numpy
Don't know about OSX.
4) The actual code on Github.
Step 2: Setting Up the MakeyMakey
MakeyMakey acts like a keyboard to your PC. The signal it sends correspond to the keys you put your alligator clips on. In this case, we will use the SPACE key. The other alligator clip will go to the earth inputs.
Each person puts the alligator in contact with his skin. In this case I put on my foot with the help of a little elastic.
The MakeyMakey goes to your USB input.
Step 3: Running the Game and Creating New Songs
With python installed and set to system PATH, go to the terminal/cmd and digit:
python clap_music.py <name_of_the_song>
Replace the <name_of_the_song> for any song file inside musics folder. The names must match.
To create another song, make a .txt file with the name of the desired song. In this file, each line contains: NOTE+OCTAVE:DURATION:VOLUME
The duration and volume values must be floating points and max volume must be 1.0
The code of this prokect was based on Beep reader player project, go check it out.