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.