New audio output architecture for MuseScore 2.0
A recurring criticism from MuseScore users is the audio rendering quality. We have always maintained that audio comes second to notation and it continues to be the case.
Back in version 0.9, MuseScore was playing every instrument with a piano sound only. It wasn’t until version 0.9.6 that it played all General MIDI instruments. As is possible in MuseScore 1.3, we are able to choose any SF2 soundfont to render the score. So you may wonder, what is planned for MuseScore 2.0?
As a teaser, listen to Reunion by Marc Sabatella, rendered by the current development version using
FluidR3_GM.sf3 and Salamander Piano SFZ and rendered by MuseScore 1.3 using
TimGM6mb.sf2. Read on while listening!
How audio rendering works in MuseScore
Sound generation from the score is done in two steps:
- Create a MIDI-like representation of the score
- Have one or more synthesizers playing this representation and output it to the system sound card.
There are several improvements in MuseScore 2.0 regarding the first step. Crescendos, mordents and tremolo will be played, for example. There is still much to do in this area (rallentando, ritardando, more articulations and crescendo on one note, etc...), however.
For this post, we focus on the second step. Currently, MuseScore 1.3 uses a modified version of FluidSynth to read SF2 files and then output the result via the audio driver selected in Preferences → I/O. MuseScore 1.3 comes by default with a small SF2 file,
TimGM6mb.sf2 (5.69 MB). We could have included a better and bigger SF2 file, but it would have largely increased the size of the MuseScore installation package.
FluidR3_GM.sf2 for example, is 141 MB.
Improving the default playback and the SF2 standard
Why are SF2 so big? Internally and as a standard, they use uncompressed sound samples (WAV). Werner, however, had an idea of changing the standard and create a new format using compressed samples (OGG). He named it SF3 and added support for it in MuseScore.
The result is spectacular!
FluidR3_GM.sf3 is only 19 MB in size and the difference from the original SF2 is not audible. The next version of MuseScore will be packaged with this soundfont and only at an increased size of 15 MB.
In addition, it will be possible to load several SF2/SF3 files and select instruments in these soundfonts in the Mixer dialog.
MuseScore uses FluidSynth and therefore, requires SF2 soundfonts to reproduce sounds. Advanced users tend to want more options, however, so in MuseScore 2.0, the code has been made more modular and two new synthesizers have been added.
Aeolus is a synthesized - not sampled - pipe organ emulator by Fons Adriaensen in MuseScore. Being synthesized, Aeolus is also small but very realistic.
Zerberus is a new synthesizer built from scratch by Werner Schweer. The goal is to support a limited number of free SFZ soundbanks. For MuseScore 2.0, it will only support the Salamander Piano SFZ. Salamander Piano is a very high quality sample library recorded by Alexander Holm in 16 velocity layers from a Yamaha C5 Grand and licensed under Creative Commons Attribution. The full version of Salamander Piano is sampled in WAV format and is sized 1.9 GB as a result. The sound quality is extremely good, but it will cost some disk space and memory.
MuseScore has two effects: reverb and chorus. Once the sound is generated by the synthesizer, MuseScore 1.3 applies both effects. The gain of each effect can be changed in the Synthesizer dialog.
MuseScore 2.0 will provide two chained effect racks - each can host one effect. Currently, MuseScore provides only one effect Zita-rev1. More effects could be implemented/integrated - another reverb effect Freeverb is being worked on.
Saving synthesizers and effects parameters
MuseScore 1.3 doesn’t save any synthesizer settings in the score file. Changes to the soundfont, master tuning, synthesizer volume and reverb are not stored in the file, so if it’s opened elsewhere, it could sound different.
By default, MuseScore 2.0 will not save synthesizer parameters (soundfont, tuning...), or effect parameters (gain, etc...) in the score either. Nevertheless, it will be possible to save these parameters by using the “Save to score” button in the Synthesizer dialog. It will, of course, be possible to load them from the score at the same place. The other opened scores will then use the loaded parameters.
A note about the soundfont (SF2, SF3, SFZ) files: In MuseScore 1.3, it is possible to load one SF2 file directly from anywhere. MuseScore 2.0 will provide a way to configure soundfont folders. These folders will be scanned by MuseScore for available soundfonts and users will be able to choose from this list. Loading soundfonts will be easier: Just drop them in the soundfont directory and they will be available to use in MuseScore.
MuseScore 2.0 will come out of the box with a better soundfont compared to MuseScore 1.x. Advanced users will have several new ways of tuning the audio output of their scores. For developers, it will be easier to add support for other synthesizers and effects.