Synthesize your own little Raspberry Pi piano. Uses FluidSynth SoundFont synthesizer. Features polyphony and sustain, meaning you could push all of the notes at once and the note will play longer with the button held down.
Schematic and PCB are are shared on EasyEDA. Designs and python code are all open. Customize it your way!
This project first started as sound fidget board for my toddler, but I played with it more than he did. After several revisions it became a little piano grown ups can appreciate.
Step 1: Plan for Build
Needs a Raspberry PI zero that has an internet connection to install packages. Alternatively one can use my minimal image that plays the piano as I built it, networking has been removed too. A regular size Raspberry Pi could work too, but it would stick out from the piano PCB.
You can use JST or screw terminals, depending on the speakers you use. I used the JST connector with enclosed speakers.
You can use Raspbery Pi compatible USB sound speakers or adapter instead of the Maxim amplifier chip, which requires solder paste to solder it under the chip. I tried it with mini USB speakers, but it sounds more tinny than the speakers shown. If you use USB sound hardware, none of the audio components on the PCB will needed. They are on the left of the Raspberry Pi.
I mounted the Raspberry Pi Zero below the PCB, but you can put on the top. Just make sure the SD card is the same side as pin 1 marked on the PCB and make sure the header pins on the Pi Zero are soldered to match.
This project needs a custom PCB from your favorite PCB manufacturer. I got 5 from JLCPCB for 14 USD.
I also provided a Bill of Materials spreadsheet.
Step 2: Build
I used low temperature lead free solder paste and a hot air soldering station on the Amp ICs. I focused the heat on top of the IC until I could see the solder bead to connectors visible on the side of the IC. The rest of the components are through hole or large SMD size that were easily hand soldered. I used my converted toaster oven to reflow a earlier revision, but I ended up hand fixing much of it.
Step 3: Software
Prepare SD card with Raspbian Lite
curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fluidsynth python-numpy python-pip
sudo pip install pyfluidsynth
Transfer Project files
Use WinSCP or other SCP software to copy python and sound font file to the Pi home folder
chmod +x piano.py sudo nano /etc/rc.local
Scroll down, and just before the exit 0 line, enter the following:
python /home/pi/piano.py &
It's a good idea to make the filesystem read only, so it can just be powered off.
The switch on the top right allows to turn off read only, to be able to modify the system.
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/read-only-fs.sh sudo bash read-only-fs.sh
Yes for read/write jumper GPIO = 3
No for GPIO-halt
Yes for kernel panic
Choose option 1 for Pi Zero W and Pi Zero 1.3 and option 2 for a 1.2 Version (not W)
Download USBpiano.py and rename to piano.py if using USB sound hardware
I made a card image for the piano, configured the way I built it. Everything unnecessary was removed from the image including networking. Uses default password: raspberry
Participated in the
Raspberry Pi Contest 2020