notes from the shore

Adventures in Home Recording

Soundfont Editing for Wind Controllers

I know, – dry, bland title. I promise that the next one will be back to my usual, moderately witty appellations.

If you have followed my recording exploits, gentle reader, then you know about my continual search for more controlled expression of my instruments. The most detailed post so far is Control Freak, which documented using drawn-in continuous controller curves to modify the volume of the instrument. As mentioned in a later post, I did purchase the Yamaha WX-5 for this very purpose. I’ve been pleased with the results.

As background, let’s take a quick look at how I use my WX. My favorite instrument is Garritan’s Jazz and Big Band library. It responds natively to CC#2 (breath control), which makes playing it a lot of fun. I’ve been practicing the WX-5 mostly using the JABB library, playing along to tracks that I programmed into Band-in-a-Box. I especially like playing the various woodwinds in the library. I can enter a basic song in BIAB in about 5 minutes, choose an appropriate accompaniment, and I’m off. Certainly not ready for prime time, but boy does it make practicing more fun.

Another fun application is my Minimoog emulator, the freeware program Minimogue VA, which can learn any midi controller for any function. I map CC#2 to sustain level in the ADSR envelope and filter cutoff. Great fun and control.

Still, I need a wider variety of sounds for my recordings, especially ethnic and pre-baroque instruments. For this, I turn to soundfonts. If you are new to this blog, a soundfont is the proprietary format created by Emu and the Soundblaster folks to load custom sounds into their sound card. There are also a few software synths that will play back soundfonts, the most popular being Synthfont and sfz. Now, for all the myriad soundfonts available free on the Internet, they aren’t often  (try never) programmed to respond to breath control. I have recently gained some experience in soundfont programming in my quest to create a sampled djembe, and thought I would give it a shot.

There are two primary editors for soundfonts – Vienna, offered by Creative Technologies (the ones who wrote the spec and sell the soundblaster cards), and Viena, by the gent who wrote Synthfont. Both have their strengths, but Viena is still in beta, and the aspect of soundfont programming that I needed for this excersize is still a bit buggy. As a result, all my editing was done with the Vienna soundfont editor. I had some existing soundfonts that I downloaded and wanted them to respond to breath control.

I started with research, but I can’t believe how little there is on the web about soundfont programming. No one on any forums will engage me about the subject, and there are essentially two documents, the main one written over 10 (yes, TEN) years ago by a guy who doesn’t even use soundfonts anymore. That article is here, and another more recent web page is here. Neither article covers the very important subject of “modulators.”

Modulators, in Soundfont parlance, are the real-time controls of the sound. You can map any MIDI CC to any of about 20 parameters, including all the functions of the volume and filter envelopes. I finally figured it out, based mostly on the very brief and somewhat enigmatic material presented in the Vienna help file. Some day, if I get this all figured out, I need to publish a “Complete Guide to Soundfont Programming.”

Start by loading your soundfont into Vienna, and drill down on the Soundfont tree until you get to the instrument you want to edit and select “Global Zone.” Directly beneath the Soundfont tree is the modulator section. I resize the various panes (by dragging them around), until I can see everything I want to see. It should look something like this:

Breathe Control Modulator from Vienna

When all was said and done, I made two changes to the soundfont to get them to respond properly to breath control. First, I mapped CC#2 to the sustain level of the ADSR volume envelope. There are only two options to change – the shape of the curve and the amount. In soundfonts, and this is important, volume changes are all ATTENUATION, this means a reduction in volume. Therefore, as can be seen in the screenshot above, you need to assign a descending curve to the Primary Mapper.

I also played around a lot with the amount of modulation, and found that a surprisingly small 35.0 dB attenuation produced satisfactory results.

The next modulator is accompanied by some divergence of opinion. Key on Velocity is the primary method of controlling the volume of individual notes with a typical keyboard controller (unless you’re using Garritan products – more on that in a moment). The WX-5 can be set to send velocity based on breath pressure, or just send a value of 100 for every note. The standard thinking for wind controllers is leave it to that standard value of 100 (out of 127), and let the breath control (CC#2) do ALL your volume control.

That’s fine for many, maybe most, applications. However, the Garritan libraries are set up so that velocity does not control volume (at least for sustaining instruments), but rather the strength of the attack, and volume is controlled by CC#1 and 2 (mod wheel and breath control, respectively). This allows for intense, soft playing, or mellow, loud playing. For that reason, I don’t want to be switching my WX-5 back and forth between the two modes depending on which synth I’m playing. Also, the dip switch for making the change is a pain to switch.

So, it was incumbent upon me to make the patches respond appropriately to velocity. Here’s a Vienna screen shot of that modulator:

Velocity Modulator from Vienna

Again, the modulator is “Initial ATTENUATION”, so more modulator means less volume. Thus the descending curve again. Also, it doesn’t take much to make this controller have a significant effect, so 25 dB is plenty.

So far I’ve programmed two instruments with these modifications – an English Horn and an Oboe, both for a current piece I’m working on. I’ve played in both parts on the WX-5, and while the CC#2 data looks like a mountain range, the results are quite pleasing to the ear. I even left in some of the less dramatic clams in my playing to add to the realism.

Now that you know this, I challenge you to reprogram some of your own favorite soundfonts and play up a storm with your wind synth.

Advertisements

March 6, 2008 - Posted by | Production Diary, Soundfont Editing | ,

7 Comments »

  1. Great info
    THanks for the contribution

    Comment by Nate | February 16, 2009 | Reply

  2. Thanks for your effort here!

    Comment by Jud | February 23, 2009 | Reply

  3. Do you think the program Awave studio could help you here a bit?

    Comment by ProDigit | August 29, 2009 | Reply

  4. Maybe, but I’ve moved to the sfz format from sf2 because I couldn’t find a soundfont player that would respond to the modulators. Thanks for reading!

    Comment by raweber | August 29, 2009 | Reply

  5. Rob, I came across your page while trying to understand MIDI modulators. I’ve written a PD patch which tries to run a microtonal clarinet synth. There’s a video about our project at https://vimeo.com/80450876 (section 3, “The WX5”, is the most relevant) and a technical report at https://vimeo.com/77621987

    The clarinet sound is dreadful, even in Alex’s hands, and he’s an international-grade player. I was thinking of looking more deeply into extracting control information from the wind controller, but in the end we might do just as well actually building a clarinet!

    We are using open-source resources to create our instruments, because this is a scientific project and I feel it needs to be widely reproduced and tested so that science can happen. This needs to be possible for people without access to specific proprietary systems. Consequently, I’ve steered clear of sfz fonts because they aren’t yet widely supported in the open-source community (although this is changing).

    I don’t suppose you came across anything further on modulators in sf2? They are implemented in programs like polyphone (my favourite) (http://sourceforge.net/projects/polyphone/) and swami (http://www.swamiproject.org/) but as you say, there is precious little about what they do.

    I suppose I should take my own advice and read the source code…

    Nick/.

    Comment by Nick Bailey | April 8, 2014 | Reply

  6. Hi, Nick, thanks for taking the time to read. I’m afraid I haven’t come across much more in terms of documentation of the modulators. It’s a shame, because I think for sf2 and sfz are really powerful formats, but they’re also really obtuse. I know that Plogue is expanding the sfz format, but my recent attempts to program in that format have resulted in failure.

    I hate to say it, but there’s a reason that Kontakt is the most popular format for sample programming. It seems to have the best combination of flexibility and power of any of the formats out there. It’s really a shame that it costs $500.

    I’ll check out the videos later today.

    Comment by robntweber | April 10, 2014 | Reply

  7. Hi Rob! Thanks for the heads-up about Kontakt. I’m not familiar with it. I’m really an Electronics Engineer that’s been drafted in to this project because I can code a bit!

    Just to be clear, it’s not the $500 that’s the issue. It’s source code availability. It would have to be free (as in speech) rather than free (as in beer). The French have two different words — libre (freedom of use) and gratuit (no charge) — but we anglophones are stuck with the ambiguity. As Richard Stallman, the Free Software Foundation guy said, “Charge as much as you can for your free software so you can afford to write more free software!”

    Anyway, I clearly need to know more about how this stuff works, so I’ll check out Kontakt.

    Comment by Nick Bailey | April 11, 2014 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: