What’s a SoundFont?
The MPTK synthesizer is based on SoundFont, a kind of library which contains hundred sounds of instruments as piano, sax, drum, … with the description (quite complex!) of how to use each sounds for each keys and velocity. Happily the complexity is hidden by MPTK!
A SoundFont can contains hundreds samples. Moreover hundreds SoundFont are available on the web!!! for free or not, on different styles (general, classic, jazz, electro, hip hop, …), with different quality and size. The possibilities are huge, quite infinite!
SoundFont(R) is a registered trademark of E-mu Systems, Inc.
The FREE version of Midi Player Tool Kit use the SoundFont GeneralUser_GS_SoftSynth_v144 from Christian Collins site here. It’s a SoundFont with a very good balancing between size and quality.
The PRO version is able to use others SoundFonts and optimize the size of sounds in your application:
- Keep only banks of interest for your application.
- Analyze your Midi files to keep only patches necessary.
So, you keep a low volume of files for your application or game.
Find and download interesting SounfFonts here:
- Don’t forget to have a look to the Christian Collins site which contains a lot of interesting information.
More of that, you can create or modify SoundFont. There are many applications for that:
- The well known Viena is free. Have a look, it’s interesting to understand how works a synthesizer based on SoundFont.
- I encourage you also to have a look here: polyphone-soundfonts. A good SoundFont editor (free also), a strong documentation and a lot of SoundFont files referenced by instrument. A must have!
Tips: try General Midi SoundFont to get a large variety of instruments and a compatibility with Midi norm.
Add a new SoundFont to MPTK [Pro]
- Download SoundFont on your computer, see above.
- Go to the menu Unity menu MPTK “SoundFont Setup”
This popup windows is displayed (empty if no SoundFont already exists):
Panel “SoundFont available”
This panel displays your list of SoundFont available for your project. You can add, remove or select SoundFont. Some information are displayed in the list: count of patches, count of waves, total size.
Button Add SoundFont
Click on the button “Add SoundFont” and select your SoundFont from your computer (filename of type .sf2). A first and quick analysis is done. Any samples are extracted.
Button Remove: delete definitively the SoundFont and all samples associated to it .
Button Default / Select: select the default SoundFont to use when playing Midi files. Only one SoundFont can be selected at the same time. But it’s possible to change the default SoundFont when running. See API documentation.
Panel “Banks available“
A SoundFont is composed with banks, each bank contains a set of patches (or preset which is a synonym), each patch can used one or more waves.
Only two banks can be enables at the same time: for the Instrument and for the Drum Kit. But you can change default when running with the MPTK API.
You can select the banks to used in the top right sub windows:
- Checkbox Keep: Choose the banks to keep or remove if your need is to lower the volume of data. Banks and relevant presets and waves will be stripped.
- Button Instrument: Choose your default bank for Instrument as Piano, Sax, Organ, Guitar. Often the first bank contains a well selected variety of instruments.
- Button Drum: Choose your default bank for Drum Kit sound. Often the last bank.
Next you have the choice : optimize your patches list depending on the Midi files defined in MPTK or get all patches and waves available.
- Button Optimize from Midi file list: each Midi Files (here, how to add Midi files in MPTK: Midi File Setup) are analyzed to detect patches and waves used. Patches and samples not used are stripped from the SoundFont to reduce the size of your project.
- Button Extract all Patchs & Waves: keep all patches and samples from the selected banks.
Warning: Extracting samples can take a while if the SoundFont is huge. From some tens of seconds to tens of minutes, during this extraction, the Unity editor is locked and don’t react to your input. Be patient! This action is only necessary at the first loading of a SoundFont.
When the work is done, the sub panel Logs displays some information about the extraction. You can save logs, open folder with the logs, clear the logs.
- Free Version is published with the SoundFont “GeneralUser_GS_SoftSynth_v144”. It’s a free sound font with a good balancing between size and quality but you can’t change it. To download the same SoundFont as for the free version, you could visit the excellent Christian Collins’s site.
- Christian Collins site here
- and search for GeneralUser GS SoftSynth version 1.44.
- Demo video here
- Don’t forget to ask authorization for copyrighted resources!