I'm a music teacher, but I'm involved in programming microcontrollers. Therefore I started to think of an instrument to develop using midi. I decided to create a midi trombone.
Something detects the pressure of lips or air pressure inside a mouth piece. Something detects the slide position of a tube inside another one. From this data I create midi events.
A note on event is created, when the pressure is raised from low/nought to some specific pressure. There should be pressures for silent, 1st partial (pedal tone), 2nd partial (base tone, Bb1), 3rd partial (F2), 4th partial (Bb2) etc. I know blowing in a horn is at least two parameters; kind of air volume for tone volume and lip pressure for pitch. I probably ignore the tone volume for the present and concentrate on the pitch, so probably I'll have a mouth piece, which lets little air through. Then there's a gauge measuring the pressure.
Then I have the slide. I'll probably have two straight tubes inside each other. A light in the end of one. A light sensor at the opposite end of the other. Then I calibrate values to resemble the seven positions of the trombone slide. The inner tube should have a matte black inner surface, while the outer tube should have equally a matte black outside, to make sure the light sensor only reacts to the light inside.
When playing, midi events must be created. When the pressure in the mouth piece raises from low/nought to something relevant, the corresponding partial is calculated. The position of the slide is read and the nearest pitch is calculated. A pitch bend value is calculated to resemble how much off the pitch the slide is. The key down event is now created, together with the pitch bend event. As long there's pressure in the mouth piece, the slide is read and the corresponding pitch bend event is created. When the pressure drops or rises to resemble another partial, a key up event is created as well as a new key down for the new note. Or if the drop in the pressure goes below a threshold, only the key up is created, resulting in silence.
Reading the pressure might get tricky. It must be fast enough, but still it has to follow whether the rise of pressure is supposed to trigger all the partial notes from the 1st to some high note, or just the high note immediately. The difference is in the time for reaching the high note. Don't know how fast pressure gauges are. Same goes in the other direction. When is a drop in the pressure a note off event and when is it just a subsequential drop from high partials to low partials?
So, whatever will happen in the mouth piece I don't know yet. I'll be using Microbit as a micro controller. I will solder a standard midi cable to it, connecting it to an old synth. I hope the pitch bend range can be set on the synt, either on the front panel keys or through midi messages. I have no real questions at this point, but please comment if you are a trombonist or if you have experience in programming and developing midi instruments.