A digital trumpet using Arduino UNO. (My first project).
The schematic is simple to follow. I have included the code files to make it work. The code is well documented to facilitate anyone who would like to follow along.
The linear potentiometer controls which overtone (sort of like which octave) the "trumpet" plays. I found it useful to mark where the pitches changed along the pot to make playing easier.
One switch is the "breath" switch; pressing it makes noise come from the trumpet. The other three are the first, second and third "valves," dropping the pitch by 2, 1 and 3 half steps respectively as they do on a traditional trumpet.
The second potentiometer is a volume knob; it works like you might expect it to.
I had fun making this, and I learned quite a bit along the way. In the future, I plan to make a midi controller using the same interface, and perhaps the option to select other brass instruments such as the French Horn. For now it is a fully functioning and well polished trumpet.