Breath controller in synths on Linux

I am a new Ardour user and I was looking at using and ewi electronic wind instrument with Ardour. looking online it seems that fluidsynth fairly recently implemented the breath controller response when used in a particular mode “PolyMono”, has anyone tried this and how would you configure it for use within Ardour?

Pinging this. It’s not really a Linux thing at all, would be the same for fluidsynth on any platform. I don’t see a way to change mode of the fluidsynth plugin. I can see that I could connect an Ardour MIDI track up via Jack to a running version of fluidsynth in this mode, and then route that fluidsynth audio back to an audio track. Would this be the best way to handle it? How would this interact with the export process?

fluidsynth is built into Ardour 5.12 and later (and likely a bit earlier too). Look for the “a-fluid” plugin from the “Ardour Team”.

No need to run it externally with JACK.

Yes, thanks. I did see that, but I didn’t see a way to configure it to be in the mode where it responds to breath control. Also I don’t actually own an EWI yet, so I can’t just play with it to see what it does :wink:

For reference, when running fluidsynth you’d do the following:

> setbreathmode 1 0 1 1
> breathmode
Channel    , poly breath , mono breath , breath sync
channel:  0, off         , off         , off        
channel:  1, off         , on          , on         
...

and now channel 1 is in “mono” mode (it only plays one note at a time) and it responds to breath control messages to modulate the single note.

at least that’s how I understand it… but I don’t know how you’d get the Ardour fluidsynth plugin to do something similar.

If I go the external route, what would I do? record the audio track while playing the MIDI track? Then if I want to redo the MIDI track, I’d re-record the audio track before exporting?

The plugin version is not configurable but heeds information from a soundfont. A .sf2 could mark a specific bank/patch as monophonic. The breath controller default is CC-2.
You cannot manually override that like you can with interactive command-line fluidsynth.

So by default the Ardour plugin heeds the CC-2 data? My understanding is by default the command line version doesn’t do anything with it.

I guess I could build up a soundfont specifically for wind type instruments by cutting and pasting from soundfonts I have… and mark them all as monophonic.

Do you actually have any experience with this? or is it more of an in-theory thing?

I’ve used https://www.polyphone-soundfonts.com/ to do some basic editing, and define exclusive groups for some drum soundfonts. For the case at hand, I don’t have any experience though.

Depends on what your goal is.

I’d probably use a MIDI track in Ardour (without a synth plugin). Then route MIDI to fluidsynth (the JACK app), and audio from there back into Ardour’s master-bus.
That way MIDI can be edited in Ardour, and Session > Export also works.

PS. Start fluidsynth before starting Ardour. That way Ardour re-establishes port connections.

1 Like

So, I bought an EWI USB, and without trying to edit soundfonts, I decided to simply test out fluidsynth running on the command line in breath control mode.

The single biggest problem with this whole system is that velocity is mapped to loudness by default. So basically you have random loudness based on how quickly you changed fingerings or how quickly you tongue the breath control etc.

If you turn on breathmode it seems like things get a bit better, but it’s still problematic.

My plan is to insert mididings into the routing, and alter all the notes to have maximal velocity, so that the only thing altering the volume is the breath control.

@x42 I haven’t done anything with soundfonts ever, is it possible to specify in the soundfont that the instrument should not respond to velocity and only to breath control from CC-2?

Yes, it’s possible (common case are organs, they’re on/off only, independent of velocity).

As workaround you could add some midi-filters (come with Ardour, filed under “Utils”):
Add the “MIDI Velocity Adjust” plugin before he synth and set “Note-on min” to 127

That plugin-collection also includes a “MIDI CCMap” that allows to change one CC into another. (e.g. CC2 -> CC1) in case you need that

1 Like

Awesome, I figured out how to get the plugins you mentioned (on Debian they are in a separate package x42-plugins), and the velocity mapping is perfect to eliminate the first problem of random seeming volumes, I just set everything to 127 and it sounds relatively normal. Next problem is I need to find some sound-fonts that have decent sounding jazz/funk instruments: sax, mute trumpet, breathy jazz flute, cornet or whatever that respond to CC2 messages, or that have licenses that let them be modified with the editor you mentioned. :wink:

It’s fairly entertaining to play the aaah chorus or cello with your mouth :joy:

Thanks again!