• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.azure/H21-Nov-2021-1,1491,036

.circleci/H21-Nov-2021-6867

.github/H21-Nov-2021-464380

.obs/H21-Nov-2021-65

cmake_admin/H03-May-2022-1,6301,382

contrib/H07-May-2022-352222

doc/H03-May-2022-4,1743,306

include/H21-Nov-2021-2,8041,128

sf2/H03-May-2022-37,61236,616

src/H03-May-2022-64,69439,626

test/H03-May-2022-3,0622,166

test-android/H21-Nov-2021-1,343994

.cirrus.ymlH A D21-Nov-2021644 149

.clang-formatH A D21-Nov-20211.6 KiB6259

.clang-tidyH A D21-Nov-20212.7 KiB5553

.gitignoreH A D21-Nov-2021343 4234

AUTHORSH A D21-Nov-20215.4 KiB156118

CONTRIBUTING.mdH A D21-Nov-20213.2 KiB9880

ChangeLogH A D21-Nov-202171.3 KiB1,6941,290

LICENSEH A D21-Nov-202125.8 KiB505420

README.cmake.mdH A D21-Nov-20213.2 KiB11687

README.mdH A D21-Nov-20216.4 KiB10367

THANKSH A D21-Nov-20211.6 KiB4338

TODOH A D21-Nov-20211.3 KiB5945

fluidsynth.conf.inH A D21-Nov-2021208 64

fluidsynth.pc.inH A D21-Nov-2021324 1311

fluidsynth.service.inH A D21-Nov-2021334 1612

sonar-project.propertiesH A D21-Nov-2021450 1711

README.cmake.md

1## For users - how to compile FluidSynth
2
3The latest information on how to compile FluidSynth using the cmake build system can be found in our wiki:
4
5https://github.com/FluidSynth/fluidsynth/wiki/BuildingWithCMake
6
7
8## For developers - how to add a new feature to the CMake build system
9
10Let's explain this issue with an example. We are adding D-Bus support to
11FluidSynth as an optional feature, conditionally adding source files that
12require this feature. The first step is to add a macro "option()" to the main
13CMakeLists.txt file, the one that is located at the fluidsynth root directory.
14
15file CMakeLists.txt, line 64:
16
17```cmake
18option ( enable-dbus "compile DBUS support (if it is available)" on )
19```
20
21Now, let's check if the dbus-1 library and headers are installed, using
22pkg-config:
23
24file CMakeLists.txt, lines 371-377:
25
26```cmake
27unset ( DBUS_SUPPORT CACHE )
28if ( enable-dbus )
29    pkg_check_modules ( DBUS dbus-1>=1.0.0 )
30    set ( DBUS_SUPPORT ${DBUS_FOUND} )
31else ( enable-dbus )
32    unset_pkg_config ( DBUS )
33endif ( enable-dbus )
34```
35
36The first line clears the value of the CMake variable DBUS_SUPPORT. If the
37value of the option "enable-dbus" is true, then the macro  pkg_check_modules()
38is used to test a package named "dbus-1" with version 1.0.0 or later. This macro
39automatically defines the variables DBUS_LIBRARIES, DBUS_INCLUDEDIR, DBUS_FOUND
40and others. The value of the last one is assigned to our variable DBUS_SUPPORT
41for later use.
42
43There is a report to summarize the performed checks and the enabled features
44after the configuration steps, so let's add a line in this report regarding
45the D-Bus support.
46
47file cmake_admin/report.cmake, lines 14-18:
48
49```cmake
50if ( DBUS_SUPPORT )
51    message ( "D-Bus:                 yes" )
52else ( DBUS_SUPPORT )
53    message ( "D-Bus:                 no" )
54endif ( DBUS_SUPPORT )
55```
56
57The variable DBUS_SUPPORT is available for the CMake files, but we want to make
58it available to the compilers as well, to conditionally build code using
59"#ifdef DBUS_SUPPORT". This can be done adding a line to the config.cmake file:
60
61file src/config.cmake, lines 22-23:
62
63```c
64/* Define if D-Bus support is enabled */
65#cmakedefine DBUS_SUPPORT @DBUS_SUPPORT@
66```
67
68The file config.cmake will be processed at configure time, producing a header
69file "config.h" in the build directory with this content, if the dbus support
70has been enabled and found:
71
72```c
73/* Define if D-Bus support is enabled */
74#define DBUS_SUPPORT  1
75```
76
77Finally, we can add the new source files to the build system for the compiler
78target with the macro add_library(), and the libraries for the linker target
79with the macros link_directories() and target_link_libraries().
80
81file src/CMakeLists.txt, lines 57-60
82
83```cmake
84if ( DBUS_SUPPORT )
85    set ( fluid_dbus_SOURCES fluid_rtkit.c fluid_rtkit.h )
86    include_directories ( ${DBUS_INCLUDEDIR} ${DBUS_INCLUDE_DIRS} )
87endif ( DBUS_SUPPORT )
88```
89
90file src/CMakeLists.txt, lines 163-197
91
92```cmake
93link_directories (
94    ...
95    ${DBUS_LIBDIR}
96    ${DBUS_LIBRARY_DIRS}
97)
98
99add_library ( libfluidsynth
100    ...
101    ${fluid_dbus_SOURCES}
102    ...
103)
104```
105
106file src/CMakeLists.txt, lines 163-197
107
108```cmake
109target_link_libraries ( libfluidsynth
110    ...
111    ${DBUS_LIBRARIES}
112    ...
113)
114```
115
116

README.md

1# FluidSynth
2
3| | Build Status |
4|---|---|
5| <img src="https://www.kernel.org/theme/images/logos/tux.png" height="30" alt=""> **Linux** | [![FluidSynth Linux](https://github.com/FluidSynth/fluidsynth/workflows/FluidSynth%20Linux/badge.svg)](https://github.com/FluidSynth/fluidsynth/actions?query=workflow%3A%22FluidSynth+Linux%22) |
6| <img src="https://cdn.pling.com/img//hive/content-pre1/112422-1.png" height="25" alt=""> **FreeBSD** | [![Build Status](https://api.cirrus-ci.com/github/FluidSynth/fluidsynth.svg?branch=master)](https://cirrus-ci.com/github/FluidSynth/fluidsynth) |
7| <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.Win?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=3&branchName=master) |
8| <img src="https://www.microsoft.com/windows/favicon.ico" height="25" alt=""> **Windows (vcpkg)** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.vcpkg?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=6&branchName=master) |
9| <img src="https://www.apple.com/favicon.ico" height="30" alt=""> **MacOSX** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.macOS?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=5&branchName=master) |
10| <img src="https://www.android.com/favicon.ico" height="30" alt=""> **Android** | [![Build Status](https://dev.azure.com/tommbrt/tommbrt/_apis/build/status/FluidSynth.fluidsynth.Android?branchName=master)](https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=4&branchName=master) |
11| <img src="https://www.android.com/favicon.ico" height="30" alt=""> **Android** (legacy Cerbero) | [![CircleCI](https://circleci.com/gh/FluidSynth/fluidsynth/tree/master.svg?style=shield)](https://circleci.com/gh/FluidSynth/fluidsynth) |
12
13
14
15#### FluidSynth is a cross-platform, real-time software synthesizer based on the Soundfont 2 specification.
16
17FluidSynth generates audio by reading and handling MIDI events from MIDI input devices by using a [SoundFont](https://github.com/FluidSynth/fluidsynth/wiki/SoundFont). It is the software analogue of a MIDI synthesizer. FluidSynth can also play MIDI files.
18
19[![SonarQube Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=FluidSynth_fluidsynth&metric=alert_status)](https://sonarcloud.io/dashboard?id=FluidSynth_fluidsynth) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/FluidSynth/fluidsynth.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/FluidSynth/fluidsynth/context:cpp) [![OHLOH Project Stats](https://www.openhub.net/p/fluidsynth/widgets/project_thin_badge?format=gif)](https://www.openhub.net/p/fluidsynth)
20
21
22## Documentation
23
24The central place for documentation and further links is our **wiki** here at GitHub:
25
26#### https://github.com/FluidSynth/fluidsynth/wiki
27
28If you are missing parts of the documentation, let us know by writing to our mailing list.
29Of 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.
30
31Latest information about FluidSynth is also available on the web site at https://www.fluidsynth.org/.
32
33## License
34
35The source code for FluidSynth is distributed under the terms of the [GNU Lesser General Public License](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html), see the [LICENSE](https://github.com/FluidSynth/fluidsynth/blob/master/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](https://github.com/FluidSynth/fluidsynth/wiki/LicensingFAQ).
36
37## Building from source
38
39For information on how to build FluidSynth from source, please [refer to our wiki](https://github.com/FluidSynth/fluidsynth/wiki/BuildingWithCMake).
40
41## Links
42
43- FluidSynth's Home Page, https://www.fluidsynth.org
44
45- FluidSynth's wiki, https://github.com/FluidSynth/fluidsynth/wiki
46
47- FluidSynth's API documentation, https://www.fluidsynth.org/api/
48
49---
50
51## Historical background
52
53### Why did we do it
54
55The synthesizer grew out of a project, started by Samuel Bianchini and
56Peter Hanappe, and later joined by Johnathan Lee, that aimed at
57developing a networked multi-user game.
58
59Sound (and music) was considered a very important part of the game. In
60addition, users had to be able to extend the game with their own
61sounds and images. Johnathan Lee proposed to use the Soundfont
62standard combined with intelligent use of midifiles. The arguments
63were:
64
65- Wavetable synthesis is low on CPU usage, it is intuitive and it can
66  produce rich sounds
67
68- Hardware acceleration is possible if the user owns a Soundfont
69  compatible soundcard (important for games!)
70
71- MIDI files are small and Soundfont2 files can be made small thru the
72  intelligent use of loops and wavetables. Together, they are easier to
73  downloaded than MP3 or audio files.
74
75- Graphical editors are available for both file format: various
76  Soundfont editors are available on PC and on Linux (Smurf!), and
77  MIDI sequencers are available on all platforms.
78
79It seemed like a good combination to use for an (online) game.
80
81In order to make Soundfonts available on all platforms (Linux, Mac,
82and Windows) and for all sound cards, we needed a software Soundfont
83synthesizer. That is why we developed FluidSynth.
84
85### Design decisions
86
87The synthesizer was designed to be as self-contained as possible for
88several reasons:
89
90- It had to be multi-platform (Linux, macOS, Win32). It was therefore
91  important that the code didn't rely on any platform-specific
92  library.
93
94- It had to be easy to integrate the synthesizer modules in various
95  environments, as a plugin or as a dynamically loadable object. I
96  wanted to make the synthesizer available as a plugin (jMax, LADSPA,
97  Xmms, WinAmp, Director, ...); develop language bindings (Python,
98  Java, Perl, ...); and integrate it into (game) frameworks (Crystal
99  Space, SDL, ...). For these reasons I've decided it would be easiest
100  if the project stayed very focused on its goal (a Soundfont
101  synthesizer), stayed small (ideally one file) and didn't dependent
102  on external code.
103