I have been programming an electronic trumpet in Scratch. I am using a MaKey MaKey and a PicoBoard for the hardware side of this project.
Here is the Scratch code I devised.
You can download the project from my Scratch projects page.
Scratch reads the PicoBoard's sound sensor to determine if I am blowing on the microphone. For some notes, which use all open valves on the trumpet, I have added a fourth key that the MaKey MaKey reads. Additionally, the PicoBoard reads how hard I am blowing on the microphone, so Scratch will play a low B flat, an F, or a high B flat.
Here is the trumpet with the PicoBoard and MaKey MaKey hooked up to it.
On the back of the trumpet you can see how I have the copper tape pads mapped to the keys on the keyboard.
Here is the Scratch code I devised.
You can download the project from my Scratch projects page.
Scratch reads the PicoBoard's sound sensor to determine if I am blowing on the microphone. For some notes, which use all open valves on the trumpet, I have added a fourth key that the MaKey MaKey reads. Additionally, the PicoBoard reads how hard I am blowing on the microphone, so Scratch will play a low B flat, an F, or a high B flat.
Here is the trumpet with the PicoBoard and MaKey MaKey hooked up to it.
On the back of the trumpet you can see how I have the copper tape pads mapped to the keys on the keyboard.
I built a second model with a piece of MDF and some metal nuts and bolts.
This has been a hard fun project. I am indebted to this Scratch forum post for helping me get my head around how to have Scratch read when I am pressing multiple keys.
Comments
Scratch 2 has the blocks for the PicoBoard and WeDo but they are not functional yet. I'm still using Scratch 1.4 until the physical computing gear comes online.
Have fun!