Trumpet MIDI Controller Using Atmega32

The Trumpet MIDI Controller allows trumpet players the freedom of synthesizing from and composing on their native instrument.
Trumpet MIDI Controller Using Atmega32
The Trumpet MIDI Controller combines custom hardware and software with the Yamaha Silent Brass pickup mute to convert any standard trumpet into a fully functional MIDI controller and MIDI pass through device for up to 16 channels.
Thomas Craig (twc22)
Bradley Factor (bef23)

High Level Design

Project Inspiration

Robert Moog created one of the first modular voltage-controlled music synthesizers in 1964. However, unlike the synthesizers created by competitor Don Buchla, Moogs synthesizers used a piano-style keyboard for the majority of user input. Since then, most synthesizers have also featured a piano-style keyboard. The motivation for this design is mostly pragmatic. Pianos have a very large range with up to 88 keys. Neglecting hand motion for reaching largely spaced notes, all of the notes require similar amounts of effort to play, and therefore the entire range is readily available. This is useful to both performers and composers.
Despite the universal nature of the piano-style keyboard, some instruments differ sufficiently to make keyboard input too impractical or unnatural, a prime example being drums. Piano notes are mainly defined by pitch and duration. Although duration is similarly defined for drums, the type of drum played typically predefines the pitch, rather than how the drum is played. There are also key mechanical differences between how one plays a keyboard and how one plays drums, which make trying to use one to imitate the other awkward at best.
Although there has been some branching out in synthesizer design, in particular to drum synthesizers and electric guitars, the predominant modern synthesizer still uses a keyboard. This also appears to be the case in ECE 476 final projects, especially with regard to MIDI controllers. Our desire to produce a unique and challenging project in combination with Brads ownership of a trumpet and music workstation led to the idea, and eventual selection, of a trumpet-based MIDI controller.
During the concept development phase, we discovered two marginally similar products on the market, the Morrison Digital Trumpet (MDT) and the Yamaha EZ-TP Trumpet. The MDT is marketed as a brass wind controller which supports 10 octaves of notes, does not require any lip buzzing, and can be substituted as a performance instrument. This is accomplished through breath sensing with a piezoelectric transducer, photodiode sensing of valves and additional buttons for octave selection, and output to a MIDI sound module. The MDT sells for $1,955 which places it in the mid-range price of MIDI instruments and mid to high-range price for an actual trumpet. The Yamaha EZ-TP is similar except that the main input is humming or whistling in addition to valve presses. The EZ-TP is difficult to locate, however its selling price is about $350, placing it in the very low-end pricing for both synthesizers and trumpets.

Project Concept

Our primary goal is to create a functional MIDI controller that unlike the MDT and the EZ-TP can be played the same as a typical trumpet. This means that it must be capable of playing every note within the standard range of a trumpet based on the same user inputs given to a normal trumpet. MIDI stands for Musical Instrument Digital Interface, a standard designed for transmitting instrumental events, such as beginning or stopping a note, rather than sampled music waveforms.

Music Theory

The sound of a trumpet is produced through coupled resonance between a mouthpiece and the rest of the trumpet. The trumpeter blows air through closed lips which makes a buzzing sound in the mouthpiece. This then sets up a closed-open standing wave in the air column within the trumpet. The output pitch is selected from a range of overtones, natural resonances of the trumpet, by changing lip tension and aperture, known as embouchure. Typical modern trumpets are constructed with three piston valves which increase the tubing length when engaged. The first, second, and third valves lower the trumpets pitch by a whole step, half step, and one-and-a-half steps respectively. Adjustments of the embouchure, and valve selection known as fingerings, make the trumpet able to play all twelve pitches of Western music.
Fingerings select overtone series. They are denoted by Open, 1, 2, 12, 23, 13, and 123 which indicate which valves are depressed, with Open denoting no valves depressed. The standard range of a trumpet is from F#3 to C6. Between limitations imposed by fingerings and the range of the trumpet, this means that there are between 2 and 6 notes per overtone series. It is worth noting that the overtone series begins with the first overtone rather than the fundamental.
The most common type of trumpet, and the type that will be used in the Trumpet MIDI Controller, is a Bb trumpet. This means that when playing a note written as a C, the actual frequency output is that of a Bb. Similarly, all other notes produced by the trumpet are a whole step lower than the written note.
A final but important note regarding music theory and trumpet mechanics, air pressure applied by the trumpeter controls the volume of the sound output of the trumpet. However, higher notes are more difficult to play, so the softest version of a given note may be louder than most cases of another lower note.

Background Mathematics

The principal mathematical tool used for this project is the Fast Fourier Transform (FFT), which converts a sampled signal from time to frequency domain. In other words, the FFT provides the amplitude of corresponding frequency signals which, when added together, will give you the originally input sample sequence. This allows us to determine which frequencies are dominant in the sampled signal.
Also important to this project, but beyond the scope of explanation here, is the Nyquist-Shannon Sampling Theorem. Particularly important results from this theorem are aliasing and the Nyquist frequency.
Fingerings select overtone series. They are denoted by Open, 1, 2, 12, 23, 13, and 123 which indicate which valves are depressed, with Open denoting no valves depressed. The standard range of a trumpet is from F#3 to C6. Between limitations imposed by fingerings and the range of the trumpet, this means that there are between 2 and 6 notes per overtone series. It is worth noting that the overtone series begins with the first overtone rather than the fundamental.
The most common type of trumpet, and the type that will be used in the Trumpet MIDI Controller, is a Bb trumpet. This means that when playing a note written as a C, the actual frequency output is that of a Bb. Similarly, all other notes produced by the trumpet are a whole step lower than the written note.
A final but important note regarding music theory and trumpet mechanics, air pressure applied by the trumpeter controls the volume of the sound output of the trumpet. However, higher notes are more difficult to play, so the softest version of a given note may be louder than most cases of another lower note.

Background Mathematics

The principal mathematical tool used for this project is the Fast Fourier Transform (FFT), which converts a sampled signal from time to frequency domain. In other words, the FFT provides the amplitude of corresponding frequency signals which, when added together, will give you the originally input sample sequence. This allows us to determine which frequencies are dominant in the sampled signal.
Also important to this project, but beyond the scope of explanation here, is the Nyquist-Shannon Sampling Theorem. Particularly important results from this theorem are aliasing and the Nyquist frequency.
Fingerings select overtone series. They are denoted by Open, 1, 2, 12, 23, 13, and 123 which indicate which valves are depressed, with Open denoting no valves depressed. The standard range of a trumpet is from F#3 to C6. Between limitations imposed by fingerings and the range of the trumpet, this means that there are between 2 and 6 notes per overtone series. It is worth noting that the overtone series begins with the first overtone rather than the fundamental.
The most common type of trumpet, and the type that will be used in the Trumpet MIDI Controller, is a Bb trumpet. This means that when playing a note written as a C, the actual frequency output is that of a Bb. Similarly, all other notes produced by the trumpet are a whole step lower than the written note.
A final but important note regarding music theory and trumpet mechanics, air pressure applied by the trumpeter controls the volume of the sound output of the trumpet. However, higher notes are more difficult to play, so the softest version of a given note may be louder than most cases of another lower note.

Background Mathematics

The principal mathematical tool used for this project is the Fast Fourier Transform (FFT), which converts a sampled signal from time to frequency domain. In other words, the FFT provides the amplitude of corresponding frequency signals which, when added together, will give you the originally input sample sequence. This allows us to determine which frequencies are dominant in the sampled signal.
Also important to this project, but beyond the scope of explanation here, is the Nyquist-Shannon Sampling Theorem. Particularly important results from this theorem are aliasing and the Nyquist frequency.

Implementation

Hardware

MCU Board

The Microcontroller, or MCU, Board is the center of the Trumpet’s electrical design. The MCU Board is a modified ECE476 Prototype Board which hosts an Atmel Mega32 running at 16 MHz. It is responsible for sampling audio data, valve presses, and MIDI commands, processing that data, and outputting the corresponding MIDI commands. The modifications to the board include:
1. A 2×2 Molex Microfit 3.0 receptacle has been mounted in the location intended for a DB-9 connector. TTL-level transmit and receive signals from the MCU’s UART are routed to this connector, along with ground and Vbattery. This connector is called the MIDI connector.
2. A small rework wire has been run from 5V to the AREF pin.
The audio board provides biasing for the BJT within the condenser microphone as well as amplification of the audio signal with an AD623 instrumentation amplifier. The biasing is provided by a resistor voltage-divider (R3 and R4). This signal is then capacitively coupled through C2 to a ~2.5V DC offset such that the signal will be able to swing rail-to-rail on a single 5V supply. Vref and V- are both referenced to a 2.5V DC level such that the AC signal is amplified, since the amplifier’s output voltage is A*(V+-V-) + Vref, and so the output can swing rail-to-rail as well. Using a 5.7 kOhm gain resistor sets the gain to be about 21 which works well for our signals which are between tens of millivolts and a couple hundred of millivolts. The audio board connects to A0 for channel 0 of the microcontrollers ADC as well as power and ground.

Audio Board

The photodiode board uses pairs of LED to determine which valves are depressed at a given time. One of the diodes in each pair is set up to emit with a constant 20mA current while the other diode is tied between ground and the base of an NPN BJT such that incident light upon the photodiode produces a voltage on the BJTs base. Since each BJT is configured as a common emitter amplifier, the base voltage is amplified and inverted on the output. Each channel is identical. The Photodiode Boards signal and power connects directly to the Comparator Board.
Trumpet MIDI Controller Using Atmega32

Photodiode Board

The photodiode board uses pairs of LED to determine which valves are depressed at a given time. One of the diodes in each pair is set up to emit with a constant 20mA current while the other diode is tied between ground and the base of an NPN BJT such that incident light upon the photodiode produces a voltage on the BJTs base. Since each BJT is configured as a common emitter amplifier, the base voltage is amplified and inverted on the output. Each channel is identical. The Photodiode Boards signal and power connects directly to the Comparator Board.

 Parts List:

Solder Board (6) $2.50 x 1: $2.50
Custom PC Board $5 x 1: $5.00
Mega32 x1: $8.00
DIP Socket: $0.50 x 7: $3.50
Header: $0.05 x 16: $0.80
Radio Shack Board Perf Board: $2.00 x 2: $4.00
Quad Comparator 296-17223-5-ND: x1 $0.53
Opto-Isolator 6N138QT-ND: x2 $1.60
Male DIN-5 CP-1050-ND: x1 $1.23
Female DIN-5 CP-1150-ND: x1 $1.32
Narrow View RED LED 67-1122-ND: x8 $4.56
Battery Holder BH26AAW-ND: x1 $1.21
Analog AD623 In-Amp AD623ANZ-ND: x1 $4.50
Assorted Microfit 3.0 Connectors: Sampled
Maxim MAX233ACPP x1: Sampled
Assorted Resistors: ECE476 Lab
10k Potentiometers: ECE476 Lab
Assorted Capacitors: ECE476 Lab
Assorted LEDs: ECE476 Lab
74LS32 Quad-OR x1: ECE476 Lab
MCP6544 Quad-Comparator x1: Sample
BJT 2N3904 x3: ECE476 Lab
Total: $38.75
For more detail: Trumpet MIDI Controller Using Atmega32


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top