Software synthesizer based on the SoundFont 2 specifications
Find a file
getraid-gg 1cdeebef37 Enable the use of UTF-8 filenames under Windows (#718)
While `fopen` (used through the macro `FLUID_FOPEN`) uses UTF-8 on *nix, it's restricted to ANSI on Windows. A change to enable using paths containing non-ANSI characters was suggested before in issue #128 but was rejected due to requiring large parts of both the public API and private implementation to be modified to accommodate Windows.

This PR instead changes the macro definition for `FLUID_FOPEN` from `fopen` to a new wrapper, `fluid_fopen`. This wrapper is defined in `fluidsynth_priv.h` and defined in `fluid_sys.c` (following the pattern of `fluid_alloc`). Under Windows, it converts the `const char*` UTF-8 parameters to Unicode `wchar_t*` strings using the Windows API function `MultiByteToWideChar` and opens the file using the Windows API-specific `_wfopen`. On all other platforms, it simply calls `fopen`.

The public API is unchanged. This solution will require Windows users of the API to convert UTF-16 strings to UTF-8 (which then get converted back into UTF-16 anyway), but that's still an improvement over only being able to use ANSI paths.

This PR also adds a new test, `test_utf8_open`, which tests `FLUID_FOPEN` directly and through `fluid_is_soundfont` and `fluid_synth_sfload` using a new soundfont file, `sf2/â– VintageDreamsWaves-v2â– .sf2`, which is just a copy of `VintageDreamsWaves-v2.sf2` with Unicode characters in the filename.
2020-12-22 11:30:14 +01:00
.circleci Update Android CircleCI build to use latest orb, Android API, Oboe and Cerbero (#690) 2020-10-20 17:09:11 +02:00
.github Update Issue templates to point to GitHub discussion 2020-12-20 12:30:42 +01:00
cmake_admin Add getopt support to CMake summary 2020-10-31 12:13:39 +01:00
doc Elaborate on synth.device-id 2020-12-18 11:57:11 +01:00
include Fx unit api (#673) 2020-11-22 21:02:06 +01:00
sf2 Enable the use of UTF-8 filenames under Windows (#718) 2020-12-22 11:30:14 +01:00
src Enable the use of UTF-8 filenames under Windows (#718) 2020-12-22 11:30:14 +01:00
test Enable the use of UTF-8 filenames under Windows (#718) 2020-12-22 11:30:14 +01:00
.appveyor-vcpkg.yml Fix cross-compilation from Win32 to ARM using vcpkg (#630) 2020-04-08 11:13:42 +02:00
.azure-pipelines-mac.yml MacOS CI: upgrade packages before installing 2020-03-05 17:17:19 +01:00
.azure-pipelines.yml Breaking unit tests for WindowsXP should be fatal 2020-12-19 14:42:17 +01:00
.cirrus.yml Replace FreeBSD 13.0 with 11.4 (#692) 2020-10-20 20:36:49 +02:00
.clang-format cmake: setup formatting targets 2018-06-24 12:59:46 +02:00
.clang-tidy Silence clang-tidy's unsafe string operations 2019-07-11 10:16:22 +02:00
.gitignore add gitignore 2017-09-23 18:17:40 +02:00
.travis.yml Remove fluid_event_any_control_change() from public API (#674) 2020-09-12 10:40:57 +02:00
AUTHORS Fix various typos 2019-12-17 20:11:49 +01:00
ChangeLog remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
CMakeLists.txt Enable the use of UTF-8 filenames under Windows (#718) 2020-12-22 11:30:14 +01:00
CONTRIBUTING.md Add documentation hints to style guide 2020-11-14 16:59:25 +01:00
fluidsynth.conf.in add systemd service files 2018-02-20 21:31:35 +01:00
fluidsynth.pc.in remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
fluidsynth.service.in Set the systemd unit target to default.target 2020-09-22 16:53:20 +02:00
fluidsynth.spec.in remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
LICENSE move README and LICENSE to top-level dir 2017-07-27 12:11:26 +02:00
README.cmake.md Update and rename README.cmake to README.cmake.md 2018-06-15 17:47:12 +02:00
README.md Add SonarQube and LGTM badges to README 2020-09-08 16:33:57 +02:00
sonar-project.properties Add SonarQube static code analysis (#671) 2020-09-06 23:43:18 +02:00
THANKS remove fop-level "fluidsynth" directory node 2017-09-03 13:30:26 +02:00
TODO Cleanup TODO 2020-02-16 15:59:11 +01:00

FluidSynth

Build Status
Linux Build Status Travis
FreeBSD Build Status
Windows Build Status
Windows (vcpkg) Build status
MacOSX Build Status
Android CircleCI

FluidSynth is a cross-platform, real-time software synthesizer based on the Soundfont 2 specification.

FluidSynth generates audio by reading and handling MIDI events from MIDI input devices by using a SoundFont. It is the software analogue of a MIDI synthesizer. FluidSynth can also play MIDI files.

SonarQube Quality Gate Status Language grade: C/C++ OHLOH Project Stats

Documentation

The central place for documentation and further links is our wiki here at GitHub:

https://github.com/FluidSynth/fluidsynth/wiki

If you are missing parts of the documentation, let us know by writing to our mailing list. Of course, you are welcome to edit and improve the wiki yourself. All you need is an account at GitHub. Alternatively, you may send an EMail to our mailing list along with your suggested changes. Further information about the mailing list is available in the wiki as well.

Latest information about FluidSynth is also available on the web site at http://www.fluidsynth.org/.

License

The source code for FluidSynth is distributed under the terms of the GNU Lesser General Public License, see the LICENSE file. To better understand the conditions how FluidSynth can be used in e.g. commercial or closed-source projects, please refer to the LicensingFAQ in our wiki.

Building from source

For information on how to build FluidSynth from source, please refer to our wiki.


Historical background

Why did we do it

The synthesizer grew out of a project, started by Samuel Bianchini and Peter Hanappe, and later joined by Johnathan Lee, that aimed at developing a networked multi-user game.

Sound (and music) was considered a very important part of the game. In addition, users had to be able to extend the game with their own sounds and images. Johnathan Lee proposed to use the Soundfont standard combined with intelligent use of midifiles. The arguments were:

  • Wavetable synthesis is low on CPU usage, it is intuitive and it can produce rich sounds

  • Hardware acceleration is possible if the user owns a Soundfont compatible soundcard (important for games!)

  • MIDI files are small and Soundfont2 files can be made small thru the intelligent use of loops and wavetables. Together, they are easier to downloaded than MP3 or audio files.

  • Graphical editors are available for both file format: various Soundfont editors are available on PC and on Linux (Smurf!), and MIDI sequencers are available on all platforms.

It seemed like a good combination to use for an (online) game.

In order to make Soundfonts available on all platforms (Linux, Mac, and Windows) and for all sound cards, we needed a software Soundfont synthesizer. That is why we developed FluidSynth.

Design decisions

The synthesizer was designed to be as self-contained as possible for several reasons:

  • It had to be multi-platform (Linux, macOS, Win32). It was therefore important that the code didn't rely on any platform-specific library.

  • It had to be easy to integrate the synthesizer modules in various environments, as a plugin or as a dynamically loadable object. I wanted to make the synthesizer available as a plugin (jMax, LADSPA, Xmms, WinAmp, Director, ...); develop language bindings (Python, Java, Perl, ...); and integrate it into (game) frameworks (Crystal Space, SDL, ...). For these reasons I've decided it would be easiest if the project stayed very focused on its goal (a Soundfont synthesizer), stayed small (ideally one file) and didn't dependent on external code.