Creating and using custom SoundFonts in MuseScore

• created 3 months ago • last updated 3 weeks ago

    Summary

    In this tutorial we'll attempt to make a night-time forest soundtrack using some bird noises we record as samples and then include in a custom SoundFont that we'll use to make a score in MuseScore. We begin with brief instructions on the use of Audacity to record the samples, followed by a short guide to using PolyPhone to create the SoundFont. We then discuss using the custom SoundFont in MuseScore to create a sound effects track.

    The tutorial MuseScore (ForestBirdiesTrack.mscz) and SoundFont file (ForestBirdies.sf2, from zip file ForestBirdies.zip) that we create are available to download as part of this tutorial.

    There are two ways to use these files - the first if you just want to quickly see the result of the new SoundFont in a template score. The second works through a tutorial on how to create, manage and use these files.

    Option Description
    1 - Quick Start Download the two files (ForestBirdies.zip and ForestBirdiesTrack.mscz). Open the MuseScore file, load the SoundFont file into Synthesizers and listen to the birds without going through the tutorial. Section 1 describes this approach.
    2 - Follow the tutorial as you go. Follow the more detailed tutorial instructions to make your own SoundFont, and use it in your own score. Follow the instructions in Section 2 and Section 3 to learn about what's going on, and how you can make and use your own custom SoundFonts.

    Note that both Audacity and PolyPhone have detailed usage instructions online, so we try to avoid duplicating this information by focussing on just the key features required to run through the tutorial. The methods however are applicable to the creation of any custom SoundFont that can be used in MuseScore.

    References (section 4 below) list the links you can use to get hold of and use Audacity and PolyPhone.

    1. Quick start guide for playing demo Bird Noises soundtrack without following tutorial

    If you just want to quickly hear the bird noises SoundFont in action without following the tutorial, follow these instructions.

    1.1. Install the bird noises SoundFont file

    Download ForestBirdies.zip, unzip and store the file ForestBirdies.sf2 in your MuseScore SoundFonts directory. You can check this directory by going to Settings/Preferences and finding the SoundFonts directory.

    1.2. Download and open the score file

    Download and save the ForestBirdiesTrack.mscz somewhere (usually in your default Scores directory - see settings as per step 1a above.)

    1.3. Add the new SoundFont to your synthesizer list

    In View - Synthesizers click Add and add the ForestBirdies.sf2 SoundFont into the list in the first tab (Fluid). Make sure it stays as the first entry in the list (the default) so no other SoundFonts override it. If you want to add effects e.g. Reverberation, you can do so in these settings too.

    1.4. Play the track

    You should be ready to go: click 'Play' and you should hear a short C scale on a piano, followed by the bird noises.

    2. Detailed instructions for creating and using a custom SoundFont

    2.1. Recording the wooden instruments and creating sample files.

    2.1.1. Instruments used to create the SoundFont

    To create the SoundFont in this tutorial I recorded some bird noises using a set of wooden bird noise instrument (whistles etc.) purchased from a market in Arles, near Avignon, France a few years ago. They are packaged in a wooden box with a glass lid. The maker's details are listed at the end of this tutorial.

    Chant Des Oiseaux

    They're not too bad as far as realistically creating bird sounds goes, but the sounds haven't been recorded professionally - an extremely detailed topic on its own.

    2.1.2. Sampling instruments using Audacity

    The sounds were recorded using a basic microphone and recorded and processed in the freely-available Audacity software. In Audacity, the sounds were trimmed to remove silence, levels were normalized and for a couple of the files, some noise reduction and a small amount of reverberation was added. You want to leave the SoundFont sounds as natural and unprocessed as you can, giving you scope to add effects using MuseScore's Synthesizer - Master Effects.

    In Audacity, the output format used for each sample is as follows:
    16-bit, mono, sampling rate 44.1K/s .wav format
    PolyPhone will recognize the original sampling parameters when you add the samples to the SoundFont. Note however that this was not an exercise in high-end sampling given the simple, low-fidelity of the wooden instruments themselves.

    The list of sample files, their size and names are listed in a table at the end of this document. The attached SoundFont for this article (ForestBirdies.zip below) contains the original samples, which can be extracted from PolyPhone if need be (although this is not required for this tutorial).

    2.2. Creating a custom SoundFont using PolyPhone

    The SoundFont file format architecture includes the concepts of Samples, Instruments and Presets.
    The table below briefly discusses the 3 main components of a SoundFont file. In our example, we are only using the most simple properties of a SoundFont – the format allows for far more customization, but our bird noises example does not require the use of these additional settings.

    Property Purpose
    Samples SoundFonts embed your sample files into the .sf2 format. These are used to create Instruments. Samples are bound to Instruments.
    Instruments An instrument is a collection of one or more sample files, with their required key ranges, loop setting and a root key. Instruments are bound to Presets.
    Presets The ultimate sound setting you choose when using your SoundFont file in MuseScore. Presets have a bank and preset number to allow for selection in MuseScore (or any other software that uses SoundFonts), and can be set up to override key ranges, root keys and loop settings – although this overriding is not required in our example of bird noises. Presets also allow you to define MIDI settings and effects (e.g. Chorus and Reverberation) – again we do not need to override these settings so they are not discussed further.

    2.2.1. Create your new SoundFont file

    Click New SoundFont and set Product to your chosen name for the SoundFont. You can also add copyright information and free format comments.

    2.2.2. Add samples to your SoundFont

    Once you have your .wav file format (only) sounds, you add these sample files to your new SoundFont by clicking the sine wave icon (add samples) and selecting them from Finder/Explorer. To see the samples you've already added, you can click the 'up' arrow next to Samples. These arrows also function the same way for Instruments and Presets. PolyPhone also shows you an estimate of the key, based on a frequency analysis of your sample - although we ignore this as the goal is not to create a melodious track. You can also perform parametric equalization on your sample, and adjust the sample rate (neither feature is used or required for this tutorial). To keep things simple when making the SoundFont file, it's probably better to use Audacity to adjust these settings when processing the sample file itself.

    PolyPhone Add Sample

    2.2.3. Add Instruments – one per sound

    Once the samples have been added, you then add a new instrument by clicking the Speaker icon.
    PolyPhone Add Instrument

    Give your new instrument a name. In the ForestBirdies.sf2 SoundFont, make an Instrument for each sample, matching the name to the sample name (e.g. Cuckoo). Then, bind the samples to your Instrument by right clicking your sample file (e.g. Cuckoo) and select Bind to… to attach it to the corresponding instrument (Cuckoo).

    Now you can click on your instrument (Cuckoo1) and set the keyboard notes you wish to use to play the sound – do this by setting the Key Range values (e.g. 48-51 for the Cuckoo sound), corresponding to C3 to D#3 (middle C is C4). So that the SoundFont preset knows which note a sample pertains to, it's important that you set the Root Key for the instrument – this will be the number of the key that starts the key range (48 or C3) and reflects the 'original' frequency at which the sound was recorded.

    The result of these edits is that for each sound there will be 4 notes on your allocated to play the sound, starting at the root key and moving up in frequency by a semitone. When playing the notes, you can choose which of the stepped semitones you wish to use – the original frequency, or slightly higher (and faster). You will usually want to loop your sample here too: double click Loop Playback in the Instruments window for Cuckoo, and select the middle icon (ordinary looping). This type of loop simply starts playing the note again after its elapsed duration, and repeats for as long as the key is held down.

    Repeat this process for each of your samples/instruments.

    2.2.4. Create Presets for each Instrument

    Finally, you need to create Presets for each instrument: Preset settings tell the SoundFont how it will be selected in the SoundFont including the bank and preset numbers. You can also attach multiple instruments to a single preset, although this is not required in this tutorial. Click the Notes icon and enter a name for the preset (again using the same name you used for the sample and instrument e.g. Cuckoo).

    PolyPhone Add Preset

    To attach the instrument to the preset, right click the instrument and select Bind to…, selecting the corresponding preset. In our case, leave the preset settings blank, i.e. there is no need to override the instruments key range or root keys – these are picked up from your Instrument settings in the previous step.

    Save your SoundFont file, and you should have a new ForestBirdies.sf2 file, ready for use in MuseScore. The summary screen from PolyPhone shows the results of creating the SoundFont for this tutorial.
    PolyPhone Summary

    2.3. Using your new SoundFont in MuseScore

    As this tutorial is not designed to repeat detailed documentation for MuseScore, we'll simply cover the steps require to create a new score using your custom SoundFont – refer to MuseScore's documentation for more detailed information on these processes – we'll just list them in summarized format, on the assumption you can refer to the original MuseScore documentation for more information.

    2.3.1. Add your new SoundFont to MuseScore

    Identify the location of your MuseScore's SoundFont files by checking your Settings/Preferences and copying your SoundFont file to this directory location. Then, in MuseScore View – Synthesizer, click Add and select your new SoundFont file. Position the SoundFont at the top of list to ensure the bird sound plays, and not a sound from one of your other loaded SoundFonts.

    You should now be able to use the SoundFont file in your next score. Click Save to Score if you want MuseScore to load the new SoundFont file when your new score is opened. By storing the reference to the SoundFont file in your score, you can avoid cluttering up your instrument selection with unneeded SoundFont patches. Note that SoundFont files disappear from your MuseScore SoundFont directory if you delete them in the Synthesizer window – for this reason, it's a good idea to have all your SoundFonts backed up in another location ready to reload if you work on a different score using different SoundFonts.

    2.3.2. Create a score to use your SoundFont file

    In this example of a 'bird noise' score, we need a staff for each bird noise (i.e. instrument). The example SoundFont file has 6 bird noises, so we create a staff for each sound. The sample MuseScore file also has a piano instrument with a treble and bass staff, making a total of 8 staves.

    If you're using the template MuseScore file for this tutorial ForestBirdiesTrack.mscz (available to download below), the score has been set up with a staff for each instrument (bird noise).

    If you're creating a new score from scratch, select the 'closest' matching template to make this step easier: I used 'Bluegrass Band' as it contained 7 Staves. In the Instruments window, I then removed the last staff, and replaced it with treble/bass Piano staves - you can use this for accompaniment, and it's also helpful to always have a playable staff for testing.

    2.3.3. Set Stave/Part Properties and clefs for each instrument

    For each staff, select Stave/Part Properties (right click a note or rest in the staff to choose this setting) and give each staff a name matching the specific bird noise e.g. Cuckoo, Owl Long, Owl Short etc. Note that you will need to do this one-by-one, and select OK each time to update the score as pressing the up or down arrow to move through the staves does not seem to 'take' the previously set staff property.

    Take note of the clef settings in the tutorial MuseScore file too – these have been set up to reflect the key range of the corresponding instrument (bird noise).

    Remember that each instrument (bird noise) has a playable range of only 4 notes because you assigned this key range when creating the SoundFont file. Notes outside the key range play silence. To help ensure your notes for an instrument (bird noise) match that instrument's key range, you can optionally set the 'Useable pitch range' for each staff in the staff settings. To activate this feature, you'll also need to check Color notes outside of useable pitch range in Preferences – Note Input. Now, if you enter a note outside of the playable range, the note will be colored red. This has been set up in the tutorial score file for you.
    After following this process, you should have a score with 8 staves, with any notes entered outside of the instrument's key range highlighted red (viewable only after you've unselected a note in the bar).

    2.3.4. Set your instrument for each staff using the Mixer window

    In the Mixer view, you should see 8 instruments. Step through each instrument, and assign the corresponding SoundFont patch e.. for Cuckoo, choose the Cuckoo patch. Repeat this process, using the other bird noise patches for each score. The last 2 staves in this example simply use 'Grand Piano' - these staves are optional, but could be used to provide additional sounds, or a melodic overlay to the sound effect track you are making.

    2.4. Write your bird sound 'notes'

    2.4.1. Entering notes within range limits for each instrument

    Remember that when creating the SoundFont file, you set a key range e.g. Cuckoo was set to C3 to D# 3. Make sure you enter notes that fit within this range for the relevant instrument, or you won't hear any sounds! The attached MuseScore file shows the ranges for each bird noise – there are 4 notes per sound, in sequence from C3 to B4. Each sound has a key range of 4 semitones, raising the frequency slightly higher each time.

    2.4.2. Out of key note range example

    If you set up the key range settings in step 2.3.3 above, you will notice that any keys entered outside of the instrument's key range will be highlighted red - as seen in this example for notes F2 and E3 using the Cuckoo instrument:
    Cuckoo Range Example

    3. Next steps - Create your soundtrack score

    With your new SoundFont working in your new score, you are then free to use MuseScore to create the rest of your 'music' (or in this case, a soundtrack). The sample score for this tutorial simply plays each note for each bird noise within its key range – use these bars to copy and create your own night time forest soundtrack, but make sure you stick to the key range for each instrument, or you won't hear anything!

    4. References

    4.1. Files used in this tutorial

    File Name Description
    ForestBirdies.zip Zipped bird noises SoundFont file (sf2 format). This file includes the 6 samples used for the presets
    ForestBirdiesTrack.mscz MuseScore template file showing use of each bird noise in score. If you store this file in your MuseScore Templates directory, it will be available when you create new scores

    4.2. Sample files used in the SoundFont .sf2 file

    File name Size Duration (seconds) Description
    Cuckoo 1.wav 146 KB 1 Single cuckoo call
    Duck 1.wav 654 KB 3 Short 'quack'
    Duck 2.wav 940 KB 5 Longer 'quack'
    High pitched bird 1.wav 1,842 KB 10 10 seconds of random 'tweets' from small birds
    Owl 1 long.wav 543 KB 3 Generic owl – longer 3 second call
    Owl 2 short.wav 252 KB 1 Generic owl – short 1 second call

    Note that these sample files were not uploaded to this tutorial, but can be extracted from the SoundFont file if you want them.

    5. Software used in this tutorial

    5.1. PolyPhone SoundFont editing software

    https://www.polyphone-soundfonts.com

    5.2. Polyphone documentation

    https://www.polyphone-soundfonts.com/en/documentation/manual

    5.3. Audacity sound editing software

    https://audacityteam.org

    Audacity documentation and support
    https://www.audacityteam.org/help/

    6. Birdsong wooden instruments

    6.1 Craftsman maker

    Made by the woodcrafsman Alain Carpentras, from:

    Tournerie sur Bois,
    48 Impasse Clos Ste Catherine,
    84 700 Sorgues, France.

    7. Wooden set website with medal honors

    https://www.atelier-castors-appeaux.fr/

    Attachment Size
    ForestBirdies.zip 1.72 MB
    ForestBirdiesTrack.mscz 22.71 KB

    Do you still have an unanswered question? Please log in first to post your question.