I added a basic breath sensor to the pastry saxophone. It kinda works! The response of the breath sensor is quite slow - I think I need to use something stretchier than a nitrile glove. It doesn't feel sensitive enough to do staccato notes or anything yet.
I didn't get dynamics working with the USB MIDI yet, but on/off breath control works well
The breath sensor works like this guy's video: https://www.youtube.com/watch?v=es92GqYBge0
The black tape all over it is to block out light - I found it was making a big difference to the readings.
I've started printing the mouthpiece and designed the sensor half of the breath sensor. This uses a TCRT5000 IR reflectivity sensor, which shines at a diaphragm clamped between the two halves.
When you blow into the mouthpiece, the diaphragm expands towards the sensor, increasing the amount of IR that's reflected back into it.
Dynamics now work! I'm using the breath velocity value from the cardboard breath sensor to set the MIDI breath controller value, and mapping that to volume in the synth. I'm sure there's a much more complex and nice-sounding config that can be done, but this is cool!
It needs to be a bit more linear, but that just means making some sort of calibration curve for the sensor. That can wait until I've got the 3D printed one working.
I've put the code up on https://gitlab.com/gbrnt/electro-sax
There's currently a latency problem - I need to check whether it's on the Arduino end or on the computer end. The breath sensor has some extra latency - I think that comes from the current prototype but I'm not entirely sure.
The end-to-end latency of the electro-sax is definitely too high right now. It's recommended to get it below 10ms (if you can) and here it is at 160ms.
That's enough that when you're doing something like a run of short notes you do one too many because the sound hasn't caught up yet.
Let's see how much I can improve this just by changing Jack settings. Not sure how Pipewire comes into this.
@gbrnt I'm glad I'm not the only one who still used Audacity... I was told it was outdated, but it's the only workstation that makes sense to me
@gbrnt I'd agree. What kind of sounds or music do you make? I've been making notification sounds I want to get onto some PinePhone OS's.
@evandornbusch I've done notification sounds in the past, and occasionally edited the audio track of videos (noise reduction, adding music, etc). It's just my go-to program for any kind of audio editing or recording.
In this case it was the first thing I thought of for measuring the timing of the key going down vs the sound coming out of the computer.
@gbrnt I don't suppose you could let me check our your favorite self-made notification sound for some inspiration? All of mine involve chirps in the several kHz tone and I've been told they're very unappealing to the average person.
@evandornbusch Sorry, I never managed to come up with something I liked much! The best I've got is a ding sound in my pomodoro timer: https://github.com/gbrnt/pomodoro.py/blob/master/timer_done.wav
@gbrnt I think it's lovely! I am creating a collection of tones and sounds if you ever need one for an open source project.
@evandornbusch Now I think about it I might not even have made that sound! It might have been from freesound.org. I remember trying to make a good ding sound but not whether I managed it.
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!