You are here

Using Midi instruments

In my previous project, I had 4 midi tracks. each with a different instrument sound. In each track I added sfizz as a plugin, and then specified the required sfz file for the appropriate instrument. I have no idea if this is the best way of doing it, but it worked.

In my new project I thought I could do something similar, except that for this one I am using FluidSynth sounds. I have added FluidSynth as a plugin in each track and then specified the instrument,

This doesn't seem to work terribly well. For a start, sometimes when I have loaded the plugin, I have to make several attempts at specifying the required program number before I can get any sound other than the default "Yamaha Grand Piano". Worse still, I sometimes find that the instrument I have specified for one track is somehow transferred also to one or other of my existing tracks.

I suspect I am possibly doing something fundamentally wrong. Is there a better way of using these various instruments?


There are several fluid plugins and each one behaves differently.
You are using sfizz correctly. But the behavior in sf2 is not the same as in sfz. Each Sfz defines an instrument and variants of it. An Sf2 defines entire libraries.

Let's get to the point:

If it is to be used directly on a midi track and not on a bus, I recommend FluidSynth DSSI.
To avoid problems:
1 Load the sf2 library from the plugin interface (do not select the instrument, leave it as default, otherwise the conflicts you mention may be created.)
2 The instrument must be selected from the track properties.

File attachments: 

Thank you for your helpful suggestions, and the useful gif. However, I am still getting some of the same problems as before,

Let me explain exactly what I am doing, in case some of it is is wrong. I click on the Plugins tab of the relevant Track dialog, click the Add button and select FluidSynth DSSI plugin. I then double-click on the name of the newly added plugin, click the Load SoundFont button and select /usr/share/sounds/sf2/FluidR3_GM.sf2 . I close that dialog and select the Track tab. In the Instrument box I select FluidSynth DSSI plugin. At this point I only have instrument numbers (e.g. "71 --") showing next to "Program", so I close and reopen the Track dialog. I then have instrument names showing ("70 - Bassoon").

Although I don't get the Grand Piano sound any more, I am still having problems with instruments getting copied from one track to another. I noticed that after setting Bassoon on one track, the other tracks also showed "Bassoon" although they were still playing the correct sounds. However, after saving and reloading the file, all the tracks were now playing the Bassoon sound.

Why might this be happening?

I found the answer only minutes after sending the previous message. Foolishly I had all the instruments set to use midi channel 1; this worked fine when I was using sfz instruments, but clearly it doesn't work in this latest case. Now that I have set the 4 (so far) instruments to different channels, the problem seems to be solved.

I'm glad you found the solution.

I forgot that Qtractor treats all midi tracks that share a channel as if they were one. If you make a change to the properties of a track it will be applied to all of the same channel (logical behavior on the other hand).

Since SF2 manages libraries (not just an instrument) it supports channel information.
This allows you to make a multi-instrumental arrangement with a single SF2 and different midi channels.

As I understand it (I could be wrong) SFZ, when managing a single instrument, does not need to read channels. It doesn't matter to him because he can only play the loaded instrument. It cannot change another, because there is no other.

I recommend you always do it from the track properties, because it works the same for virtual synths and hardware synths. Especially if you work with GM libraries and synth with GM support, since it will be very easy for you to exchange more or less equivalent sounds without changing the session settings.

What I have got now works fine: I have fewer than 15 instruments (plus drums) to manage. But in the future I'm intending to do some orchestral stuff which will certainly need more than that.

I assume that that's where I need to use busses, so that I can have 2 or 3 instances of FluidSynth loaded at the same time. Am I right? And where do I put them? I think it must be on output busses, but then again I'm not really sure about this. Any further advice would be very much appreciated.

I used a fluidsynth-dssi in each track and hit the limit of 15 instances that worked as expected. I could increase this limit by building fluidsynth-dssi from source with "#define FSD_CHANNEL_COUNT 32" instead of 16 in fluidsynth-dssi.h

I am afraid a standard build of fluidsynth-dssi will hit the 15 instruments limit, no matter how many instances you load in your session.

As I indicated before, each plugin works in a different way.

Fluidsynth-dssi, at least in my experience, does not support multichannel, which is necessary to use it on BUS.

The only one that works correctly in BUS with the method that I have indicated (configuring from track and not from plugin) is "ACE Fluidsynth LV2". However, I can't find it for download. It came preinstalled in AVLinux.

I consider it to be (configuring from track) the most suitable method because it is the standard and therefore compatible with hardware synths. But if the plugin only allows it to be configured from its interface, and this does not create problems, it is also an option.

As I also indicated before, Calf Fluid does support multichannel, but it is managed from the plugin interface, not from the track.
You just have to add an instance (only one) of Calf Fluid on every bus you need, load a soundfont, and from the plugin interface assign each instrument to each midi channel. As you know, you have 16 instruments (channels) per BUS.

The only problem with Calf Fluid is that you lose the sf2 file name, but it will work correctly. It can be easily solved by writing down the name anywhere :).

However it is not necessary to work with buses. The only advantage of working by bus is performance. But generally with a machine that is 10 years old or less (which is not exactly new) and more than 4 gigabytes (which is not something unusual nowadays) it is not worth working by bus (I disagree here with Rui).

The advantage of working on separate tracks is that you can EQ, mix and apply effects to each instrument separately.
You can also automate these effects separately.

Losing all that for a minimal performance improvement I don't see the point. But it is good that we know the two ways of working, their pros and cons.
Logically, if you have dozens of instruments you take the risk of running out of RAM, that also depends on the weight of the SF2.
Each project must be valued.

For me, continuing to work on separate tracks with fluidsynth DSSI controlled from the track properties is the best option.
If I needed many many instruments (seeing that fluidsynth-dssi only supports 15), I would play with several plugins (Calf, ACE, DIE...)
If I ran out of ram I would change strategy to plugins in BUS.

As far as I know we have the following plugins, and we can combine them in a session.
In principle they should work well from their own interface. It's a matter of trying them and seeing how best to configure each one of them, whether from the interface itself or from the track. See their behaviors, whether or not they cause problems, etc.

Calf Fluidsynth
ACE Fluidsynth
DIE Fluidsynth:

I forgot to mention Carla as an option. Its track-hosted behavior is similar to Sfizz in the following:
It doesn't matter how the track is configured. It doesn't matter if all the tracks have the same channel. It will play the instrument that is configured within each Carla instance.

- Being able to use many many instruments without having to resort to midi buses.
- Instruments can be combined to create a unique timbre within each Carla instance.
- Effects can be added in a modular way (series and parallel).

- It is much more complex to manage.
- It is much more complex to maintain: It is a host within a host. Therefore, for backup issues, project documentation, etc., the workflow becomes heavier. Each .carxp (Carla's session file) would have to be saved separately to have control over which sf2s and other plugins were operating in the session.

If memory serves, the sfizz plugin only supports sfz; not sf2? Either way, I've found the Calf Fluidsynth plugin (lv2) to be completely usable. Not sure if it's the most optimal method as I do not use the instrument menus from inside Qtractor. I simply load the Calf Fluidsynth LV2 into the track and then use the plugin itself to load the sf2 or sfz I'm interested in working with.

I did not recommend Calf Fluid for several reasons.

Calf Fluid is capable of handling multiple channels at once (from the plugin interface), so it makes more sense to use it on a bus, not a track.

You also have to know that the channel number of the track must match the channel selected in Calf Fluid, which is why I consider it more complex to manage.

And finally, in Qtracktor Calf Fluid loses the name of the SondFont file (sf2).
This is because the lv2 Qtractor plugins compress this information, and apparently Calf Fluid does not know how to read it from the interface.
Since it is compressed, you cannot read it within the session xml file either.
It has already happened to me in old sessions when I opened them, and since the soundfont had changed its location, it did not load. Since this information was lost, I was unable to restore the original instrument, as I did not know what it was. I ended up playing something similar, but it wasn't the same, so I had to readjust the mix and the final master to the new sound (eq, compression, etc.).

These are the reasons why I have stopped using Calf Fluid and why I do not recommend it.

It was long to explain, but hey, since you gave me the opportunity I ended up doing it :-)

Try the fluidsynth-dssi plugin. It's so simple, it might be exactly what you want.

This is what I was using all along - but unfortunately I forgot to set different midi channels for the various instruments!

rncbc's picture


please remember that...

loading a SF2 file into a(ny) plugin that supports it, including all the fluidsynth based, on a MIDI track is quite often a annoying waste of machine resources, mainly RAM, as you probably only work on a single channel and instrument/preset at a time; multi-timbral plugin instruments are here recommended to be inserted on MIDI (output) buses.

and, either way, you'll need to take care to which exact MIDI channel is which to address the intended sounding SF2 instrument preset, always.

the SFZ spec, as is, is a single-instrument per file spec. so the above doesn't really apply; though not multi-timbral in its original spec, some sfz-supporting plugins might implement some kind of multiplexing channel mapping, and thus be regarded as multi-timbral, so to speak, where each one of several sfz files/instruments is mapped to one and only one MIDI channel, just as sf2 does (ever since the late 90s, mind you ;)) such a plugin is, once again, best inserted to a MIDI output bus (and not to a MIDI track, at least in the qtractor-model-of-things(tm):)).

hth. cheers

Although I was not on the wrong path with the SFZ, it is now clearer to me.
Thank you :).

I have been reviewing SFZ and I have verified that it does have support for presets. An XML that points to different SFZ, therefore it should be possible to make libraries.
This being the case, there really should be no preference for SF2, (since SFZ allows the instruments to be better defined). However I say it, SF2 is more portable to me. Although I think it is something more subjective than real.

As for the buses.
As I indicated above to DavidJS, I do not agree with the advantages of working in BUS. My machine is more than 10 years old and it is true that more resources are consumed, but we are talking about a more than acceptable percentage for what you get in return. Being able to work eq and other effects separately.


I thought I should experiment with this, but I can't get any sound other than the default Yamaha Grand Piano.

I created a new MIDI output bus and added FluidSynth DSSI plugin as an output plugin. I then selected this as the instrument under the MIDI heading, and set the Bank and Instrument numbers I wanted in the relevant tracks. Needless to say, I have tried quite a few other permutations of settings too but I can't get the result I want: every time I hear either the piano sound or nothing at all.

I'm probably doing something very basic incorrectly, but reading relevant sections of the manuals hasn't helped.

Can someone explain where I'm going wrong?

rncbc's picture

maybe not your fault but fluidsynth-dssi is not really suited for this scenario--actually it's the DSSI spec which is at stake iirc. it only supports one program/preset selection at a time or instance.


So I tried using Ace Fluid Synth instead. Now I get no sound at all, Although the my new output bus and the Master midi output bus both show appropriate activity when I play the relevant track(s), the Master audio bus doesn't move. Yet all the connections seem be OK.

"Although the my new output bus..."
If I understand correctly, you mean a "new" audio bus.
To obtain output on the Master audio bus you must add an "auxiliary send" on "new" audio bus to the Master audio bus.

If it is something else, you can send the session compressed in .qtz. This way we can get a clearer idea of what is happening to try to help you.

rncbc's picture

should work fine, as long you select the proper instrument, bank and program on each Track > Track Properties...

if you don't get any sound on the Master Out (Audio) then you should check whether you're actually set to send audio to it, which is the default, or you're having dedicated audio output ports for plugin instruments on the MIDI output bus in question (menu plugin > Audio > ...?)


My new bus is a MIDI bus, not audio. So far as I can see, it is set to the default and should send audio to Master Audio out. But the mixer clearly shows a signal on the new bus but no audio going out. No doubt there is something pretty basic I have misunderstood.

I am attaching a simplified version of my file - I have shortened it and removed 6 instruments and an audio track, but you can see how I have set things up. I notice that when I open the file I get a couple of messages like "fluidsynth: warning: No preset found on channel 0 [bank=0 prog=73]", but I don't understand why.

Thanks for all your help.

File attachments: 
rncbc's picture

your session file works fine here, as soon a sf2 file gets loaded--just used a pretty old one here from creative soundblaster days if it matters ;)

are you loading any? and does all the notes you're playing falls into legal note range? coz specic sf2's may restrict the note range for each of the instrument/presets that is featured.

also note that the .sf2 file(s) don't get bundled into the .qtz, so I cannot attest if you're having one or else...


How very stupid of me! You're absolutely right - I hadn't actually loaded the soundfont file into ACE FluidSynth. I think I was confused by the very different and much more complex dialog compared to what I had seen before. And I hadn't even noticed the box labelled "SF2 File:".

The available note range of the instruments is not a problem: in any case, I am well acquainted with the ranges of real (physical) instruments. I'm not sure why the flute track was empty - it wasn't supposed to be.

Thanks for your help, as always, and I apologize for sometimes being so dim.

Add new comment