Compare commits

...

665 commits

Author SHA1 Message Date
Marisa Heit
2867c8d8db Fix potential race condition when creating detached threads 2022-07-25 21:15:29 -05:00
Marisa Heit
b58d142dd9 Fix test cases 2022-07-24 22:47:32 -05:00
Marisa Heit
32f4347d26 Use native Win32 API instead of glib on Windows
- Don't look for PkgConfig on Win32.
- Don't force glib and gthread on Win32.
- Support finding libsndfile with vcpkg.
- Add enable-static-msvcrt option to use the static VC runtime library.
- Add stubs that define glib functions to Win32 equivalents.
2022-07-24 22:47:32 -05:00
derselbst
85fcbde9e0 Merge remote-tracking branch 'origin/2.2.x' into master 2022-07-10 18:18:30 +02:00
derselbst
7e3fdc9056 Bump to 2.2.8 2022-07-10 00:05:56 +02:00
Bill Peterson
57554ee35a Reorder LADSPA fx mixing
This PR moves mixing of LADSPA effects in fluid_rvoice_mixer_process_fx() before mixing of the internal reverb and chorus effects.

Currently, if a user sets synth.audio-groups >1, LADSPA effects can be applied to specific MIDI channels only. The user can then follow @mawe42's great suggestion from the mailing list and use a zero-gain amp effect to mix the LADSPA buffers back to the first host port for output to the sound card (This seems like the most proper way to do this IMO - the LADSPA subsystem shouldn't have to figure out what FluidSynth's audio output channels are on its own).

However, since the internal reverb and chorus are applied first and don't care about synth.audio-groups, the LADSPA effects will appear in the internal effects buffers regardless of which audio_group the currently-playing MIDI channels are part of. Increasing synth.effects-groups is not ideal since it adds a lot of processing load, and also would seem to require that effects-groups always be equal to audio-groups. A user could disable the internal reverb and chorus and add them as LADSPA effects, but it's nice to be able to have backing instruments or tracks from MIDI files play "normally" (i.e. according to the soundfonts' reverb and chorus settings), while a user plays lead with interesting effects that don't alter the backing voices.

Resolves #1117.
2022-06-27 17:45:59 +02:00
derselbst
24898c126d Merge branch '2.2.x' into master 2022-06-27 17:43:09 +02:00
derselbst
1f8c6a4633 Minor cleanup 2022-06-27 17:39:18 +02:00
Pedro López-Cabanillas
9910b0dc9b Adding audio.periods setting to the fluid_pulse audio driver
This common setting was ignored by the PulseAudio driver.
It doesn't change the synthesis buffer size, which is still
the number of frames specified by audio.period-size, but
the number of periods may be raised to request a higher latency
amount, unless audio.pulseaudio.adjust-latency is 1 (the
default). In turn, PulseAudio will grant or not this latency
request. See: [PulseAudio Latency
Control](https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/LatencyControl/).
2022-06-27 17:39:18 +02:00
Tom M
a50680aafa
Add warnings and extend documentation for issue #1120 (#1126) 2022-06-27 17:26:15 +02:00
Tom M
3a3ed4f783
Fix system-wide config file not loaded (#1121) 2022-06-23 20:32:29 +02:00
Marcus Weseloh
b274aaefba
Wording and typo fixes for LADSPA documentation 2022-06-20 21:02:49 +02:00
derselbst
58ec0d8eb7 Fix div by zero in fluid_player_set_tempo() 2022-06-15 22:07:44 +02:00
Tom M
41f00ec8cb
Merge pull request #1115 from albedozero/system_realtime
Modify select drivers to pass system realtime messages
2022-06-11 17:35:34 +02:00
derselbst
3591299ea0 Format recent code changes 2022-06-11 17:26:09 +02:00
Bill Peterson
ff362b52cd fluid_midi_parser_parse pass all realtime messages 2022-06-10 03:50:08 -05:00
Bill Peterson
fe7fa3e309 winmidi pass system realtime messages 2022-06-10 03:49:36 -05:00
Bill Peterson
1b4b7ddbfe alsa_seq pass system realtime messages 2022-06-10 03:49:30 -05:00
Tom M
b675a392ea
Fix CI builds after update (#1114) 2022-06-10 09:47:08 +02:00
derselbst
f06619e079 Merge remote-tracking branch 'origin/2.2.x' into master 2022-05-28 22:28:33 +02:00
derselbst
a293761e44 Fix several flaws in example.c 2022-05-28 22:28:09 +02:00
Tom M
7ede2382d3
More precise wording for new_fluid_audio_driver() 2022-05-26 12:56:56 +02:00
derselbst
0e0a287be4 Merge remote-tracking branch 'origin/2.2.x' into master 2022-05-23 00:40:27 +02:00
Tom M
0d0b4d4b84
Fix universal MacOS CI build (#1106)
Do not build libomp, because it depends on cmake-bootstrap, which for some reason tries to execute a unit test compiled for arm64, which obviously fails on a x86_64 host.
2022-05-23 00:37:23 +02:00
derselbst
d554067fc5 Fix size_t to int truncation in fluid_wasapi_finddev_callback() 2022-05-21 21:35:16 +02:00
derselbst
f013e82d58 Fix size_t to int truncation in new_fluid_midi_file() 2022-05-21 20:48:39 +02:00
Tom M
eff5da51c4
Add universal build to Mac CI pipeline (#1096) 2022-05-10 23:15:09 +02:00
derselbst
308cf73796 Restore orphaned enable-openmp 2022-04-27 20:40:54 +02:00
derselbst
2779d5b2b8 Merge branch '2.2.x' into master 2022-04-25 20:25:47 +02:00
derselbst
1daf078708 Bump to 2.2.7 2022-04-25 20:18:10 +02:00
Tom M
50003761c1
Bump minimum required SDL2 version
due to SDL_HINT_NO_SIGNAL_HANDLERS
2022-04-23 09:58:05 +02:00
derselbst
4ee4b0403e Fix Fluidsynth not responding to either SIGTERM nor SIGINT
with recent SDL2
2022-04-22 23:38:33 +02:00
derselbst
a0ca05e16d Merge branch '2.2.x' into master 2022-04-21 14:17:01 +02:00
derselbst
0771899e3f Update vcpkg ref to fix CI pipeline 2022-04-21 14:15:33 +02:00
Tom M
0995727374
Merge pull request #1080 from FluidSynth/issue1078
Add a function to create a sequencer event from a midi event
2022-04-21 13:26:07 +02:00
derselbst
cd0b3ce0c5 Amend documentation of audio.coreaudio.channel-map 2022-04-21 13:22:24 +02:00
Tom M
486e3f34d7
Merge pull request #1081 from mattrtaylor/coreaudio-channel-map
Multi-channel output for the CoreAudio driver.
2022-04-21 13:01:39 +02:00
Matt Taylor
b80ad6ecf5 Add an 'empty string' default value to the audio.coreaudio.channel-map setting documentation to be consistent with other entries. 2022-04-19 14:54:26 -06:00
Matt Taylor
034f316d2c Remove the default value from the audio.coreaudio.channel-map setting documentation. 2022-04-19 14:52:19 -06:00
Matt Taylor
2bf041cf76 Update documentation to more clearly indicate what happens if there are more outputs than specified in the channel map.
https://github.com/FluidSynth/fluidsynth/pull/1081#discussion_r853428937
2022-04-19 14:45:48 -06:00
Matt Taylor
552bfce3ed Initialize newly allocated channel map with a value of -1 (off) for all channels.
https://github.com/FluidSynth/fluidsynth/pull/1081#discussion_r853430986
2022-04-19 14:33:13 -06:00
Matt Taylor
ab0b79c114 Print debug log message when channel map value is out of range.
https://github.com/FluidSynth/fluidsynth/pull/1081#discussion_r853437544
2022-04-19 14:31:52 -06:00
derselbst
15529d50a8 Make MIDI Event API const correct 2022-04-19 22:15:18 +02:00
derselbst
2acb068075 Fix C90 build 2022-04-19 22:15:03 +02:00
Tom M
a9d555ff50
WinXP CI build: use x87 FPU (#1083) 2022-04-19 22:00:47 +02:00
Matt Taylor
7e081d700b Add a safety check in case CoreAudio provides more buffers than were allocated. 2022-04-15 15:13:07 -06:00
Matt Taylor
326d90e952 Add an 'audio.coreaudio.channel-map' setting to enable multi-channel output routing for CoreAudio. 2022-04-15 14:08:21 -06:00
Matt Taylor
49a3b410f0 Enable the 'synth.audio-channels' setting for the CoreAudio driver. 2022-04-15 12:07:53 -06:00
derselbst
757b151601 Move fluid_event_from_midi_event() to fluid_event.c 2022-04-12 21:45:19 +02:00
JimHenry
719b525e2b Add @note and @code to fluid_event_from_midi_event() documentation block. 2022-04-12 10:40:23 +02:00
JimHenry
b1a28624ba Add fluid_event_from_midi_event(fluid_event_t *evt, const fluid_midi_event_t *event) to create a sequencer event from a midi event. Issue #1078 2022-04-12 10:37:29 +02:00
Tom M
88e039efeb
Fix fluid_curtime() returning very incorrect timings (#1076) 2022-04-05 22:10:39 +02:00
derselbst
8b00644751 Bump to 2.2.6 2022-03-19 12:49:15 +01:00
derselbst
5dcae73657 Merge branch '2.2.x' into master 2022-03-15 21:37:23 +01:00
derselbst
8784dbbc74 Elaborate on MSB and LSB handling, #1052 2022-03-15 21:35:32 +01:00
Tom M
c037dde536
Merge pull request #1067 from FluidSynth/issue1059
Prevent ModEnv from being stuck in decay phase
2022-03-15 21:11:29 +01:00
derselbst
2715e4bc98 Compile libpcre and complete building glib with meson 2022-03-06 15:48:30 +01:00
devingryu
c88ed31585 WIP: Glib building with meson for Android 2022-03-06 15:19:10 +01:00
derselbst
344796a6a8 Potential fix for #1059
Apply Christian's decay to sustain transition hack to modenv as well.
2022-03-06 12:21:38 +01:00
derselbst
122066ca6d Cosmetic changes 2022-03-06 12:19:27 +01:00
derselbst
80611111e9 Merge branch '2.2.x' into master 2022-03-05 17:16:05 +01:00
devingryu
22144a4fa3 Fix oboe driver build issue in latest glib 2022-03-05 17:14:00 +01:00
Tom M
bf23f7a2a5
Merge pull request #1055 from FluidSynth/reset-cc
Fix some broken behaviour around ALL_CTRL_OFF
2022-03-03 20:23:49 +01:00
Tom M
fa619aaae8
Update Android CI to use FLAC 1.3.4 (#1056)
Update Pipeline from master and bump FLAC to 1.3.4
2022-02-26 00:05:04 +01:00
derselbst
764ceae1ef Fix Sustained voices being held after ALL_CTRL_OFF 2022-02-25 18:47:47 +01:00
derselbst
62ed1c813d Fix Portamento FromKey issue 2022-02-25 18:29:31 +01:00
derselbst
ea9758a2ed Add a unit test for ALL_CTRL_OFF 2022-02-25 18:29:31 +01:00
Brad Howes
8d00f6cdac Proper version check. validated on macOS 11.6.1 and macOS 12.2.1 2022-02-25 17:18:13 +01:00
derselbst
43282855dd Update documentation about dynamic-sample-loading 2022-02-25 15:09:06 +01:00
derselbst
3ac9b6fbf0 Merge branch '2.2.x' into master 2022-02-20 18:27:41 +01:00
Tom M
adc2794ef6
Merge pull request #1038 from FluidSynth/oss-new
Revise OSS driver a bit
2022-02-20 18:26:41 +01:00
Brad Howes
a5bdbd57e2 Improvements on patches from feedback. 2022-02-20 18:20:16 +01:00
Brad Howes
d8113d497b Consider earlier releases 2022-02-20 18:20:07 +01:00
Brad Howes
ac0aab2fa0 Silence compiler warnings on macOS 2022-02-20 18:19:54 +01:00
Tom M
0b4fa214b6
Initialize Pipewire with pw_init() (#1032)
Before you using any PipeWire functions, one must call pw_init() (e.g. https://docs.pipewire.org/page_tutorial1.html)
2022-01-29 13:13:25 +01:00
devingryu
b89898ef7f
Use project-specific SOURCE_DIR and BINARY_DIR (#1040) 2022-01-29 13:11:29 +01:00
derselbst
4a36f0b085 Undeprecate OSS as it's needed on BSD 2022-01-28 16:35:35 +01:00
derselbst
3e0321f49c Remove FIXME in OSS driver
Why shouldn't we reuse the int16 buffer for dithering before streaming to OSS?
2022-01-28 16:35:07 +01:00
derselbst
0c4342b461 Fix a memory leak in OSS driver 2022-01-28 16:30:53 +01:00
derselbst
d6903d0ff7 Fix Time-of-check time-of-use race condition in OSS driver 2022-01-28 16:30:51 +01:00
derselbst
91515b09c4 Merge remote-tracking branch 'origin/2.2.x' into master 2022-01-24 14:29:20 +01:00
Tom M
59fdc3795b
Compile demos during CI builds (#1037) 2022-01-23 15:33:33 +01:00
derselbst
290ab8402b Extend error logging for SysEx DT1 messages
Related to #1035
2022-01-22 12:05:02 +01:00
derselbst
634a8b0c04 Correctly override MacOS Framework installation prefix 2022-01-18 09:12:50 +01:00
derselbst
166f767767 Add a note about headers and MacOS frameworks 2022-01-18 09:12:50 +01:00
Pedro López-Cabanillas
8a96ec9c3a cmake macos frameworks update
The framework target needs to know about the headers, so cmake tries to copy the framework files into the bundle.
The macro set_source_files_properties() is a modern (cmake >= 3.0) replacement of the general set_property().
2022-01-18 09:12:50 +01:00
derselbst
bee42dd5cc Call make install in Mac CI pipeline 2022-01-18 09:12:50 +01:00
derselbst
f4f897d3bf Update MacCI pipeline from master 2022-01-18 09:12:50 +01:00
derselbst
b580a112c1 Remove orphaned tarball target 2022-01-16 15:53:44 +01:00
derselbst
dbd7e728b6 Bump to 2.2.5 2022-01-16 15:48:31 +01:00
Tom M
e3d8b3f2c3
Prevent samples accidentally having their loops disabled (#1018)
If a SoundFont sets `loopstart == loopend` and then uses loop-offset-modulators to fix up those loops assigning them with a valid position, the sample was previously switched to unlooped mode erroneously.

For the long story, see #1017.
2022-01-16 14:35:53 +01:00
Tom M
b7a0264459
Show a warning when file renderer is use with more than one stereo channel (#1028)
Resolves #1026
2022-01-16 14:33:52 +01:00
derselbst
3229899a34 Deprecate OSS driver 2022-01-16 14:32:46 +01:00
derselbst
dc24dcd435 Deprecate MidiShare driver 2022-01-16 14:32:46 +01:00
Tom M
015c6af52d
Fix regression from #969 (#1016)
In the previous CMake change the pkgconfig file was accidentally not installed anymore. Didn't recognized this earlier, because the OBS CI workflow was broken and therefore not running.
2022-01-04 16:55:15 +01:00
Tom M
46998a9d21
Update README.md (#1015)
Remove legacy cerbero build badge. Since the CMake update it's now completely broken.
2022-01-04 16:48:29 +01:00
derselbst
47d57bfe78 Merge remote-tracking branch 'origin/2.2.x' into master 2022-01-04 16:20:04 +01:00
Tom M
4eb3afe8a4
Attempt to fix OBS Ci build 2022-01-04 16:19:30 +01:00
Tom M
6b96c19b01
Merge pull request #969 from FluidSynth/cmake-modernization
CMake Modernizations
2022-01-04 15:12:52 +01:00
derselbst
870ae6be88 Merge branch '2.2.x' into master 2022-01-03 18:11:59 +01:00
Arthur Cosentino
ab3ab92c15 Fix grammatical error in error message
Resolves #1014
2022-01-03 18:09:24 +01:00
Tom M
13b376819c
Merge pull request #901 from paulsapps/glib_optional
Outsource a few GLIB related functions to fluid_sys
2021-12-21 13:09:09 +01:00
derselbst
881236dc03 Revert GLIB_SUPPORT macro and CMake related changes 2021-12-21 12:34:17 +01:00
derselbst
a173da91da Update libffi in Android CI pipeline 2021-12-20 19:02:29 +01:00
derselbst
76639ecf33 Cleanup Android CI Pipeline
Always print out cmake log files
2021-12-20 18:01:30 +01:00
derselbst
bf83911631 Fix Android CI Build
by explicitly enabling C language extensions. This will cause the
std=gnu90 to be passed via CMAKE_REQUIRED_FLAGS, making clang know about
the inline keyword rather than failing when querying for the netinet
headers:

/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64//sysroot/usr/include/linux/swab.h:39:8: error: unknown type name 'inline'
static inline __attribute__((__const__)) __u32 __fswahw32(__u32 val) {
2021-12-20 17:55:42 +01:00
derselbst
ce6e270a41 Fix PC_REQUIRES_PRIV related overlinking in fluidsynth.pc 2021-12-20 16:21:08 +01:00
derselbst
d9f95b77d4 Fix pkgconfig file generation after merge from master 2021-12-20 16:11:38 +01:00
derselbst
cfc5d722ec Modernize Pipewire cmake usage 2021-12-20 16:01:42 +01:00
derselbst
d47f53518e Merge branch 'master' into cmake-modernization 2021-12-20 15:56:02 +01:00
derselbst
8eaa91bf3b Remove obsolete comment from fluidsettings.xml
It's generated automatically by cmake.
2021-12-11 17:22:09 +01:00
derselbst
0d92eba476 Revert "Add Pipewire driver to Linux CI build"
This reverts commit 30e80abe77. Pipewire
is not yet available on Ubuntu 20.*
2021-12-11 17:21:31 +01:00
derselbst
776b4510c1 Remove MacOS 10.14 build 2021-12-11 17:16:45 +01:00
derselbst
72b74820a9 Document new pipewire settings 2021-12-11 17:16:02 +01:00
derselbst
30e80abe77 Add Pipewire driver to Linux CI build 2021-12-11 17:02:35 +01:00
derselbst
69113aad89 Format Pipewire driver 2021-12-11 17:00:30 +01:00
derselbst
3bc4e88903 Use FLUID_FREE 2021-12-11 17:00:04 +01:00
derselbst
94c459970e Fix pipewire build 2021-12-11 16:59:36 +01:00
Tom M
e63ea6698e
Merge pull request #982 from sykhro/master
[RFC] PipeWire audio driver
2021-12-11 16:56:16 +01:00
Eli M
6292e2c04d Add PipeWire driver to the build system
Signed-off-by: E. Melucci <eli@meluc.ci>
2021-12-07 17:17:16 +01:00
Eli M
c831deb81c Add PipeWire driver to the audio drivers list 2021-12-07 17:17:16 +01:00
Eli M
5b36a556fe Implement PipeWire driver
Signed-off-by: E. Melucci <eli@meluc.ci>
2021-12-07 17:17:16 +01:00
derselbst
56034e7f2b Fix vcpkg CI pipeline
vcpkg repo seems now to be a complete repo rather than shallow as before
2021-12-05 17:45:10 +01:00
Tom M
056e29ea59 Make Android CI Pipeline fail correctly
Only execute the steps when succeeded()
2021-11-27 10:46:31 +01:00
KO Myung-Hun
56fd559860 Fix failure due to list JOIN sub-command
list JOIN sub-command is supported since v3.12.
2021-11-27 10:34:16 +01:00
derselbst
6c807bdd37 Bump to 2.2.4 2021-11-21 16:40:48 +01:00
Bill Peterson
a3dd7fddcb
Rewind playlist if calling fluid_player_play after all loops complete (#994) 2021-10-30 15:01:58 +02:00
derselbst
a01917baa2 Remove enable-debug cmake option 2021-10-17 18:31:43 +02:00
derselbst
bb3bc6da26 Remove enable-pkgconfig cmake option 2021-10-17 18:31:07 +02:00
derselbst
90da8af70f Merge branch 'master' into cmake-modernization 2021-10-17 18:23:09 +02:00
Nikos Chantziaras
de05ef2a1c
Fix static mingw linking issues (#990)
* add missing link to libmman
* more complete list of private dependencies in pkg-config file
2021-10-17 18:12:49 +02:00
Tom M
fa75468595
Add a static MinGW CI build (#992) 2021-10-17 14:43:30 +02:00
Yu Qing
7ef8652326
fix windows related encoding problems (#984) 2021-10-03 12:15:57 +02:00
Nikos Chantziaras
db5db4b845
Add cmake build option for disabling OpenMP (#986)
In my case this is because of issue #985, but there's also the use case of being able to test without OpenMP. For example, to disable it on my system in order to test if the crash had anything to do with OpenMP, I had to manually edit `CMakeLists.txt` each time I wanted to turn it off and on again.
2021-09-28 21:53:08 +02:00
Bill Peterson
6c593180ce
Per-channel ALL_SOUND_OFF when seeking/stopping player (#980)
- Only send all sound off on channels which had notes playing
- Send it as ALL_SOUND_OFF CC to a MIDI router to route it to a different synth channel afterwards
2021-09-28 21:29:26 +02:00
Pedro López-Cabanillas
1ddf4c54cf Debian packaging adapted to GNUInstallDirs 2021-09-15 22:56:05 +02:00
Pedro López-Cabanillas
563592aa3d Adopting GNUInstallDirs
* removed and/or replaced most definitions from DefaultDirs.cmake
* removed LIB_SUFFIX
* fixed DEFAULT_SOUNDFOUNT in Windows
2021-09-15 22:56:05 +02:00
derselbst
926581851e Bump to 2.2.3 2021-09-11 18:26:35 +02:00
derselbst
27d357ed31 Add non framework Mac CI build 2021-09-11 18:17:20 +02:00
derselbst
1d9957f14b Merge branch 'master' into cmake-modernization 2021-09-11 18:10:23 +02:00
Pedro López-Cabanillas
6a0d838f33 Fixed OpenMP detection and building, better PkgConfigHelpers.cmake 2021-09-11 18:09:52 +02:00
Tom M
054685fa67
Merge pull request #973 from pedrolcl/no-global-macros
No global macros
2021-09-07 22:49:54 +02:00
Tom M
6e123d6ef0
Add MacOS 11 CI Build (#975) 2021-09-07 22:10:29 +02:00
Pedro López-Cabanillas
b23dc4e961 fixed compilation of CLI client 2021-09-05 22:37:25 +02:00
Pedro López-Cabanillas
55678a078a new macros in pkgconfighelpers.cmake
* sanitize_target_dirs(target) removes include and link directories that
do not exist from the given immported target
* generate_pkgconfig_spec() builds fluidsynth.pc taking the private
libraries from a given target dependencies
2021-09-05 21:56:52 +02:00
Pedro López-Cabanillas
19b9a12e4f fixed link CLI program 2021-09-05 12:09:54 +02:00
Pedro López-Cabanillas
5a71336bd9 replaced global include_directories and link_directories
* by target_include_directories
* by target_link_libraries, using imported targets when possible
2021-09-05 11:30:25 +02:00
Pedro López-Cabanillas
21aca082a9 less property dance 2021-09-04 20:38:17 +02:00
Pedro López-Cabanillas
66b77bfb6f
cmake modernization, tasks 1 & 2 (#970)
* raised cmake_minimum_required ( VERSION 3.13 )
* removed other CMAKE_VERSION checks
* fixed overlinking of library, cmdline client, and unit tests
2021-09-03 12:21:05 +02:00
derselbst
1e6c5b75e3 Add .cmake build files to .spec file 2021-09-01 21:04:33 +02:00
Pedro López-Cabanillas
ebed81099d Clarifications 2021-09-01 21:03:10 +02:00
Pedro López-Cabanillas
7ca3407d30 fixes and simplifications
* FluidSynthConfigVersion.cmake is created with ${VERSION} instead of
${LIB_VERSION_INFO}
* FluidSynthConfig.cmake.in simplified: it doesn't need to include the
version file.
* Simplified BUILD_INTERFACE generator expression as suggested
2021-09-01 21:00:30 +02:00
Pedro López-Cabanillas
ad4f1b9191 cmake: export targets
The build system creates two exported targets:
- The executable FluidSynth::fluidsynth
- The library FluidSynth::libfluidsynth

A downstream project using CMake can find and link the library target
directly with cmake (without needing pkg-config) this way:

~~~
project(sample LANGUAGES C)
find_package ( FluidSynth )
if (FluidSynth_FOUND)
  add_executable( sample sample.c )
  target_link_libraries ( sample PRIVATE FluidSynth::libfluidsynth )
endif ()
~~~

After installing fluidsynth in a prefix like "$HOME/Fluidsynth3":
cmake -DCNAKE_PREFIX_PATH="$HOME/Fluidsynth3/;..."

Instead installing, the build directory can be used directly, for
instance:

cmake -DFluidSynth_DIR="$HOME/fluidsynth-2.2.2/build/" ...
2021-09-01 21:00:18 +02:00
Tom M
f6fa0290b7
Merge pull request #967 from FluidSynth/revert-943-wip-cmake-export-targets
Reverts most of #943 on master as it accidentally broke compilation with CMake < 3.11, but keep the build files for OBS.
2021-09-01 20:58:02 +02:00
derselbst
a244420666 Add necessary files for CI at OBS 2021-09-01 19:54:08 +02:00
derselbst
e6ce0f4845 Remove fluidsynth.spec.in in favor of contrib/fluidsynth.spec 2021-09-01 19:53:58 +02:00
Tom M
fab1ca1ca9
Revert "cmake: export targets" 2021-08-30 16:07:53 +02:00
Tom M
ec0d6e011e
Merge pull request #943 from pedrolcl/wip-cmake-export-targets
cmake: export targets
2021-08-28 23:50:04 +02:00
derselbst
5e1fbf1866 Add necessary files for CI at OBS 2021-08-28 23:36:10 +02:00
derselbst
fefd22a9d6 Remove fluidsynth.spec.in in favor of contrib/fluidsynth.spec 2021-08-28 23:23:34 +02:00
Tom M
c1e286629f
Fix NULL deref in delete_fluid_ladspa_effect() (#963) 2021-08-23 20:04:44 +02:00
Nihal
2fafca42a1
fix typo (#954) 2021-08-07 13:35:04 +02:00
Pedro López-Cabanillas
f023d7e014 Reverted PRIVATE in target_link_libraries() and clarifications 2021-08-02 11:31:43 +02:00
Pedro López-Cabanillas
64a7787e90 fixes and simplifications
* FluidSynthConfigVersion.cmake is created with ${VERSION} instead of
${LIB_VERSION_INFO}
* FluidSynthConfig.cmake.in simplified: it doesn't need to include the
version file.
* Simplified BUILD_INTERFACE generator expression as suggested
2021-08-02 11:31:43 +02:00
Pedro López-Cabanillas
cf5fbac9af cmake: export targets
The build system creates two exported targets:
- The executable FluidSynth::fluidsynth
- The library FluidSynth::libfluidsynth

A downstream project using CMake can find and link the library target
directly with cmake (without needing pkg-config) this way:

~~~
project(sample LANGUAGES C)
find_package ( FluidSynth )
if (FluidSynth_FOUND)
  add_executable( sample sample.c )
  target_link_libraries ( sample PRIVATE FluidSynth::libfluidsynth )
endif ()
~~~

After installing fluidsynth in a prefix like "$HOME/Fluidsynth3":
cmake -DCNAKE_PREFIX_PATH="$HOME/Fluidsynth3/;..."

Instead installing, the build directory can be used directly, for
instance:

cmake -DFluidSynth_DIR="$HOME/fluidsynth-2.2.2/build/" ...
2021-08-02 11:31:43 +02:00
Tom M
ff6b4db503
Update Linux CI (#953) 2021-07-31 21:32:36 +02:00
Tom M
8e56188316
Define socklen_t in according to a feature test (#949)
Co-authored-by: KO Myung-Hun <komh@chollian.net>
2021-07-28 11:00:27 +02:00
Tom M
ec6d563c39
Fix VERSION_GREATER_EQUAL for CMAKE < v3.7 (#950)
VERSION_GREATER_EQUAL was introduced in CMAKE v3.7.

Co-authored-by: KO Myung-Hun <komh@chollian.net>
2021-07-28 10:49:57 +02:00
Evan Miller
c68a10ca13
Restore support for Mac OS X 10.5 and earlier (#947)
Expands on #803 and closes #946.

Tested on macOS 11.4 as well as 10.4.
2021-07-28 10:20:48 +02:00
derselbst
62b60ae161 Add OBS Workflow
Continuous Integration with OBS for various Linux Distros as described here:
https://openbuildservice.org/2021/05/31/scm-integration/

Secret Github Token is owned by @derselbst
Secret OBS Token is owned by build.opensuse.org/users/derselbst
Fluidsynth Github Repo Webhook currently only set up for PullRequest
events (because it's the only event type supported by OBS, at the moment)
2021-07-27 22:47:08 +02:00
Tom M
1511b5a575
Merge pull request #942 from Ghabry/emscripten
Emscripten: Fix CMake issues
2021-07-19 14:01:05 +02:00
Ghabry
0e3411cba4 Emscripten: --as-needed is not supported 2021-07-19 00:36:31 +02:00
Ghabry
475f902584 Fix emscripten: Append CMAKE_MODULE_PATH instead of overwriting it
Emscripten adds a custom CMAKE_MODULE_PATH in the toolchain file.
Without these modules TestBigEndian fails.
2021-07-19 00:27:34 +02:00
Atsushi Eno
4240d31e51
Implement Android Oboe audio error recovery mode. (#940)
Context: https://github.com/FluidSynth/fluidsynth/discussions/931

There is a new settings "audio.oboe.error-recovery-mode" which has
string value of "Reconnect" (default) or "Stop".

Under `Reconnect` mode, it automatically recreate AudioStream for the
same audio device ID (which is the default = valid device, unless a
specific ID is specified). The behavior is the same as OpenSLES.

In the future Fluidsynth might want to provide consistent error handling
mode for audio device unplugged state, but so far this change makes apps
behave not too weird.
2021-07-15 21:40:07 +02:00
Tom M
fc21d284dc
Fix Fluidsynth.pc doesn't include static libraries (#933) 2021-07-11 17:37:54 +02:00
Tom M
a0ec2c5932
Merge pull request #939 from luzpaz/typos
Fix source comment typos
2021-07-10 17:24:52 +02:00
luz paz
e4c8ef080c Fix source comment typos
Found via `codespell -q 3 -S ChangeLog -L bloc,blocs,capela,parms,readd,seh`
2021-07-10 08:44:35 -04:00
derselbst
aa2561d091 Bump to 2.2.2 2021-07-09 21:56:04 +02:00
Curtis "Fjord" Hawthorne
346331020b
Update license header (#937) 2021-07-09 20:32:47 +02:00
Bill Peterson
be79856caa
Only send all_notes_off when stopping player (#934) 2021-07-06 11:04:59 +02:00
Tamás Korodi
e096919477
Select soundfont samples by frequency instead of midi note numbers (#932)
For detuned channels it might be better to use another key for Soundfont sample selection
giving better approximations for the pitch than the original key.
Example: play key 60 on 6370 Hz => use tuned key 64 for sample selection

This feature is only enabled for melodic channels.
For drum channels we always select Soundfont samples by key numbers.
2021-07-05 00:47:47 +02:00
Pedro López-Cabanillas
7ff164d8ab
wasapi: increase initialization timeout to 2 seconds, same as shutdown timeout (#929)
The 2 seconds timeout was chosen for consistency, but the reason to increase the initialization timeout is that one of my test devices (Asus T101HA, Windows 10) fails to initialize the wasapi driver with a timeout error most of the times.
2021-07-02 17:09:44 +02:00
Bill Peterson
bfca737a7c
autoconnect all available effects ports (#927)
Step through all available effects outputs and connect them to jack inputs, and wrap around if there are fewer input ports than effects outputs.
2021-06-30 18:44:14 +02:00
Tom M
92089e0a0f
Make audio.jack.autoconnect connect all available ports (#923) 2021-06-27 11:45:52 +02:00
Tom M
95e3693779
Fix linkage of openMP for XCode 12.5 (#919) 2021-06-22 09:23:19 +02:00
Tom M
15bd824af0
Merge pull request #913 from atsushieno/android-testing-rebased
Add Android testing setup
2021-06-14 08:53:55 +02:00
atsushieno
9eb855a96d Add flexibility on abiFilters.
context: https://github.com/FluidSynth/fluidsynth/pull/913#issuecomment-860195788

Run with `./gradlew -PcustomAbiFilters=x86` etc.
2021-06-14 03:18:15 +09:00
derselbst
0ef0c703b6 minor fixes during Android testing 2021-06-13 13:14:50 +02:00
Pedro López-Cabanillas
6b7fc061eb
fix for bug#915 fluidsynth.exe short option '-Q' not working when compiled with getopt (#916) 2021-06-13 10:46:47 +02:00
atsushieno
e36d1438df [test-android] disable tests by the converter. And it is fully documented now. 2021-06-12 19:05:52 +09:00
atsushieno
7dd8f0118c [test-android] Tests are now runnable as ./gradlew connectedCheck 2021-06-12 19:05:52 +09:00
atsushieno
f176cd8e7b [test-android] disable failing tests in run_all_tests.c.
... not in CMakeLists.txt.
2021-06-12 19:05:52 +09:00
atsushieno
c232274d6a [test-android] fix java package names. 2021-06-12 19:05:52 +09:00
atsushieno
ecdae699da [test-android] those converted tests are now loaded and run (and fail hard). 2021-06-12 19:05:52 +09:00
atsushieno
12cc9ed74b Convert ctests into another test sources that can be compiled in Android test.
The existing ctests cannot be simply used in Android tests because
everything is compiled as standalone executable with `main()` function.
Since Android 11+ does not support standalone executables, those test
`main()` functions are converted as unique functions and then picked up
in this test's native-lib CMakeLists.txt.

Since those tests depend on libfluidsynth internals, we cannot simply
link with libfluidsynth.so. We instead compile the library with OBJ files.
2021-06-12 19:05:52 +09:00
atsushieno
962a544d15 Revert "[test-android] another build script fix for host/target was needed."
This reverts commit f5144c011ef58b901dc5b1153d59ee61fa32a900.
2021-06-12 19:05:52 +09:00
atsushieno
ed555f076b [test-android] another build script fix for host/target was needed. 2021-06-12 19:05:52 +09:00
atsushieno
0635766f85 [test-android] fix gettext build in build.sh by distinct --host and --target.
gettext is known as cause of problem for running host tool in target ABI
in our builds, and the latest script still had the issue.
https://github.com/atsushieno/aap-lv2-fluidsynth/actions/runs/914453645

This fixes the problem by explicitly specifying that the build host is
x86_64 linux.
If you want to reuse the script on other platforms, you have to edit it.
2021-06-12 19:05:52 +09:00
atsushieno
ea2a824383 [android] make $NDK optional in the build script. 2021-06-12 19:05:51 +09:00
atsushieno
e4ef966630 [test-android] really fix build scripts.
Changes are from https://github.com/FluidSynth/fluidsynth/issues/897#issuecomment-854896563
2021-06-12 19:05:51 +09:00
atsushieno
6e23e82a29 update build script, still broken. 2021-06-12 19:05:51 +09:00
atsushieno
fc4dcd709e [test-android] some followups on README. 2021-06-12 19:05:51 +09:00
atsushieno
e6b3ce8a6b Add Android test app.
As described on README, it does not really run tests yet.
But it asserts that libfluidsynth.so is loadable at least.
2021-06-12 19:05:51 +09:00
Tom M
f81caf37f1
Fix multiplication result may overflow 'int' before it is converted to 'size_t'. (#911) 2021-06-12 09:59:30 +02:00
Tom M
d709339ab5
Fix ordering of NoteOn Vel=0 events (#908) 2021-06-11 22:57:54 +02:00
Tom M
2321868124
Few fixes for Android CI Pipeline (#906) 2021-06-11 22:56:22 +02:00
jjceresa
de478947bf
When playing the same note more than once the (#905)
When playing the same note more than once the previous note is forced in release stage except if pedaling (sostenuto or sustain) is active. This makes it sound more like a real piano. See https://lists.nongnu.org/archive/html/fluid-dev/2021-06/msg00001.html
2021-06-11 22:40:17 +02:00
Tom M
bf574c6f03
Create codeql-analysis.yml (#910) 2021-06-11 22:27:14 +02:00
Tom M
17b6e44a3f Add schedule trigger to vcpkg pipeline 2021-06-10 09:39:10 +02:00
Tom M
9380e27009
Fix vcpkg pipeline (#909) 2021-06-10 09:26:43 +02:00
Paul
768fa225db
fix typo (#902) 2021-05-30 23:04:40 +02:00
Paul
20e09bb76d
fix some type conversion warnings in MSVC (#903) 2021-05-30 23:04:23 +02:00
Paul
9e9aa997f1 add new "enable-glib" option to compile out use of glib bar LADSPA 2021-05-30 20:46:59 +01:00
Tom M
17fb48def5
Include header files in Android Artifacts (#896) 2021-05-26 18:26:40 +02:00
Tom M
148cec6c03
Do not stringify cmake variable in if clause (#895) 2021-05-26 14:19:25 +02:00
Tom M
aba9485a9c
Fix import library naming clash (#893) 2021-05-26 14:18:19 +02:00
jjceresa
eda2fb21b0
Fix bad router behaviour. (#891)
Each input event has values (chan, par1, par2) that could be changed by a rule.
After a rule had been applied on any value and the value is out of range, the event
can be ignored or the value can be clamped depending of the type of the event:
- To get full benefice of the rule the value is clamped and the event
  passed to the output.
- To avoid MIDI messages conflicts at the output, the event is ignored
  (i.e not passed to the output).

chan value: event is ignored regardless of the event type
par1: event is ignored for PROG_CHANGE or CONTROL_CHANGE type, par1 is clamped otherwise.
par2: par2 is clamped regardless of the event type.
2021-05-24 16:26:56 +02:00
Tom M
bf884758cb
Update vcpkg based Windows CI Pipeline (#892) 2021-05-23 13:02:04 +02:00
Tom M
a28a5e6d20
Improve OGG/Vorbis detection (#888)
Previously, cmake only tested for a specific version of libsndfile and then assumed, it has OGG/Vorbis support. However, libsndfile may still be compiled without OGG/Vorbis support. If this is the case, fluidsynth should refuse to load SF3 files. Otherwise the attempt to load SF3 files would fail with a bunch of error messages.

The solution of this PR proposes to lookup the private libs listed in sndfile.pc and see whether it includes "vorbis".
2021-05-12 21:09:33 +02:00
Tom M
cd393d863a
Fix broken SF3 support for Android binaries (#890)
Libsndfile was unintentionally compiled without OGG/Vorbis support. That's because libopus was missing. When compiling libsndfile with autotools [you get a nice warning](9349a566e2/configure.ac (L381-L386)). When using CMake you don't...

Solution: Compile libopus before compiling libsndfile. Now it reports

```
-- The following features have been enabled:

 * ENABLE_EXTERNAL_LIBS, enable FLAC, Vorbis, and Opus codecs
```
2021-05-12 17:43:35 +02:00
Tom M
8446023255
Add more test cases for UTF8 filenames (#889) 2021-05-12 17:41:55 +02:00
Tom M
fbd9d139ec
Fix test suite on big endian architectures (#887)
Make sure to use correct amount for 16-bit generators.
2021-05-12 17:40:52 +02:00
Tom M
ba99ed36dc
Remove MinGW x86 CI Job (#886)
The unit tests keep failing when compiling with MinGW x86 on x64 Windows10. This is related to the change introduced in #629. The exact reason for the failure is unknown. I assume it's a broken MinGW implementation of the function `fgetpos()` or `_fseeki64()`, as the tests run fine for WindowsXP x86. However, I have little interest in further investigation, as I don't consider using MinGWx86 on x64 to be a valid use-case.
2021-05-12 17:40:03 +02:00
Tom M
e8963251be
Avoid unnecessary pipeline runs (#885)
Pipelines should not be triggered when other pipelines are modified. This saves many resources when messing around with a single pipeline, because other pipelines won't run.
2021-05-10 23:19:24 +02:00
Tom M
8ddf8fadb5
Move and rename Azure Pipelines (#884) 2021-05-10 22:18:43 +02:00
Tom M
6d78ebe154
Speed up Windows CI a bit (#883) 2021-05-10 22:00:03 +02:00
Tom M
90a6c52e1c
Rewrite Android CI Pipeline (#875) 2021-05-08 18:31:20 +02:00
derselbst
532c3e066f Bump to 2.2.1 2021-05-08 18:30:07 +02:00
Tom M
e3957306e8
Update default value of audio.driver 2021-05-08 11:27:54 +02:00
Marcus Weseloh
6a67dff3a7 Make ALSA default audio driver on supported platforms
The jack driver has a potential side-effect of starting
a new server. ALSA does not have such side-effects
and therefore makes a better default audio driver.
2021-05-08 11:25:08 +02:00
Tom M
1525a6fc0b
Restore old behaviour of fluid_player_join() (#876)
This basically reverts #783 because it causes a deadlock in existing client code.
2021-05-07 22:50:09 +02:00
Christopher Snowhill
7068c13f71 Handle GM/GM2 mode on, GS reset, and XG reset, and reset the
synthesizer upon setting the mode.
2021-05-07 22:04:57 +02:00
Tom M
4231645fb8
Define _WIN32_WINNT during compilation (#871) 2021-05-07 09:45:17 +02:00
Carlo Bramini
f88f27c0da
[WAVEOUT] Dynamic alloc of WAVEHDR (#873)
It seems that the addition of multichannel output has broken the WaveOut driver.
If you try to run FluidSynth with -a waveout, you will get this message:

fluidsynth: audio.periods 8 exceeds internal limit 4

Actually, the default value for period is set to 8, so it will never work unless you change that value before opening the driver. Rather than lowering the default period value or rising the limit of the number of buffers, in my opinion it would be better to free the driver from this limitation, by allocating the needed amount of memory for WAVEHDR too.
Attached patch fixes this bug.
2021-05-03 20:16:40 +02:00
derselbst
0ea101721a Make users aware of relative sequencer tick error 2021-05-01 15:16:39 +02:00
derselbst
0825e815a8 Elaborate some error messages 2021-05-01 10:00:34 +02:00
Carlo Bramini
10510e486b
[WINDOWS] Fix declaration of GUIDs (try 2). (#868)
Supersedes and closes #867.
2021-04-29 21:03:19 +02:00
Tom M
7b3c2b87f7
Address clang-tidy10 warnings (#860) 2021-04-27 20:28:32 +02:00
Tom M
f69a47081a
Fix MinGW warnings (#861) 2021-04-27 20:27:56 +02:00
Tom M
c8c3966586
Use CHECK_SYMBOL_EXISTS when probing for functions (#859) 2021-04-25 14:49:03 +02:00
Tom M
00806600b6
fluid_compare_func_t const correctness (#858)
fluid_compare_func_t should receive const args.
2021-04-25 13:44:40 +02:00
Carlo Bramini
883ea24960
Remove useless braces. (#855) 2021-04-20 19:40:25 +02:00
Carlo Bramini
52baa228db Remove useless braces.
It is not really clear to me the reason because braces are written into the initialization of channel_mask_speakers[], since their presence causes these messages from the compiler:

fluid_dsound.c:63:5: warning: braces around scalar initializer

In my opinion, it is better to remove them.
2021-04-20 19:40:08 +02:00
Tom M
f55bc7990c
Merge pull request #848 from FluidSynth/crt-free
Make Windows CRT linkage user-selectable
2021-04-16 18:21:25 +02:00
Tom M
86e876f7a0
Merge pull request #849 from chirs241097/wasapi
A few fixes for the WASAPI driver
2021-04-16 18:20:00 +02:00
Chris Xiong
5eff4e592e wasapi: correctly render effects if no custom audio processing is used.
I couldn't find a conceivable use case for calling `new_fluid_audio_driver2`
with `fluid_synth_process` as its callback in client code... So I took the
lazy route.

If custom audio processing is indeed used, nothing would be changed by this
patch. It still gets no effects buffer (like the vast majority of other
drivers).
2021-04-16 18:34:11 +08:00
Chris Xiong
0d627c7c0b wasapi: use device period size in shared mode. 2021-04-16 18:21:36 +08:00
Pedro López-Cabanillas
03fb32c979
WASAPI driver reorganization (#839)
Avoid initializing COM in the caller's thread context.

See also: #833
2021-04-14 09:35:35 +02:00
derselbst
92de920274 Update Windows CI images to windows-2019 2021-04-13 21:29:20 +02:00
derselbst
5988bc6d1c Make sure WinXP builds use statically linked CRT 2021-04-13 21:28:36 +02:00
derselbst
b990f765c2 Remove statically linked CRT workaround
Leave it to the user to override CMAKE_MSVC_RUNTIME_LIBRARY.
2021-04-13 21:12:25 +02:00
derselbst
ab4eebaf5b Clarify API documentation of fluid_free() 2021-04-13 21:07:37 +02:00
jjceresa
149e08f181
Fix incomplete chorus reverb help strings (#845) 2021-04-12 10:10:03 +02:00
Marcus Weseloh
aa966e4c31
Fix a memory leak if a setting is registered multiple times (#844)
If a string setting is registered multiple times, the previous
default value wasn't freed, leading to a memory leak.
2021-04-11 19:32:43 +02:00
Marcus Weseloh
aad6288955
Merge pull request #823 from FluidSynth/refactor-and-fix-sffile-defsfont
Refactor of sffile and defsfont code, including some bugfixes
2021-04-11 00:25:43 +02:00
jjceresa
c72abf4e0c
Fix typos in fx API documentation (#841) 2021-04-10 22:47:10 +02:00
Marcus Weseloh
7e4c843d7b
Update feature request issue template (#837)
Many discussions happen on GitHub now, so update the issue template
to point people there as well.
2021-04-10 16:34:12 +02:00
derselbst
d2754028b4 Merge branch 'master' into refactor-and-fix-sffile-defsfont 2021-04-10 16:30:05 +02:00
Tom M
487156c3ed
Merge pull request #818 from FluidSynth/defsfont-integration-test
Add defsfont integration test
2021-04-10 16:03:31 +02:00
Marcus Weseloh
92947586fb Cross-platform fixes for test utils
Use executable suffix to make test work on Windows and
specify explicit output directory for dump_sfont tool.

Uses a generator expression $<0:> to prevent VS and Xcode from
adding per-config subdirectories to the RUNTIME_OUTPUT_DIRECTORY
2021-04-10 15:44:14 +02:00
Marcus Weseloh
703f158c99 Ensure that we only try to dump font loaded by the defsfont loader
No the cleanest way to check which loader created the sfont,
but as it is just a test tool, it might be good enough...
2021-04-10 15:44:14 +02:00
Marcus Weseloh
cc186512ed Add integration tests for defsfont loader
Runs the new dump_sfont utility on the test soundfonts and
compares them against the stored representation. Raise an error
if there are any differences.
2021-04-10 15:44:14 +02:00
Marcus Weseloh
736caf9d21 Add ability to get name of generator from gen index
Used in dump_sfont test utility.
2021-04-10 15:44:13 +02:00
Marcus Weseloh
522b751f4f New dump_sfont utility to output a defsfont as YAML
Intended to be used in integration tests to compare the output
against a previously generated output.
2021-04-10 15:44:13 +02:00
Marcus Weseloh
1b61e1fbd3 Add fluid_list function to find index of data in list
Will be used in the defsfont dump utility.
2021-04-10 15:37:41 +02:00
Tom M
8a39c5aea4
Zone Validation Test (#826)
This is my implementation of a unit test to verify the preset and instrument zone validation behaviour.
2021-04-10 15:33:12 +02:00
Marcus Weseloh
1eda0ae863
Merge pull request #834 from FluidSynth/fix-gcc-warnings
Fix two gcc warnings
2021-04-10 15:27:46 +02:00
Marcus Weseloh
74ccd9cb9d Fix maybe-uninitialized warning in gcc 9.3 2021-04-10 12:06:32 +02:00
Marcus Weseloh
614fcab9cc Fix missing initializer warnings on gcc 9.3 2021-04-10 12:04:05 +02:00
Tom M
ebbaff32bf
Fix typo in --help 2021-04-08 13:30:40 +02:00
Vladimir Davidovich
30c899973d
Fix failure to create the audio driver on macOS (#828)
The deprecated Component Manager for hosting Audio Components is not supported when rebuilding against the 11.00 or later SDK.
Co-authored-by: Vladimir Davidovich <thy.ringo@gmail.com>
2021-04-07 21:32:59 +02:00
Tom M
2173fdcab3
Run GitHub Actions on forked pull requests 2021-04-07 21:30:43 +02:00
Tom M
ddb13e36c5
Collect coverage during test execution (#825) 2021-04-03 17:34:48 +02:00
Marcus Weseloh
5ebd4d3d26 Speedup SF2 loading by using prepend instead of append on samples
Using prepend both in sffile and defsfont reduces insert complexity
to O(1) and does not affect the final order of the sample list, as
the reversed order of the samples in sffile is reversed again in
defsfont.
2021-03-28 15:00:43 +02:00
Marcus Weseloh
0f8e2c7fde Refactor load_igen and load_pgen
Cleanup of the code structure and fix of the ineffective
check for global zones that are not first in list.

Fixes #813
2021-03-27 22:42:57 +01:00
Marcus Weseloh
dfbef11da0 Remove instsamp hack
This change removes the need for the instsamp hack in instrument
and preset zones. The sampleid and instrument generators are
treated as any other generator and simply passed to the defsfont
import functions. Those read the two generators and use the
index to look up valid samples and instruments.

Both generators are then reset to GEN_UNUSED again, just to make
sure that the rest of FluidSynth doesn't get confused. But that might
not be necessary.
2021-03-27 22:42:57 +01:00
Marcus Weseloh
6ca9b21740 Add more invalid generators for presets and instruments
Presets should not contain sampleid generators, instruments
should not contain instrument generators.
2021-03-27 22:42:57 +01:00
Marcus Weseloh
6b63c80d3d Remove code duplication by re-using enum from fluid_gen.h
We already have an enum for all generator values, so there is
no need to define another list in the loader code.
2021-03-27 22:42:57 +01:00
Marcus Weseloh
c4d38a7125 Fix preset generator validity checks
The previous implementation used 0 as end-of-list sentinel
value. But 0 is also the id of the first generator in the
invalid_preset_gen list. This effectively prevented checks
for invalid preset generators.

Also contains some code cleanup to make the check for invalid
instrument generators similar to invalid preset generators.

Fixes #821
2021-03-27 22:42:57 +01:00
Marcus Weseloh
259aecedf2 Remove unused macros 2021-03-27 22:42:57 +01:00
Marcus Weseloh
84704ea440 Remove Gen_MaxValid macro
Not really necessary, checking against Gen_Last is just as
understandable and removes a macro.
2021-03-27 22:42:57 +01:00
Marcus Weseloh
359af770a3 Rename Gen_Dummy to Gen_last to clarify the purpose 2021-03-27 22:42:57 +01:00
Marcus Weseloh
b61abdd907 Remove unused structs in sffile code 2021-03-27 22:42:57 +01:00
Marcus Weseloh
16d2f43509 Remove unused library, genre and morphology fields
Those fields are not used anywhere, so let's simply remove them.
2021-03-27 22:42:57 +01:00
Tom M
8413c35aca
Fix a regression in fluid_player_stop() (#822)
fluid_player_stop() should not set the STOPPING state, when the player has already finished. Introduced in 676923757c.
2021-03-27 18:35:00 +01:00
derselbst
3f5394a15d Bump version to 2.2.0 2021-03-27 17:46:01 +01:00
Marcus Weseloh
661a06b504
Merge pull request #820 from FluidSynth/player-reset-between-songs
Reset synth after end, not before start of song
2021-03-27 00:49:29 +01:00
Marcus Weseloh
7dd870f498 Update player.reset-synth doc with new behaviour 2021-03-24 20:41:48 +01:00
Marcus Weseloh
9a4b95a742 Reset the synth after the end, not before the start of a song
This change prevents an unnecessary synth reset before the first
MIDI song is played. It allows changing synth parameters via a
config file without having to unset the player.reset-synth setting.
2021-03-24 20:41:18 +01:00
Marcus Weseloh
d13c4965e1
Update api_doc_build.yml
Fix ubuntu version to 18.04 to keep doxygen
version stable. Latest ubuntu has a new version
which breaks the current API docs layout
2021-03-19 19:50:40 +01:00
Tom M
a3d0a56996
Update API docs
Make breaking changes a bit more obvious.
2021-03-17 20:11:46 +01:00
Tom M
c32faa7b17
Parallelize SF2 loading (#812)
The loading of SF2 samples can be parallelized as well, at least for bigger soundfonts like the Stgiga 4GB monster.

The following test is performed with hot-caches:

`time src/fluidsynth -i -a alsa Stgiga\'s\ HiDef\ Soundfont\ \(2019-05-25\).sf2`

Serial version:
```
real    0m15,460s
user    0m14,163s
sys     0m1,192s
```

Parallelized version proposed by this PR:
```
real    0m5,851s
user    0m14,089s
sys     0m1,194s
```
2021-03-17 19:41:33 +01:00
Tom M
ea5ebe4813
Merge pull request #815 from FluidSynth/fluid-sffile-variable-renaming
Rename variables in fluid_sffile.c for easier readability
2021-03-16 08:47:28 +01:00
Tom M
5ae72f8c74
Merge branch 'master' into fluid-sffile-variable-renaming 2021-03-15 21:40:16 +01:00
derselbst
9ea6c75724 Merge branch '2.1.x' into master 2021-03-15 21:27:42 +01:00
Tom M
005719628a
Invalid generators were not removed from zone list (#810)
fluid_list_remove() should receive the beginning of a list, so it can adjust the predecessor of the element to be removed. Otherwise the element would remain in the list, which in this case led to a use-after-free afterwards.
2021-03-15 20:12:51 +01:00
Marcus Weseloh
e3d95cb854 Rename p in load_igen to inst_list 2021-03-14 21:33:46 +01:00
Marcus Weseloh
552b1c4aa6 Rename p in load_imod to inst_list 2021-03-14 21:32:08 +01:00
Marcus Weseloh
dd037c725e Rename p in load_ibag to inst_list 2021-03-14 21:31:27 +01:00
Marcus Weseloh
93a74ff3bd Rename pr in load_ihdr to prev_inst 2021-03-14 21:29:28 +01:00
Marcus Weseloh
c545766ea6 Rename p in load_ihdr to inst 2021-03-14 21:27:40 +01:00
Marcus Weseloh
8df5abf903 Rename p in load_pgen to preset_list 2021-03-14 21:24:25 +01:00
Marcus Weseloh
9e7c108f4c Rename p in load_pmod to preset_list 2021-03-14 21:12:04 +01:00
Marcus Weseloh
f1baa556a6 Rename p in load_pbag to preset_list 2021-03-14 21:11:07 +01:00
Marcus Weseloh
edc99ebc24 Rename p2 in fixup_igen to zone_list 2021-03-14 21:03:10 +01:00
Marcus Weseloh
06145d2139 Rename p2 in fixup_pgen to zone_list 2021-03-14 21:02:29 +01:00
Marcus Weseloh
e254c56373 Rename p2 in load_igen to zone_list 2021-03-14 21:00:15 +01:00
Marcus Weseloh
0c363cc574 Rename p2 in load_imod to zone_list 2021-03-14 20:59:32 +01:00
Marcus Weseloh
355c50631d Rename p2 in load_ibag to zone_list 2021-03-14 20:58:55 +01:00
Marcus Weseloh
b5d80a1248 Rename p2 in load_pgen to zone_list 2021-03-14 20:58:03 +01:00
Marcus Weseloh
a044835cf5 Rename p2 in load_pmod to zone_list 2021-03-14 20:56:58 +01:00
Marcus Weseloh
0e761da102 Rename p2 in load_pbag to zone_list 2021-03-14 20:55:52 +01:00
Marcus Weseloh
f694d41a0e Rename p3 in fixup_igen to inst_list 2021-03-14 20:54:27 +01:00
Marcus Weseloh
fd3e9bdc21 Rename p3 in fixup_pgen to inst_list 2021-03-14 20:54:14 +01:00
Marcus Weseloh
bc2afb682b Rename p3 in load_igen to gen_list 2021-03-14 20:51:10 +01:00
Marcus Weseloh
b506304bef Rename p3 in load_imod to mod_list 2021-03-14 20:50:18 +01:00
Marcus Weseloh
5bf9cf545f Rename p3 in load_pmod to gen_list 2021-03-14 20:49:45 +01:00
Marcus Weseloh
2c3caafcdf Rename p3 in load_pmod to mod_list 2021-03-14 20:48:58 +01:00
Tom M
8a778e0c0e
Add warning if soundfont bigger 2GB (#811)
Advice the user to use fluidsynth 2.2.0 or later when loading soundfonts > 2GB
2021-03-14 17:20:09 +01:00
derselbst
b8fb6c81e1 Change short option for --query-audio-devices to -Q
Resolves #802
2021-03-13 20:15:36 +01:00
Tom M
4a696cabf9
Add missing dll dependencies to CI artifact (#806) 2021-03-13 20:10:59 +01:00
derselbst
14ab1ec6ab Merge branch '2.1.x' into master 2021-03-13 18:32:41 +01:00
derselbst
2c1561ea18 Bump to 2.1.8 2021-03-13 18:24:28 +01:00
Patryk Obara
908b98107c Rename generated table files from .c to .inc.h
These two files are not ordinary C files, and are being compiled
through #include's in other C source files, not through invoking
compiler on generated files. This might confuse both developers and
automated systems.

For longer explanation see discussion in #800.
2021-03-13 16:36:32 +01:00
TotalCaesar659
a27457c32f
Update URLs to HTTPS (#796) 2021-03-08 16:46:36 +01:00
Tom M
5d1078f7b9
Merge pull request #795 from mawe42/ladspa-improvements
Improvements to LADSPA subsystem
2021-03-07 12:50:03 +01:00
Marcus Weseloh
17c355ffaf Free the host_nodes list in fx destructor to prevent memory leaks 2021-03-07 12:18:47 +01:00
Tom M
a2b2625517
Silence annoying 'non-existing shell command file' error (#794) 2021-03-07 10:54:31 +01:00
Marcus Weseloh
4ec1f799f8 Use separate lists for user and host nodes
Remove the global nodes list with separate host and audio nodes. Instead
use completely separate lists and search through both lists in the only
place where that is required: getting a node by name.
2021-03-06 18:21:14 +01:00
Marcus Weseloh
7e553339e4 Don't add effect control nodes to global node list
As effect control nodes are private to the effect and only ever
accessed via the effect and port name, they don't need to be added
to the global node list and can be cleaned up in the effect
destructor.
2021-03-06 18:21:14 +01:00
Marcus Weseloh
ef29d03cc9 Move bookkeeping of nodes out of node creation function
Removal from and iterating through othe node lists is also handled
separately, so adding nodes to the lists should be explicit as well.
2021-03-06 18:20:56 +01:00
Marcus Weseloh
14b288a801 Linking effect ports is only supported for audio ports
Clarify the code and error messages to reflect that
limitation / design decision.
2021-03-06 18:19:39 +01:00
Marcus Weseloh
f66a7e1442 Use lists to keep track of LADSPA nodes and effects
Removes the need for static allocation and prevents users from
running into our arbitrary node and effect limits.

Fixes #793
2021-03-06 18:19:39 +01:00
derselbst
ca40101025 Increase number of LADSPA nodes
Quick solution for 2.1.8 only.
Addresses #793.
2021-03-06 09:45:32 +01:00
jjceresa
e4241469d4
Fix return in fluid_synth_chorus_set_param(), fluid_synth_reverb_set_param() (#789) 2021-03-04 21:47:59 +01:00
derselbst
73182866e0 Merge branch '2.1.x' into master 2021-03-04 20:19:09 +01:00
derselbst
8adaaa7079 Fix regression introduced in aebc4837dd
If a voice has finished, sample_count may be smaller than FLUID_BUFSIZE,
in which case audible artifacts would occur.
Addresses #786
2021-03-04 20:16:19 +01:00
Tom M
57e035f8f7
Add Chris' soundcard enumeration tool (#773) 2021-03-01 18:29:51 +01:00
derselbst
6771f51178 Make sfont unloading test a bit more stable 2021-02-27 16:28:46 +01:00
derselbst
7e325c6f4b Fix FreeBSD CI 2021-02-27 16:26:56 +01:00
Tom M
5271779a03
Update recent API changes 2021-02-27 14:01:33 +01:00
Arthur Chaloin
676923757c
Fix race condition in fluid_player_callback (#783)
Co-authored-by: Arthur Chaloin <arthur.chaloin@gmail.com>
2021-02-27 13:09:48 +01:00
Arthur Chaloin
13185d32b2
Add optional per tick callback to player (#780)
Co-authored-by: Arthur Chaloin <arthur.chaloin@gmail.com>
Co-authored-by: derselbst <tom.mbrt@googlemail.com>
2021-02-26 21:05:31 +01:00
jjceresa
04c30be0b9 update comment 2021-02-08 10:23:01 +01:00
derselbst
66407e2584 Prevent MIDI player from playing immediately after creation 2021-02-08 10:23:01 +01:00
derselbst
2172e1b009 Rename player_step to player_seek 2021-02-08 10:23:01 +01:00
derselbst
9f3eee0dd5 Document player commands which cannot be used in command file 2021-02-08 10:23:01 +01:00
derselbst
d5cb8d312e Fix player_seek command in user command file 2021-02-08 10:23:01 +01:00
jjceresa
77f5bee296
Fix player position displayed in fluid_handle_player_cde() (#775)
This PR fixes the player position displayed in fluid_handle_player_cde() when calling fluid_player_seek().
2021-02-07 22:45:22 +01:00
Tom M
65c7d809f8
Replace Travis badge with GitHub Action 2021-02-07 14:10:25 +01:00
derselbst
9690c0dd73 Merge branch '2.1.x' into master 2021-02-07 13:52:19 +01:00
Tom M
dfc7378754
Good Bye TravisCI! (#772) 2021-02-07 13:46:02 +01:00
derselbst
aebc4837dd Simplify control flow to allow auto-vectorization by compiler 2021-02-07 11:05:33 +01:00
derselbst
25b0503ba7 Avoid audible clicks when rapidly chaning panning 2021-02-07 11:05:33 +01:00
Tom M
0d76403f9f
Parallelize SF3 loading (#746) 2021-02-06 20:32:17 +01:00
Tom M
4836ff15c4
Speedup Android CI a bit (#769) 2021-02-06 19:28:52 +01:00
jjceresa
616fca3d8d Elaborate out-of-polyphony error message 2021-02-06 16:57:32 +01:00
Tom M
8745f542c2
Merge pull request #747 from FluidSynth/oboe-phil
Update Oboe driver
2021-02-06 10:43:07 +01:00
derselbst
ad16f40325 Speed up build + tests for TravisCI 2021-02-03 21:48:59 +01:00
derselbst
641605294c Introduce audio.oboe.sample-rate-conversion-quality setting 2021-01-30 19:31:51 +01:00
derselbst
977fe31ef4 Document the impact of synth.sample-rate on audio drivers 2021-01-30 18:45:21 +01:00
Chris Xiong
712707fe87
Add WASAPI driver. (#754)
This driver is currently tested and verified to work on:
 - Windows Vista x64 VM
 - Windows 7 x64 VM
 - Windows 10 1909 x64 (VM and Laptop)
 - Windows 10 21296 x64 on a ThinkPad X1 Yoga 1st Gen with 3 different sound cards (Conexant CX20753/4, Scarlett Solo Gen 2, Aureon 7.1 USB)

This driver is capable of reaching very low latency in exclusive mode (~6ms on Scarlett Solo with 48kHz).
2021-01-29 18:11:17 +01:00
Tom M
d0e90be5b5
Update TravisCI badge 2021-01-29 16:43:47 +01:00
derselbst
9e0c401aeb Document new WASAPI settings and other missing ones 2021-01-29 14:57:25 +01:00
derselbst
b84e8b83e0 Merge branch '2.1.x' into master 2021-01-29 14:42:04 +01:00
derselbst
e2d67ea772 Bump to 2.1.7 2021-01-29 14:37:27 +01:00
derselbst
dc3d7b8ffa Fix possible NULL deref
when allocation of drybuf fails
2021-01-29 14:07:01 +01:00
derselbst
4d76a6ad85 Restore int16 sample format for waveout and dsound
Addresses #760
2021-01-29 13:59:21 +01:00
jjceresa
8322d95425
Fix waveout driver crash (#759)
This PR addresses issue https://github.com/FluidSynth/fluidsynth/issues/758.

It ensures that the `internal buffer size` used by waveout device driver and the `extra buffers size` required by fluid_synth_process() are both coherent (i.e they should be of same size). To ensure this, both kind of buffers are now dependent of`audio.period` and `audio.period-size settings`.
2021-01-29 13:56:57 +01:00
rncbc
cd28701d52 Allow the MIDI file player restart on-demand (#755)
Resets the default sample timer properly, allowing the internal
MIDI file player to restart its playlist on any other time but
the initial first.

Lets Qsynth play any MIDI files that are drag-n-dropped, anytime
after the first, following synth engine initialization.
2021-01-28 11:25:13 +01:00
derselbst
c7878dec74 Update API docs of fluid_settings_getstr_default() 2021-01-28 11:15:23 +01:00
derselbst
4b5afca76c Fix a double-free when issuing the info command on string setting
Fixes #756.
2021-01-28 10:34:39 +01:00
derselbst
70abf1953f Add a comment for issue #751 2021-01-23 17:50:40 +01:00
derselbst
4fd7899d61 Merge branch '2.1.x' into master 2021-01-23 17:16:26 +01:00
derselbst
e887a6369c Update new_fluid_audio_driver2() support list 2021-01-23 16:28:56 +01:00
derselbst
fff51822eb Disable floating point underflow exceptions
They often occur in reverb, chorus and IIR and break our CI for no good reason.
2021-01-23 16:00:42 +01:00
derselbst
b9820362f4 Update API docs about bug #751 2021-01-23 15:57:28 +01:00
Chris Xiong
8e9d361651 chorus: avoid overwriting input buffer when storing samples in the delay line.
In `fluid_rvoice_mixer.c`:`fluid_rvoice_mixer_process_fx()`:

If an audio processing callback is used, `mix_fx_to_out` would be `FALSE`. As a result, `in_ch` and `out_ch_l` points to the same buffer.

In `fluid_chorus.c`:`fluid_chorus_processreplace()`:
```C
        /* process stereo unit */
        /* store the chorus stereo unit d_out to left and right output */
        left_out[sample_index]  = d_out[0] * chorus->wet1  + d_out[1] * chorus->wet2;
        right_out[sample_index] = d_out[1] * chorus->wet1  + d_out[0] * chorus->wet2;

        /* Write the current input sample into the circular buffer */
        push_in_delay_line(chorus, in[sample_index]);
```

Here the chorus processing code writes to the left output buffer (which will overwrite the input buffer in this case) before the sample from the input buffer is stored into the delay buffer, making the chorus output all zeros. If no audio processing callback is used, `mix_fx_to_out` would be `TRUE` and `in` and `left_out` will not point to the same buffer, therefore the order doesn't matter.

Simply swapping the two steps should be a sufficient fix. This patch also apply the same change to `fluid_chorus_processmix` only for the sake of consistency (since they are almost exact copies of each other).

Resolves #751.
2021-01-23 15:49:26 +01:00
derselbst
1fefa4d2f2 Merge pull request #745 from chirs241097/winadrv-cb
Add support for new_fluid_audio_driver2 to dsound and waveout drivers.
2021-01-23 15:08:24 +01:00
Chris Xiong
64121229ea Add support for multiple stereo outputs when callbacks are used. 2021-01-23 15:06:40 +01:00
derselbst
d547b569ad Leave framesPerCallback unspecified 2021-01-22 19:48:54 +01:00
derselbst
998eeee471 Elaborate API docs of fluid_audio_func_t 2021-01-22 19:46:03 +01:00
Chris Xiong
908494524b Consistency changes and removal of other unnecessary stuff. 2021-01-20 11:55:29 +08:00
derselbst
1e18ee7781 Use oboe 1.5.0 2021-01-19 18:48:52 +01:00
derselbst
c9c80a5fde Oboe driver can have lower latency 2021-01-19 18:48:52 +01:00
derselbst
2cfd56bb10 Modernize Oboe driver 2021-01-19 18:48:52 +01:00
Chris Xiong
772f62fc91 Add support for new_fluid_audio_driver2 while using the waveout driver. 2021-01-19 10:25:24 +08:00
Chris Xiong
9562ae6009 Add support for new_fluid_audio_driver2 while using the dsound driver. 2021-01-19 10:24:40 +08:00
jjceresa
4f2cb370a1
Add shell commands to the MIDI File Player (#713) 2021-01-15 19:04:02 +01:00
Tom M
ca6bcda7d9
Merge pull request #739 from FluidSynth/parse-cmd3
Handle settings-related commands in user command file early
2021-01-10 12:08:19 +01:00
jjceresa
2cada68e02
Fix MIDI player tempo reset issues (#711) 2021-01-10 12:01:28 +01:00
derselbst
20ff3f866c Avoid unknown command errors when parsing settings early 2021-01-09 19:44:18 +01:00
derselbst
9bb048f27f Don't print warning when parsing early 2021-01-09 18:51:46 +01:00
derselbst
40ed09367a Parse set commands from config file early 2021-01-09 18:51:33 +01:00
Mauro Carvalho Chehab
4e8f570d32 Don't warn when parsing config files
When fluid_shell is called from fluid_source(), is is currently
printing this message:

    Received EOF while reading commands, exiting the shell.

Suppress it.
2021-01-08 23:48:40 +01:00
Mauro Carvalho Chehab
3d805e9a03 Only change a set if the value actually changed
That prevents warnings about changing a non-realtime parameter
set command is issued, but the value is identical to the
previous one.
2021-01-08 23:47:39 +01:00
derselbst
e04cd572cb Merge branch '2.1.x' into master 2021-01-03 21:37:32 +01:00
Tom M
fd9bf6a6b0
MinGW CI: Provide Release Build Binaries (#738) 2021-01-03 20:55:48 +01:00
derselbst
272b3b8717 Update API docs on fluid_synth_sfunload() 2021-01-03 18:30:16 +01:00
jjceresa
cf424de5cf delete_fluid_synth() may not unload soundfonts still used by rvoices 2021-01-03 18:30:16 +01:00
jjceresa
0d38823527 SoundFonts cannot be unloaded if polyphony is ever exceeded
If polyphony is exceeded and FluidSynth has to allocate a voice by
calling fluid_synth_free_voice_by_kill_LOCAL(), two problems occur:

 1)The value returned by fluid_synth_get_active_voice_count() never
   returns back to 0.
 2)SoundFont samples are not unref'd properly, and therefore if an attempt is
   made to unload the SoundFont, the deferred unload timer is started, and
   fluid_synth_sfunload_callback() unsuccessfully tries	to unload the SoundFont forever.

These 2 issues are fixed by this commit.
2021-01-03 18:30:16 +01:00
Tom M
5c1cfe6a5f
Regression tests for #727 (#735)
This PR adds regression tests for #727, ensuring that soundfonts are correctly unloaded via the lazy-timer-unloading mechanism.
2021-01-03 09:42:42 +01:00
Tom M
6339feb106 Update API docs on settings recycling 2021-01-03 09:41:46 +01:00
derselbst
57f40ea91c Fix heap-use-after free 2021-01-03 09:41:46 +01:00
derselbst
03cf8e28f6 Add a unit test for issue 733 2021-01-03 09:41:46 +01:00
derselbst
17dfadbd0b Fix SonarCloud Analysis on 2.1.x branch
By adding sonar-project.properties from master
2021-01-02 17:14:41 +01:00
Tom M
4bfeff5764
Elaborate API docs on voice state 2021-01-01 22:27:25 +01:00
derselbst
26710f1076 Bump to 2.1.6 2021-01-01 21:26:12 +01:00
derselbst
6b0ddee85c Update CI scripts from master 2021-01-01 21:22:27 +01:00
jjceresa
0ae16f6a2b
Check first MIDI files then Soundfonts files in fluidsynth.c (#731) 2020-12-31 10:28:12 +01:00
Tom M
a14c70cbbd
Fix the fluid_synth_set_sample_rate() change problem for jack driver (#722) 2020-12-31 10:25:53 +01:00
Tom M
21d20eac67
Replace AppVeyor vcpkg CI with Azure Pipelines (#728) 2020-12-29 19:35:04 +01:00
derselbst
1be0e5ae7c Log error when audio callback function fails
Addresses #724
2020-12-28 18:08:38 +01:00
Tom M
9a25e71b02
Add FLUID_SEQ_SCALE event type (#723) 2020-12-27 17:53:36 +01:00
derselbst
0853cac6a3 Fix doxygen warnings 2020-12-27 10:48:07 +01:00
derselbst
0968e403c9 Remove pre-generated doxygen files 2020-12-22 13:23:28 +01:00
derselbst
bc056b576b Print error if fluid_is_soundfont() fails 2020-12-22 13:16:30 +01:00
derselbst
3c84dcc816 Update API docs about UTF8 filenames 2020-12-22 11:30:14 +01:00
derselbst
ed34742824 Add log messages to fluid_fopen() 2020-12-22 11:30:14 +01:00
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
derselbst
468f6ff082 Update Issue templates to point to GitHub discussion 2020-12-20 12:30:42 +01:00
derselbst
e5f5bb5471 Breaking unit tests for WindowsXP should be fatal 2020-12-19 14:42:17 +01:00
derselbst
b14265cf99 Elaborate on synth.device-id 2020-12-18 11:57:11 +01:00
Carlo Bramini
f15147d43a
Replace g_ascii_strtoll() with FLUID_STRTOL() (#717) 2020-12-16 09:15:04 +01:00
Carlo Bramini
3719c58246
Make some strings const (#716) 2020-12-16 00:05:28 +01:00
Marcus Weseloh
e68f4b22de Revert "Commit to test API doc build"
This reverts commit fd39f6e1e0.
2020-12-13 16:37:20 +01:00
Marcus Weseloh
fd39f6e1e0
Commit to test API doc build
Will be removed with next commit again.
2020-12-13 16:31:45 +01:00
Marcus Weseloh
b7f7d818a7
Also set commit name and email for api doc build commits 2020-12-13 16:26:55 +01:00
Marcus Weseloh
01ecf9e3b9
Fix commit message for deploying API doc 2020-12-13 14:56:16 +01:00
Marcus Weseloh
5ff3b73a4d
Clean existing files in API doc on GH pages 2020-12-13 14:53:32 +01:00
Marcus Weseloh
fcad97bacd
Fix build path in API doc publish step 2020-12-13 14:50:32 +01:00
Marcus Weseloh
9f853e7d53
Update API doc build to upload to GH pages 2020-12-13 14:48:51 +01:00
Tom M
9cd0fbdbf8
Re-enable unit tests with mingw
and allow them to fail to ensure build artifacts are being published
2020-12-11 12:37:52 +01:00
Tom M
f6276a14ab
Fix Windows CI
Remove fake pkg-config
2020-12-11 12:22:00 +01:00
Chris Xiong
9b485fad7c
Handle GS SysEx messages for setting whether a channel is used for rhythm part. (#708)
Some MIDI files that uses the GS standard uses channels other than channel 10 as percussion channel. Currently FluidSynth ignores the messages setting that up, causing notes meant to be played with a drum instrument played with a melodic instrument or vice versa. This patch will partially fix the issue.

Currently the implementation in this patch doesn't cover a specific "quirk" in Roland GS Modules: they seem to remember the last used instrument in the selected mode. This patch simply sets the instrument number to 0 instead.

A test file is attached. If played correctly (with `-o synth.device-id=16`) no out of place drum or piano sounds should be heard.

[wikipedia_MIDI_sample_gstest.mid.gz](https://github.com/FluidSynth/fluidsynth/files/5610727/wikipedia_MIDI_sample_gstest.mid.gz)
2020-11-29 00:20:04 +01:00
Nathan Umali
33c147402b
Update owner of the SoundFont registered trademark. (#706)
As of the time of this PR, the SoundFont registered trademark is owned by Creative Technology Ltd.
http://tmsearch.uspto.gov/bin/showfield?f=doc&state=4803:rj74xq.2.1
http://assignments.uspto.gov/assignments/q?db=tm&qt=sno&reel=&frame=&sno=74325965
2020-11-25 12:31:16 +01:00
jjceresa
c9b187bd85
Fx unit api (#673)
This PR addresses #669 point 2.1.
It proposes set/get API functions to change/read fx unit parameters.
The deprecated shell commands are updated. Now the commands line have 2 parameters:
- first parameter is the fx unit index.
- second parameter is the value to apply to the fx unit.
2020-11-22 21:02:06 +01:00
Marcus Weseloh
0c34b3d56c Update generated fluidsettings.txt for API doc build on fluidsynth.org 2020-11-19 21:07:06 +01:00
Tom M
bfe0f26d96
Merge pull request #703 from mawe42/doc-improvements
API documentation cleanup and improvements
2020-11-16 22:57:22 +01:00
Marcus Weseloh
4a7d7ad688 Settings reference style more consistent with rest of reference pages 2020-11-16 22:29:42 +01:00
Marcus Weseloh
602a2bcdc1 Remove unused command alias and sync Doxyfile.cmake and Doxyfile 2020-11-16 22:09:06 +01:00
Marcus Weseloh
c7f9d05190
GitHub Action to build the API docs from master branch (#704)
Uploads the complete HTML API docs as an artifact called api_docs.zip
2020-11-16 15:27:56 +01:00
Marcus Weseloh
9971f9372c Workaround for doxygen bug with linebreaks in ALIASES
Using \_linebr is not ideal, as it's an internal command. But that
seems to be the most compatible way to specify line breaks in ALIASES
accross different doxygen versions at the moment.
2020-11-15 00:31:32 +01:00
Marcus Weseloh
42f91986cd Use SVG for fluid mixer image 2020-11-14 21:16:23 +01:00
Marcus Weseloh
7d994ff9be Add intro text to deprecated list 2020-11-14 18:46:17 +01:00
Marcus Weseloh
0a23598126 Remove obsolete doxygen config options 2020-11-14 18:32:39 +01:00
Marcus Weseloh
3d930ffda4 Remove debug leftover 2020-11-14 17:12:39 +01:00
Marcus Weseloh
36280b9788 Add missing group brief descriptions 2020-11-14 17:10:26 +01:00
Marcus Weseloh
a279b2b397 Make top links black on hover, not white 2020-11-14 17:10:06 +01:00
Marcus Weseloh
961579774d Add documentation hints to style guide 2020-11-14 16:59:25 +01:00
Marcus Weseloh
d0db0cc119 Document how to revert the styling and layout changes 2020-11-14 16:27:43 +01:00
Marcus Weseloh
6113c15f94 Improve styling of field tables (enum values) 2020-11-14 16:22:50 +01:00
Marcus Weseloh
a03362a155 Style improvements for small screens
- hide side nav
- hide search box
- make content full height
2020-11-14 16:13:10 +01:00
Marcus Weseloh
5ccc7543ae Hide nav sync toggle button 2020-11-14 16:12:17 +01:00
Marcus Weseloh
3c1c796396 Add generated fluidsettings.txt for fluidsynth.org API doc build
Probably not the final solution, but works for now.
2020-11-14 15:10:57 +01:00
Marcus Weseloh
eebbfb6a62 Smaller cleanup and reformatting of long lines. 2020-11-14 14:59:29 +01:00
Marcus Weseloh
b565b3ebc3 Use custom \setting{} alias to link to fluid settings 2020-11-14 14:56:18 +01:00
Marcus Weseloh
0f9aed6f83 Use \image for images and improve quality of FluidMixer image 2020-11-14 14:25:44 +01:00
Marcus Weseloh
cb16f8d32d Split HTML_EXTRA_FILEs into separate lines 2020-11-14 14:04:05 +01:00
Marcus Weseloh
c4512367c4 Move examples into doc/examples directory 2020-11-14 13:40:46 +01:00
Marcus Weseloh
20ec6f3376 Move usage guide pages into separate files in doc/usage 2020-11-14 13:26:05 +01:00
Marcus Weseloh
67cb344a20 Move recent changes into separate file 2020-11-14 13:23:55 +01:00
Marcus Weseloh
cc84da2094 Split doxygen INPUT into separate lines, for easier readability 2020-11-14 13:21:57 +01:00
Marcus Weseloh
3c68eaa619 Sync the static Doxyfile with Doxyfile.cmake
Still missing is the integration of the generated fluidsettings.txt,
as that requires a build script currently not available on the
server generating the public API docs.
2020-11-13 23:21:47 +01:00
Marcus Weseloh
2a2027085e Separate new_* and delete_* functions from the rest 2020-11-13 22:23:29 +01:00
Marcus Weseloh
ee2ac9e1d9 Mark settings with callbacks as realtime and output this in the generated docs 2020-11-13 20:46:02 +01:00
Marcus Weseloh
1d9d7e9042 Also update the styling of the deprecated list 2020-11-12 22:31:19 +01:00
Marcus Weseloh
d2a29ec4c5 Make sure libxslt is only searched if doxygen is available as well 2020-11-12 21:50:35 +01:00
Marcus Weseloh
5a70df1cb7 Remove footer, as it takes away valuable vertical space 2020-11-12 21:27:00 +01:00
Marcus Weseloh
921c0e08c0 Updated documentation styling 2020-11-12 21:27:00 +01:00
Marcus Weseloh
d4741b7d5e Sort groups/modules, briefs and members 2020-11-12 21:27:00 +01:00
Marcus Weseloh
f5900a261f Custom doxygen layout to rename modules to API Reference 2020-11-12 21:27:00 +01:00
Marcus Weseloh
512f39b1a1 Some more brief message abbreviation hints 2020-11-12 21:27:00 +01:00
Marcus Weseloh
48761ea724 Consistent capitalization of usage guide section names 2020-11-12 21:27:00 +01:00
Marcus Weseloh
a9135faf70 Structure the large synth header into subgroups
Also include version.h and ladspa.h in the Synthesizer group.
2020-11-12 21:27:00 +01:00
Marcus Weseloh
4ea5d64eb7 Rename setting reference page name to lowercase, for consistency 2020-11-12 21:27:00 +01:00
Marcus Weseloh
6780293d0c Add version defines and functions to misc group 2020-11-12 21:27:00 +01:00
Marcus Weseloh
9248032feb SoundFont API
Includes Generators, Modulators, Loader etc
2020-11-12 21:27:00 +01:00
Marcus Weseloh
7f1ac22869 Miscellaneous group 2020-11-12 21:27:00 +01:00
Marcus Weseloh
4a40695541 Settings documentation 2020-11-12 21:27:00 +01:00
Marcus Weseloh
39ae70793a MIDI Seqencer documentation 2020-11-12 21:27:00 +01:00
Marcus Weseloh
4185b25d6f MIDI input group
Contains MIDI Driver, MIDI Router, MIDI Player and MIDI Events
2020-11-12 21:27:00 +01:00
Marcus Weseloh
bae3dec78a Logging interface 2020-11-12 21:27:00 +01:00
Marcus Weseloh
66b7c19893 Audio output group
With subgroups Audio Driver and File Renderer
2020-11-12 21:27:00 +01:00
Marcus Weseloh
af68288628 Command Shell group for all shell related commands
With subgroups for command handler, shell and server.
2020-11-12 21:27:00 +01:00
Marcus Weseloh
8617e53a00 Replace all links to fluidsettings.xml with proper \ref's 2020-11-12 21:23:31 +01:00
Marcus Weseloh
c5b50455d7 Use xsltproc to include settings in API documentation 2020-11-12 21:23:31 +01:00
Marcus Weseloh
272cc5edad Some additional subgrouping 2020-11-12 21:23:31 +01:00
Marcus Weseloh
a11806aa32 Change files into groups / modules 2020-11-12 21:23:31 +01:00
Marcus Weseloh
d00849b556 Restructure devdocs into separate pages 2020-11-12 21:23:31 +01:00
Marcus Weseloh
339b30c946 Move doxygen customizations into separate directory 2020-11-12 21:23:31 +01:00
Marcus Weseloh
d1237c4678 Make larger enums easier to read 2020-11-12 21:23:31 +01:00
Marcus Weseloh
cfa9e7bedc Enable navigation sidebar 2020-11-12 21:23:31 +01:00
Marcus Weseloh
93b3375fe3 Remove "References" and "Referenced by" links from doc
They auto generated links are quite long on some functions, making
the documentation harder to read.
2020-11-12 21:23:31 +01:00
Marcus Weseloh
ae145daf72 Remove FLUIDSYNTH_API and FLUID_DEPRECATED macros from documentation 2020-11-12 21:23:15 +01:00
Tom M
780eebcb2c
Merge pull request #702 from FluidSynth/settings-stylesheet
New style for FluidSynth Settings XML and other small cleanup
2020-11-03 17:17:22 +01:00
Marcus Weseloh
c18e008d70 Options seems to be more widely used, so use that instead of Choices 2020-11-02 19:37:14 +01:00
Marcus Weseloh
54e164426f As gs is default for midi-bank-select, list it as first option for clarity 2020-11-02 19:33:08 +01:00
Marcus Weseloh
f1d760f02c Update ladspa.active description
Use 1 (TRUE) for consistency and mention LADSPA documentation
2020-11-02 19:32:37 +01:00
Marcus Weseloh
f3390e8049 Update effects-groups description to avoid the word "unit" 2020-11-02 19:31:54 +01:00
Marcus Weseloh
4fef48e740 Better explain currently unused effects-channels 2020-11-02 19:31:31 +01:00
Marcus Weseloh
f2d0789b26 Consistently format all floats 2020-11-02 19:30:24 +01:00
Marcus Weseloh
d14c9edc4f Update periods and period-size with current values from source 2020-11-02 19:05:36 +01:00
Marcus Weseloh
cd4376dfea shell.port is an int setting, not num 2020-11-02 19:00:35 +01:00
Marcus Weseloh
8d5377e391 Use (empty string) for empty default values of str settings 2020-11-02 18:55:36 +01:00
Marcus Weseloh
4f50c7278c Cleanup section label markup and rendering 2020-11-02 18:49:13 +01:00
Marcus Weseloh
a8041e45f8 Updated XSL / styling for fluidsettings.xml 2020-11-02 18:26:21 +01:00
derselbst
b28c0ed044 Revert "remove VintageDreamsWaves-v2.sf3"
This reverts commit a36c06cff2. We've got
explicit permission from Ian Wilson to convert it to SF3.

Addresses #701.
2020-10-31 15:42:33 +01:00
Marcus Weseloh
109c41c355
Add public API to pin and unpin presets to the sample cache (#698)
Following the discussion about an API to pin and unpin preset samples in the sample cache here:
https://lists.nongnu.org/archive/html/fluid-dev/2020-10/msg00016.html

Short explanation of the change:

Only the default loader currently supports dynamic sample loading, so I thought it might be a good idea to keep the changes for this feature mostly contained in the default loader as well. I've added two new preset notify flags (FLUID_PRESET_PIN and FLUID_PRESET_UNPIN) that are handled by the preset->notify callback and trigger the loading and possibly unloading of the samples.
2020-10-31 13:23:15 +01:00
derselbst
58ccd6d53e Add getopt support to CMake summary 2020-10-31 12:13:39 +01:00
jjceresa
032700f4e1
Add hint message when compiled without getopt support (#697) 2020-10-27 17:57:21 +01:00
Tom M
ef789ad3eb
Merge pull request #699 from FluidSynth/fix-small-warnings
Fix two small gcc warnings
2020-10-27 17:48:23 +01:00
jjceresa
42819d3e40 avoid an unlikely race condition 2020-10-27 14:01:37 +01:00
Marcus Weseloh
c8fea77528 Fix possible uninitialized use of dry_idx variable 2020-10-26 21:01:59 +01:00
Marcus Weseloh
7fc56567ca Remove unused variable 2020-10-26 20:59:44 +01:00
Tom M
e5695b7c2b
Replace FreeBSD 13.0 with 11.4 (#692)
13.0 hasn't been released yet and the CI build keeps failing for long.
2020-10-20 20:36:49 +02:00
Jon Latané
21653bd08b
Update Android CircleCI build to use latest orb, Android API, Oboe and Cerbero (#690)
This fixes the currently-broken CircleCI build for Android-useable .so files.

Currently the Cerbero build is based off https://github.com/falrm/cerbero until https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/641 is merged and deployed to the GitHub cerbero mirror.

Here is a successful build with the updated CircleCI workflow: https://app.circleci.com/pipelines/github/falrm/fluidsynth-android/31/workflows/0ad3186a-394c-4736-984b-96496b608053/jobs/32

Fixes #688
2020-10-20 17:09:11 +02:00
Tom M
3efaaffba5
Update and rename README.Android.md to README.md 2020-10-18 11:38:52 +02:00
jjceresa
5b8f3cbbc2
Ensure WaveOut compatibility with Win9X/NT (#687) 2020-10-14 17:54:56 +02:00
derselbst
f14cbb8782 Add FluidMixer chart to API docs 2020-10-11 19:40:05 +02:00
derselbst
15d4794013 Elaborate on synth.cpu-cores 2020-10-11 18:48:53 +02:00
Tom M
97615ef2cf
Promote Controller/Pressure/Bend event functions to 32bits (#670) 2020-10-08 16:33:52 +02:00
derselbst
d64ab70709 Fix build on Windows 9x/ME
Addresses #679
2020-10-04 20:42:08 +02:00
derselbst
94dbb9601e Add proper unicode support to Windows error reporting 2020-10-04 13:40:26 +02:00
derselbst
66d916a34a Fix Windows build 2020-10-04 13:32:38 +02:00
derselbst
abc89d7d6c Improve error reporting in Waveout and DSound drivers 2020-10-04 13:21:15 +02:00
jjceresa
b5da68393c
Fix minor bug in windows audio driver (#680) 2020-10-04 12:39:54 +02:00
jjceresa
b55884b273
Make winmidi driver multi devices capable. (#677) 2020-09-27 14:22:56 +02:00
KO Myung-Hun
83394ab286 Define FLUIDSYNTH_API on OS/2
Previously, CMake on OS/2 exported all the symbols unconditionally. Now
it exports necessary symbols only. As a result, it's necessary to
define FLUIDSYNTH_API correctly.

Addresses #678
2020-09-24 17:59:05 +02:00
David Runge
1cc492fdb5 Set the systemd unit target to default.target
fluidsynth.service.in:
The [Install] section [1] in systemd unit declares in which target the
service will be started.
The `multi-user.target` [2] - managed by the systemd _system_ service
manager - is used in the `fluidsynth.service`.
However, as it is a _user_ unit it needs to be pulled in by the
`default.target` [3] instead, which is the main target for the user
session (as started by `user@.service` [4]).

[1] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#%5BInstall%5D%20Section%20Options
[2] https://www.freedesktop.org/software/systemd/man/systemd.special.html#multi-user.target
[3] https://www.freedesktop.org/software/systemd/man/systemd.special.html#default.target1
[4] https://www.freedesktop.org/software/systemd/man/user@.service.html
2020-09-22 16:53:20 +02:00
derselbst
90ba627794 Remove a FIXME 2020-09-13 13:38:38 +02:00
derselbst
e48e48121b Remove a FIXME
Not aware of any problems caused by the old glib thread API. It will be removed sooner or later anyway.
2020-09-13 13:38:38 +02:00
derselbst
f6038ea194 Add comment into empty block 2020-09-13 13:38:38 +02:00
derselbst
dceb6e9835 Remove a FIXME
I have no clue what it refers to or what it's meant by that.
2020-09-13 13:38:38 +02:00
derselbst
c94ccdfed1 Remove a FIXME
I don't see any 'allocation' of preset. And ALL public synth functions have a mutex lock which might potentially block when called from synth context, but only then if the client app pessimizes this situation by extensively calling the synth from outside the synth context.
2020-09-13 13:38:38 +02:00
derselbst
0b8fa2e386 Remove a FIXME
I don't see any problem calling fluid_channel_init() from within synth context
2020-09-13 13:38:38 +02:00
derselbst
18fdafe37f Fix another NULL dereference
Access to field 'zone' results in a dereference of a null pointer (loaded from variable 'pr'), if size is negative. However, size should be unsigned.
2020-09-13 13:38:38 +02:00
derselbst
c4cd8bfc24 Fix a NULL dereference
Access to field 'zone' results in a dereference of a null pointer (loaded from variable 'prev_preset'), if `size` is negative. Problem is: Parameter `size` is `chunk.size` and should be unsigned.
2020-09-13 13:38:38 +02:00
derselbst
ec74ed905b Fix an impossible NULL deref 2020-09-13 13:38:38 +02:00
derselbst
7ff98227c6 Remove dead code 2020-09-13 13:38:38 +02:00
Tom M
4c1292d8ab
Remove fluid_event_any_control_change() from public API (#674)
Originally, I have only marked it deprecated. But since we have an SOVERSION bump next release and because this function was only meant for internal usage, I think it's safe to remove it right now.
2020-09-12 10:40:57 +02:00
derselbst
6776569abe Deprecate fluid_event_any_control_change() 2020-09-11 22:22:35 +02:00
Tom M
b8bd00539a
Add SonarQube and LGTM badges to README 2020-09-08 16:33:57 +02:00
Tom M
565002f34f
Add SonarQube static code analysis (#671) 2020-09-06 23:43:18 +02:00
derselbst
23b270c08b Merge branch '2.1.x' into master 2020-09-06 14:54:26 +02:00
derselbst
ff7c72c80f Bump to 2.1.5 2020-09-06 11:52:39 +02:00
jjceresa
f94cee0a50
Add multi channels support for audio driver. (#667)
This PR addresses #665.

1) Add new functions for multi channels support: `fluid_synth_write_float_channels()`, `fluid_synth_write_s16_channels()`
2) `dsound` and `waveout` driver make use of this support. tested on 2 audio devices: 
    - creative SB Live! (6 channels).
    - Realtek: ALC889A (8 channels).
2020-09-02 21:31:50 +02:00
jjceresa
57af8803f2
Mapping of fx unit output to dry buffers in mix mode. (#668)
Currently, all fx unit output (in mix mode) are mapped to the `first buffer`.
This is not appropriate for synth.audio-groups > 1

This PR allows the mapping of fx output based on `fx unit index` and `synth.audio-groups` value.
This allows us to get the `fx output `mixed to the respective  `buffer` on which a `MIDI channel` is mapped.
For example: with `synth.audio-groups = 3` and  `synth.effect-groups = 3`:
- MIDI chan 0 (dry + fx0) is mapped to buf 0
- MIDI chan 1 (dry + fx1) is mapped to buf 1
- MIDI chan 2 (dry + fx2) is mapped to buf 2
2020-09-02 21:10:31 +02:00
jjceresa
7834c4eb62 Add a chart about voice mixing and rendering 2020-09-02 20:54:05 +02:00
Tom M
aea6644324
Use a runtime check to detect version of libinstpatch (#666)
It could be that during runtime an older version of libinstpatch is used than the one fluidsynth was compiled against. In this case, libinstpatch will fail to load DLS fonts, because libinstpatch's initialization semantics don't match those compiled into fluidsynth.
2020-08-31 20:35:21 +02:00
jjceresa
c76949e6d3
Limiting audio-channels to audio-groups (#663) 2020-08-22 13:24:41 +02:00
derselbst
0acfd81e28 Merge branch '2.1.x' into master 2020-08-17 18:24:45 +02:00
derselbst
fa6f9c3570 Remove unused member variable 2020-08-17 18:23:43 +02:00
Tom M
43078d6b7b
TravisCI: add a build for GCC 4.8 (#662) 2020-08-17 18:19:15 +02:00
Fabrice Fontaine
0cccf83a38 CMakeLists.txt: fix build with gcc 4.8 (#661)
-Werror=incompatible-pointer-types is unconditionally used since version
2.1.4 and 137a14e106. This will raise a
build failure when checking for threads on gcc 4.8:

/home/buildroot/autobuild/run/instance-3/output-1/host/bin/arm-none-linux-gnueabi-gcc --sysroot=/home/buildroot/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-gnueabi/sysroot -DTESTKEYWORD=inline  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -Wall -W -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Wbad-function-cast -Wcast-align   -DNDEBUG -fPIE   -o CMakeFiles/cmTC_98946.dir/CheckIncludeFile.c.o   -c /home/buildroot/autobuild/run/instance-3/output-1/build/fluidsynth-2.1.4/CMakeFiles/CMakeTmp/CheckIncludeFile.c
cc1: error: -Werror=incompatible-pointer-types: no option -Wincompatible-pointer-types

Fixes:
 - http://autobuild.buildroot.org/results/13cbba871db56ef8657a3d13c6ac8e1b4da0d244

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-08-17 18:01:39 +02:00
derselbst
4b83ee55c0 Merge branch '2.1.x' into master 2020-08-10 20:35:42 +02:00
jjceresa
3ee2bbed96 fix NULL permitted for out and fx pointer buffer
Closes #659
2020-08-10 20:33:42 +02:00
Tom M
31c4e12ac9
Update Travis CI (#658)
* update to Ubuntu Focal
* use clang10
* avoid unintentional fallbacks to  default `/usr/bin/c++` compiler
* fix related compiler warnings
2020-07-28 21:05:01 +02:00
derselbst
3c94f6366d Merge branch '2.1.x' into master 2020-07-12 13:03:59 +02:00
derselbst
277eda6bc6 Update Android Asset loader to new callback API 2020-07-12 13:03:30 +02:00
derselbst
2393aef3bd Fix printf format warnings 2020-07-12 12:55:32 +02:00
derselbst
62b715483f Merge branch '2.1.x' into master 2020-07-09 19:39:21 +02:00
derselbst
d7abe8bdfd Fix a possible race condition during midi autoconnect 2020-07-09 19:30:32 +02:00
derselbst
eac0de0345 Fix a NULL deref in jack driver 2020-07-09 19:10:11 +02:00
derselbst
85f94c61c9 Fix passing arguments from incompatible pointer type 2020-07-08 19:20:13 +02:00
derselbst
137a14e106 Turn incompatible-pointer-types warning into error 2020-07-08 19:10:53 +02:00
Tom M
031b740451
Update Doxyfile 2020-07-06 18:46:57 +02:00
derselbst
d73135fc48 Merge branch '2.1.x' into master 2020-07-05 16:32:47 +02:00
derselbst
459949a62b Bump to 2.1.4 2020-07-05 16:19:33 +02:00
derselbst
56f8f9be7c Update API docs 2020-07-05 16:15:11 +02:00
derselbst
c5293fc753 Fix an uninitialized memory access
that could possibly trigger an FPE trap for instruments that use the exclusive class generator
2020-06-28 14:58:02 +02:00
derselbst
4261848dd4 Fix regression introduced in a89399476e
Mentioned commit broke fluid_synth_start() when using a DLS soundfont.
2020-06-26 17:38:49 +02:00
Tom M
aa32da0a47
Properly handle overlapping notes when using fluid_event_note() (#637) 2020-06-15 08:38:56 +02:00
Tom M
e16ca05a58
Avoid num_samples from becoming negative (#653)
For Soundfonts bigger 2GiB, num_samples becomes negative. When being passed to safe_fread() it's promoted to long long and when being passed to fread(), it's cast to size_t. Works fine in twos-complement, but still is not nice.
2020-06-08 09:24:23 +02:00
derselbst
0354196e43 Fix typo in API docs 2020-05-27 17:26:14 +02:00
Tom M
0d98c47545
Revise the sequencer's event queue (#604)
Proposing a new event queue for the sequencer, based on prior discussion:
https://lists.nongnu.org/archive/html/fluid-dev/2019-12/msg00001.html

With this change fluidsynth will require a C++98 compliant compiler.

Consider this as RFC, feedback is welcome.

The "pain-points" from the discussion:

#### 1. It is slow.

Done (thanks to heap sort), see runtime of `test_seq_event_queue_sort`.

#### 2. A meaningful ordering for events with the same tick has not been considered.

Done, see comments in `fluid_seq_queue.cpp`.

#### 3. Complicated implementation

Now uses one single event queue, which requires C++98. Implemented similarly to std::priority_queue by using heap sort.

The "queue" I use currently is of type `std::deque`. `deque` does not provide preallocation. `std::vector` does provide it. However, `std::deque` has the huge advantage that appending additional elements is cheap. For `std::vector` appending new elements would require to reallocate all the memory and copy it to the new array. So,

* either use `std::deque` with the risk that memory allocation may occur during `fluid_sequencer_send_at()`, or
* use `std::vector` with a preallocated pool of events and make `fluid_sequencer_send_at()` when the `vector` runs out of capacity.

Comments?

#### 4. Events that have been processed are deleted and gone.

After having thought about this more, this is the correct behavior. After events have been dispatched, they must be released to free underlying memory, see point 3. For the very rare case that a client (e.g. fluid_player) may require those events in the future, the client should be responsible for storing the events somewhere.

#### 5. The sequencer supports the system timer as alternative time source.

The conclusion from the mailing list was that the system timer can be removed. This has been done.

#### 6. Time Scaling

Time scaling can now be used for arbitrary tempo changes. The previous implementation was capable of that as well, however, the time-scale was limited to 1000. The only limitation for the scale is now >0, see `test_seq_scale`.

### Other Points

* `fluid_sequencer_remove_events()` turned out to be broken before, as it did not remove all events from the queue. This has been fixed, see `test_seq_event_queue_remove`.

* Consider the following code executed by `threadA`:

```c
fluid_sequencer_send_at(event0);
fluid_sequencer_set_time_scale(); // new scale
fluid_sequencer_send_at(event1);
```

The new scale will be definitely applied to `event1`. However, if another concurrently running `threadB` executes `fluid_sequencer_process()`, it was previously not clear, whether the new scale was also applied to event0. This depends on whether `event0` was still in the `preQueue`, and this depends on `event0.time` and the tick count that `fluid_sequencer_process()` is being called with. This has been changed. As of now, events are queued with their timestamp AS-IS. And only the latest call to `fluid_sequencer_set_time_scale()` is being considered during `fluid_sequencer_process()`. This makes the implementation very simple, i.e. no events need to be changed and the sequencer doesn't have to be locked down. On the other hand, it means that `fluid_sequencer_set_time_scale()` can only be used for tempo changes when called from the sequencer callback. In other words, if `threadA` executes the code above followed by `fluid_sequencer_process()`, `event0` and `event1` will be executed with the same tempo, which is the latest scale provided to the seq. Is this acceptable? The old implementation had the same limitation. And when looking through the internet, I only find users who call `fluid_sequencer_set_time_scale()` from the sequencer callback. Still, this is a point I'm raising for discussion.
2020-05-26 17:16:22 +02:00
Tom M
9995fd88b2
Support loading SoundFonts >2GiB on Windows (#629)
Since sizeof(long) == 4 even on 64 bit Windose, big files cannot be
loaded natively via the ANSI C file API. This change makes fluidsynth's
file callback API use long long, which is guaranteed to be at least 64
bit wide.
2020-05-26 16:53:59 +02:00
derselbst
19a20eb852 Fix another NULL deref related to #635 2020-05-23 15:31:48 +02:00
derselbst
27ad0684c6 Add regression test for #635 2020-05-23 15:30:27 +02:00
derselbst
28cde7e867 Reactivate test_preset_sample_loading 2020-05-23 14:40:41 +02:00
derselbst
5af89f8c92 Bump to 2.1.3 2020-05-23 14:29:17 +02:00
derselbst
a865ac33d9 Remove SDL2 not inited warning for upcoming release
Addresses #649
2020-05-19 19:44:47 +02:00
derselbst
9ad2bcaa10 Quote MIDI device names
Addresses #650
2020-05-19 16:39:07 +02:00
derselbst
4f1fdc0df7 Fix unicode string comparison 2020-05-19 16:39:07 +02:00
derselbst
45efbd97c0 Revise log messages in new_fluid_winmidi_driver()
Addresses #650.
2020-05-19 16:39:07 +02:00
derselbst
69e7eca670 Fix notes not being played that start at the value of seek_ticks
Fixes #646
2020-05-17 09:56:35 +02:00
jjceresa
d63524683f
Fix ordering of operations (#647) 2020-05-09 09:31:51 +02:00
derselbst
304096add7 Update API docs about synthesis context 2020-05-02 20:12:01 +02:00
jjceresa
8a3eaf9b18
Make fluidsynth call ipatch_close() (#644) 2020-05-02 14:31:34 +02:00
derselbst
87a6debba0 Replace custom version check by GLIB_CHECK_VERSION 2020-05-02 13:42:10 +02:00
derselbst
87c7599e63 Remove unused variable 2020-05-02 13:24:33 +02:00
jjceresa
6aea18bef4
Allow the reverb to pre allocate delay lines. (#638)
This PR allows the reverb to pre-allocate the memory needed for the maximum sample-rate of the synth. That means that on sample rate change there are no memory allocation and the function fluid_revmodel_samplerate_change() should always return FLUID_OK.

The PR addresses discussion in #608.
2020-05-01 13:26:52 +02:00
jjceresa
791dac6736
Stop dsound properly. (#642)
Stopping `dsound `before stopping `audio thread` avoid dsound playing transient glitches between the time audio task is stopped and dsound will be released. These short trailing glitches are particularly audible when captured by a reverb connected on output.
2020-04-30 19:51:24 +02:00
Tom M
e2d435dad6
Fix a NULL deref in delete_rvoice_mixer_threads() (#641)
The function attempts to lock a mutex that might have not been created yet, due to a previous error.
2020-04-30 19:49:58 +02:00
jjceresa
ff14432cd9
Make chorus capable of sample rate change. (#639) 2020-04-27 18:07:22 +02:00
Tom M
a89399476e
Fix a NULL pointer deref if dynamic-sample-loading is enabled (#636) 2020-04-25 17:26:21 +02:00
derselbst
85cf123d38 Guard against multiple calls to fluid_player_seek()
Addresses #634
2020-04-22 17:28:47 +02:00
derselbst
f14c33a4e6 Elaborate docs of audio.realtime-prio 2020-04-22 17:28:38 +02:00
derselbst
893f48e4a2 Amend 69cfa781eb
Remove incorrect atomic read from player->seek_ticks. Addresses #634
2020-04-20 15:57:59 +02:00
derselbst
69cfa781eb Fix a race condition while fluid_player is seeking
Fixes #634
2020-04-19 12:08:48 +02:00
derselbst
f15b8e5447 Update API docs
for fluid_get_sysconf() and fluid_get_userconf()
2020-04-18 23:56:59 +02:00
Tobias Kortkamp
fdd577b567
Fix FreeBSD CI (#631)
Switch to FreeBSD 12.1-RELEASE.  12.0-RELEASE is no longer supported.

Signed-off-by: Tobias Kortkamp <t@tobik.me>
2020-04-09 10:53:27 +02:00
Tom M
85237e4fc8
Fix cross-compilation from Win32 to ARM using vcpkg (#630)
For some reason, the configure command must be specified explicitly in the `gentables` build step. Otherwise, the ARM target compiler will be used to build `make_tables` rather than the host compiler. 

Now that microsoft/vcpkg#10485 has been completed, an ARM CI build can be added to AppVeyor. Also, the build status table in the README has been updated.
2020-04-08 11:13:42 +02:00
derselbst
d9ad6a0725 Fix warning in cmake >= 3.17 2020-04-06 10:40:37 +02:00
derselbst
2a6b22e9bb Bump to 2.1.2 2020-04-05 18:44:06 +02:00
derselbst
631c9798cb Update API docs on fluid_player_set_bpm()
Resolves #624
2020-03-20 19:57:43 +01:00
derselbst
eff728753b Update API docs 2020-03-08 09:55:09 +01:00
Tom M
cc85d285b5
Fix a memory leak in Oboe driver (#626) 2020-03-07 14:15:13 +01:00
Tom M
c9d023230a
Add verbose error logging for opensles and oboe (#627) 2020-03-07 14:14:28 +01:00
derselbst
cabb219285 Update API docs 2020-03-07 13:42:09 +01:00
derselbst
12fa690667 MacOS CI: upgrade packages before installing 2020-03-05 17:17:19 +01:00
derselbst
8eb06fdb6c FreeBSD CI: update repositories 2020-03-05 16:28:54 +01:00
derselbst
ddbd0afcc8 Fix a possible NULL dereference 2020-03-03 16:48:24 +01:00
derselbst
33f687704f Exit with error when invalid commandline arguments are supplied
Resolves #623
2020-03-03 16:46:50 +01:00
derselbst
a359e7f222 Turn SDL2 initialization message into a warning
Resolves #622
2020-03-03 16:15:32 +01:00
Tom M
3b851da6f7
Amend comment in fluidsynth_fx.c 2020-02-16 19:55:28 +01:00
derselbst
7ea9e21081 Fix build of OSS driver if soundcard.h is not in sys/ 2020-02-16 16:43:20 +01:00
derselbst
ab15b32656 Bump to 2.1.1 2020-02-16 15:59:11 +01:00
derselbst
991a0a01d7 Cleanup TODO 2020-02-16 15:59:11 +01:00
derselbst
98d395bab0 Update fluidsynth_fx example to explain effects mixing 2020-02-16 10:03:45 +01:00
derselbst
871e409572 Update API doc of fluid_audio_func_t 2020-02-16 10:03:27 +01:00
derselbst
746cbeb1c1 Remove orphaned SF spec link from API docs 2020-02-16 09:44:07 +01:00
derselbst
d5424462b5 Update documentation of --verbose option 2020-02-14 13:40:50 +01:00
Tom M
aa3f5a52fd
Make printing debug messages runtime configurable (#619)
Supplying --verbose to the fluidsynth executable now prints debug messages to stdout. Debug messages are still being printed by default when fluidsynth was compiled in debug mode.
2020-02-13 17:09:20 +01:00
Tom M
2bbe9272bb
Merge pull request #614 from FluidSynth/sfsampletype
Hardening fluid_sample_validate() against invalid flag combinations
2020-02-13 17:07:57 +01:00
derselbst
b3939138d4 Extend error logging in alsa driver 2020-02-08 18:55:26 +01:00
derselbst
729a0d04fa Turn cmake's developer warnings into errors during CI builds 2020-02-02 15:45:44 +01:00
derselbst
2759d9e087 Remove unused member SFSample::samfile 2020-02-02 15:25:53 +01:00
derselbst
8a0761a129 Fix cmake warning 2020-02-02 15:25:39 +01:00
derselbst
df58a440f2 Warn if ogg sample is not ogg compressed 2020-02-02 15:19:27 +01:00
Tom M
9f7ea07bfc
Fix broken FreeBSD logo in README.md 2020-02-01 19:45:06 +01:00
derselbst
e4f4390521 Fix libinstpatch's import lib name 2020-02-01 19:25:11 +01:00
derselbst
93a170ca58 Minor API doc update 2020-02-01 14:37:35 +01:00
Tom M
af2342ac43
Solve the sequencer client unregistering problem (#610)
Responsibility for calling fluid_sequencer_unregister_client() in case of FLUID_SEQ_UNREGISTERING events has been moved to fluid_sequencer_send_now(). In other words, a FLUID_SEQ_UNREGISTERING event now really unregisters the client, no matter how the client's callback function looks like.

Avoids leaking the sequencer clients if implementations do not unregister them explicitly.

Also fixes another memory leak if fluid_sequencer_register_fluidsynth() clients were unregistered with fluid_sequencer_unregister_client() rather than by sending an unregistering event.
2020-02-01 14:32:35 +01:00
Tom M
943ed37e54
Add ubsan and asan to TravisCI (#612)
Also add clang9
2020-02-01 10:55:50 +01:00
Nikos Chantziaras
545959ca17
Fix linking against libinstpatch (#617)
This fixes the case where linking fails if libinstpatch is not installed in a system/default location but instead needs to be found through `PKG_CONFIG_PATH`.
2020-02-01 08:54:21 +01:00
Atsushi Eno
69ba49348a
CMakeLists.txt: make positional code (-fPIC) customizible. (#616)
For some use cases it is necessary to specify -fPIC even if we build
static library e.g. building vst plugins (*.so) which may not load
shared libraries from outside the system paths (depends on DAWs).
For such environment we would like to build the final shared library
without depending on `libfluidsynth.so(.*)` but if we build libfluidsynth.a
it always comes without -fPIC. This change makes it adjustable.
2020-01-31 15:45:18 +01:00
derselbst
dcc9c27acf Hardening fluid_sample_validate() against invalid flag combinations
e.g. unknown compression types, multiple exclusive flags or no flags at all
2020-01-24 15:57:08 +01:00
derselbst
76f4bc3db3 Add a unit test for fluid_sample_validate() 2020-01-24 15:57:08 +01:00
derselbst
a250ac2a97 Slightly extend test_sfont_loading.c 2020-01-24 13:33:41 +01:00
Tom M
872c6bc678
Compile suitable demo files from doc/ (#611) 2020-01-24 08:57:20 +01:00
derselbst
5070fe8419 Attempt to fix double free in jack driver 2020-01-23 14:43:42 +01:00
derselbst
5b3ec92cec Fix a memory leak in the file renderer 2020-01-19 16:17:00 +01:00
Tom M
c85ad53d60
Deprecate usage of the system timer for the sequencer (#599)
Deprecate usage of the system timer for the sequencer and print a warning if the system timer is used.
2020-01-19 15:37:42 +01:00
Tom M
3610372ae5
Workaround for jack sample rate mismatch (#607)
During the creation of a jack audio driver, it is checked whether the sample-rate of the settings object matches jack's rate. If not, it was adjusted previously via fluid_synth_set_sample_rate(). Due to the deprecation of that function and removal of real-time capability of the synth.sample-rate setting, a regression was introduced in 5fbddcecc3 causing the synth's sample-rate to be not updated.

This workaround obtains the synth via the settings instance and for now calls the deprecated sample-rate set function.
2020-01-19 15:36:15 +01:00
derselbst
ba71d6ad9e Update unregistering unit test 2020-01-18 09:51:19 +01:00
derselbst
e19652d45a Amend documentation about synth.sample-rate setting 2020-01-11 14:45:20 +01:00
derselbst
6163577a61 Remove unused clang-format cmake target 2020-01-11 09:45:05 +01:00
derselbst
850e8a2ec8 Fix building without pkg-config 2020-01-11 09:43:46 +01:00
Tom M
528e5465f1
Merge pull request #606 from ffontaine/master
CMakeLists.txt: use pkg-config to find readline
2020-01-11 09:38:06 +01:00
derselbst
7f816029ab Fix a few integer truncation warnings 2020-01-10 17:07:58 +01:00
derselbst
7af62902b6 Update API doc of fluid_sample_type 2020-01-10 16:57:23 +01:00
Fabrice Fontaine
c538c9fa7e CMakeLists.txt: use pkg-config to find readline
Use pkg_check_modules to find readline dependencies such as ncurses and
fallback on current mechanism.

This will fix the following build failure when building statically:

/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/buildroot/autobuild/instance-1/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libreadline.a(display.o): in function `cr':
display.c:(.text+0x1a0): undefined reference to `tputs'

Fixes:
 - http://autobuild.buildroot.org/results/88609eefe55af2ca50d43e17d3424b923528b07a

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-01-10 08:57:57 +01:00
Tom M
9b069faf87
Merge pull request #598 from FluidSynth/seq-test
Add unit tests for the sequencer
2020-01-03 21:05:07 +01:00
derselbst
f979c58e3c Add a unit test for fluid_sequencer_set_time_scale() 2020-01-03 20:30:09 +01:00
derselbst
6b42f27724 Remove redundant call to fluid_event_set_time()
It's already done by fluid_sequencer_send_at()
2020-01-02 11:14:25 +01:00
derselbst
68371d382b Update API doc of fluid_sequencer_add_midi_event_to_buffer() 2020-01-02 11:14:04 +01:00
derselbst
7898c4f4ab Add a unit test for fluid_sequencer_send_at() 2019-12-27 10:49:25 +01:00
luz.paz
45f8e0a868 Fix various typos
Found via `codespell -q 3 -L uint -S ./ChangeLog -L dur`
2019-12-17 20:11:49 +01:00
derselbst
13c6e98936 Guard the sequencer API 2019-12-14 18:38:27 +01:00
Tom M
cd199cfdc8
Remove unused tracing code from sequencer (#596) 2019-12-14 18:09:29 +01:00
derselbst
4af42bd8ea Update API docs about queuing seq events 2019-12-13 16:02:25 +01:00
derselbst
9a168ce3b2 Remove FreeBSD10.4 from CI
Image is not available anymore
2019-12-12 12:04:35 +01:00
derselbst
08848864d2 Elaborate API docs
fluid_synth_all_sounds_off() and fluid_synth_all_notes_off()
2019-12-06 17:24:58 +01:00
derselbst
b266cf21a3 Fix copy artifacts on WinXP 2019-12-01 10:35:33 +01:00
281 changed files with 60345 additions and 6471 deletions

View file

@ -1,50 +0,0 @@
image:
- Visual Studio 2017
build:
parallel: true
verbosity: detailed
configuration:
- Release
environment:
# update the vcpkg cache even if build fails
APPVEYOR_SAVE_CACHE_ON_ERROR: true
matrix:
- platform: x86
- platform: x64
cache:
- c:\Tools\vcpkg\installed
init:
- set TARGET_PLATFORM=
- if "%platform%"=="x64" ( set TARGET_PLATFORM= Win64)
- if "%platform%"=="ARM" ( set TARGET_PLATFORM= ARM)
- echo %TARGET_PLATFORM%
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set "generator=Visual Studio 15 2017%TARGET_PLATFORM%" && set "toolset=v141_xp" )
- echo %generator%
- echo %toolset%
install:
# make sure the latest version of git is installed
- choco upgrade git -y
- vcpkg install glib:%platform%-windows
build_script:
- mkdir build
- cd build
- cmake -G "%generator%" -T "%toolset%" -Denable-pkgconfig=0 -DCMAKE_TOOLCHAIN_FILE=c:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DNO_GUI=1 ..
- cmake --build . --config Release # build libfluidsynth and fluidsynth exec
- cmake --build . --config Release --target check # build and exec unittests
after_build:
- 7z a fluidsynth-vcpkg-%platform%.zip %APPVEYOR_BUILD_FOLDER%\build\src\Release\*
artifacts:
- path: build/fluidsynth-vcpkg-%platform%.zip
name: FluidSynth

View file

@ -1,24 +0,0 @@
# C/C++ with GCC
# Build your C/C++ project with GCC using make.
# Add steps that publish test results, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
jobs:
- job: macOS
pool:
vmImage: 'macOS-10.14'
steps:
- script: |
brew update
brew install glib gobject-introspection libsndfile pkg-config jack dbus-glib pulseaudio portaudio sdl2
displayName: 'Prerequisites'
- script: |
mkdir build && cd build
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
make
displayName: 'Compile fluidsynth'
- script: |
cd build || exit -1
make check || exit -1
displayName: 'Execute Unittests'

View file

@ -0,0 +1,551 @@
trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.azure/azure-pipelines-win.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
parameters:
- name: UseCache
displayName: Use Dependency Cache
type: boolean
default: true
values:
- true
- false
schedules:
- cron: "0 0 * * 1"
displayName: 'Weekly Monday Midnight build without caching'
branches:
include:
- master
always: true
variables:
ICONV_VERSION: '1.16'
# Use recent master libffi, because 3.3 is broken: checking host system type... Invalid configuration `arm-none-linux-eabi': machine `arm-none-linux' not recognized
FFI_VERSION: '3.4.2'
GETTEXT_VERSION: '0.21'
#need to switch to meson build system to use a more recent version
GLIB_VERSION: '2.71'
GLIB_EXTRAVERSION: '2'
OBOE_VERSION: '1.5.0'
SNDFILE_VERSION: '1.0.31'
INSTPATCH_VERSION: '1.1.6'
VORBIS_VERSION: '1.3.7'
OGG_VERSION: '1.3.5'
OPUS_VERSION: '1.3.1'
FLAC_VERSION: '1.3.4'
PCRE_VERSION: '8.45'
# Android NDK sources and standalone toolchain is put here
DEV: '$(System.DefaultWorkingDirectory)/android-build-root'
# This is a symlink pointing to the real Android NDK
# Must be the same as $ANDROID_NDK_HOME see:
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
# We cannot use $ANDROID_NDK_HOME because this is an environment variable, but here, we need a compile-time constant.
NDK: '/usr/local/lib/android/sdk/ndk-bundle'
# All the built binaries, libs and their headers will be installed here
PREFIX: '$(DEV)/opt/android'
# Prevent installing to lib64/
# This becomes important, if you would build on e.g. openSUSE
LIBPATH0: '$(PREFIX)/lib'
# The path of standalone NDK toolchain
# Refer to https://developer.android.com/ndk/guides/standalone_toolchain.html
NDK_TOOLCHAIN: '$(NDK)/toolchains/llvm/prebuilt/linux-x86_64/'
# Don't mix up .pc files from your host and build target
PKG_CONFIG_PATH: '$(LIBPATH0)/pkgconfig'
# setting PKG_CONFIG_PATH alone does not seem to be enough to avoid mixing up with the host, also set PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR: '$(PKG_CONFIG_PATH)'
# Set Android target API level
# when compiling with clang use at least 28 as this makes sure that android provides the posix_spawn functions, so the compilation of gettext will (should) work out of the box
# it's probably a bug of gettext, if posix_spawn is not available it replaces it with its own implementation. Autotools of gettext set HAVE_POSIX_SPAWN==0 (which is correct) but for some reason REPLACE_POSIX_SPAWN==0 (which is wrong, as it should be 1).
#
# NOTE: API 24 is required because it provides fseeko() and ftello() required by libflac
ANDROID_API: '24'
# Tell configure what flags Android requires.
# Turn Wimplicit-function-declaration into errors. Else autotools will be fooled when checking for available functions (that in fact are NOT available) and compilation will fail later on.
# Also disable clangs integrated assembler, as the hand written assembly of libffi is not recognized by it, cf. https://crbug.com/801303
CFLAGS: "-fPIE -fPIC -I$(PREFIX)/include --sysroot=$(NDK_TOOLCHAIN)/sysroot -I$(NDK_TOOLCHAIN)/sysroot/usr/include -Werror=implicit-function-declaration"
CXXFLAGS: $(CFLAGS)
CPPFLAGS: $(CXXFLAGS)
DEBIAN_FRONTEND: 'noninteractive'
ARTIFACT_NAME: 'fluidsynth-android$(ANDROID_API)'
jobs:
- job: Android
strategy:
matrix:
ARM:
ARCH: 'arm'
ANDROID_ARCH: 'armv7a'
ANDROID_ABI_CMAKE: 'armeabi-v7a'
ANDROID_TARGET_ABI: "eabi"
ANDROID_ABI_MESON: 'arm'
# the --target to be used by autotools
AUTOTOOLS_TARGET: "$(ARCH)-linux-android$(ANDROID_TARGET_ABI)"
AARCH64:
ARCH: 'aarch64'
ANDROID_ARCH: 'aarch64'
ANDROID_ABI_CMAKE: 'arm64-v8a'
ANDROID_TARGET_ABI:
ANDROID_ABI_MESON: 'aarch64'
AUTOTOOLS_TARGET: "$(ARCH)-none-linux-android"
i686:
ARCH: 'i686'
ANDROID_ARCH: 'i686'
ANDROID_ABI_CMAKE: 'x86'
ANDROID_TARGET_ABI:
ANDROID_ABI_MESON: 'x86'
AUTOTOOLS_TARGET: "$(ARCH)-pc-linux-android"
x86_64:
ARCH: 'x86_64'
ANDROID_ARCH: 'x86_64'
ANDROID_ABI_CMAKE: 'x86_64'
ANDROID_TARGET_ABI:
ANDROID_ABI_MESON: 'x86_64'
AUTOTOOLS_TARGET: "$(ARCH)-pc-linux-android"
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
set -ex
mkdir -p $(DEV)
displayName: 'mkdir $(DEV)'
- script: |
sudo apt-get update -y
displayName: 'Update apt'
- script: |
set -ex
sudo -E apt-get -y --no-install-suggests --no-install-recommends install wget tar bzip2 xz-utils ca-certificates
displayName: 'apt-get install wget tar'
- script: |
set -ex
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz
tar zxf libiconv-${ICONV_VERSION}.tar.gz
wget -O libffi-${FFI_VERSION}.tar.gz https://github.com/libffi/libffi/releases/download/v${FFI_VERSION}/libffi-${FFI_VERSION}.tar.gz
tar zxf libffi-${FFI_VERSION}.tar.gz
wget http://ftp.gnu.org/pub/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz
tar zxf gettext-${GETTEXT_VERSION}.tar.gz
wget http://ftp.gnome.org/pub/gnome/sources/glib/${GLIB_VERSION}/glib-${GLIB_VERSION}.${GLIB_EXTRAVERSION}.tar.xz
tar xf glib-${GLIB_VERSION}.${GLIB_EXTRAVERSION}.tar.xz
wget -O oboe-${OBOE_VERSION}.tar.gz https://github.com/google/oboe/archive/${OBOE_VERSION}.tar.gz
tar zxf oboe-${OBOE_VERSION}.tar.gz
wget https://github.com/libsndfile/libsndfile/releases/download/${SNDFILE_VERSION}/libsndfile-${SNDFILE_VERSION}.tar.bz2
tar jxf libsndfile-${SNDFILE_VERSION}.tar.bz2
wget -O libinstpatch-${INSTPATCH_VERSION}.tar.gz https://github.com/swami/libinstpatch/archive/refs/tags/v${INSTPATCH_VERSION}.tar.gz
tar zxf libinstpatch-${INSTPATCH_VERSION}.tar.gz
wget https://github.com/xiph/vorbis/releases/download/v${VORBIS_VERSION}/libvorbis-${VORBIS_VERSION}.tar.gz
tar zxf libvorbis-${VORBIS_VERSION}.tar.gz
wget https://github.com/xiph/ogg/releases/download/v${OGG_VERSION}/libogg-${OGG_VERSION}.tar.gz
tar zxf libogg-${OGG_VERSION}.tar.gz
wget -O flac-${FLAC_VERSION}.tar.gz https://github.com/xiph/flac/archive/refs/tags/${FLAC_VERSION}.tar.gz
tar xf flac-${FLAC_VERSION}.tar.gz
wget -O opus-${OPUS_VERSION}.tar.gz https://github.com/xiph/opus/archive/refs/tags/v${OPUS_VERSION}.tar.gz
tar xf opus-${OPUS_VERSION}.tar.gz
wget -O pcre-${PCRE_VERSION}.tar.bz2 https://sourceforge.net/projects/pcre/files/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.tar.bz2/download
tar jxf pcre-${PCRE_VERSION}.tar.bz2
cd pcre-${PCRE_VERSION}
# CMake checks for existence of strtoq() using the C compiler - and yes, it does exist!
# Later on, it's actually used by the C++ compiler, where it does not exist.
# Rename the function so CMake won't find it.
sed -i 's/strtoq/strtoqqqq/g' CMakeLists.txt
displayName: 'Download Dependencies'
workingDirectory: $(DEV)
- task: Cache@2
inputs:
key: '$(ARCH) | $(DEV)/*.tar.*'
path: '$(PREFIX)'
cacheHitVar: 'CACHE_RESTORED'
displayName: 'Cache fluidsynth dependency libraries'
condition: and(not(in(variables['Build.Reason'], 'Schedule')), ${{ parameters.useCache }})
- script: |
set -ex
sudo apt remove --purge --auto-remove cmake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
displayName: 'Use recent CMake Version'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
enabled: 'false'
- script: |
set -ex
sudo -E apt-get -y --no-install-suggests --no-install-recommends install gettext cmake zlib1g-dev autogen automake autoconf libtool pkg-config autotools-dev build-essential meson ninja-build python3-distutils
displayName: 'apt-get install build-tools'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK_ROOT
displayName: 'Use NDK r22'
- script: |
set -e
# The cross-compile toolchain we use
export ANDROID_TARGET=${ARCH}-linux-android${ANDROID_TARGET_ABI}
echo "##vso[task.setvariable variable=ANDROID_TARGET]$ANDROID_TARGET"
export ANDROID_TARGET_API=${ANDROID_ARCH}-linux-android${ANDROID_TARGET_ABI}${ANDROID_API}
echo "##vso[task.setvariable variable=ANDROID_TARGET_API]$ANDROID_TARGET_API"
# Add the standalone toolchain to the search path.
export PATH=$PATH:${PREFIX}/bin:${PREFIX}/lib:${PREFIX}/include:${NDK_TOOLCHAIN}/bin
echo "##vso[task.setvariable variable=PATH]$PATH"
LIBPATH1=$(NDK_TOOLCHAIN)/sysroot/usr/lib
LIBPATH2=$(NDK_TOOLCHAIN)/sysroot/usr/lib/$(ARCH)-linux-android$(ANDROID_TARGET_ABI)/$(ANDROID_API)
LIBPATH3=$(NDK_TOOLCHAIN)/sysroot/usr/lib/$(ARCH)-linux-android$(ANDROID_TARGET_ABI)
export LDFLAGS="-pie -Wl,-rpath-link=${LIBPATH1} -L${LIBPATH1} -Wl,-rpath-link=${LIBPATH2} -L${LIBPATH2} -Wl,-rpath-link=${LIBPATH3} -L${LIBPATH3} -Wl,-rpath-link=${LIBPATH0} -L${LIBPATH0}"
echo "##vso[task.setvariable variable=LDFLAGS]$LDFLAGS"
# Tell configure what tools to use.
export AR=${ANDROID_TARGET}-ar
echo "##vso[task.setvariable variable=AR]$AR"
export AS=${ANDROID_TARGET_API}-clang
echo "##vso[task.setvariable variable=AS]$AS"
export CC=${ANDROID_TARGET_API}-clang
echo "##vso[task.setvariable variable=CC]$CC"
export CXX=${ANDROID_TARGET_API}-clang++
echo "##vso[task.setvariable variable=CXX]$CXX"
export LD=ld.lld
echo "##vso[task.setvariable variable=LD]$LD"
export STRIP=${ANDROID_TARGET}-strip
echo "##vso[task.setvariable variable=STRIP]$STRIP"
export RANLIB=${ANDROID_TARGET}-ranlib
echo "##vso[task.setvariable variable=RANLIB]$RANLIB"
displayName: 'Set environment variables'
- script: |
set -ex
pushd libiconv-${ICONV_VERSION}
./configure \
--host=${AUTOTOOLS_TARGET} \
--prefix=${PREFIX} \
--libdir=${LIBPATH0} \
--disable-rpath \
--enable-static \
--disable-shared \
--with-pic \
--disable-maintainer-mode \
--disable-silent-rules \
--disable-gtk-doc \
--disable-introspection \
--disable-nls
make -j$((`nproc`+1))
make install
popd
displayName: 'Compile libiconv'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
pushd libiconv-${ICONV_VERSION}
cat config.log
displayName: 'libiconv config.log'
workingDirectory: $(DEV)
condition: and(failed(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
pushd libffi-${FFI_VERSION}
NOCONFIGURE=true autoreconf -v -i
# install headers into the conventional ${PREFIX}/include rather than ${PREFIX}/lib/libffi-3.2.1/include.
#sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' -i include/Makefile.in
#sed -e '/^includedir/ s/=.*$/=@includedir@/' -e 's/^Cflags: -I${includedir}/Cflags:/' -i libffi.pc.in
./configure --host=${AUTOTOOLS_TARGET} --prefix=${PREFIX} --libdir=${LIBPATH0} --enable-static --disable-shared
make -j$((`nproc`+1))
make install
popd
displayName: 'Compile libffi'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
pushd gettext-${GETTEXT_VERSION}
./configure \
--host=${AUTOTOOLS_TARGET} \
--prefix=${PREFIX} \
--libdir=${LIBPATH0} \
--disable-rpath \
--disable-libasprintf \
--disable-java \
--disable-native-java \
--disable-openmp \
--disable-curses \
--enable-static \
--disable-shared \
--with-pic \
--disable-maintainer-mode \
--disable-silent-rules \
--disable-gtk-doc \
--disable-introspection
make -j$((`nproc`+1))
make install
popd
displayName: 'Compile gettext'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- template: cmake-android.yml
parameters:
sourceDir: 'pcre-$(PCRE_VERSION)'
cmakeArgs: '-DPCRE_SUPPORT_UNICODE_PROPERTIES=1 -DPCRE_SUPPORT_UTF=1 -DPCRE_BUILD_PCRECPP=0 -DPCRE_BUILD_TESTS=0'
- script: |
set -ex
export PKGCFG=`which pkg-config`
pushd glib-${GLIB_VERSION}.${GLIB_EXTRAVERSION}
cat << EOF > cross_file.ini
[host_machine]
system = 'android'
cpu_family = '${ANDROID_ABI_MESON}'
cpu = '${ANDROID_ARCH}'
endian = 'little'
[binaries]
c = '${NDK_TOOLCHAIN}/bin/${CC}'
cpp = '${NDK_TOOLCHAIN}/bin/${CXX}'
ar = '${NDK_TOOLCHAIN}/bin/${AR}'
as = '${NDK_TOOLCHAIN}/bin/${AS}'
ld = '${NDK_TOOLCHAIN}/bin/${LD}'
strip = '${NDK_TOOLCHAIN}/bin/${STRIP}'
ranlib = '${NDK_TOOLCHAIN}/bin/${RANLIB}'
pkgconfig = '${PKGCFG}'
[properties]
prefix = '${PREFIX}'
c_args = '${CFLAGS}'
cpp_args = '${CXXFLAGS}'
pkg_config_libdir = '${PKG_CONFIG_LIBDIR}'
c_link_args = '${LDFLAGS}'
[project options]
libmount = 'disabled'
xattr = false
selinux = 'disabled'
nls = 'disabled'
glib_debug = 'disabled'
glib_assert = false
glib_checks = false
libelf = 'disabled'
EOF
cat cross_file.ini
# When CC and CXX are set, then meson detects them as host compiler (not cross compiler),
# so they tries to run arm binaries in x86. That's why sanity check is failing, and that's
# why we have to use env -i.
# And we must explicitly set PKG_CONFIG_LIBDIR, because pkg_config_libdir is only recognized by meson >= 0.54
env -i bash -c "export PATH && export PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) && meson setup build --cross-file cross_file.ini --prefix=$(PREFIX)"
ninja -C build
ninja -C build install
popd
displayName: 'Compile glib (meson)'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
pushd glib-${GLIB_VERSION}.${GLIB_EXTRAVERSION}
ls -la build
cat build/meson-logs/meson-log.txt
popd
displayName: 'Meson LOG'
workingDirectory: $(DEV)
condition: and(succeededOrFailed(), ne(variables.CACHE_RESTORED, 'true'))
- template: cmake-android.yml
parameters:
sourceDir: 'libogg-$(OGG_VERSION)'
cmakeArgs: '-DINSTALL_DOCS=0'
- template: cmake-android.yml
parameters:
sourceDir: 'libvorbis-$(VORBIS_VERSION)'
# flac uses c99 macros, but doesnt specify a standard, so we need to do it explicitly.
# On i686, they invoke yasm with -fstack-protector-strong flag... turn off asm optimizations.
- template: cmake-android.yml
parameters:
sourceDir: 'flac-$(FLAC_VERSION)'
cmakeArgs: '-DCMAKE_C_STANDARD=99 -DCMAKE_C_STANDARD_REQUIRED=1 -DWITH_ASM=0 -DBUILD_CXXLIBS=0 -DBUILD_PROGRAMS=0 -DBUILD_EXAMPLES=0 -DBUILD_DOCS=0 -DINSTALL_MANPAGES=0'
# another broken xiph project that doesn't specify the C standard and keeps complaining of you don't have C99
- template: cmake-android.yml
parameters:
sourceDir: 'opus-$(OPUS_VERSION)'
cmakeArgs: '-DBUILD_PROGRAMS=0 -DOPUS_MAY_HAVE_NEON=1 -DCMAKE_C_STANDARD=99 -DCMAKE_C_STANDARD_REQUIRED=1'
- template: cmake-android.yml
parameters:
sourceDir: 'libsndfile-$(SNDFILE_VERSION)'
cmakeArgs: '-DBUILD_PROGRAMS=0 -DBUILD_EXAMPLES=0'
- template: cmake-android.yml
parameters:
sourceDir: 'oboe-$(OBOE_VERSION)'
installCommand: 'cp liboboe.* ${PREFIX}/lib/ && cp -ur ../include/oboe ${PREFIX}/include'
- script: |
set -ex
# create a custom pkgconfig file for oboe to allow fluidsynth to find it
cat << EOF > ${PKG_CONFIG_PATH}/oboe-1.0.pc
prefix=${PREFIX}
exec_prefix=\${prefix}
libdir=\${prefix}/lib
includedir=\${prefix}/include
Name: Oboe
Description: Oboe library
Version: ${OBOE_VERSION}
Libs: -L\${libdir} -loboe -landroid -llog
Cflags: -I\${includedir}
EOF
cat ${PKG_CONFIG_PATH}/oboe-1.0.pc
displayName: 'Create fake oboe.pc'
workingDirectory: $(DEV)
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- template: cmake-android.yml
parameters:
sourceDir: 'libinstpatch-$(INSTPATCH_VERSION)'
# finally, compile fluidsynth
- template: cmake-android.yml
parameters:
workDir: '$(System.DefaultWorkingDirectory)'
sourceDir: '.'
condition: succeeded()
cmakeArgs: '-Denable-opensles=1 -Denable-floats=1 -Denable-oboe=1 -Denable-dbus=0 -Denable-oss=0'
installCommand: ''
- script: |
set -x
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(PREFIX)/lib:$(NDK_TOOLCHAIN)/sysroot/usr/lib/$(ARCH)-linux-android$(ANDROID_TARGET_ABI)/$(ANDROID_API)
pushd build
make -j$((`nproc`+1)) check
ldd test/test_sample_cache
popd
displayName: 'Execute fluidsynth unit test'
condition: and(succeeded(), in(variables['ARCH'], 'x86_64', 'i686'))
enabled: 'false'
- script: |
set -ex
pushd build
make install
popd
displayName: 'Install fluidsynth'
- template: cmake-android.yml
parameters:
workDir: '$(System.DefaultWorkingDirectory)/doc/android/fluidsynth-assetloader/'
sourceDir: '.'
condition: succeeded()
installCommand: 'cp *.so ${PREFIX}/lib/'
- script: |
ls -Rg $(PREFIX)
displayName: 'Show cross-compiled files in $(PREFIX)'
condition: or(succeeded(), failed())
- script: |
set -ex
# use ANDROID_ABI_CMAKE so libs can be simply copied to the archive contents in src/main/jniLibs
mkdir -p $(Build.ArtifactStagingDirectory)/lib/$(ANDROID_ABI_CMAKE)
cd $(Build.ArtifactStagingDirectory)/lib/$(ANDROID_ABI_CMAKE)
cp -LR $(PREFIX)/lib/* .
ls -Rg .
rm -rf *.dll *.alias gettext/ libtextstyle.* *.a *.la
rm -f *.so.*
mkdir -p $(Build.ArtifactStagingDirectory)/include
cd $(Build.ArtifactStagingDirectory)/include
cp -a $(PREFIX)/include/fluidsynth* .
displayName: 'Collecting artifacts'
- script: |
set -ex
ls libFLAC.so
ls libfluidsynth-assetloader.so
ls libfluidsynth.so
ls libgio-2.0.so
ls libglib-2.0.so
ls libgmodule-2.0.so
ls libgobject-2.0.so
ls libgthread-2.0.so
ls libinstpatch-1.0.so
ls liboboe.so
ls libogg.so
ls libopus.so
ls libsndfile.so
ls libvorbis.so
ls libvorbisenc.so
ls libvorbisfile.so
ls libpcre.so
ls libpcreposix.so
displayName: 'Verify all libs exist'
workingDirectory: '$(PREFIX)/lib'
- task: PublishBuildArtifacts@1
displayName: 'Publishing Artefacts for Android API$(ANDROID_API) $(ANDROID_ABI_CMAKE)'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(ARTIFACT_NAME)'
publishLocation: 'Container'
- script: |
set -ex
# as very last step before creating the pipeline cache, remove fluidsynth
pushd build
make uninstall
popd
displayName: 'Uninstall fluidsynth'

View file

@ -0,0 +1,199 @@
trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.azure/azure-pipelines-win.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
parameters:
- name: UseCache
displayName: Use Dependency Cache
type: boolean
default: true
jobs:
- job: macOS_brew
strategy:
matrix:
UnixLibs:
imageName: 'macos-11'
CMakeFlags: '-Denable-framework=0'
10_15:
imageName: 'macOS-10.15'
CMakeFlags: ''
11_0:
imageName: 'macos-11'
CMakeFlags: ''
12_0:
imageName: 'macos-12'
CMakeFlags: ''
pool:
vmImage: $(imageName)
# recommended by https://github.com/Homebrew/brew/issues/2491#issuecomment-294207661
# brew update || brew update
# brew upgrade $PACKAGES
steps:
- script: |
set -ex
PACKAGES="glib gobject-introspection libsndfile pkg-config jack dbus-glib pulseaudio portaudio sdl2 libomp"
brew install $PACKAGES
displayName: 'Prerequisites'
- script: |
set -ex
mkdir build && cd build
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
make -j3
displayName: 'Compile fluidsynth'
- script: |
set -ex
cd build
make -j3 check
displayName: 'Execute Unittests'
- script: |
set -ex
cd build
make -j3 demo
displayName: 'Compile demos'
- script: |
set -ex
cd build
sudo make install
rm -f install_manifest.txt
displayName: 'Install fluidsynth to default location'
- script: |
set -ex
cd build
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) ..
make install
displayName: 'Install fluidsynth to artifact dir'
- job: macOS_ports
timeoutInMinutes: 300
strategy:
matrix:
# SDL2/SDL_cpuinfo.h includes some x86 specific headers, which ofc doesn't work when cross compiling for arm64
# And this universal build thingy doesn't work on Mac10.15 for some reason...
# Furthermore, there is a problem when restoring the cache on Mac11, so disable this job as well
#11_0_universal_unixlibs:
# macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-11-BigSur.pkg'
# imageName: 'macos-11'
# CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0 -DLIB_SUFFIX=""'
12_0_universal_unixlibs:
macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-12-Monterey.pkg'
imageName: 'macos-12'
CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0 -DLIB_SUFFIX=""'
pool:
vmImage: $(imageName)
steps:
- script: |
set -ex
brew install wget pkg-config
wget $(macPortsUrl)
sudo installer -pkg *.pkg -target /
rm -f *.pkg
sudo chown -R $(id -u):$(id -g) /opt/local
sudo chflags nouchg /opt/local
displayName: 'Prerequisites'
workingDirectory: $(Agent.TempDirectory)
- task: Cache@2
continueOnError: true
displayName: "Cache macPort packages"
condition: and(not(in(variables['Build.Reason'], 'Schedule')), ${{ parameters.useCache }})
inputs:
key: '"$(Agent.OS)" | "$(imageName)" | "$(macPortsUrl)" | "versionalways"'
path: '/opt/local'
cacheHitVar: CACHE_RESTORED
- script: |
set -ex
export PATH=$PATH:/opt/local/bin
echo $PATH
which codesign
which port
cmake --version || true
echo "+universal" | sudo tee -a /opt/local/etc/macports/variants.conf
sudo sh -c 'cat << EOF >> /opt/local/etc/macports/macports.conf
buildfromsource always
universal_archs arm64 x86_64
ui_interactive no
EOF'
sudo port install glib2-devel libsndfile dbus-glib readline
# fixup permissions to allow non-priv pipeline user access every directory, to make the caching step succeed at the end
sudo chown -R $(id -u):$(id -g) /opt/local
# remove all extended attributes, as they cannot be restored when restoring the pipeline cache
#sudo xattr -rcv /opt/local
displayName: 'Port install universal'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- script: |
set -ex
export PATH=$PATH:/opt/local/bin
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig"
mkdir build && cd build
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
make -j3
displayName: 'Compile fluidsynth'
- script: |
export PATH=$PATH:/opt/local/bin
sudo port -v install fluidsynth +universal
displayName: 'port install fluidsynth +universal'
condition: failed()
enabled: false
- script: |
set -x
cat /opt/local/var/macports/logs/*cmake-bootstrap/cmake-bootstrap/main.log
cat /opt/local/var/macports/build/*cmake-bootstrap/cmake-bootstrap/work/cmake-3.9.4-arm64/Bootstrap.cmk/*.log
cat /opt/local/var/macports/logs/*_fluidsynth/fluidsynth/main.log
condition: failed()
displayName: 'Print fluidsynth error log'
- script: |
set -ex
cd build
make -j3 check
displayName: 'Execute Unittests'
- script: |
set -ex
cd build
make -j3 demo
displayName: 'Compile demos'
- script: |
set -ex
cd build
sudo make install
rm -f install_manifest.txt
displayName: 'Install fluidsynth to default location'
- script: |
set -ex
cd build
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) ..
make install
cd /opt/local/lib/
cp -a libgthread*.dylib libglib*.dylib libintl*.dylib libsndfile*.dylib libdbus-*.dylib libreadline*.dylib $(Build.ArtifactStagingDirectory)/lib
file /opt/local/lib/libglib-2.0.dylib $(Build.ArtifactStagingDirectory)/bin/fluidsynth $(Build.ArtifactStagingDirectory)/lib/libfluidsynth*.dylib
displayName: 'Install fluidsynth to artifact dir'
- task: PublishBuildArtifacts@1
displayName: 'Publish fluidsynth artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'fluidsynth-$(imageName)'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
displayName: 'Publish macPorts deps'
enabled: false
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
inputs:
PathtoPublish: '/opt/local/lib'
ArtifactName: 'macports-$(imageName)'
publishLocation: 'Container'

View file

@ -0,0 +1,154 @@
trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-win.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
parameters:
- name: UseCache
displayName: Use Dependency Cache
type: boolean
default: true
schedules:
- cron: "0 0 * * 1"
displayName: 'Weekly Monday Midnight build without caching'
branches:
include:
- master
always: true
variables:
toolset: 'v142'
generator: 'Visual Studio 16 2019'
configuration: 'RelWithDebInfo'
VCPKG_REVISION: 'e809a42f87565e803b2178a0c11263f462d1800a'
jobs:
- job: vcpkg
workspace:
clean: all
strategy:
matrix:
ARM:
platform: 'arm'
cmake_platform: 'ARM'
ARM64:
platform: 'arm64'
cmake_platform: 'ARM64'
x86:
platform: 'x86'
cmake_platform: 'Win32'
x64:
platform: 'x64'
cmake_platform: 'x64'
pool:
vmImage: 'windows-2019'
steps:
- task: Cache@2
displayName: "Cache vcpkg's packages"
condition: and(not(in(variables['Build.Reason'], 'Schedule')), ${{ parameters.useCache }})
inputs:
key: $(VCPKG_REVISION) | "$(platform)"
path: '$(VCPKG_INSTALLATION_ROOT)\installed'
cacheHitVar: CACHE_RESTORED
- bash: |
set -ex
echo $(generator)
echo $(toolset)
# choco upgrade ninja -y
# ninja --version
cmake --version
rm -rf C:/Strawberry/perl/bin/pkg-config*
choco install --svc --sdc -i pkgconfiglite
# chocoTask=$!
# manually update vcpkg
cd $VCPKG_INSTALLATION_ROOT
# git checkout master
git remote -v
git fetch --tags --prune --progress origin
git checkout --force $(VCPKG_REVISION)
sed -i 's/arm64/arm/g' ports/glib/portfile.cmake
./bootstrap-vcpkg.sh
# wait $chocoTask
which pkg-config
displayName: 'Update vcpkg'
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
# https://dev.azure.com/tommbrt/_apis/projects?api-version=5.0
project: 'd3638885-de4a-4ce7-afe7-f237ae461c07'
pipeline: 1
artifactName: libinstpatch-$(cmake_platform)
downloadPath: '$(Agent.TempDirectory)'
displayName: 'Get libinstpatch'
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
- task: CopyFiles@2
inputs:
SourceFolder: '$(Agent.TempDirectory)\libinstpatch-$(cmake_platform)'
Contents: '**'
TargetFolder: '$(VCPKG_INSTALLATION_ROOT)\installed\$(platform)-windows'
displayName: 'Install libinstpatch'
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
- bash: |
set -ex
vcpkg install glib:$(platform)-windows libsndfile:$(platform)-windows
displayName: 'vcpkg build Dependencies'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- bash: |
set -ex
cd $VCPKG_INSTALLATION_ROOT/installed/$(platform)-windows/
pwd
rm -rf include/FLAC* include/ffi* include/iconv* include/opus tools share
ls -Rg .
pkg-config --list-all
pkg-config --cflags libinstpatch-1.0 || true
displayName: 'Cleanup dependencies'
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- bash: |
set -ex
mkdir build
cd build
cmake -Werror=dev -G "$(generator)" -A "$(cmake_platform)" -T "$(toolset)" -Denable-readline=0 -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=$VCPKG_INSTALLATION_ROOT/installed/$(platform)-windows -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
cmake --build . --config $(configuration) --parallel 3
displayName: 'Compile fluidsynth'
- bash: |
set -ex
cmake --build build --config $(configuration) --target check --parallel 3
displayName: 'Execute Unittests'
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
- bash: |
set -ex
cmake --build build --config $(configuration) --target demo --parallel 3
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build
cmake --build . --config $(configuration) --target install || exit -1
REM del bin\concrt*.dll
REM del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll
REM del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll
REM del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib
REM del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc
REM rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q
displayName: 'fluidsynth install'
- task: CopyFiles@2
inputs:
SourceFolder: '$(VCPKG_INSTALLATION_ROOT)/installed/$(platform)-windows/'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
CleanTargetFolder: true
displayName: 'Copy Binaries to Artifact Dir'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: fluidsynth-vcpkg-$(platform)

View file

@ -1,28 +1,40 @@
# C/C++ with GCC
# Build your C/C++ project with GCC using make.
# Add steps that publish test results, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
trigger:
paths:
include:
- '*'
exclude:
- '.azure/azure-pipelines-android.yml'
- '.azure/azure-pipelines-mac.yml'
- '.azure/azure-pipelines-vcpkg.yml'
- '.circleci/config.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
jobs:
- job: Windows
- job: WindowsXP
variables:
toolset: v141_xp
strategy:
matrix:
XP_x86:
x86:
platform: Win32
toolset: v141_xp
gtk-bundle: $(gtk-bundle-x86)
libsndfile-url: $(libsndfile-url-x86)
artifact-prefix: "fluidsynth"
imageName: 'vs2017-win2016'
XP_x64:
CFLAGS: "/arch:IA32"
CXXFLAGS: "/arch:IA32"
x64:
platform: x64
toolset: v141_xp
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
artifact-prefix: "fluidsynth"
imageName: 'vs2017-win2016'
CFLAGS: ""
CXXFLAGS: ""
pool:
vmImage: $(imageName)
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
inputs:
@ -30,7 +42,7 @@ jobs:
# https://dev.azure.com/tommbrt/_apis/projects?api-version=5.0
project: 'd3638885-de4a-4ce7-afe7-f237ae461c07'
pipeline: 1
artifactName: libinstpatch-$(platform)
artifactName: libinstpatch-XP-$(platform)
downloadPath: '$(Build.ArtifactStagingDirectory)'
displayName: 'Get libinstpatch'
- script: |
@ -44,19 +56,20 @@ jobs:
REM need to fix the naming of libsndfile otherwise the linker won't find it
mv lib\libsndfile-1.lib lib\sndfile.lib || exit -1
mv lib\libsndfile-1.def lib\sndfile.def || exit -1
cd $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform)
cd $(Build.ArtifactStagingDirectory)\libinstpatch-XP-$(platform)
cp -rf * d:\deps\
mv -f * ..
cd ..
rmdir $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform)\
rmdir $(Build.ArtifactStagingDirectory)\libinstpatch-XP-$(platform)\
DEL /F C:\Strawberry\perl\bin\pkg-config.bat
displayName: 'Prerequisites'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
pkg-config --list-all
mkdir build && cd build || exit -1
cmake -A $(platform) -T $(toolset) -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) -Denable-readline=0 -Denable-floats=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1
cmake --build . --config Release || exit -1
cmake -Werror=dev -A $(platform) -T $(toolset) -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) -Denable-readline=0 -Denable-floats=1 -Denable-jack=0 -Denable-sdl2=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 -Dwindows-version=0x0501 .. || exit -1
cmake --build . --config Release --parallel 3 || exit -1
displayName: 'Compile fluidsynth'
- script: |
@ECHO ON
@ -64,6 +77,12 @@ jobs:
cd build || exit -1
cmake --build . --config Release --target check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
cd build || exit -1
cmake --build . --config Release --target demo || exit -1
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build
@ -71,43 +90,37 @@ jobs:
del $(Build.ArtifactStagingDirectory)\bin\concrt*.dll
del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll
del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll
del $(Build.ArtifactStagingDirectory)\lib\libinstpatch*.lib
del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib
del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc
rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-1 /s /q
rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q
displayName: 'Copy Artifacts'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: $(artifact-prefix)-$(platform)
- job: WindowsCI
- job: Windows10
variables:
toolset: v142
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
strategy:
matrix:
default:
CMAKE_FLAGS:
CMAKE_CONFIG: Release
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
debug_prof:
CMAKE_FLAGS: -Denable-profiling=1 -Denable-trap-on-fpe=1 -Denable-fpe-check=1
CMAKE_CONFIG: Debug
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
no_network:
CMAKE_FLAGS: -Denable-network=0
CMAKE_CONFIG: Release
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
static_lib:
CMAKE_FLAGS: -DBUILD_SHARED_LIBS=0
CMAKE_CONFIG: Release
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
minimal:
CMAKE_FLAGS: -Denable-ipv6=0 -Denable-network=0 -Denable-aufile=0 -Denable-dbus=0 -Denable-threads=0 -Denable-winmidi=0 -Denable-waveout=0 -Denable-dsound=0 -Denable-libsndfile=0 -Denable-floats=1
CMAKE_FLAGS: -Denable-ipv6=0 -Denable-network=0 -Denable-aufile=0 -Denable-threads=0 -Denable-winmidi=0 -Denable-waveout=0 -Denable-dsound=0 -Denable-libsndfile=0 -Denable-floats=1
CMAKE_CONFIG: Release
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
pool:
vmImage: 'windows-2019'
steps:
@ -122,13 +135,14 @@ jobs:
REM need to fix the naming of libsndfile otherwise the linker won't find it
mv lib\libsndfile-1.lib lib\sndfile.lib || exit -1
mv lib\libsndfile-1.def lib\sndfile.def || exit -1
DEL /F C:\Strawberry\perl\bin\pkg-config.bat
displayName: 'Prerequisites'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
mkdir build && cd build || exit -1
cmake -A x64 -DCMAKE_BUILD_TYPE=$(CMAKE_CONFIG) -DCMAKE_VERBOSE_MAKEFILE=1 $(CMAKE_FLAGS) -DNO_GUI=1 .. || exit -1
cmake --build . --config $(CMAKE_CONFIG) || exit -1
cmake -Werror=dev -A x64 -T $(toolset) -DCMAKE_BUILD_TYPE=$(CMAKE_CONFIG) -DCMAKE_VERBOSE_MAKEFILE=1 $(CMAKE_FLAGS) -DNO_GUI=1 -Dwindows-version=0x0A00 -Denable-jack=0 -Denable-pulseaudio=0 -Denable-ladspa=0 -Denable-dbus=0 -Denable-readline=0 -Denable-sdl2=0 -Denable-libinstpatch=0 .. || exit -1
cmake --build . --config $(CMAKE_CONFIG) --parallel 3 || exit -1
displayName: 'Compile fluidsynth'
- script: |
@ECHO ON
@ -136,24 +150,32 @@ jobs:
cd build || exit -1
cmake --build . --config $(CMAKE_CONFIG) --target check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
cd build || exit -1
cmake --build . --config $(CMAKE_CONFIG) --target demo || exit -1
displayName: 'Compile demos'
- job: WindowsMinGW
variables:
artifact-prefix: "fluidsynth-mingw"
strategy:
matrix:
x86:
CMAKE_FLAGS: -DCMAKE_C_FLAGS="-m32"
platform: Win32
gtk-bundle: $(gtk-bundle-x86)
libsndfile-url: $(libsndfile-url-x86)
mingw-url: $(mingw-url-x86)
x64:
CMAKE_FLAGS:
platform: x64
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
mingw-url: $(mingw-url-x64)
x64-static:
CMAKE_FLAGS: '-DBUILD_SHARED_LIBS=0'
platform: x64
gtk-bundle: $(gtk-bundle-x64)
libsndfile-url: $(libsndfile-url-x64)
mingw-url: $(mingw-url-x64)
pool:
vmImage: 'vs2017-win2016'
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
inputs:
@ -180,6 +202,7 @@ jobs:
mv lib\libsndfile-1.def lib\sndfile.def || exit -1
cd mingw*\ && cp -rf * .. && cd .. && rm -rf mingw* || exit -1
cd $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform) && cp -rf * d:\deps\ && mv -f * .. && cd .. && rmdir $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform)\ || exit -1
DEL /F C:\Strawberry\perl\bin\pkg-config.bat
displayName: 'Prerequisites'
- script: |
@ECHO ON
@ -189,8 +212,8 @@ jobs:
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
pkg-config --list-all
mkdir build && cd build || exit -1
cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) $(CMAKE_FLAGS) -Denable-readline=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1
mingw32-make.exe all || exit -1
cmake -Werror=dev -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) $(CMAKE_FLAGS) -Denable-readline=0 -Denable-floats=1 -Denable-jack=0 -Denable-pulseaudio=0 -Denable-ladspa=0 -Denable-dbus=0 -Denable-sdl2=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1
mingw32-make.exe -j3 all || exit -1
displayName: 'Compile fluidsynth'
- script: |
@ECHO ON
@ -199,5 +222,35 @@ jobs:
set PATH=%PATH:C:\Program Files\Git\bin;=%
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
cd build || exit -1
mingw32-make.exe check || exit -1
mingw32-make.exe -j4 check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
REM remove that path from PATH to make sure sh.exe is not found (cmake will complain otherwise)
set PATH=%PATH:C:\Program Files\Git\bin;=%
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
cd build || exit -1
mingw32-make.exe -j4 demo || exit -1
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build
mingw32-make.exe install || exit -1
xcopy d:\deps\bin\libgcc_s_sjlj-1.dll $(Build.ArtifactStagingDirectory)\bin
xcopy d:\deps\bin\libgcc_s_seh-1.dll $(Build.ArtifactStagingDirectory)\bin
xcopy d:\deps\bin\libgomp-1.dll $(Build.ArtifactStagingDirectory)\bin
xcopy d:\deps\bin\libstdc++-6.dll $(Build.ArtifactStagingDirectory)\bin
xcopy d:\deps\bin\libwinpthread-1.dll $(Build.ArtifactStagingDirectory)\bin
REM xcopy test $(Build.ArtifactStagingDirectory)\bin /s
del $(Build.ArtifactStagingDirectory)\bin\concrt*.dll
del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll
del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll
del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib
del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc
rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q
displayName: 'Copy Artifacts'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: $(artifact-prefix)-$(platform)

67
.azure/cmake-android.yml Normal file
View file

@ -0,0 +1,67 @@
parameters:
- name: cmakeArgs
type: string
default: ''
- name: sourceDir
type: string
default: ''
- name: workDir
type: string
default: $(DEV)
- name: condition
type: string
default: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
- name: installCommand
type: string
default: 'make install'
steps:
- script: |
set -ex
pushd ${{ parameters.sourceDir }}
mkdir -p build
pushd build
# Invoke cmake in the most correctest way I've could find while try and erroring:
#
# The biggest pain point is that CMake does not seem to respect our existing cross compilation CFLAGS and LDFLAGS.
# Hence we are passing them manually, once via Android flags and once for "Required" flags. The latter is necessary
# to let cmake correctly probe for any existing header, function, library, etc.
# Watch out: Sometimes the flags are passed as ;-limited list!
cmake -G "Unix Makefiles" \
-DCMAKE_MAKE_PROGRAM=make \
-DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/android.toolchain.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DANDROID_NATIVE_API_LEVEL=${ANDROID_API} \
-DANDROID_ABI=${ANDROID_ABI_CMAKE} \
-DANDROID_TOOLCHAIN=${CC} \
-DANDROID_NDK=${NDK} \
-DANDROID_COMPILER_FLAGS="${CFLAGS// /;}" \
-DANDROID_LINKER_FLAGS="${LDFLAGS// /;}" \
-DANDROID_STL="c++_shared" \
-DCMAKE_REQUIRED_FLAGS="${CFLAGS}" \
-DCMAKE_REQUIRED_LINK_OPTIONS="${LDFLAGS// /;}" \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_STAGING_PREFIX=${PREFIX} \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DBUILD_SHARED_LIBS=1 \
-DLIB_SUFFIX="" \
${{ parameters.cmakeArgs }} ..
make -j$((`nproc`+1))
${{ parameters.installCommand }}
popd
popd
displayName: 'Compile ${{ parameters.sourceDir }}'
workingDirectory: ${{ parameters.workDir }}
condition: ${{ parameters.condition }}
- script: |
ls -la ${{ parameters.sourceDir }}/build/CMakeFiles/
cat ${{ parameters.sourceDir }}/build/CMakeFiles/CMakeError.log
cat ${{ parameters.sourceDir }}/build/CMakeFiles/CMakeOutput.log
true
displayName: 'Print ${{ parameters.sourceDir }} Cmake Error Log'
condition: or(${{ parameters.condition }}, failed())
workingDirectory: ${{ parameters.workDir }}

View file

@ -1,55 +1,67 @@
version: 2.1
orbs:
android: circleci/android@0.2.0
android: circleci/android@0.2.1
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-29
- image: circleci/android:api-30
environment:
JVM_OPTS: -Xmx3200m
steps:
- run:
name: Setup Git email and user for Cerbero
command: git config --global user.email "ci@beatscratch.io" && git config --global user.name "CI testing"
- android/install-ndk:
ndk-version: android-ndk-r18b
ndk-sha: 500679655da3a86aecf67007e8ab230ea9b4dd7b
- run:
name: Link NDK for Cerbero
command: |
mkdir -p /home/circleci/android-sdk-linux
ln -s /opt/android/android-ndk-r18b /home/circleci/android-sdk-linux/ndk-bundle
# - android/install-ndk:
# ndk-version: android-ndk-r18b
# ndk-sha: 500679655da3a86aecf67007e8ab230ea9b4dd7b
- run:
name: Install FluidSynth build dependencies
command: sudo apt-get update && sudo apt-get install autotools-dev automake autoconf libtool g++ autopoint make cmake
bison flex yasm pkg-config gtk-doc-tools libxv-dev libx11-dev libpulse-dev
python3-dev texinfo gettext build-essential pkg-config doxygen curl libxext-dev
libxi-dev x11proto-record-dev libxrender-dev libgl1-mesa-dev libxfixes-dev
libxdamage-dev libxcomposite-dev libasound2-dev libxml-simple-perl dpkg-dev
bison flex yasm pkg-config libpulse-dev
python3-dev gettext build-essential pkg-config curl
libasound2-dev dpkg-dev
debhelper build-essential devscripts fakeroot transfig gperf libdbus-glib-1-dev
wget glib-networking libxtst-dev libxrandr-dev libglu1-mesa-dev libegl1-mesa-dev
git subversion xutils-dev intltool ccache python3-setuptools autogen maven make
wget glib-networking libxtst-dev libxrandr-dev
git intltool ccache python3-setuptools autogen maven make
- checkout
- run:
name: Prepare FluidSynth Android
name: Build Cerbero and Oboe
working_directory: doc/android
command: |
export TERM=dumb
export VERBOSE=1
echo Starting `nproc` parallel jobs
make -f Makefile.android prepare
- run:
name: Link Cerbero NDK for build
command: |
mkdir -p /home/circleci/android-sdk-linux
echo "android-ndk-21 content"
ls /home/circleci/code/doc/android/external/cerbero/build/android-ndk-21
ln -s /home/circleci/code/doc/android/external/cerbero/build/android-ndk-21 /home/circleci/android-sdk-linux/ndk-bundle
echo "/home/circleci/android-sdk-linux/ndk-bundle content"
ls /home/circleci/android-sdk-linux/ndk-bundle
- run:
name: Build FluidSynth Android
working_directory: doc/android
command: |
export TERM=dumb
make -f Makefile.android
- run:
name: Show directory contents
working_directory: doc/android
command: |
ls -R
mv ./external/cerbero/build/logs dist/
cp ./external/cerbero/build/sources/android_armv7/glib-2.62.6/_builddir/meson*.txt dist/armeabi-v7a/
cp ./external/cerbero/build/sources/android_arm64/glib-2.62.6/_builddir/meson*.txt dist/arm64-v8a/
cp ./external/cerbero/build/sources/android_x86/glib-2.62.6/_builddir/meson*.txt dist/x86/
cp ./external/cerbero/build/sources/android_x86_64/glib-2.62.6/_builddir/meson*.txt dist/x86_64/
- run:
name: Zip FluidSnyth Android Distribution
name: Zip FluidSynth Android Distribution
working_directory: doc/android
command: zip -r android-dist.zip dist
- store_artifacts:
path: doc/android/android-dist.zip
destination: android-dist.zip
destination: android-dist.zip

View file

@ -3,12 +3,11 @@ task:
name: FreeBSD
freebsd_instance:
matrix:
# There isn't a stable 13.0 image yet (2019-09)
image_family: freebsd-13-0-snap
image_family: freebsd-12-0
image_family: freebsd-10-4
image_family: freebsd-11-4
image_family: freebsd-12-2
image_family: freebsd-13-0
install_script: pwd && ls -la && pkg install -y cmake glib alsa-lib ladspa portaudio pulseaudio pkgconf sdl2
install_script: pwd && ls -la && pkg update --force && pkg install -y cmake glib alsa-lib ladspa portaudio pulseaudio pkgconf sdl2
compile_script: pwd && ls -la && mkdir $HOME/fluidsynth_install/ && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=0 -DNO_GUI=1 .. && make -j4 && make check && make install
compile_script: pwd && ls -la && mkdir $HOME/fluidsynth_install/ && mkdir build && cd build && cmake -Werror=dev -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=0 -DNO_GUI=1 .. && make -j4 && make check && make install

View file

@ -13,11 +13,14 @@ Else it might be closed without further notice.
If you have a question look into our wiki
( https://github.com/FluidSynth/fluidsynth/wiki )
or the developer resources
( http://www.fluidsynth.org/api/ )
( https://www.fluidsynth.org/api/ )
If you still have a question, need support or want to discuss ideas, contact our mailing list:
If you still have a question, need support or want to discuss ideas, contact our mailing list
https://lists.nongnu.org/mailman/listinfo/fluid-dev
or start a GitHub Discussion:
https://github.com/FluidSynth/fluidsynth/discussions
Below is a form that shall help getting relevant information for bugs together.
We strongly recommend to use it! Feel free to edit or remove inapplicable/unneeded parts.
-->

View file

@ -13,17 +13,23 @@ Else it might be closed without further notice.
If you have a question look into our wiki
( https://github.com/FluidSynth/fluidsynth/wiki )
or the developer resources
( http://www.fluidsynth.org/api/ )
( https://www.fluidsynth.org/api/ )
If you still have a question, need support or want to discuss ideas, contact our mailing list:
If you still have a question, need support or want to discuss ideas, contact our mailing list
https://lists.nongnu.org/mailman/listinfo/fluid-dev
or start a GitHub Discussion:
https://github.com/FluidSynth/fluidsynth/discussions
Below is a form that shall help getting relevant information for features together.
Feel free to edit or remove inapplicable/unneeded parts.
-->
### Related discussion on the mailing list
_Features should be discussed by the community. Historically, our community lives at the mailing list. Bring up your ideas there, before opening tickets. In case you already did that, provide a link to the thread._
### Related discussion
_Feature requests should be discussed by the community, either on the mailing
list or via a GitHub Discussion. Please bring up your ideas there before
opening tickets. In case you already did that, please provide a link to the
thread._
### Is your feature request related to a problem?
_A clear and concise description of what the problem is._

View file

@ -5,10 +5,13 @@ Else it might be closed without further notice._
_If you have a question look into our wiki
( https://github.com/FluidSynth/fluidsynth/wiki )
or the developer resources
( http://www.fluidsynth.org/api/ )_
( https://www.fluidsynth.org/api/ )_
_If you still have a question, need support or want to discuss ideas, contact our mailing list:
https://lists.nongnu.org/mailman/listinfo/fluid-dev_
If you still have a question, need support or want to discuss ideas, contact our mailing list
https://lists.nongnu.org/mailman/listinfo/fluid-dev
or start a GitHub Discussion:
https://github.com/FluidSynth/fluidsynth/discussions
_Below is a form that shall help getting relevant information for bugs and feature requests together.
We strongly recommend to use it! Feel free to edit or remove inapplicable/unneeded parts._
@ -30,7 +33,7 @@ We strongly recommend to use it! Feel free to edit or remove inapplicable/unneed
### Other information
<!-- If you are able to illustrate the bug or feature request with an example, please provide simple
source code below or as attatched file. List any other information that is relevant to your issue:
source code below or as attached file. List any other information that is relevant to your issue:
Stack traces,
related issues,
build logs,

52
.github/workflows/api_doc_build.yml vendored Normal file
View file

@ -0,0 +1,52 @@
name: API Doc Build
on:
push:
branches:
- master
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install Dependencies
run: sudo apt-get install doxygen xsltproc
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config $BUILD_TYPE --target doxygen
- name: Install SSH Client 🔑
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.DEPLOY_API_TOKEN }}
- name: Publish API Docs to GH Pages
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
FOLDER: ${{runner.workspace}}/build/doc/api/html/
REPOSITORY_NAME: FluidSynth/fluidsynth.github.io
BRANCH: main
TARGET_FOLDER: api/
SSH: true
CLEAN: true
COMMIT_MESSAGE: Updating API doc from fluidsynth master
GIT_CONFIG_NAME: API Doc Deploy
GIT_CONFIG_EMAIL: fluid-api-deploy@fluidsynth.github.io

71
.github/workflows/codeql-analysis.yml vendored Normal file
View file

@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '17 18 * * 4'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

102
.github/workflows/linux.yml vendored Normal file
View file

@ -0,0 +1,102 @@
name: FluidSynth Linux
on:
pull_request:
push:
paths-ignore:
- '.azure/**'
- '.circleci/**'
- '.github/workflows/sonarcloud.yml'
- '.cirrus.yml'
- 'README.md'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04
strategy:
matrix:
CC: [""]
CXX: [""]
CMAKE_FLAGS: ["-Denable-profiling=1","-Denable-floats=1 -Denable-profiling=1","-Denable-floats=1","-Denable-trap-on-fpe=1","-Denable-fpe-check=1","-Denable-ipv6=0","-Denable-network=0","-Denable-aufile=0","-DBUILD_SHARED_LIBS=0","-Denable-ubsan=1 -Denable-debug=1", "-Denable-debug=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold"]
include:
- CC: "clang-7"
CXX: "clang++-7"
CMAKE_FLAGS: ""
- CC: "clang-8"
CXX: "clang++-8"
CMAKE_FLAGS: ""
- CC: "clang-10"
CXX: "clang++-10"
CMAKE_FLAGS: ""
- CC: "clang-12"
CXX: "clang++-12"
CMAKE_FLAGS: ""
# clang9 is covered by openSUSE Leap 15.2
# clang11 is covered by openSUSE Leap 15.3
steps:
- uses: actions/checkout@v2
- name: Add apt-get repositories
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- name: Update apt
run: sudo apt-get update -y
- name: Install Dependencies
run: sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cmake-data cmake libglib2.0-0 libsndfile-dev libasound2-dev libjack-dev portaudio19-dev libsdl2-dev libpulse-dev libdbus-1-dev libsystemd-dev libinstpatch-dev libreadline-dev g++-7 g++-8 clang-7 clang-8 clang-9 clang-10 clang-tidy-10
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
echo Can execute `nproc` make jobs in parallel
cmake --version
cmake -E make_directory ${{github.workspace}}/build
which clang-tidy || true
ls -la `which clang-tidy` || true
echo $PATH
echo $SONARSC
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
export CC=${{ matrix.CC }}
export CXX=${{ matrix.CXX }}
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev ${{ matrix.CMAKE_FLAGS }} -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 $GITHUB_WORKSPACE
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: make -j`nproc`
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
run: make -j`nproc` check
- name: Demo
working-directory: ${{github.workspace}}/build
shell: bash
run: make -j`nproc` demo
- name: Install
working-directory: ${{github.workspace}}/build
run: make install

103
.github/workflows/sonarcloud.yml vendored Normal file
View file

@ -0,0 +1,103 @@
on:
# Trigger analysis when pushing in master or pull requests, and when creating
# a pull request.
push:
branches:
- master
paths-ignore:
- '.azure/**'
- '.circleci/**'
- '.github/workflows/linux.yml'
- '.cirrus.yml'
- 'README.md'
pull_request:
types: [opened, synchronize, reopened]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# Use Debug build for better code coverage results
BUILD_TYPE: Debug
name: SonarCloud Workflow
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Add apt-get repositories
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- name: Update apt
run: sudo apt-get update -y
- name: Install Dependencies
run: sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cmake-data cmake libglib2.0-0 libsndfile-dev libasound2-dev libjack-dev portaudio19-dev libsdl2-dev libpulse-dev libdbus-1-dev libsystemd-dev libinstpatch-dev libreadline-dev lcov gcovr ggcov
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
cmake -E make_directory ${{github.workspace}}/build
echo $PATH
- name: Get Sonar Build Wrapper
shell: bash
working-directory: ${{github.workspace}}/build
run: |
set -ex
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
mv build-wrapper-linux-x86/* .
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev -Denable-portaudio=1 -Denable-ladspa=1 -Denable-coverage=1 -DNO_GUI=1 $GITHUB_WORKSPACE
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
./build-wrapper-linux-x86-64 --out-dir bw-output make
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
run: |
./build-wrapper-linux-x86-64 --out-dir bw-output make coverage
# sonar-scanner does not like utf8 filenames
- name: Prepare for Sonar
run: |
rm -rf ${{ github.workspace }}/sf2
gcovr --version
gcovr --help
ls -la ${{ github.workspace }}
ls -la ${{ github.workspace }}/build
ls -la ${{ github.workspace }}/build/coverage
# The official sonarsource/sonarcloud-github-action@v1.5 action does not work properly.
# It keeps complaining that the build-wrapper.json cannot be found.
# Hence, use a third party action to download and add sonar-scanner to PATH and then run it manually.
- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v3
- name: Run sonarqube
env:
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.cfamily.build-wrapper-output=${{ github.workspace }}/build/bw-output
-Dsonar.coverageReportPaths=build/coverage/sonarqube.report
-Dsonar.verbose=false
-Dsonar.host.url=https://sonarcloud.io/

2
.gitignore vendored
View file

@ -1,4 +1,5 @@
build/
.vs/
CMakeCache.txt
CMakeFiles
@ -38,3 +39,4 @@ install_manifest.txt
# ProjectFiles
*.pro.user*
*.user

6
.obs/workflows.yml Normal file
View file

@ -0,0 +1,6 @@
workflow:
steps:
- branch_package:
source_project: home:derselbst:anmp
source_package: fluidsynth
target_project: home:derselbst:anmp:github-ci

View file

@ -1,70 +0,0 @@
language: c
sudo: false
os: linux
dist: bionic
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-bionic-7
- llvm-toolchain-bionic-8
packages:
- cmake-data
- cmake
- libglib2.0-0
- libsndfile-dev
- libasound2-dev
- libjack-dev
- portaudio19-dev
- libpulse-dev
- libdbus-glib-1-dev
- ladspa-sdk
- libsdl2-dev
env:
- CMAKE_FLAGS="-Denable-profiling=1"
- CMAKE_FLAGS="-Denable-floats=1 -Denable-profiling=1"
- CMAKE_FLAGS="-Denable-floats=0"
- CMAKE_FLAGS="-Denable-trap-on-fpe=1"
- CMAKE_FLAGS="-Denable-fpe-check=1"
- CMAKE_FLAGS="-Denable-ipv6=0"
- CMAKE_FLAGS="-Denable-network=0"
- CMAKE_FLAGS="-Denable-aufile=0"
- CMAKE_FLAGS="-DBUILD_SHARED_LIBS=0"
matrix:
include:
- arch: arm64
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && sudo apt-get install gcc-7"
- env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8 && sudo apt-get install gcc-8"
- CMAKE_FLAGS="-Denable-debug=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold"
- env:
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && sudo apt-get install clang-7"
- env:
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8 && sudo rm -f /usr/local/clang-7.0.0/bin/clang-tidy && sudo ln -s /usr/bin/clang-tidy-8 /usr/bin/clang-tidy && sudo apt-get install clang-8 clang-tidy-8"
- CMAKE_FLAGS="-Denable-profiling=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold"
- os: linux-ppc64le
env:
- CMAKE_FLAGS=""
before_install:
- eval "${MATRIX_EVAL}"
- which clang-tidy || true
- ls -la `which clang-tidy` || true
- echo $PATH
before_script:
- mkdir $HOME/fluidsynth_install/
- mkdir build && cd build
script:
- cmake -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install ${CMAKE_FLAGS} -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
- make -j4
- make check
- make install # install only on linux, as CMAKE_INSTALL_PREFIX is ignored for frameworks on macosx and I cant tell whether that's correct or a bug.

10
AUTHORS
View file

@ -70,7 +70,7 @@ summary of contributions.
* The initial alsa driver was based on the jMax alsa driver by
Francois Dechelle and his Real-time Team at Ircam
(http://www.ircam.fr/jmax). The jMax code was based upon Ardour's
(https://www.ircam.fr/jmax). The jMax code was based upon Ardour's
alsa_device.cc by Paul Barton-Davis. file: iiwu_alsa.c
* Code was borrowed from the glib library to the smurf files. The goal was
@ -84,7 +84,7 @@ summary of contributions.
Smurf's midi_alsaraw.c by Josh Green. file: iiwu_alsa.c
* The reverb algorithm was written by Jezar
(http://www.dreampoint.co.uk). His code is public domain. The code
(https://www.dreampoint.co.uk). His code is public domain. The code
was translated to C by Peter Hanappe. file: iiwu_synth.c
* The original code for the chorus effect was written by Juergen
@ -103,7 +103,7 @@ summary of contributions.
adapted version was integrated in the source code. files:
fluid_cmd.c, fluidsynth/synth.h, fluid_synth.c.
* Some interpolation algorihms were used that were found in
* Some interpolation algorithms were used that were found in
the music-dsp archives (http://www.smartelectronix.com/musicdsp).
They were written by Joshua Scholar and others. file: iiwu_synth.c
@ -150,4 +150,6 @@ Bernat Arlandis i Mañó
Sven Meier
Marcus Weseloh
Jean-jacques Ceresa
Vladimir Davidovich
Tamás Korodi
Evan Miller

File diff suppressed because it is too large Load diff

View file

@ -38,3 +38,60 @@ Find FluidSynth's style guide below. Syntax related issues, like missing braces,
* Every block after an if, else, while or for should be enclosed in braces
* **Allman-Style** braces everywhere
### Documentation Style Guide
We use Doxygen for public API functions, usage examples and other
information.
#### Order of Elements
Please ensure that the order of elements in the documentation block
is consistent with the existing documentation. Most importantly,
each function starts with a single sentence brief description,
followed by any `@param` and `@return` tags. `@deprecated` and
`@since` should always come last.
Example:
```
/**
* Brief description of the function (only a single sentence).
*
* @param ...
* @param ...
* @return ...
*
* Detailed description of the function. This can be multiple paragraphs,
* include code examples etc. It can also include @note, @warning or
* other special tags not mentioned below.
*
* @deprecated This is deprecated because ...
*
* @since 1.2.3
*/
```
#### Mark Lifecycle Functions
All functions are sorted alphabetically in the generated API documentation.
To ensure that the `new_*` and `delete_*` functions appear first, please make
sure to surround those lifecycle functions with `@startlifecycle{}` and
`@endlifecycle` tags.
Example:
```
/** @startlifecycle{Some Name} */
new_fluid_some_name(...);
delete_fluid_some_name(...);
/** @endlifecycle */
```
#### Referencing Setting Items
If you want to mention a setting item (for example `audio.periods`),
please use the custom `@setting{name}` tag. The argument `name` should be
the setting name with all `.` replaced by `_`.
Example:
```
/**
* This is a comment that references \setting{audio_periods}. You
* can also link to a group of settings with \setting{audio} or
* \setting{synth}.
*/
```

View file

@ -1,8 +1,8 @@
This file is no longer used. For detailed Changelog information, please refer to the
version control system's commits. For an overview of differences between versions,
see:
http://sourceforge.net/apps/trac/fluidsynth/wiki/ChangeLog1_1_2
http://sourceforge.net/apps/trac/fluidsynth/wiki/ChangeLog1_1_1
https://sourceforge.net/apps/trac/fluidsynth/wiki/ChangeLog1_1_2
https://sourceforge.net/apps/trac/fluidsynth/wiki/ChangeLog1_1_1
etc.
For developer related "What's new"-information, doc/fluidsynth-v11-devdoc contains

10
FluidSynthConfig.cmake.in Normal file
View file

@ -0,0 +1,10 @@
# for the find_dependency() macro:
# include(CMakeFindDependencyMacro)
# it has the same syntax as find_package:
# find_dependency(MYDEP REQUIRED)
# define variables for configuration options:
# set(network-enabled @enable-network@)
# finally, include the targets file
include("${CMAKE_CURRENT_LIST_DIR}/FluidSynthTargets.cmake")

View file

@ -1,31 +1,32 @@
# FluidSynth
| Build Status | glib < 2.30 | glib >= 2.30 |
|---|---|---|
| <img src="https://www.kernel.org/theme/images/logos/tux.png" height="30" alt=""> **Linux** | n.a. | [![Build Status Travis](https://travis-ci.org/FluidSynth/fluidsynth.svg?branch=master)](https://travis-ci.org/FluidSynth/fluidsynth/branches) |
| <img src="https://www.theinquirer.net/w-images/866eae81-b13b-47b5-8180-929943e9dc21/0/daemonhammerfreebsd-580x358.jpg" height="25" alt=""> **FreeBSD** | n.a. | [![Build Status](https://api.cirrus-ci.com/github/FluidSynth/fluidsynth.svg?branch=master)](https://cirrus-ci.com/github/FluidSynth/fluidsynth) |
| <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) | [![Build status](https://ci.appveyor.com/api/projects/status/anbmtebt5uk4q1it/branch/master?svg=true)](https://ci.appveyor.com/project/derselbst/fluidsynth-g2ouw/branch/master) |
| <img src="https://www.apple.com/favicon.ico" height="30" alt=""> **MacOSX** | n.a. | [![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) |
| <img src="https://www.android.com/favicon.ico" height="30" alt=""> **Android** | n.a. | [![CircleCI](https://circleci.com/gh/FluidSynth/fluidsynth/tree/master.svg?style=shield)](https://circleci.com/gh/FluidSynth/fluidsynth) |
| | Build Status |
|---|---|
| <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) |
| <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) |
| <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) |
| <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) |
| <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) |
| <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) |
#### 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](https://github.com/FluidSynth/fluidsynth/wiki/SoundFont). It is the software analogue of a MIDI synthesizer. FluidSynth can also play MIDI files.
[![OHLOH Project Stats](https://www.openhub.net/p/fluidsynth/widgets/project_thin_badge?format=gif)](https://www.openhub.net/p/fluidsynth)
[![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)
## Documentation
The central place for documentation and further links is our **wiki** here at GitHub:
**https://github.com/FluidSynth/fluidsynth/wiki**
#### 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/.
Latest information about FluidSynth is also available on the web site at https://www.fluidsynth.org/.
## License
@ -37,11 +38,11 @@ For information on how to build FluidSynth from source, please [refer to our wik
## Links
- FluidSynth's Home Page, http://www.fluidsynth.org
- FluidSynth's Home Page, https://www.fluidsynth.org
- FluidSynth's wiki, https://github.com/FluidSynth/fluidsynth/wiki
- FluidSynth's API documentation, http://www.fluidsynth.org/api/
- FluidSynth's API documentation, https://www.fluidsynth.org/api/
---
@ -94,6 +95,6 @@ several reasons:
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 focussed on its goal (a Soundfont
if the project stayed very focused on its goal (a Soundfont
synthesizer), stayed small (ideally one file) and didn't dependent
on external code.

2
THANKS
View file

@ -5,7 +5,7 @@ file AUTHORS.
We would like to thank the Fondation Daniel Langlois for their
funding. Their help made this project to get of the ground. Without it
would simply not exist. Many thanks!
(http://www.fondation-langlois.org)
(https://www.fondation-langlois.org)
In alphabetic order:

14
TODO
View file

@ -21,27 +21,15 @@ Bugs to mash
------------
- Investigate why MIDI rendering causes burst of notes at start
Validation
----------
- Validation tests: create soundfont with basic wave forms [sine,
square, triangle]; make test midi file; compare with SBLive output;
"regression" test
- Validate chorus (often sounds rather crappy)
- Analyse performance
Documentation
-------------
- Write documention on tuning
- Add usage scenarios in the documentation
- Write documentation on tuning
- User and system configuration file
Misc
----
- Remove dependency of settings on audio driver and other (see
fluid_settings_init())
- When specifying -i -s (no console and TCP server) log to TCP clients
with easier parsable messages ("warning:", "error:", etc)
- Pause and resume the synthesizer/audio thread (run synthesizer as a daemon)
- set loop on/off on a sample (set_gen GEN_SAMPLEMODE?)

View file

@ -0,0 +1,603 @@
# Copyright (c) 2012 - 2017, Lars Bilke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# CHANGES:
#
# 2012-01-31, Lars Bilke
# - Enable Code Coverage
#
# 2013-09-17, Joakim Söderberg
# - Added support for Clang.
# - Some additional usage instructions.
#
# 2016-02-03, Lars Bilke
# - Refactored functions to use named parameters
#
# 2017-06-02, Lars Bilke
# - Merged with modified version from github.com/ufz/ogs
#
# 2019-05-06, Anatolii Kurotych
# - Remove unnecessary --coverage flag
#
# 2019-12-13, FeRD (Frank Dana)
# - Deprecate COVERAGE_LCOVR_EXCLUDES and COVERAGE_GCOVR_EXCLUDES lists in favor
# of tool-agnostic COVERAGE_EXCLUDES variable, or EXCLUDE setup arguments.
# - CMake 3.4+: All excludes can be specified relative to BASE_DIRECTORY
# - All setup functions: accept BASE_DIRECTORY, EXCLUDE list
# - Set lcov basedir with -b argument
# - Add automatic --demangle-cpp in lcovr, if 'c++filt' is available (can be
# overridden with NO_DEMANGLE option in setup_target_for_coverage_lcovr().)
# - Delete output dir, .info file on 'make clean'
# - Remove Python detection, since version mismatches will break gcovr
# - Minor cleanup (lowercase function names, update examples...)
#
# 2019-12-19, FeRD (Frank Dana)
# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
#
# 2020-01-19, Bob Apthorpe
# - Added gfortran support
#
# 2020-02-17, FeRD (Frank Dana)
# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters
# in EXCLUDEs, and remove manual escaping from gcovr targets
#
# 2021-01-19, Robin Mueller
# - Add CODE_COVERAGE_VERBOSE option which will allow to print out commands which are run
# - Added the option for users to set the GCOVR_ADDITIONAL_ARGS variable to supply additional
# flags to the gcovr command
#
# 2020-05-04, Mihchael Davis
# - Add -fprofile-abs-path to make gcno files contain absolute paths
# - Fix BASE_DIRECTORY not working when defined
# - Change BYPRODUCT from folder to index.html to stop ninja from complaining about double defines
# USAGE:
#
# 1. Copy this file into your cmake modules path.
#
# 2. Add the following line to your CMakeLists.txt (best inside an if-condition
# using a CMake option() to enable it just optionally):
# include(CodeCoverage)
#
# 3. Append necessary compiler flags:
# append_coverage_compiler_flags()
#
# 3.a (OPTIONAL) Set appropriate optimization flags, e.g. -O0, -O1 or -Og
#
# 4. If you need to exclude additional directories from the report, specify them
# using full paths in the COVERAGE_EXCLUDES variable before calling
# setup_target_for_coverage_*().
# Example:
# set(COVERAGE_EXCLUDES
# '${PROJECT_SOURCE_DIR}/src/dir1/*'
# '/path/to/my/src/dir2/*')
# Or, use the EXCLUDE argument to setup_target_for_coverage_*().
# Example:
# setup_target_for_coverage_lcov(
# NAME coverage
# EXECUTABLE testrunner
# EXCLUDE "${PROJECT_SOURCE_DIR}/src/dir1/*" "/path/to/my/src/dir2/*")
#
# 4.a NOTE: With CMake 3.4+, COVERAGE_EXCLUDES or EXCLUDE can also be set
# relative to the BASE_DIRECTORY (default: PROJECT_SOURCE_DIR)
# Example:
# set(COVERAGE_EXCLUDES "dir1/*")
# setup_target_for_coverage_gcovr_html(
# NAME coverage
# EXECUTABLE testrunner
# BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
# EXCLUDE "dir2/*")
#
# 5. Use the functions described below to create a custom make target which
# runs your test executable and produces a code coverage report.
#
# 6. Build a Debug build:
# cmake -DCMAKE_BUILD_TYPE=Debug ..
# make
# make my_coverage_target
#
include(CMakeParseArguments)
option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)
# Check prereqs
find_program( GCOV_PATH gcov )
find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
find_program( FASTCOV_PATH NAMES fastcov fastcov.py )
find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
find_program( CPPFILT_PATH NAMES c++filt )
if(NOT GCOV_PATH)
message(FATAL_ERROR "gcov not found! Aborting...")
endif() # NOT GCOV_PATH
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
list(GET LANGUAGES 0 LANG)
if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
if("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3)
message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
endif()
elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang")
# Do nothing; exit conditional without error if true
elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
# Do nothing; exit conditional without error if true
else()
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
endif()
endif()
set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
CACHE INTERNAL "")
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path)
if(HAVE_fprofile_abs_path)
set(COVERAGE_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path")
endif()
endif()
set(CMAKE_Fortran_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the Fortran compiler during coverage builds."
FORCE )
set(CMAKE_CXX_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the C++ compiler during coverage builds."
FORCE )
set(CMAKE_C_FLAGS_COVERAGE
${COVERAGE_COMPILER_FLAGS}
CACHE STRING "Flags used by the C compiler during coverage builds."
FORCE )
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used for linking binaries during coverage builds."
FORCE )
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
FORCE )
mark_as_advanced(
CMAKE_Fortran_FLAGS_COVERAGE
CMAKE_CXX_FLAGS_COVERAGE
CMAKE_C_FLAGS_COVERAGE
CMAKE_EXE_LINKER_FLAGS_COVERAGE
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
link_libraries(gcov)
endif()
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_lcov(
# NAME testrunner_coverage # New target name
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES testrunner # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
# # to BASE_DIRECTORY, with CMake 3.4+)
# NO_DEMANGLE # Don't demangle C++ symbols
# # even if c++filt is found
# )
function(setup_target_for_coverage_lcov)
set(options NO_DEMANGLE)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT LCOV_PATH)
message(FATAL_ERROR "lcov not found! Aborting...")
endif() # NOT LCOV_PATH
if(NOT GENHTML_PATH)
message(FATAL_ERROR "genhtml not found! Aborting...")
endif() # NOT GENHTML_PATH
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(DEFINED Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (CMake 3.4+: Also compute absolute paths)
set(LCOV_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES LCOV_EXCLUDES)
# Conditional arguments
if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
set(GENHTML_EXTRA_ARGS "--demangle-cpp")
endif()
# enable branch coverage
set ( Coverage_LCOV_ARGS ${Coverage_LCOV_ARGS} --rc lcov_branch_coverage=1 )
set ( Coverage_GENHTML_ARGS ${Coverage_GENHTML_ARGS} --branch-coverage )
# Setting up commands which will be run to generate coverage data.
# Cleanup lcov
set(LCOV_CLEAN_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory .
-b ${BASEDIR} --zerocounters
)
# Create baseline to make sure untouched files show up in the report
set(LCOV_BASELINE_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b
${BASEDIR} -o ${Coverage_NAME}.base
)
# Run tests
set(LCOV_EXEC_TESTS_CMD
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
)
# Capturing lcov counters and generating report
set(LCOV_CAPTURE_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b
${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
)
# add baseline counters
set(LCOV_BASELINE_COUNT_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base
-a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total
)
# filter collected data to final coverage report
set(LCOV_FILTER_CMD
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove
${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info
)
# Generate HTML output
set(LCOV_GEN_HTML_CMD
${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o
${Coverage_NAME} ${Coverage_NAME}.info
)
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Executed command report")
message(STATUS "Command to clean up lcov: ")
string(REPLACE ";" " " LCOV_CLEAN_CMD_SPACED "${LCOV_CLEAN_CMD}")
message(STATUS "${LCOV_CLEAN_CMD_SPACED}")
message(STATUS "Command to create baseline: ")
string(REPLACE ";" " " LCOV_BASELINE_CMD_SPACED "${LCOV_BASELINE_CMD}")
message(STATUS "${LCOV_BASELINE_CMD_SPACED}")
message(STATUS "Command to run the tests: ")
string(REPLACE ";" " " LCOV_EXEC_TESTS_CMD_SPACED "${LCOV_EXEC_TESTS_CMD}")
message(STATUS "${LCOV_EXEC_TESTS_CMD_SPACED}")
message(STATUS "Command to capture counters and generate report: ")
string(REPLACE ";" " " LCOV_CAPTURE_CMD_SPACED "${LCOV_CAPTURE_CMD}")
message(STATUS "${LCOV_CAPTURE_CMD_SPACED}")
message(STATUS "Command to add baseline counters: ")
string(REPLACE ";" " " LCOV_BASELINE_COUNT_CMD_SPACED "${LCOV_BASELINE_COUNT_CMD}")
message(STATUS "${LCOV_BASELINE_COUNT_CMD_SPACED}")
message(STATUS "Command to filter collected data: ")
string(REPLACE ";" " " LCOV_FILTER_CMD_SPACED "${LCOV_FILTER_CMD}")
message(STATUS "${LCOV_FILTER_CMD_SPACED}")
message(STATUS "Command to generate lcov HTML output: ")
string(REPLACE ";" " " LCOV_GEN_HTML_CMD_SPACED "${LCOV_GEN_HTML_CMD}")
message(STATUS "${LCOV_GEN_HTML_CMD_SPACED}")
endif()
# Setup target
add_custom_target(${Coverage_NAME}
COMMAND ${LCOV_CLEAN_CMD}
COMMAND ${LCOV_BASELINE_CMD}
COMMAND ${LCOV_EXEC_TESTS_CMD}
COMMAND ${LCOV_CAPTURE_CMD}
COMMAND ${LCOV_BASELINE_COUNT_CMD}
COMMAND ${LCOV_FILTER_CMD}
COMMAND ${LCOV_GEN_HTML_CMD}
# Set output files as GENERATED (will be removed on 'make clean')
BYPRODUCTS
${Coverage_NAME}.base
${Coverage_NAME}.capture
${Coverage_NAME}.total
${Coverage_NAME}.info
${Coverage_NAME}/index.html
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
)
# Show where to find the lcov info report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)
endfunction() # setup_target_for_coverage_lcov
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_gcovr_html(
# NAME ctest_coverage # New target name
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES executable_target # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
# # to BASE_DIRECTORY, with CMake 3.4+)
# )
# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
# GCVOR command.
function(setup_target_for_coverage_gcovr_html)
set(options NONE)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT GCOVR_PATH)
message(FATAL_ERROR "gcovr not found! Aborting...")
endif() # NOT GCOVR_PATH
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(DEFINED Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (CMake 3.4+: Also compute absolute paths)
set(GCOVR_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
if(CMAKE_VERSION VERSION_GREATER 3.4)
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
# Combine excludes to several -e arguments
set(GCOVR_EXCLUDE_ARGS "")
foreach(EXCLUDE ${GCOVR_EXCLUDES})
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
endforeach()
# Set up commands which will be run to generate coverage data
# Run tests
set(GCOVR_HTML_EXEC_TESTS_CMD
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
)
# Create folder
set(GCOVR_HTML_FOLDER_CMD
${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
)
# Running gcovr
set(GCOVR_HTML_CMD
${GCOVR_PATH} --html --html-details -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
-o ${Coverage_NAME}/index.html
)
# The --keep option is broken since gcovr 4.0 all our gcov files are deleted before SonarQube
# can use them. Hence create an additional sonarqube report, but do not fail if this fails.
set(GCOVR_SONAR_CMD
${GCOVR_PATH} --sonarqube -r ${BASEDIR} ${GCOVR_ADDITIONAL_ARGS}
${GCOVR_EXCLUDE_ARGS} --object-directory=${PROJECT_BINARY_DIR}
-o ${Coverage_NAME}/sonarqube.report || true
)
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Executed command report")
message(STATUS "Command to run tests: ")
string(REPLACE ";" " " GCOVR_HTML_EXEC_TESTS_CMD_SPACED "${GCOVR_HTML_EXEC_TESTS_CMD}")
message(STATUS "${GCOVR_HTML_EXEC_TESTS_CMD_SPACED}")
message(STATUS "Command to create a folder: ")
string(REPLACE ";" " " GCOVR_HTML_FOLDER_CMD_SPACED "${GCOVR_HTML_FOLDER_CMD}")
message(STATUS "${GCOVR_HTML_FOLDER_CMD_SPACED}")
message(STATUS "Command to generate gcovr HTML coverage data: ")
string(REPLACE ";" " " GCOVR_HTML_CMD_SPACED "${GCOVR_HTML_CMD}")
message(STATUS "${GCOVR_HTML_CMD_SPACED}")
endif()
add_custom_target(${Coverage_NAME}
COMMAND ${GCOVR_HTML_EXEC_TESTS_CMD}
COMMAND ${GCOVR_HTML_FOLDER_CMD}
COMMAND ${GCOVR_HTML_CMD}
COMMAND ${GCOVR_SONAR_CMD}
BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html # report directory
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Running gcovr to produce HTML code coverage report."
)
# Show info where to find the report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ;
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
)
endfunction() # setup_target_for_coverage_gcovr_html
# Defines a target for running and collection code coverage information
# Builds dependencies, runs the given executable and outputs reports.
# NOTE! The executable should always have a ZERO as exit code otherwise
# the coverage generation will not complete.
#
# setup_target_for_coverage_fastcov(
# NAME testrunner_coverage # New target name
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
# DEPENDENCIES testrunner # Dependencies to build first
# BASE_DIRECTORY "../" # Base directory for report
# # (defaults to PROJECT_SOURCE_DIR)
# EXCLUDE "src/dir1/" "src/dir2/" # Patterns to exclude.
# NO_DEMANGLE # Don't demangle C++ symbols
# # even if c++filt is found
# SKIP_HTML # Don't create html report
# )
function(setup_target_for_coverage_fastcov)
set(options NO_DEMANGLE SKIP_HTML)
set(oneValueArgs BASE_DIRECTORY NAME)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES FASTCOV_ARGS GENHTML_ARGS)
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT FASTCOV_PATH)
message(FATAL_ERROR "fastcov not found! Aborting...")
endif()
if(NOT GENHTML_PATH)
message(FATAL_ERROR "genhtml not found! Aborting...")
endif()
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
if(Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
# Collect excludes (Patterns, not paths, for fastcov)
set(FASTCOV_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_FASTCOV_EXCLUDES})
list(APPEND FASTCOV_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES FASTCOV_EXCLUDES)
# Conditional arguments
if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
set(GENHTML_EXTRA_ARGS "--demangle-cpp")
endif()
# Set up commands which will be run to generate coverage data
set(FASTCOV_EXEC_TESTS_CMD ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS})
set(FASTCOV_CAPTURE_CMD ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
--search-directory ${BASEDIR}
--process-gcno
--lcov
--output ${Coverage_NAME}.info
--exclude ${FASTCOV_EXCLUDES}
--exclude ${FASTCOV_EXCLUDES}
)
if(Coverage_SKIP_HTML)
set(FASTCOV_HTML_CMD ";")
else()
set(FASTCOV_HTML_CMD ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS}
-o ${Coverage_NAME} ${Coverage_NAME}.info
)
endif()
if(CODE_COVERAGE_VERBOSE)
message(STATUS "Code coverage commands for target ${Coverage_NAME} (fastcov):")
message(" Running tests:")
string(REPLACE ";" " " FASTCOV_EXEC_TESTS_CMD_SPACED "${FASTCOV_EXEC_TESTS_CMD}")
message(" ${FASTCOV_EXEC_TESTS_CMD_SPACED}")
message(" Capturing fastcov counters and generating report:")
string(REPLACE ";" " " FASTCOV_CAPTURE_CMD_SPACED "${FASTCOV_CAPTURE_CMD}")
message(" ${FASTCOV_CAPTURE_CMD_SPACED}")
if(NOT Coverage_SKIP_HTML)
message(" Generating HTML report: ")
string(REPLACE ";" " " FASTCOV_HTML_CMD_SPACED "${FASTCOV_HTML_CMD}")
message(" ${FASTCOV_HTML_CMD_SPACED}")
endif()
endif()
# Setup target
add_custom_target(${Coverage_NAME}
# Cleanup fastcov
COMMAND ${FASTCOV_PATH} ${Coverage_FASTCOV_ARGS} --gcov ${GCOV_PATH}
--search-directory ${BASEDIR}
--zerocounters
COMMAND ${FASTCOV_EXEC_TESTS_CMD}
COMMAND ${FASTCOV_CAPTURE_CMD}
COMMAND ${FASTCOV_HTML_CMD}
# Set output files as GENERATED (will be removed on 'make clean')
BYPRODUCTS
${Coverage_NAME}.info
${Coverage_NAME}/index.html # report directory
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
DEPENDS ${Coverage_DEPENDENCIES}
VERBATIM # Protect arguments to commands
COMMENT "Resetting code coverage counters to zero. Processing code coverage counters and generating report."
)
set(INFO_MSG "fastcov code coverage info report saved in ${Coverage_NAME}.info.")
if(NOT Coverage_SKIP_HTML)
string(APPEND INFO_MSG " Open ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html in your browser to view the coverage report.")
endif()
# Show where to find the fastcov info report
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo ${INFO_MSG}
)
endfunction() # setup_target_for_coverage_fastcov
function(append_coverage_compiler_flags)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
endfunction() # append_coverage_compiler_flags

View file

@ -1,92 +1,56 @@
# Provides install directory variables as defined by the GNU Coding Standards
include ( GNUInstallDirs )
# Several directory names used by FluidSynth to install files
# the variable names are similar to the KDE4 build system
# DEFAULT_SOUNDFONT - automatically loaded in some use cases
if ( WIN32 )
set (DEFAULT_SOUNDFONT "C:\\\\soundfonts\\\\default.sf2" CACHE STRING
set (DEFAULT_SOUNDFONT "C:\\\\ProgramData\\\\soundfonts\\\\default.sf2" CACHE STRING
"Default soundfont file")
else ( WIN32 )
set (DEFAULT_SOUNDFONT "${CMAKE_INSTALL_PREFIX}/share/soundfonts/default.sf2" CACHE STRING
set (DEFAULT_SOUNDFONT "${CMAKE_INSTALL_FULL_DATADIR}/soundfonts/default.sf2" CACHE STRING
"Default soundfont file")
endif ( WIN32 )
mark_as_advanced (DEFAULT_SOUNDFONT)
set(FRAMEWORK_INSTALL_PREFIX "")
if ( CMAKE_VERSION VERSION_GREATER "3.7.0" AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set(FRAMEWORK_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
endif()
# BUNDLE_INSTALL_DIR - Mac only: the directory for application bundles
set (BUNDLE_INSTALL_DIR "/Applications" CACHE STRING
set (BUNDLE_INSTALL_DIR "Applications" CACHE STRING
"The install dir for application bundles")
mark_as_advanced (BUNDLE_INSTALL_DIR)
# FRAMEWORK_INSTALL_DIR - Mac only: the directory for framework bundles
set (FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING
set (FRAMEWORK_INSTALL_DIR "Library/Frameworks" CACHE STRING
"The install dir for framework bundles")
mark_as_advanced (FRAMEWORK_INSTALL_DIR)
# BIN_INSTALL_DIR - the directory where executables will be installed
set (BIN_INSTALL_DIR "bin" CACHE STRING "The install dir for executables")
mark_as_advanced (BIN_INSTALL_DIR)
# SBIN_INSTALL_DIR - the directory where system executables will be installed
set (SBIN_INSTALL_DIR "sbin" CACHE STRING
"The install dir for system executables")
mark_as_advanced (SBIN_INSTALL_DIR)
# LIB_INSTALL_DIR - the directory where libraries will be installed
set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE STRING "The install dir for libraries")
mark_as_advanced (LIB_INSTALL_DIR)
# INCLUDE_INSTALL_DIR - the install dir for header files
set (INCLUDE_INSTALL_DIR "include" CACHE STRING "The install dir for headers")
mark_as_advanced (INCLUDE_INSTALL_DIR)
# DATA_INSTALL_DIR - the base install directory for data files
set (DATA_INSTALL_DIR "share" CACHE STRING
"The base install dir for data files")
mark_as_advanced (DATA_INSTALL_DIR)
# DOC_INSTALL_DIR - the install dir for documentation
set (DOC_INSTALL_DIR "share/doc" CACHE STRING
"The install dir for documentation")
mark_as_advanced (DOC_INSTALL_DIR)
# INFO_INSTALL_DIR - the info install dir
set (INFO_INSTALL_DIR "share/info" CACHE STRING "The info install dir")
mark_as_advanced (INFO_INSTALL_DIR)
# MAN_INSTALL_DIR - the man pages install dir
if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD|DragonFly")
set (MAN_INSTALL_DIR "man/man1" CACHE STRING "The man pages install dir")
else()
set (MAN_INSTALL_DIR "share/man/man1" CACHE STRING "The man pages install dir")
endif()
mark_as_advanced (MAN_INSTALL_DIR)
# SYSCONF_INSTALL_DIR - the config file install dir
set (SYSCONF_INSTALL_DIR "/etc" CACHE PATH
"The sysconfig install dir")
mark_as_advanced (SYSCONF_INSTALL_DIR)
mark_as_advanced (FRAMEWORK_INSTALL_DIR)
# XDG_APPS_INSTALL_DIR - the XDG apps dir, where .desktop files are installed
set (XDG_APPS_INSTALL_DIR "share/applications" CACHE STRING "The XDG apps dir")
set (XDG_APPS_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/applications" CACHE STRING "The XDG apps dir")
mark_as_advanced (XDG_APPS_INSTALL_DIR)
# XDG_MIME_INSTALL_DIR - the XDG mimetypes install dir
set (XDG_MIME_INSTALL_DIR "share/mime/packages" CACHE STRING
set (XDG_MIME_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/mime/packages" CACHE STRING
"The install dir for the xdg mimetypes")
mark_as_advanced (XDG_MIME_INSTALL_DIR)
# DBUS_INTERFACES_INSTALL_DIR - the directory where dbus interfaces are
# installed
set (DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces" CACHE STRING
set (DBUS_INTERFACES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/dbus-1/interfaces" CACHE STRING
"The dbus interfaces install dir")
mark_as_advanced (DBUS_INTERFACES_INSTALL_DIR)
# DBUS_SERVICES_INSTALL_DIR - the directory where dbus services are installed
set (DBUS_SERVICES_INSTALL_DIR "share/dbus-1/services" CACHE STRING
set (DBUS_SERVICES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/dbus-1/services" CACHE STRING
"The dbus services install dir")
mark_as_advanced (DBUS_SERVICES_INSTALL_DIR)
# DBUS_SYSTEM_SERVICES_INSTALL_DIR - the directory where dbus system services
# are installed
set (DBUS_SYSTEM_SERVICES_INSTALL_DIR "share/dbus-1/system-services"
set (DBUS_SYSTEM_SERVICES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/dbus-1/system-services"
CACHE STRING "The dbus system services install dir")
mark_as_advanced (DBUS_SYSTEM_SERVICES_INSTALL_DIR)

View file

@ -45,7 +45,4 @@ ENDIF(NOT WIN32)
MARK_AS_ADVANCED (
OSS_FOUND
OSS_INCLUDE_DIR
LINUX_OSS_INCLUDE_DIR
SYS_OSS_INCLUDE_DIR
MACHINE_OSS_INCLUDE_DIR
)
)

View file

@ -1,14 +1,14 @@
macro ( ADD_FLUID_TEST _test )
ADD_EXECUTABLE(${_test} ${_test}.c $<TARGET_OBJECTS:libfluidsynth-OBJ> )
add_executable( ${_test} ${_test}.c )
# only build this unit test when explicitly requested by "make check"
set_target_properties(${_test} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# import necessary compile flags and dependency libraries
if ( FLUID_CPPFLAGS )
set_target_properties ( ${_test} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} )
endif ( FLUID_CPPFLAGS )
TARGET_LINK_LIBRARIES(${_test} $<TARGET_PROPERTY:libfluidsynth,INTERFACE_LINK_LIBRARIES>)
target_link_libraries( ${_test} libfluidsynth-OBJ )
# use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed
target_include_directories(${_test}
@ -16,13 +16,85 @@ macro ( ADD_FLUID_TEST _test )
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> # include auto generated headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> # include "normal" public (sub-)headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> # include private headers
$<TARGET_PROPERTY:libfluidsynth,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
$<TARGET_PROPERTY:libfluidsynth-OBJ,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
)
# add the test to ctest
ADD_TEST(NAME ${_test} COMMAND ${_test})
# append the current unit test to check-target as dependency
add_dependencies(check ${_test})
endmacro ( ADD_FLUID_TEST )
macro ( ADD_FLUID_TEST_UTIL _util )
add_executable( ${_util} ${_util}.c )
# only build this unit test when explicitly requested by "make check"
set_target_properties(${_util} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# append no-op generator expression to avoid VS or XCode from adding per-config subdirectories
set_target_properties(${_util} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/utils/$<0:>)
# import necessary compile flags and dependency libraries
if ( FLUID_CPPFLAGS )
set_target_properties ( ${_util} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} )
endif ( FLUID_CPPFLAGS )
target_link_libraries( ${_util} libfluidsynth-OBJ )
# use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed
target_include_directories(${_util}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> # include auto generated headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> # include "normal" public (sub-)headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> # include private headers
$<TARGET_PROPERTY:libfluidsynth-OBJ,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
)
# append the current unit test to check-target as dependency
add_dependencies(check ${_util})
endmacro ( ADD_FLUID_TEST_UTIL )
# This macro adds a test that writes its output to a file called
# <test>.output (in the current working dir) and then compares
# the content with the file given in _expected_output
macro ( ADD_FLUID_SF_DUMP_TEST _sfname)
set( test_args "${CMAKE_SOURCE_DIR}/sf2/${_sfname} ${_sfname}.yml" )
ADD_TEST(${_sfname}_dump_test
${CMAKE_COMMAND}
-Dtest_cmd=${CMAKE_BINARY_DIR}/test/utils/dump_sfont${CMAKE_EXECUTABLE_SUFFIX}
-Dtest_args=${test_args}
-Dtest_output=${_sfname}.yml
-Dexpected_output=${CMAKE_SOURCE_DIR}/sf2/${_sfname}.yml
-P ${CMAKE_SOURCE_DIR}/cmake_admin/RunOutputTest.cmake
)
endmacro ( ADD_FLUID_SF_DUMP_TEST )
macro ( ADD_FLUID_DEMO _demo )
ADD_EXECUTABLE(${_demo} ${_demo}.c )
# only build this unit test when explicitly requested by "make check"
set_target_properties(${_demo} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# import necessary compile flags and dependency libraries
if ( FLUID_CPPFLAGS )
set_target_properties ( ${_demo} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} )
endif ( FLUID_CPPFLAGS )
TARGET_LINK_LIBRARIES(${_demo} libfluidsynth)
# use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed
target_include_directories(${_demo}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> # include auto generated headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> # include "normal" public (sub-)headers
$<TARGET_PROPERTY:libfluidsynth,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
)
# append the current unit test to check-target as dependency
add_dependencies(demo ${_demo})
endmacro ( ADD_FLUID_DEMO )

View file

@ -0,0 +1,75 @@
macro ( sanitize_property_dirs target property )
set(_cleandirs)
get_target_property(_dirs ${target} ${property})
if(_dirs)
foreach(_d IN LISTS _dirs)
if(EXISTS ${_d})
list(APPEND _cleandirs ${_d})
else()
message(DEBUG "removing spurious directory ${_d} from property ${property} of target ${target}")
endif()
endforeach()
set_property(TARGET ${target} PROPERTY ${property} ${_cleandirs})
endif()
endmacro ( sanitize_property_dirs )
macro ( sanitize_target_dirs target )
if (TARGET ${target})
message(DEBUG "performing sanitize_target_dirs(${target})")
sanitize_property_dirs( ${target} INTERFACE_INCLUDE_DIRECTORIES )
sanitize_property_dirs( ${target} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES )
sanitize_property_dirs( ${target} INTERFACE_LINK_DIRECTORIES )
endif()
endmacro ( sanitize_target_dirs )
macro ( generate_pkgconfig_spec template outfile target )
#message(DEBUG "generate_pkgconfig_spec: ${outfile} from template: ${template}")
if (TARGET ${target})
# retrieve all the private libs we depend on
get_target_property (_libs ${target} INTERFACE_LINK_LIBRARIES)
set(_cleanlibs)
foreach(_lib IN LISTS _libs)
if (TARGET ${_lib})
# All the imported PkgConfig target are explicitly added to PC_REQUIRES_PRIV.
# Do not duplicate them into the Libs.private section, as they will be already part of Requires.private
else()
list(APPEND _cleanlibs ${_lib})
endif()
endforeach()
list(REMOVE_DUPLICATES _cleanlibs)
set (LIBS_PRIVATE ${_cleanlibs})
# make a copy
set ( LIBS_PRIVATE_WITH_PATH ${LIBS_PRIVATE} )
# this matches any path and any flag entries (starting with '-')
set ( LIB_LIST_REGEX "(^(.+)\/([^\/]+)$)|(^\-.*$)" )
# remove all entries from the list which are specified by path and which already have -l
list ( FILTER LIBS_PRIVATE EXCLUDE REGEX ${LIB_LIST_REGEX} )
# include only entries specifed by path
list ( FILTER LIBS_PRIVATE_WITH_PATH INCLUDE REGEX ${LIB_LIST_REGEX} )
# prepend the linker flag to all entries except the ones that already have it
list ( TRANSFORM LIBS_PRIVATE PREPEND "-l")
list ( JOIN LIBS_PRIVATE " " LIBS_PRIVATE_JOINED )
list ( JOIN LIBS_PRIVATE_WITH_PATH " " LIBS_PRIVATE_WITH_PATH_JOINED )
list ( JOIN PC_REQUIRES_PRIV " " PC_REQUIRES_PRIV_JOINED )
configure_file ( ${template} ${outfile} IMMEDIATE @ONLY)
endif()
endmacro ( generate_pkgconfig_spec )
macro ( unset_pkg_config _prefix )
unset ( ${_prefix}_VERSION CACHE )
unset ( ${_prefix}_PREFIX CACHE )
unset ( ${_prefix}_CFLAGS CACHE )
unset ( ${_prefix}_CFLAGS_OTHER CACHE )
unset ( ${_prefix}_LDFLAGS CACHE )
unset ( ${_prefix}_LDFLAGS_OTHER CACHE )
unset ( ${_prefix}_LIBRARIES CACHE )
unset ( ${_prefix}_INCLUDEDIR CACHE )
unset ( ${_prefix}_INCLUDE_DIRS CACHE )
unset ( ${_prefix}_LIBDIR CACHE )
unset ( ${_prefix}_LIBRARY_DIRS CACHE )
unset ( __pkg_config_checked_${_prefix} CACHE )
endmacro ( unset_pkg_config )

View file

@ -0,0 +1,31 @@
if( NOT test_cmd )
message( FATAL_ERROR "test_cmd not defined" )
endif( NOT test_cmd )
if( NOT test_output )
message( FATAL_ERROR "test_output not defined" )
endif( NOT test_output )
if( NOT expected_output )
message( FATAL_ERROR "expected_output not defined" )
endif( NOT expected_output )
separate_arguments( test_args )
execute_process(
COMMAND ${test_cmd} ${test_args}
RESULT_VARIABLE test_not_successful
)
if( test_not_successful )
message( FATAL_ERROR "${test_cmd} ${test_args} returned error ${test_not_successful}!" )
endif( test_not_successful )
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${expected_output} ${test_output}
RESULT_VARIABLE compare_not_successful
)
if( compare_not_successful )
message( SEND_ERROR "${test_output} does not match ${expected_output}!" )
endif( compare_not_successful )

View file

@ -1,14 +0,0 @@
macro ( unset_pkg_config _prefix )
unset ( ${_prefix}_VERSION CACHE )
unset ( ${_prefix}_PREFIX CACHE )
unset ( ${_prefix}_CFLAGS CACHE )
unset ( ${_prefix}_CFLAGS_OTHER CACHE )
unset ( ${_prefix}_LDFLAGS CACHE )
unset ( ${_prefix}_LDFLAGS_OTHER CACHE )
unset ( ${_prefix}_LIBRARIES CACHE )
unset ( ${_prefix}_INCLUDEDIR CACHE )
unset ( ${_prefix}_INCLUDE_DIRS CACHE )
unset ( ${_prefix}_LIBDIR CACHE )
unset ( ${_prefix}_LIBRARY_DIRS CACHE )
unset ( __pkg_config_checked_${_prefix} CACHE )
endmacro ( unset_pkg_config )

View file

@ -61,6 +61,12 @@ else ( OSS_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} OSS: no\n" )
endif ( OSS_SUPPORT )
if ( PIPEWIRE_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} PipeWire: yes\n" )
else ( PIPEWIRE_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} PipeWire: no\n" )
endif ( PIPEWIRE_SUPPORT )
if ( PORTAUDIO_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} PortAudio: yes\n" )
else ( PORTAUDIO_SUPPORT )
@ -79,6 +85,12 @@ else ( SDL2_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} SDL2: no\n" )
endif ( SDL2_SUPPORT )
if ( WASAPI_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} WASAPI: yes\n" )
else ( WASAPI_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} WASAPI: no\n" )
endif ( WASAPI_SUPPORT )
if ( WAVEOUT_SUPPORT )
set ( AUDIO_MIDI_REPORT "${AUDIO_MIDI_REPORT} WaveOut: yes\n" )
else ( WAVEOUT_SUPPORT )
@ -171,6 +183,12 @@ else ( SYSTEMD_SUPPORT )
set ( MISC_REPORT "${MISC_REPORT} systemd: no\n" )
endif ( SYSTEMD_SUPPORT )
if ( HAVE_GETOPT_H )
set ( MISC_REPORT "${MISC_REPORT} getopt: yes\n" )
else ( HAVE_GETOPT_H )
set ( MISC_REPORT "${MISC_REPORT} getopt: no\n" )
endif ( HAVE_GETOPT_H )
set ( DEVEL_REPORT "\nDeveloper nerds info:\n" )
@ -222,6 +240,20 @@ else ( ENABLE_UBSAN )
set ( DEVEL_REPORT "${DEVEL_REPORT} UBSan (debug): no\n" )
endif ( ENABLE_UBSAN )
if ( ENABLE_COVERAGE )
set ( DEVEL_REPORT "${DEVEL_REPORT} Coverage: yes\n" )
else ( ENABLE_COVERAGE )
set ( DEVEL_REPORT "${DEVEL_REPORT} Coverage: no\n" )
endif ( ENABLE_COVERAGE )
if ( MSVC )
if ( enable-static-msvcrt )
set ( DEVEL_REPORT "${DEVEL_REPORT} Static MSVC Runtime: yes\n" )
else ( enable-static-msvcrt )
set ( DEVEL_REPORT "${DEVEL_REPORT} Static MSVC Runtime: no\n" )
endif ( enable-static-msvcrt )
endif ( MSVC )
message( STATUS
"\n**************************************************************\n"
"Build Summary:\n"

1
contrib/baselibs.conf Normal file
View file

@ -0,0 +1 @@
libfluidsynth2

23
contrib/debian.changelog Normal file
View file

@ -0,0 +1,23 @@
fluidsynth (1.1.8-1) unstable; urgency=low
- Update to version 1.1.8:
* fix build against glib < 2.30 (#202)
* fix dsound audio driver on windows (#215)
* fix a bug around `synth.audio-groups` setting, which caused improper multi-channel rendering (#225)
* cmake 3.0.2 is now required
* compilation with clang is now possible
* build fixes on OS/2 (thanks to @komh)
-- Tom Moebert <tom.mbrt@googlemail.com> Fri, 13 Oct 2017 15:53:00 +0000
fluidsynth (1.1.7-1) unstable; urgency=low
* OBS snapshot.
-- Rui Nuno Capela <rncbc@rncbc.org> Tue, 5 Sep 2017 20:00:00 +0000
fluidsynth (1.1.6-1) unstable; urgency=low
* OBS snapshot.
-- Rui Nuno Capela <rncbc@rncbc.org> Sun, 19 Aug 2012 23:45:01 +0000

1
contrib/debian.compat Normal file
View file

@ -0,0 +1 @@
9

34
contrib/debian.control Normal file
View file

@ -0,0 +1,34 @@
Source: fluidsynth
Priority: optional
Section: sound
Maintainer: Rui Nuno Capela <rncbc@rncbc.org>
Build-Depends: debhelper (>= 5.0.0), cmake, pkg-config, libdb-dev, libjack-dev, libasound2-dev,
libsndfile-dev, libglib2.0-dev
Standards-Version: 3.7.2
Package: libfluidsynth1
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: FluidSynth is a real-time software synthesizer
FluidSynth is a real-time software synthesizer based on
the SoundFont 2 specifications.
Package: libfluidsynth-dev
Section: libdevel
Architecture: any
Depends: libfluidsynth1 (= ${source:Version})
Description: FluidSynth is a real-time software synthesizer
FluidSynth is a real-time software synthesizer based on
the SoundFont 2 specifications.
This package contains the header file required for compiling
hosts and plugins.
Package: fluidsynth
Section: sound
Architecture: any
Depends: libfluidsynth1 (= ${source:Version})
Description: FluidSynth is a real-time software synthesizer
FluidSynth is a real-time software synthesizer based on
the SoundFont 2 specifications.
This package contains the command-line utilities.

30
contrib/debian.copyright Normal file
View file

@ -0,0 +1,30 @@
This package was debianized by Rui Nuno Capela <rncbc@rncbc.org> on
Mon, 25 Jun 2007 10:42:40 +0100.
It was downloaded from http://www.fluidsynth.org
Upstream Author: Rui Nuno Capela <rncbc@rncbc.org>
Copyright:
Copyright (C) 2003-2015, rncbc aka Rui Nuno Capela. All rights reserved.
License:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The Debian packaging is (C) 2007-2013, Rui Nuno Capela <rncbc@rncbc.org> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.

View file

@ -0,0 +1,2 @@
debian/tmp/usr/bin/*
debian/tmp/usr/share/*

View file

@ -0,0 +1,4 @@
debian/tmp/usr/include/*
debian/tmp/usr/lib/*/*.so
debian/tmp/usr/lib/*/pkgconfig/*.pc
debian/tmp/usr/lib/*/cmake/fluidsynth/*.cmake

View file

@ -0,0 +1 @@
debian/tmp/usr/lib/*/lib*.so.*

98
contrib/debian.rules Normal file
View file

@ -0,0 +1,98 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
#export DH_COMPAT=7
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
config.status: CMakeLists.txt
dh_testdir
# Add here commands to configure the package.
cmake -DCMAKE_INSTALL_PREFIX=/usr .
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE)
# the build should fail if the tests are not successful
#$(MAKE) check
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
#-$(MAKE) distclean
dh_clean -a
install: build
dh_testdir
dh_testroot
dh_clean -k -a
dh_installdirs
# Add here commands to install the package into debian/tmp
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_install -a --list-missing
# dh_installchangelogs -a ChangeLog
# dh_installdocs -a
# dh_installexamples
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
# dh_installman
# dh_link
dh_strip -a
dh_compress -a
dh_fixperms -a
# dh_perl
# dh_python
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

0
contrib/debian.series Normal file
View file

8
contrib/fluidsynth.dsc Normal file
View file

@ -0,0 +1,8 @@
Format: 1.0
Source: fluidsynth
Version: 2.2.0-1
Binary: fluidsynth, libfluidsynth1, libfluidsynth-dev
Maintainer: Rui Nuno Capela <rncbc@rncbc.org>
Architecture: any
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 5.0.0), cmake (>= 3.13.0), pkg-config, libdb-dev, libjack-dev, libasound2-dev, libsndfile-dev, libglib2.0-dev

144
contrib/fluidsynth.spec Normal file
View file

@ -0,0 +1,144 @@
#
# spec file for package fluidsynth
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# fix build for older distros and architectures where _fillupdir is
# not yet defined by using the old path as recommended by
# https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25_fillupdir
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
Name: fluidsynth
Version: 2.2.2
Release: 0
Summary: A Real-Time Software Synthesizer That Uses Soundfont(tm)
License: LGPL-2.1-or-later
Group: Productivity/Multimedia/Sound/Midi
Url: http://www.fluidsynth.org/
Source: https://github.com/FluidSynth/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1000: baselibs.conf
BuildRequires: cmake >= 3.13.0
BuildRequires: gcc-c++
%if 0%{?is_opensuse}
BuildRequires: ladspa-devel
%endif
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(jack)
BuildRequires: pkgconfig(libinstpatch-1.0) >= 1.1.0
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(sndfile)
%if 0%{?suse_version}
%{?systemd_requires}
PreReq: %fillup_prereq
%endif
%description
FluidSynth (formerly IIWU Synth) is a real-time software synthesizer
based on the SoundFont(tm) 2 specifications. It can read MIDI events
from the MIDI input device and render them to the audio device. It
can also play MIDI files.
%package devel
Summary: Development package for the fluidsynth library
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libfluidsynth3 = %{version}
Provides: libfluidsynth-devel = %{version}
%description devel
This package contains the files needed to compile programs that use the
fluidsynth library.
%package -n libfluidsynth3
Summary: Library for Fluidsynth
Group: System/Libraries
%description -n libfluidsynth3
This package contains the shared library for Fluidsynth.
%prep
%setup -q
%build
%cmake \
-DFLUID_DAEMON_ENV_FILE=%{_fillupdir}/sysconfig.%{name} \
-Denable-lash=0
%cmake_build
%check
%cmake
%if 0%{?fedora_version} || 0%{?mageia}
%cmake_build --target check
%else
%cmake_build check
%endif
%install
%cmake_install
%if 0%{?suse_version}
# manually install systemd service files
install -Dm 644 build/fluidsynth.conf %{buildroot}%{_fillupdir}/sysconfig.%{name}
install -Dm 644 build/fluidsynth.service %{buildroot}%{_unitdir}/%{name}.service
install -d %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%pre
%service_add_pre %{name}.service
%post
%fillup_only
%service_add_post %{name}.service
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%endif
%post -n libfluidsynth3 -p /sbin/ldconfig
%postun -n libfluidsynth3 -p /sbin/ldconfig
%files
%license LICENSE
%doc AUTHORS ChangeLog README.md THANKS TODO
%{_mandir}/man?/*
%{_bindir}/*
%if 0%{?suse_version}
%{_unitdir}/%{name}.service
%{_sbindir}/rc%{name}
%{_fillupdir}/sysconfig.%{name}
%endif
%files devel
%{_libdir}/lib*.so
%dir %{_libdir}/cmake/%{name}
%{_libdir}/cmake/%{name}/*.cmake
%{_libdir}/pkgconfig/*.pc
%{_includedir}/*
%files -n libfluidsynth3
%{_libdir}/lib*.so.*
%changelog

View file

@ -27,9 +27,25 @@ if ( DOXYGEN_FOUND )
${DOXYGEN} Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
find_package ( LibXslt )
if ( LIBXSLT_XSLTPROC_EXECUTABLE )
add_custom_target ( doxygen_settings
${LIBXSLT_XSLTPROC_EXECUTABLE}
--output ${CMAKE_CURRENT_BINARY_DIR}/fluidsettings.txt
${CMAKE_CURRENT_SOURCE_DIR}/doxygen/fluidsettings.xsl
${CMAKE_CURRENT_SOURCE_DIR}/fluidsettings.xml
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_dependencies(doxygen doxygen_settings)
endif ( LIBXSLT_XSLTPROC_EXECUTABLE )
endif ( DOXYGEN_FOUND )
if ( UNIX )
install ( FILES fluidsynth.1
DESTINATION ${MAN_INSTALL_DIR} )
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
endif ( UNIX )
add_subdirectory ( examples )

View file

@ -1,246 +0,0 @@
# Doxyfile 1.6
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = libfluidsynth
PROJECT_NUMBER = 2.1.0
OUTPUT_DIRECTORY = api
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH = ../
STRIP_FROM_INC_PATH = ../include/
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = NO
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = NO
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = NO
GENERATE_TESTLIST = NO
GENERATE_BUGLIST = NO
GENERATE_DEPRECATEDLIST = YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../doc/fluidsynth-v20-devdoc.txt ../include ../include/fluidsynth ../src
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = fluid_*.h
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = ../doc
EXAMPLE_PATTERNS = *.c
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_EXTRA_STYLESHEET = ../doc/doxy_formula.css
HTML_ALIGN_MEMBERS = YES
HTML_EXTRA_FILES = ../doc/fluidsettings.xml ../doc/fluidsettings.xsl
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = YES
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = __DOXYGEN__
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_FONTNAME = FreeSans
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = YES

View file

@ -11,7 +11,7 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the
ABBREVIATE_BRIEF = "Functions for" "Functions to" "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
@ -24,7 +24,9 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
ALIASES += startlifecycle{1}="\name Lifecycle Functions for \1\_linebr@{"
ALIASES += endlifecycle="@}"
ALIASES += setting{1}="\ref settings_\1"
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
@ -34,7 +36,7 @@ CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
@ -54,9 +56,9 @@ CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
SORT_GROUP_NAMES = YES
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = NO
GENERATE_TESTLIST = NO
@ -65,7 +67,6 @@ GENERATE_DEPRECATEDLIST = YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
@ -82,18 +83,27 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = @CMAKE_SOURCE_DIR@/doc/fluidsynth-v20-devdoc.txt @CMAKE_SOURCE_DIR@/include @CMAKE_SOURCE_DIR@/include/fluidsynth @CMAKE_SOURCE_DIR@/src @CMAKE_BINARY_DIR@/include/fluidsynth
INPUT = \
@CMAKE_SOURCE_DIR@/doc/fluidsynth-v20-devdoc.txt \
@CMAKE_SOURCE_DIR@/doc/recent_changes.txt \
@CMAKE_SOURCE_DIR@/doc/usage \
@CMAKE_SOURCE_DIR@/include \
@CMAKE_SOURCE_DIR@/include/fluidsynth \
@CMAKE_SOURCE_DIR@/src \
@CMAKE_BINARY_DIR@/include/fluidsynth \
@CMAKE_BINARY_DIR@/doc/fluidsettings.txt
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c *.h
FILE_PATTERNS = *.c *.h *.txt
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = fluid_*.h
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc/examples
EXAMPLE_PATTERNS = *.c
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
IMAGE_PATH = @CMAKE_SOURCE_DIR@/doc/images
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
@ -103,8 +113,8 @@ FILTER_SOURCE_FILES = NO
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = NO
@ -120,11 +130,19 @@ IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doc/doxy_formula.css
HTML_ALIGN_MEMBERS = YES
HTML_EXTRA_FILES = @CMAKE_SOURCE_DIR@/doc/fluidsettings.xml @CMAKE_SOURCE_DIR@/doc/fluidsettings.xsl
HTML_EXTRA_FILES = \
@CMAKE_SOURCE_DIR@/doc/fluidsettings.xml \
@CMAKE_SOURCE_DIR@/doc/fluidsettings.xsl
# FluidSynth specific layout and style customizations.
# Comment the following four lines to return to the
# default doxygen styling and layout
LAYOUT_FILE = @CMAKE_SOURCE_DIR@/doc/doxygen/layout.xml
HTML_HEADER =
HTML_FOOTER = @CMAKE_SOURCE_DIR@/doc/doxygen/footer.html
HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doc/doxygen/custom.css
# end FluidSynth styling and layout
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
@ -137,9 +155,9 @@ CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
ENUM_VALUES_PER_LINE = 1
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 350
FORMULA_FONTSIZE = 10
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
@ -177,8 +195,6 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@ -195,12 +211,14 @@ PERLMOD_MAKEVAR_PREFIX =
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = __DOXYGEN__
PREDEFINED = __DOXYGEN__ \
FLUIDSYNTH_API \
FLUID_DEPRECATED
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
@ -218,7 +236,7 @@ CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_FONTNAME = FreeSans
DOT_FONTNAME =
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES

BIN
doc/FluidMixer.ppt Normal file

Binary file not shown.

View file

@ -7,7 +7,7 @@ execute the following command in this doc/ directory:
$ make doxygen
The latest generated API HTML docs can also be found at:
http://www.fluidsynth.org/api/
https://www.fluidsynth.org/api/
Even more documentation references are provided on our wiki page:
https://github.com/FluidSynth/fluidsynth/wiki/Documentation

View file

@ -16,8 +16,9 @@ PWD=$(shell pwd)
CERBERO=$(PWD)/external/cerbero
OBOE=$(PWD)/external/oboe
CMAKE=cmake
JOBS=$(shell nproc)
ANDROID_NDK = $(PWD)/external/cerbero/build/android-ndk-18
ANDROID_NDK = $(PWD)/external/cerbero/build/android-ndk-21
ABIS_SIMPLE = x86 x86-64 armv7 arm64
@ -30,22 +31,22 @@ all: build
.PHONY: prepare
prepare: checkout-oboe checkout-cerbero
for abi in $(ABIS_SIMPLE) ; do \
cd $(CERBERO) && ./cerbero-uninstalled -c config/cross-android-$$abi.cbc bootstrap && cd $(PWD) ; \
cd $(CERBERO) && ./cerbero-uninstalled -c config/cross-android-$$abi.cbc bootstrap --jobs $(JOBS) && cd $(PWD) ; \
done
.PHONY: checkout-oboe
checkout-oboe: $(OBOE)
cd $(OBOE) && git checkout 9bf3943
cd $(OBOE) && git checkout 1.5.0
$(OBOE):
git clone https://github.com/Google/oboe.git $(OBOE)
.PHONY: checkout-cerbero
checkout-cerbero: $(CERBERO)
cd $(CERBERO) && git checkout 0acd9b0
cd $(CERBERO) && git checkout e9f18b3b340de1648d885a0542d2f06c3fcfffe8
$(CERBERO):
git clone https://github.com/atsushieno/cerbero.git $(CERBERO)
git clone https://github.com/falrm/cerbero.git $(CERBERO)
.PHONY: build
build: build-oboe dist-oboe build-deps-cerbero dist-deps-cerbero build-fluidsynth dist-fluidsynth build-fluidsynth-assetloader dist-fluidsynth-assetloader
@ -53,7 +54,7 @@ build: build-oboe dist-oboe build-deps-cerbero dist-deps-cerbero build-fluidsynt
.PHONY: build-deps-cerbero
build-deps-cerbero:
for abi in $(ABIS_SIMPLE) ; do \
cd $(CERBERO) && ./cerbero-uninstalled -c config/cross-android-$$abi.cbc build glib libsndfile && cd $(PWD) ; \
cd $(CERBERO) && ./cerbero-uninstalled -c config/cross-android-$$abi.cbc build --jobs $(JOBS) glib libsndfile && cd $(PWD) ; \
done
define run_make_abi_target
@ -104,11 +105,11 @@ build-fluidsynth-one:
-DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK)/build/cmake/android.toolchain.cmake \
-Denable-opensles=on -Denable-oboe=on -Denable-oss=off -Denable-libsndfile=on \
-DANDROID_NATIVE_API_LEVEL=android-27 -DANDROID_PLATFORM=android-27 -DANDROID_ABI=$(A_ABI) ../../../.. && \
make
make -j$(JOBS)
build-oboe-one:
mkdir -p $(OBOE)/build/$(A_ABI) && cd $(OBOE)/build/$(A_ABI) && \
$(CMAKE) -DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK)/build/cmake/android.toolchain.cmake -DANDROID_ABI=$(A_ABI) -DANDROID_NATIVE_API_LEVEL=android-27 -DANDROID_PLATFORM=android-27 -DBUILD_SHARED_LIBS=on ../.. && make
$(CMAKE) -DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK)/build/cmake/android.toolchain.cmake -DANDROID_ABI=$(A_ABI) -DANDROID_NATIVE_API_LEVEL=android-27 -DANDROID_PLATFORM=android-27 -DBUILD_SHARED_LIBS=on ../.. && make -j$(JOBS)
cp oboe-1.0.pc $(OBOE)/build/$(A_ABI)
dist-oboe-one:

View file

@ -2,6 +2,8 @@
Fluidsynth supports Android audio outputs by Oboe and OpenSLES audio drivers.
If you are new to Fluidsynth on Android, check out [Hector Ricardo's Hello World App for Android](https://medium.com/swlh/creating-a-fluidsynth-hello-world-app-for-android-5e112454a8eb).
Android also has Android MIDI API which is exposed only in Android Java API, but it is not exposed as a native API, therefore there is no `mdriver` support for Android. There is an example MidiDeviceService implementation for Fluidsynth at: https://github.com/atsushieno/fluidsynth-midi-service-j
## Usage
@ -31,8 +33,8 @@ There is [an example source code](https://github.com/atsushieno/fluidsynth-midi-
## Building
In this directory the Cerbero build system is (ab)used for cross-compiling Fluidsynth's dependencies for Android. The entrypoint is `Makefile.android`. If you are looking for a step by step introduction guide for cross-compiling Fluidsynth, [you'll find it in the wiki](https://github.com/FluidSynth/fluidsynth/wiki/BuildingForAndroid).
By default, you are supposed to provide `PKG_CONFIG_PATH` to glib etc. as well as oboe. There is nothing special.
However, in reality, Oboe does not come up with an official package specification, so you will have to create it manually... unless you use `oboe-1.0.pc` in this directory as well as the build system set up here.
There are "non-normative" build scripts i.e. `Makefile.android` and a couple of helper files in this directory. In case you don't have any dependencies such as glib for Android, then it would be helpful.

View file

@ -11,7 +11,7 @@ target_compile_options ( fluidsynth-assetloader
PRIVATE -Wall
PRIVATE "$<$<CONFIG:DEBUG>:-Werror>") # Only include -Werror when building debug config
include_directories ( ../../../include )
target_include_directories ( fluidsynth-assetloader PRIVATE ../../../include )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L../../../dist/${ANDROID_ABI} -lfluidsynth" )

View file

@ -83,7 +83,7 @@ int asset_close(void *handle)
return 0;
}
long asset_tell(void *handle)
fluid_long_long_t asset_tell(void *handle)
{
AAsset *asset;
@ -91,7 +91,7 @@ long asset_tell(void *handle)
return AAsset_getLength(asset) - AAsset_getRemainingLength(asset);
}
int asset_seek(void *handle, long offset, int origin)
int asset_seek(void *handle, fluid_long_long_t offset, int origin)
{
AAsset *asset;
@ -99,7 +99,7 @@ int asset_seek(void *handle, long offset, int origin)
return AAsset_seek (asset, (off_t) offset, origin);
}
int asset_read(void *buf, int count, void *handle)
int asset_read(void *buf, fluid_long_long_t count, void *handle)
{
AAsset *asset;

View file

@ -34,9 +34,9 @@ void Java_fluidsynth_androidextensions_NativeHandler_setAssetManagerContext(JNIE
void *asset_open(const char *path);
int asset_close(void *handle);
long asset_tell(void *handle);
int asset_seek(void *handle, long offset, int origin);
int asset_read(void *buf, int count, void *handle);
fluid_long_long_t asset_tell(void *handle);
int asset_seek(void *handle, fluid_long_long_t offset, int origin);
int asset_read(void *buf, fluid_long_long_t count, void *handle);
#ifdef __cplusplus
} /* extern "C" */

View file

@ -1,12 +0,0 @@
code {
background-color: #eeeeee;
text-shadow: none;
color: black;
margin-left: 4px;
margin-right: 4px;
padding-left: 4px;
padding-right: 4px;
border-radius: 3px;
white-space: nowrap;
}

282
doc/doxygen/custom.css Normal file
View file

@ -0,0 +1,282 @@
body
{
background: #eee;
}
#titlearea
{
background: white;
}
*
{
text-shadow: none !important;
}
/* Reduce width of main content for more readability */
div.contents,
div.header
{
max-width: 60em;
background: white;
margin: 0;
padding: 1em;
}
#titlearea
{
border: 0;
}
div.headertitle
{
padding-left: 0;
}
/* Hide permalink icon in front of method name and make whole name clickable
* instead (by invisibly streting the permalink over the title). Not ideal,
* as the name can't be selected anymore, but better than the distracting
* icon. */
span.permalink
{
display: block;
position: relative;
font-size: unset;
}
span.permalink a {
position: absolute;
width: 100%;
opacity: 0;
}
/* Hide "libfluidsynth" root node of nav tree */
#nav-tree-contents > ul > li:first-child > .item > .label,
#nav-tree-contents > ul > li:first-child > .item > a
{
display: none;
}
#nav-tree,
#side-nav
{
background: #333;
}
#nav-tree .label a {
color: #fff;
}
#nav-tree .selected {
background: #666;
}
#side-nav {
width: 350px;
}
.ui-resizable-e {
background: #ddd;
}
#nav-sync {
display: none;
}
@media (max-width: 767px) {
#side-nav {
display: none !important;
}
#doc-content {
margin-left: 0 !important;
height: auto !important;
width: auto !important;
}
#MSearchBox {
display: none !important;
}
}
.sm-dox a:hover {
color: black !important;
}
#nav-tree,
div.header,
.ui-resizable-e,
.sm-dox,
.navpath ul,
.memtitle,
.sm-dox a,
.fieldtable th
{
background-image: none !important;
}
#main-nav {
background: #DFE5F1;
}
.memitem,
.memproto,
.memdoc,
.memtitle,
dl.reflist dd,
dl.reflist dt
{
box-shadow: none;
text-shadow: none;
border-right: none;
border-bottom: none;
border-bottom-left-radius: 0;
background-image: none;
border-color: #DFE5F1;
}
.memtitle,
dl.reflist dt
{
width: 100%;
box-sizing: border-box;
background: #DFE5F1;
border: 0;
}
.memproto {
background: #fafafa;
border-bottom: 1px solid #DFE5F1;
border-right: 1px solid #DFE5F1;
}
.mdescLeft,
.mdescRight,
.memItemLeft,
.memItemRight,
.memTemplItemLeft,
.memTemplItemRight,
.memTemplParams
{
background: none;
}
.memSeparator {
}
dl.reflist {
padding: 0;
}
dl.reflist dd {
margin-bottom: 1.5em;
padding: 1em;
}
code {
background-color: #eeeeee;
text-shadow: none;
color: black;
margin-left: 4px;
margin-right: 4px;
padding-left: 4px;
padding-right: 4px;
border-radius: 3px;
white-space: nowrap;
}
table.fieldtable,
table.fieldtable td,
table.fieldtable th
{
box-shadow: none;
text-shadow: none;
border-radius: 0;
border-color: #DFE5F1 !important;
}
div.fragment {
padding: 5px;
}
div.fragment .line {
line-height: 1.4;
}
.memdoc dl {
padding-left: 0;
}
dl.note {
margin-left: -10px;
padding-left: 5px;
border-left: 5px solid;
border-color: lightblue;
}
dl.deprecated {
margin-left: -10px;
padding-left: 5px;
border-left: 5px solid;
border-color: orange;
}
dl.warning {
margin-left: -10px;
padding-left: 5px;
border-left: 5px solid;
border-color: red;
}
table.directory .arrow {
height: inherit;
}
table.directory tr td {
padding: 0.4em 6px;
}
table.directory td.desc {
border: 0;
}
table.directory tr.even {
background-color: inherit;
}
table.directory tr {
border-bottom: 1px solid #eee;
}
.image img,
.image object
{
width: 100%;
height: auto;
}
.setting-item {
border-left: 1px solid #DFE5F1;
padding-bottom: 0.5em;
border-top-left-radius: 4px;
}
.setting-item h1 {
width: 100%;
padding: 0.3em 0 0.3em 10px;
box-sizing: border-box;
background: #DFE5F1;
border: 0;
font-size: 1.5em;
font-weight: normal;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.setting-item dl,
.setting-item p {
margin-left: 10px;
}

View file

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" omit-xml-declaration="yes" indent="no"/>
<!-- main template -->
<xsl:template match="/fluidsettings">
/*!
\page fluidsettings Settings Reference
<xsl:apply-templates match="*" mode="PageRef">
<xsl:sort select="@label"/>
</xsl:apply-templates>
<xsl:apply-templates match="*" mode="Page">
<xsl:sort select="@label"/>
</xsl:apply-templates>
*/
</xsl:template>
<!-- Page reference template -->
<xsl:template match="*" mode="PageRef">
- \subpage <xsl:value-of select="concat('settings_', name(.), ' ', @label)"/>
</xsl:template>
<!-- Page template -->
<xsl:template match="*" mode="Page">
\page <xsl:value-of select="concat('settings_', name(.), ' ', @label)"/>
<xsl:apply-templates match="*" mode="Setting">
<xsl:sort select="name(..)" />
</xsl:apply-templates>
</xsl:template>
<!-- Setting template -->
<xsl:template match="*" mode="Setting">
\htmlonly
<div class="setting-item">
\endhtmlonly
\section <xsl:value-of select="concat('settings_', name(..), '_', translate(name, '.', '_'))" /><xsl:text> </xsl:text><xsl:value-of select="concat(name(..), '.', name)" />
<xsl:text>&#xa;</xsl:text>
\par Type
<xsl:choose>
<xsl:when test="type = 'bool'">Boolean (int)</xsl:when>
<xsl:when test="type = 'int'">Integer (int)</xsl:when>
<xsl:when test="type = 'str'">
<xsl:choose>
<xsl:when test="vals">Selection (str)</xsl:when>
<xsl:otherwise>String (str)</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="type = 'num'">Float (num)</xsl:when>
<xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="type = 'str' and vals">\par Options
<xsl:value-of select="vals" /></xsl:when>
<xsl:when test="type = 'bool'">\par Values
0, 1</xsl:when>
<xsl:when test="min or max">\par Min - Max
<xsl:value-of select="min" /> - <xsl:value-of select="max" /></xsl:when>
</xsl:choose>
\par Default
\htmlonly
<xsl:copy-of select="def" />
\endhtmlonly
<xsl:if test="realtime">
\par Real-time
<xsl:choose>
<xsl:when test="realtime/text()">
\htmlonly
<xsl:copy-of select="realtime" />
\endhtmlonly
</xsl:when>
<xsl:otherwise>This setting can be changed during runtime of the synthesizer.</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="deprecated">
\deprecated This setting is deprecated and might be removed in a future version of FluidSynth.
</xsl:if>
\htmlonly
<xsl:copy-of select="desc"/>
\endhtmlonly
\htmlonly
</div>
\endhtmlonly
</xsl:template>
</xsl:stylesheet>

2
doc/doxygen/footer.html Normal file
View file

@ -0,0 +1,2 @@
</body>
</html>

199
doc/doxygen/layout.xml Normal file
View file

@ -0,0 +1,199 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.13 -->
<!-- Navigation index tabs for HTML output -->
<!-- FluidSynth related changes in this file compared to default layout:
- Custom title and intro for <navindev><tab type="modules">
- <membergroups> moved in front of <functions> in group layout so that we can change
constructors and destructors before all other functions
-->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="API Reference" intro="Reference of the FluidSynth API separated into functional groups."/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<membergroups visible="yes"/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View file

@ -0,0 +1,30 @@
# FluidSynth - A Software Synthesize
#
# Copyright (C) 2003-2010 Peter Hanappe and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307, USA
# CMake based build system. Pedro Lopez-Cabanillas <plcl@users.sf.net>
include ( FluidUnitTest )
add_custom_target ( demo )
ADD_FLUID_DEMO ( example )
ADD_FLUID_DEMO ( fluidsynth_arpeggio )
ADD_FLUID_DEMO ( fluidsynth_fx )
ADD_FLUID_DEMO ( fluidsynth_metronome )
ADD_FLUID_DEMO ( fluidsynth_simple )

View file

@ -19,40 +19,64 @@
#if defined(WIN32)
#include <windows.h>
#define sleep(_t) Sleep(_t * 1000)
#include <process.h>
#define getpid _getpid
#else
#include <stdlib.h>
#include <unistd.h>
#endif
int main(int argc, char **argv)
{
fluid_settings_t *settings;
fluid_synth_t *synth;
fluid_audio_driver_t *adriver;
fluid_settings_t *settings = NULL;
fluid_synth_t *synth = NULL;
fluid_audio_driver_t *adriver = NULL;
int sfont_id;
int i, key;
/* Create the settings. */
settings = new_fluid_settings();
if(settings == NULL)
{
puts("Failed to create the settings!");
goto err;
}
/* Change the settings if necessary*/
/* Create the synthesizer. */
synth = new_fluid_synth(settings);
if(synth == NULL)
{
puts("Failed to create the synth!");
goto err;
}
/* Load a SoundFont and reset presets (so that new instruments
* get used from the SoundFont)
* Depending on the size of the SoundFont, this will take some time to complete...
*/
sfont_id = fluid_synth_sfload(synth, "example.sf2", 1);
if(sfont_id == FLUID_FAILED)
{
puts("Loading the SoundFont failed!");
goto err;
}
/* Create the audio driver. The synthesizer starts playing as soon
as the driver is created. */
adriver = new_fluid_audio_driver(settings, synth);
/* Load a SoundFont and reset presets (so that new instruments
* get used from the SoundFont) */
sfont_id = fluid_synth_sfload(synth, "example.sf2", 1);
if(adriver == NULL)
{
puts("Failed to create the audio driver!");
goto err;
}
/* Initialize the random number generator */
srand(getpid());
for(i = 0; i < 12; i++)
{
/* Generate a random key */
key = 60 + (int)(12.0f * rand() / (float) RAND_MAX);
@ -66,6 +90,7 @@ int main(int argc, char **argv)
fluid_synth_noteoff(synth, 0, key);
}
err:
/* Clean up */
delete_fluid_audio_driver(adriver);
delete_fluid_synth(synth);

View file

@ -57,7 +57,7 @@ schedule_noteoff(int chan, short key, unsigned int ticks)
/* schedule a timer event (shall trigger the callback) */
void
schedule_timer_event()
schedule_timer_event(void)
{
fluid_event_t *ev = new_fluid_event();
fluid_event_set_source(ev, -1);
@ -69,9 +69,10 @@ schedule_timer_event()
/* schedule the arpeggio's notes */
void
schedule_pattern()
schedule_pattern(void)
{
int i, note_time, note_duration;
unsigned int i;
int note_time, note_duration;
note_time = time_marker;
note_duration = duration / pattern_size;
@ -124,7 +125,7 @@ main(int argc, char *argv[])
if(n != -1)
{
sequencer = new_fluid_sequencer();
sequencer = new_fluid_sequencer2(0);
/* register the synth with the sequencer */
synth_destination = fluid_sequencer_register_fluidsynth(sequencer,
synth);
@ -135,7 +136,7 @@ main(int argc, char *argv[])
{
n = atoi(argv[2]);
if((n > 1) && (n <= pattern_size))
if((n > 1) && (n <= (int)pattern_size))
{
pattern_size = n;
}

View file

@ -44,21 +44,36 @@ int fx_function(void *data, int len,
{
struct fx_data_t *fx_data = (struct fx_data_t *) data;
int i, k;
float *out_i;
/* Call the synthesizer to fill the output buffers with its
* audio output. */
if(fluid_synth_process(fx_data->synth, len, nfx, fx, nout, out) != FLUID_OK)
if(fx == 0)
{
/* Some error occured. Very unlikely to happen, though. */
return FLUID_FAILED;
/* Note that some audio drivers may not provide buffers for effects like
* reverb and chorus. In this case it's your decision what to do. If you
* had called fluid_synth_process() like in the else branch below, no
* effects would have been rendered. Instead, you may mix the effects
* directly into the out buffers. */
if(fluid_synth_process(fx_data->synth, len, nout, out, nout, out) != FLUID_OK)
{
/* Some error occurred. Very unlikely to happen, though. */
return FLUID_FAILED;
}
}
else
{
/* Call the synthesizer to fill the output buffers with its
* audio output. */
if(fluid_synth_process(fx_data->synth, len, nfx, fx, nout, out) != FLUID_OK)
{
/* Some error occurred. Very unlikely to happen, though. */
return FLUID_FAILED;
}
}
/* Apply your effects here. In this example, the gain is
* applied to all the output buffers. */
* applied to all the dry-audio output buffers. */
for(i = 0; i < nout; i++)
{
out_i = out[i];
float *out_i = out[i];
for(k = 0; k < len; k++)
{
@ -66,6 +81,17 @@ int fx_function(void *data, int len,
}
}
/* Apply the same effect to all available effect buffer. */
for(i = 0; i < nfx; i++)
{
float *fx_i = fx[i];
for(k = 0; k < len; k++)
{
fx_i[k] *= fx_data->gain;
}
}
return FLUID_OK;
}
@ -115,7 +141,7 @@ int main(int argc, char **argv)
/* Fill in the data of the effects unit */
fx_data.synth = synth;
fx_data.gain = atof(argv[2]);
fx_data.gain = (float)atof(argv[2]);
/* Create the audio driver. As soon as the audio driver is
* created, the synthesizer can be played. */

View file

@ -47,7 +47,7 @@ schedule_noteon(int chan, short key, unsigned int ticks)
/* schedule a timer event (shall trigger the callback) */
void
schedule_timer_event()
schedule_timer_event(void)
{
fluid_event_t *ev = new_fluid_event();
fluid_event_set_source(ev, -1);
@ -59,9 +59,10 @@ schedule_timer_event()
/* schedule the metronome pattern */
void
schedule_pattern()
schedule_pattern(void)
{
int i, note_time;
unsigned int i;
int note_time;
note_time = time_marker;
for(i = 0; i < pattern_size; ++i)
@ -111,7 +112,7 @@ main(int argc, char *argv[])
if(n != -1)
{
sequencer = new_fluid_sequencer();
sequencer = new_fluid_sequencer2(0);
/* register the synth with the sequencer */
synth_destination = fluid_sequencer_register_fluidsynth(sequencer,
synth);

View file

@ -21,7 +21,7 @@ int main()
// array of buffers used to setup channel mapping
float *dry[1 * 2], *fx[1 * 2];
// first make sure to zero out the sample buffers everytime before calling fluid_synth_process()
// first make sure to zero out the sample buffers every time before calling fluid_synth_process()
memset(left, 0, sizeof(left));
memset(right, 0, sizeof(right));

View file

@ -18,6 +18,10 @@ int main()
const char *DRV[] = { "alsa", "jack", "portaudio" };
const char *adrivers[2];
/* three iterations, first register only alsa, then only jack, and last portaudio
* ...just to demonstrate how and under which conditions fluid_audio_driver_register()
* can be called
*/
for(int i = 0; i < sizeof(DRV) / sizeof(DRV[0]); i++)
{
adrivers[0] = DRV[i];
@ -39,11 +43,10 @@ int main()
fluid_settings_t *settings = new_fluid_settings();
res = fluid_settings_setstr(settings, "audio.driver", DRV[i]);
/* settings API will be refactored to return FLUID_OK|FAILED next major release
* returning TRUE or FALSE is deprecated
/* As of fluidsynth 2, settings API has been refactored to return FLUID_OK|FAILED
* rather than returning TRUE or FALSE
*/
#if FLUIDSYNTH_VERSION_MAJOR >= 2
if(res != FLUID_OK)
#else
if(res == 0)

View file

@ -11,13 +11,14 @@ NOTE: You're not expected to look at this raw XML file. Please open it in a webb
https://stackoverflow.com/a/3839054
https://stackoverflow.com/a/6251757
Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</deprecated>
Developers:
- Settings can be deprecated by adding: <deprecated>SOME TEXT</deprecated>
- Real-time settings can be marked with <realtime>SOME OPTIONAL TEXT</realtime>.
-->
<?xml-stylesheet type="text/xsl" href="fluidsettings.xsl"?>
<fluidsettings>
<synth>
<synth label="Synthesizer settings">
<setting>
<isFirst>Synthesizer settings</isFirst>
<name>audio-channels</name>
<type>int</type>
<def>1</def>
@ -39,24 +40,27 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<name>chorus.active</name>
<type>bool</type>
<def>1 (TRUE)</def>
<realtime/>
<desc>
When set to 1 (TRUE) the chorus effects module is activated. Otherwise, no chorus will be added to the output signal. Note that the amount of signal sent to the chorus module depends on the "chorus send" generator defined in the SoundFont.</desc>
</setting>
<setting>
<name>chorus.depth</name>
<type>num</type>
<def>8</def>
<min>0</min>
<max>256</max>
<def>8.0</def>
<min>0.0</min>
<max>256.0</max>
<realtime/>
<desc>
Specifies the modulation depth of the chorus.</desc>
</setting>
<setting>
<name>chorus.level</name>
<type>num</type>
<def>2</def>
<min>0</min>
<max>10</max>
<def>2.0</def>
<min>0.0</min>
<max>10.0</max>
<realtime/>
<desc>
Specifies the output amplitude of the chorus signal.</desc>
</setting>
@ -66,6 +70,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<def>3</def>
<min>0</min>
<max>99</max>
<realtime/>
<desc>
Sets the voice count of the chorus.</desc>
</setting>
@ -74,7 +79,8 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<type>num</type>
<def>0.3</def>
<min>0.1</min>
<max>5</max>
<max>5.0</max>
<realtime/>
<desc>
Sets the modulation speed in Hz.</desc>
</setting>
@ -85,7 +91,9 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<min>1</min>
<max>256</max>
<desc>
Sets the number of synthesis CPU cores. If set to a value greater than 1, then additional synthesis threads will be created to take advantage of a multi CPU or CPU core system. This has the affect of utilizing more of the total CPU for voices or decreasing render times when synthesizing audio to a file.</desc>
Sets the number of synthesis CPU cores. If set to a value greater than 1, additional synthesis threads will be created to do the actual rendering work that is then returned synchronously by the render function. This has the affect of utilizing more of the total CPU for voices or decreasing render times when synthesizing audio.
So for example, if you set cpu-cores to 4, fluidsynth will attempt to split the synthesis work it needs to do between the client's calling thread and three additional (internal) worker threads. As soon as all threads have done their work, their results are collected and the resulting buffer is returned to the caller.
</desc>
</setting>
<setting>
<name>default-soundfont</name>
@ -101,16 +109,16 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<def>0</def>
<min>0</min>
<max>126</max>
<realtime/>
<desc>
Device identifier used for SYSEX commands, such as MIDI Tuning Standard commands. Only those SYSEX commands destined for this ID or to all devices will be acted upon.</desc>
Device identifier used for SYSEX commands, such as MIDI Tuning Standard commands. Fluidsynth will only process those SYSEX commands destined for this ID. Broadcast commands (with ID=127) will always be processed.</desc>
</setting>
<setting>
<name>dynamic-sample-loading</name>
<type>bool</type>
<def>0 (FALSE)</def>
<desc>
When set to 1 (TRUE), samples are loaded to and unloaded from memory
on demand.
When set to 1 (TRUE), samples are loaded to and unloaded from memory whenever presets are being selected or unselected for a MIDI channel. PROGRAM_CHANGE and PROGRAM_SELECT events are typically responsible for this.
</desc>
</setting>
<setting>
@ -119,7 +127,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<def>2</def>
<min>2</min>
<max>2</max>
<desc>Specifies the number of effects per group. Currently there only are two effects (i.e. reverb and chorus).</desc>
<desc>Specifies the number of effects per effects group. Currently this value can not be changed so there are always two effects per group available (reverb and chorus).</desc>
</setting>
<setting>
<name>effects-groups</name>
@ -127,7 +135,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<def>1</def>
<min>1</min>
<max>128</max>
<desc>Specifies the number of effect units. By default, the sound of all voices is rendered by one reverb unit and one chorus unit respectively (even for multi-channel rendering). This setting gives the user control which effects of a voice to render to which independent audio channels. E.g. setting synth.effects-groups == synth.midi-channels allows to render the effects of each MIDI channel to separate audio buffers. If synth.effects-groups is smaller, it will wrap around. Note that any value >1 will significantly increase CPU usage.</desc>
<desc>Specifies the number of effects groups. By default, the sound of all voices is rendered by one reverb and one chorus effect respectively (even for multi-channel rendering). This setting gives the user control which effects of a voice to render to which independent audio channels. E.g. setting synth.effects-groups == synth.midi-channels allows to render the effects of each MIDI channel to separate audio buffers. If synth.effects-groups is smaller than the number of MIDI channels, it will wrap around. Note that any value >1 will significantly increase CPU usage.</desc>
</setting>
<setting>
<name>gain</name>
@ -135,6 +143,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<def>0.2</def>
<min>0.0</min>
<max>10.0</max>
<realtime/>
<desc>The gain is applied to the final or master output of the synthesizer. It is set to a low value by default to avoid the saturation of the output when many notes are played.</desc>
</setting>
<setting>
@ -142,7 +151,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<type>bool</type>
<def>0 (FALSE)</def>
<desc>
When set to "yes" the LADSPA subsystem will be enabled. This subsystem allows to load and interconnect LADSPA plug-ins. The output of the synthesizer is processed by the LADSPA subsystem. Note that the synthesizer has to be compiled with LADSPA support. More information about the LADSPA subsystem later.</desc>
When set to 1 (TRUE) the LADSPA subsystem will be enabled. This subsystem allows to load and interconnect LADSPA plug-ins. The output of the synthesizer is processed by the LADSPA subsystem. Note that the synthesizer has to be compiled with LADSPA support. More information about the LADSPA subsystem can be found in doc/ladspa.md or on the FluidSynth website.</desc>
</setting>
<setting>
<name>lock-memory</name>
@ -164,12 +173,12 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<name>midi-bank-select</name>
<type>str</type>
<def>gs</def>
<vals>gm, gs, xg, mma</vals>
<vals>gs, gm, xg, mma</vals>
<desc>
This setting defines how the synthesizer interprets Bank Select messages.
<ul>
<li>gm: ignores CC0 and CC32 messages.</li>
<li>gs: (default) CC0 becomes the bank number, CC32 is ignored.</li>
<li>gm: ignores CC0 and CC32 messages.</li>
<li>xg: CC32 becomes the bank number, CC0 toggles between melodic or drum channel.</li>
<li>mma: bank is calculated as CC0*128+CC32.</li>
</ul>
@ -187,9 +196,10 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>overflow.age</name>
<type>num</type>
<def>1000</def>
<min>-10000</min>
<max>10000</max>
<def>1000.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<desc>
This score is divided by the number of seconds this voice has been
active and is added to the overflow priority. It is usually a positive
@ -200,9 +210,10 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>overflow.important</name>
<type>num</type>
<def>5000</def>
<min>-50000</min>
<max>50000</max>
<def>5000.0</def>
<min>-50000.0</min>
<max>50000.0</max>
<realtime/>
<desc>
This score is added to voices on channels marked with the
synth.overflow.important-channels setting.
@ -211,7 +222,8 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>overflow.important-channels</name>
<type>str</type>
<def>""</def>
<def>(empty string)</def>
<realtime/>
<desc>
This setting is a comma-separated list of MIDI channel numbers that should
be treated as "important" by the overflow calculation, adding the score
@ -225,9 +237,10 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>overflow.percussion</name>
<type>num</type>
<def>4000</def>
<min>-10000</min>
<max>10000</max>
<def>4000.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<desc>
Sets the overflow priority score added to voices on a percussion
channel. This is usually a positive score, to give percussion voices
@ -238,9 +251,10 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>overflow.released</name>
<type>num</type>
<def>-2000</def>
<min>-10000</min>
<max>10000</max>
<def>-2000.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<desc>
Sets the overflow priority score added to voices that have already
received a note-off event. This is usually a negative score, to give released
@ -251,9 +265,10 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>overflow.sustained</name>
<type>num</type>
<def>-1000</def>
<min>-10000</min>
<max>10000</max>
<def>-1000.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<desc>
Sets the overflow priority score added to voices that are currently
sustained. With the default value, sustained voices are considered less
@ -263,9 +278,10 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>overflow.volume</name>
<type>num</type>
<def>500</def>
<min>-10000</min>
<max>10000</max>
<def>500.0</def>
<min>-10000.0</min>
<max>10000.0</max>
<realtime/>
<desc>
Sets the overflow priority score added to voices based on their current
volume. The voice volume is normalized to a value between 0 and 1 and
@ -280,6 +296,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<def>256</def>
<min>1</min>
<max>65535</max>
<realtime/>
<desc>
The polyphony defines how many voices can be played in parallel. A note event produces one or more voices. Its good to set this to a value which the system can handle and will thus limit FluidSynth's CPU usage. When FluidSynth runs out of voices it will begin terminating lower priority voices for new note events.</desc>
</setting>
@ -287,6 +304,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<name>reverb.active</name>
<type>bool</type>
<def>1 (TRUE)</def>
<realtime/>
<desc>
When set to 1 (TRUE) the reverb effects module is activated. Otherwise, no reverb will be added to the output signal. Note that the amount of signal sent to the reverb module depends on the "reverb send" generator defined in the SoundFont.
</desc>
@ -294,9 +312,10 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>reverb.damp</name>
<type>num</type>
<def>0</def>
<min>0</min>
<max>1</max>
<def>0.0</def>
<min>0.0</min>
<max>1.0</max>
<realtime/>
<desc>
Sets the amount of reverb damping.</desc>
</setting>
@ -304,8 +323,9 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<name>reverb.level</name>
<type>num</type>
<def>0.9</def>
<min>0</min>
<max>1</max>
<min>0.0</min>
<max>1.0</max>
<realtime/>
<desc>
Sets the reverb output amplitude.</desc>
</setting>
@ -313,8 +333,9 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<name>reverb.room-size</name>
<type>num</type>
<def>0.2</def>
<min>0</min>
<max>1</max>
<min>0.0</min>
<max>1.0</max>
<realtime/>
<desc>
Sets the room size (i.e. amount of wet) reverb.</desc>
</setting>
@ -322,8 +343,9 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<name>reverb.width</name>
<type>num</type>
<def>0.5</def>
<min>0</min>
<max>100</max>
<min>0.0</min>
<max>100.0</max>
<realtime/>
<desc>
Sets the stereo spread of the reverb signal.</desc>
</setting>
@ -334,7 +356,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<min>8000.0</min>
<max>96000.0</max>
<desc>
The sample rate of the audio generated by the synthesizer.
The sample rate of the audio generated by the synthesizer. For optimal performance, make sure this value equals the native output rate of the audio driver (in case you are using any of fluidsynth's audio drivers). Some drivers, such as Oboe, will interpolate sample-rates, whereas others, such as Jack, will override this setting, if a mismatch with the native output rate is detected.
</desc>
</setting>
<setting>
@ -354,20 +376,18 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
</desc>
</setting>
</synth>
<audio>
<audio label="Audio driver settings">
<setting>
<isFirst>Audio driver settings</isFirst>
<name>driver</name>
<type>str</type>
<def>jack (Linux),<br />
<def>alsa (Linux),<br />
dsound (Windows),<br />
sndman (MacOS9),<br />
coreaudio (Mac OS X),<br />
dart (OS/2)
</def>
<vals>alsa, coreaudio, dart, dsound, file, jack, oss, portaudio, pulseaudio, sdl2, sndman, waveout</vals>
<vals>alsa, coreaudio, dart, dsound, file, jack, oboe, opensles, oss, portaudio, pulseaudio, sdl2, sndman, wasapi, waveout</vals>
<desc>
The audio system to be used. In order to use sdl2 as audio driver, the application is responsible for initializing SDL's audio subsystem.<br /><br /><strong>Note:</strong> sdl2 and waveout are available since fluidsynth 2.1.
</desc>
@ -375,8 +395,8 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>periods</name>
<type>int</type>
<def>16 (Linux, Mac OS X),<br />
8 (Windows)
<def>8 (Windows, MacOS9),<br />
16 (all other)
</def>
<min>2</min>
<max>64</max>
@ -387,13 +407,13 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>period-size</name>
<type>int</type>
<def>64 (Linux, Mac OS X),<br />
512 (Windows)
<def>512 (Windows),<br />
64 (all other)
</def>
<min>64</min>
<max>8192</max>
<desc>
The size of the audio buffers (in frames).
This is the number of audio samples most audio drivers will request from the synth at one time. In other words, it's the amount of samples the synth is allowed to render in one go when no state changes (events) are about to happen. Because of that, specifying too big numbers here may cause MIDI events to be poorly quantized (=untimed) when a MIDI driver or the synth's API directly is used, as fluidsynth cannot determine when those events are to arrive. This issue does not matter, when using the MIDI player or the MIDI sequencer, because in this case, fluidsynth does know when events will be received.
</desc>
</setting>
<setting>
@ -403,7 +423,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<min>0</min>
<max>99</max>
<desc>
Sets the realtime scheduling priority of the audio synthesis thread (0 disables high priority scheduling). Linux is the only platform which currently makes use of different priority levels. Drivers which use this option: alsa, oss and pulseaudio
Sets the realtime scheduling priority of the audio synthesis thread. This includes the synthesis threads created by the synth (in case synth.cpu-cores was greater 1). A value of 0 disables high priority scheduling. Linux is the only platform which currently makes use of different priority levels as specified by this setting. On other operating systems the thread priority is set to maximum. Drivers which use this option: alsa, oss and pulseaudio
</desc>
</setting>
<setting>
@ -432,6 +452,32 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
Selects the CoreAudio device to use.
</desc>
</setting>
<setting>
<name>coreaudio.channel-map</name>
<type>str</type>
<def>(empty string)</def>
<desc>
This setting is a comma-separated integer list that maps fluidsynth mono-channels
to CoreAudio device output channels. Each position in the list represents the output channel
of the CoreAudio device.
The value of each position indicates the zero-based index of the fluidsynth
output mono-channel to route there (i.e. the buffer index used for fluid_synth_process()).
Additionally, the special value of -1 will turn off an output.
<br /><br />
For example, the default map for a single stereo output is "0,1". A value of "0,0" will
copy the left channel to the right, a value of "1,0" will flip left and right, and a
value of "-1,1" will play only the right channel.
<br /><br />
With a six-channel output device, and the synth.audio-channels and synth.audio-groups
settings both set to "2", a channel map of "-1,-1,0,1,2,3" will result in notes from odd
MIDI channels (audible on the first stereo channel, i.e. mono-indices 0,1) being sent to
outputs 3 and 4, and even MIDI channels (audible on the second stereo channel, i.e. mono-indices 2,3)
being sent to outputs 5 and 6.
<br /><br />
If the list specifies less than the number of available outputs channels, outputs
beyond those specified will maintain the default channel mapping given by the CoreAudio driver.
</desc>
</setting>
<setting>
<name>dart.device</name>
<type>str</type>
@ -522,7 +568,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>jack.server</name>
<type>str</type>
<def></def>
<def>(empty string)</def>
<desc>
Jack server to connect to. Defaults to an empty string, which uses default Jack server.
</desc>
@ -537,6 +583,15 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
Request an audio device identified device using an ID as pointed out by Oboe's documentation.
</desc>
</setting>
<setting>
<name>oboe.sample-rate-conversion-quality</name>
<type>str</type>
<def>None</def>
<vals>None, Fastest, Low, Medium, High, Best</vals>
<desc>
Sets the sample-rate conversion quality as pointed out by Oboe's documentation.
</desc>
</setting>
<setting>
<name>oboe.sharing-mode</name>
<type>str</type>
@ -555,6 +610,15 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
Sets the performance mode as pointed out by Oboe's documentation.
</desc>
</setting>
<setting>
<name>oboe.error-recovery-mode</name>
<type>str</type>
<def>Reconnect</def>
<vals>Reconnect, Stop</vals>
<desc>
Sets the error recovery mode when audio device error such as earphone disconnection occurred. It reconnects by default (same as OpenSLES behavior), but can be stopped if Stop is specified.
</desc>
</setting>
<setting>
<name>oss.device</name>
<type>str</type>
@ -563,6 +627,30 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
Device to use for OSS audio output.
</desc>
</setting>
<setting>
<name>pipewire.media-category</name>
<type>str</type>
<def>Playback</def>
<desc>
The media category to use. This value will be passed to <code>PW_KEY_MEDIA_CATEGORY</code>, see Pipewire documentation for valid values.
</desc>
</setting>
<setting>
<name>pipewire.media-role</name>
<type>str</type>
<def>Music</def>
<desc>
The media role to use. This value will be passed to <code>PW_KEY_MEDIA_ROLE</code>, see Pipewire documentation for valid values.
</desc>
</setting>
<setting>
<name>pipewire.media-type</name>
<type>str</type>
<def>Audio</def>
<desc>
The media type to use. This value will be passed to <code>PW_KEY_MEDIA_TYPE</code>, see Pipewire documentation for valid values.
</desc>
</setting>
<setting>
<name>portaudio.device</name>
<type>str</type>
@ -603,11 +691,42 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
Server to use for PulseAudio driver output.
</desc>
</setting>
<setting>
<name>sdl2.device</name>
<type>str</type>
<def>default</def>
<desc>
Device to use for SDL2 driver output.
</desc>
</setting>
<setting>
<name>wasapi.device</name>
<type>str</type>
<def>default</def>
<desc>
Device to use for WASAPI driver output.
</desc>
</setting>
<setting>
<name>wasapi.exclusive-mode</name>
<type>bool</type>
<def>0 (FALSE)</def>
<desc>
By default, WASAPI will operate in shared mode. Set it to 1 (TRUE) to use WASAPI in exclusive mode. In this mode, you'll benefit from direct soundcard access via kernel streaming, which has an extremely low latency. However, you must pay close attention to other settings, such as synth.sample-rate and audio.sample-format as your soundcard may not accept any possible sample configuration.
</desc>
</setting>
<setting>
<name>waveout.device</name>
<type>str</type>
<def>default</def>
<desc>
Device to use for WaveOut driver output.
</desc>
</setting>
</audio>
<midi>
<midi label="MIDI driver settings">
<setting>
<isFirst>MIDI driver settings</isFirst>
<name>autoconnect</name>
<type>bool</type>
<def>0 (FALSE)</def>
@ -635,20 +754,20 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>portname</name>
<type>str</type>
<def></def>
<def>(empty string)</def>
<desc>Used by coremidi and alsa_seq drivers for the portnames registered with the MIDI subsystem.</desc>
</setting>
<setting>
<name>alsa.device</name>
<type>str</type>
<def>default</def>
<desc>ALSA MIDI device to use for RAW ALSA MIDI driver.</desc>
<desc>ALSA MIDI hardware device to use for RAW ALSA MIDI driver (not to be confused with the MIDI port).</desc>
</setting>
<setting>
<name>alsa_seq.device</name>
<type>str</type>
<def>default</def>
<desc>ALSA sequencer device to use for ALSA sequencer driver.</desc>
<desc>ALSA sequencer hardware device to use for ALSA sequencer driver (not to be confused with the MIDI port).</desc>
</setting>
<setting>
<name>alsa_seq.id</name>
@ -665,7 +784,7 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<setting>
<name>jack.server</name>
<type>str</type>
<def></def>
<def>(empty string)</def>
<desc>Jack server to connect to for Jack MIDI driver. If an empty string then the default server will be used.</desc>
</setting>
<setting>
@ -678,23 +797,23 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
<name>oss.device</name>
<type>str</type>
<def>/dev/midi</def>
<desc>Device to use for OSS MIDI driver.</desc>
<desc>The hardware device to use for OSS MIDI driver (not to be confused with the MIDI port).</desc>
</setting>
<setting>
<name>winmidi.device</name>
<type>str</type>
<def>default</def>
<desc>Device for Windows MIDI driver.</desc>
<desc>The hardware device to use for Windows MIDI driver (not to be confused with the MIDI port). Multiple devices can be specified by a list of devices index separated by a semicolon (e.g "2;0", which is equivalent to one device with 32 MIDI channels).</desc>
</setting>
</midi>
<player>
<player label="MIDI player settings">
<setting>
<isFirst>MIDI player settings</isFirst>
<name>reset-synth</name>
<type>bool</type>
<def>1 (TRUE)</def>
<desc>If true, reset the synth before starting a new MIDI song, so the state of a previous song can't affect the new song. Turn it off for seamless looping of a song.</desc>
<realtime/>
<desc>If true, reset the synth after the end of a MIDI song, so that the state of a previous song can't affect the next song. Turn it off for seamless looping of a song.</desc>
</setting>
<setting>
<name>timing-source</name>
@ -705,17 +824,16 @@ Developers: Settings can be deprecated by adding: <deprecated>SOME TEXT</depreca
</setting>
</player>
<shell>
<shell label="Shell (command line) settings">
<setting>
<isFirst>Shell (command line) settings</isFirst>
<name>prompt</name>
<type>str</type>
<def>""</def>
<desc>In dump mode we set the prompt to "". The ui cannot easily handle lines, which don't end with cr. Changing the prompt cannot be done through a command, because the current shell does not handle empty arguments.</desc>
<def>(empty string)</def>
<desc>In dump mode we set the prompt to "" (empty string). The ui cannot easily handle lines, which don't end with cr. Changing the prompt cannot be done through a command, because the current shell does not handle empty arguments.</desc>
</setting>
<setting>
<name>port</name>
<type>num</type>
<type>int</type>
<def>9800</def>
<min>1</min>
<max>65535</max>

View file

@ -1,216 +1,312 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" doctype-system="about:legacy-compat"/>
<xsl:template match="/">
<html>
<head>
<style>
table
{
border: 3px solid black;
<xsl:output method="html" doctype-system="about:legacy-compat"/>
<xsl:template match="/">
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background: #eee;
}
.first-row
{
border-top: 3px solid black;
#sidebar {
position: fixed;
width: 25em;
top: 0;
bottom: 0;
padding-bottom: 2em;
box-sizing: border-box;
overflow-y: auto;
color: white;
background: #333;
}
th
{
font-weight: normal;
white-space: nowrap;
padding: 15px 5px 15px 5px;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
#sidebar ul li a {
display: block;
padding-left: 5%;
padding-top: 0.3em;
padding-bottom: 0.3em;
color: #fafafa;
}
td
{
padding: 15px 5px 15px 5px;
#sidebar a:hover {
background: #666;
}
.cell-def
{
white-space: nowrap;
border-top: 1px solid black;
}
.cell-vals
{
border-top: 1px solid black;
}
.cell-desc
{
border-top: 1px solid black;
#sidebar .muted {
color: #ccc !important;
}
.audio {background-color: hsl(170, 100%, 90%);}
.midi {background-color: hsl(125, 100%, 90%);}
.player {background-color: hsl(85, 100%, 85%);}
.shell {background-color: hsl(60, 100%, 90%);}
.synth {background-color: hsl(35, 100%, 90%);}
.deprecated {background-color: hsl(0, 0%, 93%);}
</style>
<title>FluidSettings</title>
</head>
<body>
<h1>FluidSettings</h1>
<ul>
<!-- Select the first setting of each group and use it for building up a TOC -->
<xsl:for-each select="fluidsettings/*/*[isFirst]">
<xsl:sort select="name(..)" />
<li style="margin-bottom: 15px">
<xsl:attribute name="class">
<xsl:value-of select="name(..)" />
</xsl:attribute>
<a>
<xsl:attribute name="href"><![CDATA[#]]><xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" /></xsl:attribute>
<xsl:value-of select="isFirst" />
</a>
</li>
</xsl:for-each>
</ul>
<table>
<!--print each and every setting row by row in the table-->
<xsl:for-each select="fluidsettings/*/*">
<xsl:sort select="name(..)" />
<!-- <xsl:sort select="name" /> -->
<tr>
<!-- the class attribute of tr shall be the name of the settings group of the current setting, unless the setting is marked deprecated -->
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="deprecated">
deprecated
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name(..)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td class="cell-name first-row">
<xsl:attribute name="id"><xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" /></xsl:attribute>
<a>
<xsl:attribute name="href"><![CDATA[#]]><xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" /></xsl:attribute>
<xsl:value-of select="name(..)" />.<xsl:value-of select="name" />
</a>
</td>
<th class="first-row">Type</th>
<td class="cell-type first-row">
<xsl:choose>
<xsl:when test="type = 'bool'">
int (bool)
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="type" />
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="deprecated">
deprecated
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name(..)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td></td>
<th>Default</th>
<td class="cell-def">
<xsl:copy-of select="def" />
</td>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="deprecated">
deprecated
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name(..)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td></td>
<th>
<xsl:choose>
<xsl:when test="type = 'str'">
Values
</xsl:when>
<xsl:when test="type = 'bool'">
Values
</xsl:when>
<xsl:otherwise>
Min
-
Max
</xsl:otherwise>
</xsl:choose>
</th>
<td class="cell-vals">
<xsl:choose>
<xsl:when test="type = 'str'">
<xsl:value-of select="vals" />
</xsl:when>
<xsl:when test="type = 'bool'">
1, 0
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="min" />
-
<xsl:value-of select="max" />
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="deprecated">
deprecated
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name(..)" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td></td>
<th>Description</th>
<td class="cell-desc">
<xsl:copy-of select="desc" />
<xsl:choose>
<xsl:when test="deprecated">
<br /><br />
<strong style="color:red">DEPRECATED</strong><br /><br />
<xsl:copy-of select="deprecated" />
</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
#sidebar h1 {
padding-top: 1em;
margin: 0;
padding-left: 5%;
}
#sidebar h2 {
padding-left: 5%;
margin-top: 1.5em;
margin-bottom: 0.5em;
color: lightblue;
}
#sidebar ul,
#sidebar ul li
{
list-style: none;
margin: 0;
padding: 0;
}
#sidebar li a {
text-decoration: none;
}
.deprecated-badge {
margin-left: 0.5em;
font-size: 80%;
font-weight: bold;
color: red;
}
#main {
margin-left: 25em;
padding: 1em 2em;
box-sizing: border-box;
max-width: 60em;
background: white;
color: #333;
}
#main h2 {
margin-top: 2em;
}
#main h2:first-child {
margin-top: 1em;
}
.setting {
padding: 0;
margin: 1em 0;
border-left: 1px solid #eee;
border-radius: 5px 0px 0px 0px;
}
@-webkit-keyframes flash-header {
from { background: lightblue; }
50% { background: #eee; }
to { background: lightblue; }
}
@keyframes flash-header {
from { background: lightblue; }
50% { background: #eee; }
to { background: lightblue; }
}
.setting:target .setting-header {
background: lightblue;
-webkit-animation: flash-header .5s 2 linear;
animation: flash-header .5s 2 linear;
}
.setting-header {
background: #eee;
border-radius: 5px 0px 0px 0px;
padding: 0.5em 1em;
position: relative;
}
.setting-body {
padding: 1em;
}
.setting-name {
font-weight: bold;
display: inline;
color: #333;
}
.setting-type {
color: #666;
font-weight: bold;
float: right;
}
.setting-attribute {
margin-bottom: 0.8em;
color: #666;
}
.setting-attribute .label {
display: inline-block;
vertical-align: top;
min-width: 6em;
}
.setting-attribute .value {
display: inline-block;
color: #333;
}
.setting-deprecated {
color: red;
}
.setting-description {
color: black;
margin-top: 1.5em;
}
a {
color: darkblue;
}
</style>
<title>FluidSynth Settings</title>
</head>
<body>
<div id="sidebar">
<h1>FluidSynth Settings</h1>
<xsl:for-each select="fluidsettings/*">
<xsl:sort select="@label" />
<h2><xsl:value-of select="@label" /></h2>
<ul>
<xsl:for-each select="*">
<li>
<a>
<xsl:attribute name="href"><![CDATA[#]]><xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" /></xsl:attribute>
<span class="muted"><xsl:value-of select="name(..)" /></span>.<xsl:value-of select="name" />
<xsl:if test="deprecated">
<span class="deprecated-badge">deprecated</span>
</xsl:if>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:for-each>
</div>
<div id="main">
<xsl:for-each select="fluidsettings/*">
<xsl:sort select="@label" />
<h2><xsl:value-of select="@label" /></h2>
<xsl:for-each select="*">
<xsl:sort select="name(..)" />
<div class="setting">
<xsl:attribute name="id">
<xsl:value-of select="name(..)" /><![CDATA[.]]><xsl:value-of select="name" />
</xsl:attribute>
<div class="setting-header">
<div class="setting-name">
<xsl:value-of select="name(..)" />.<xsl:value-of select="name" />
</div>
<div class="setting-type">
</div>
</div>
<div class="setting-body">
<div class="setting-attribute">
<div class="label">Type:</div>
<div class="value">
<xsl:choose>
<xsl:when test="type = 'bool'">
Boolean (int)
</xsl:when>
<xsl:when test="type = 'int'">
Integer (int)
</xsl:when>
<xsl:when test="type = 'str'">
<xsl:choose>
<xsl:when test="vals">
Selection (str)
</xsl:when>
<xsl:otherwise>
String (str)
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="type = 'num'">
Float (num)
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="type" />
</xsl:otherwise>
</xsl:choose>
</div>
</div>
<xsl:choose>
<xsl:when test="type = 'str' and vals">
<div class="setting-attribute">
<div class="label">Options:</div>
<div class="value"><xsl:value-of select="vals" /></div>
</div>
</xsl:when>
<xsl:when test="type = 'bool'">
<div class="setting-attribute">
<div class="label">Values:</div>
<div class="value">0, 1</div>
</div>
</xsl:when>
<xsl:when test="min or max">
<div class="setting-attribute">
<div class="label">Min - Max:</div>
<div class="value">
<xsl:value-of select="min" />
-
<xsl:value-of select="max" />
</div>
</div>
</xsl:when>
</xsl:choose>
<div class="setting-attribute">
<div class="label">Default:</div>
<div class="value"><xsl:copy-of select="def" /></div>
</div>
<xsl:if test="realtime">
<div class="setting-attribute">
<div class="label">Real-time:</div>
<div class="value">
<xsl:choose>
<xsl:when test="realtime/text()">
<xsl:copy-of select="realtime"/>
</xsl:when>
<xsl:otherwise>
This setting can be changed during runtime of the synthesizer.
</xsl:otherwise>
</xsl:choose>
</div>
</div>
</xsl:if>
<xsl:if test="deprecated">
<div class="setting-deprecated">
This setting is deprecated and might be removed in a future version of FluidSynth.
</div>
</xsl:if>
<div class="setting-description">
<xsl:copy-of select="desc" />
</div>
</div>
</div>
</xsl:for-each>
</xsl:for-each>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,5 +1,5 @@
/*!
\mainpage FluidSynth 2.0 Developer Documentation
/*!
\mainpage FluidSynth 2.2 Developer Documentation
\author Peter Hanappe
\author Conrad Berhörster
\author Antoine Schmitt
@ -7,43 +7,15 @@
\author Josh Green
\author David Henningsson
\author Tom Moebert
\author Copyright &copy; 2003-2019 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.1.0
\date 2019-11-30
\author Copyright &copy; 2003-2022 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.2.8
\date 2022-07-10
All the source code examples in this document are in the public domain; you can use them as you please. This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth library is distributed under the GNU Lesser General Public License. A copy of the GNU Lesser General Public License is contained in the FluidSynth package; if not, visit http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
All the source code examples in this document are in the public domain; you can use them as you please. This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth library is distributed under the GNU Lesser General Public License. A copy of the GNU Lesser General Public License is contained in the FluidSynth package; if not, visit https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\section Abstract
<a href="http://www.fluidsynth.org">FluidSynth</a> is a software synthesizer based on the <a href="http://en.wikipedia.org/wiki/SoundFont">SoundFont 2</a> specifications. The synthesizer is available as a shared object that can easily be reused in any application that wants to use wave-table synthesis. This document explains the basic usage of FluidSynth. Some of the more advanced features are not yet discussed but will be added in future versions.
\section Contents Table of Contents
- \ref Disclaimer
- \ref Introduction
- \ref NewIn2_1_0
- \ref NewIn2_0_8
- \ref NewIn2_0_7
- \ref NewIn2_0_6
- \ref NewIn2_0_5
- \ref NewIn2_0_3
- \ref NewIn2_0_2
- \ref NewIn2_0_0
- \ref CreatingSettings
- \ref CreatingSynth
- \ref CreatingAudioDriver
- \ref UsingSynth
- \ref LoadingSoundfonts
- \ref SendingMIDI
- \ref RealtimeMIDI
- \ref MIDIPlayer
- \ref FileRenderer
- \ref MIDIPlayerMem
- \ref MIDIRouter
- \ref Sequencer
- \ref Shell
- \ref Multi-channel
- \ref Advanced
<a href="https://www.fluidsynth.org">FluidSynth</a> is a software synthesizer based on the <a href="https://en.wikipedia.org/wiki/SoundFont">SoundFont 2</a> specifications. The synthesizer is available as a shared object that can easily be reused in any application that wants to use wave-table synthesis. This document explains the basic usage of FluidSynth. Some of the more advanced features are not yet discussed but will be added in future versions.
\section Disclaimer
@ -51,7 +23,7 @@ This documentation may be partly incomplete. As always, the source code is the f
SoundFont(R) is a registered trademark of E-mu Systems, Inc.
\section Introduction
\page Introduction Introduction
What is FluidSynth?
@ -61,688 +33,19 @@ What is FluidSynth?
- FluidSynth is an API (Application Programming Interface) relieving programmers from a lot of details of reading SoundFont and MIDI events and files, and sending the digital audio output to a Sound Card. These tasks can be accomplished using a small set of functions. This document explains most of the API functions and gives short examples about them.
- FluidSynth uses instrument samples contained in standard SF2 (SoundFont 2) files, having a file structure based on the RIFF format. The specification can be obtained here: http://connect.creativelabs.com/developer/SoundFont/Forms/AllItems.aspx but most users don't need to know any details of the format.
- FluidSynth uses instrument samples contained in standard SF2 (SoundFont 2) files, having a file structure based on the RIFF format. The specification is publicly available on the internet, but most users don't need to know any details of the format.
- FluidSynth can easily be embedded in an application. It has a main header file, fluidsynth.h, and one dynamically linkable library. FluidSynth runs on Linux, Mac OS X, and the Windows platforms, and support for OS/2 and OpenSolaris is experimental. It has audio and midi drivers for all mentioned platforms but you can use it with your own drivers if your application already handles MIDI and audio input/output. This document explains the basic usage of FluidSynth and provides examples that you can reuse.
- FluidSynth is open source, in active development. For more details, take a look at http://www.fluidsynth.org
- FluidSynth is open source, in active development. For more details, take a look at https://www.fluidsynth.org
\section NewIn2_1_0 Whats new in 2.1.0?
- <span style="color:red">refrain from using fluid_synth_set_sample_rate()</span>
- new reverb engine
- chorus is now stereophonic
- smallest allowed chorus speed is now 0.1 Hz (previously 0.29 Hz)
- the following audio drivers were added:
- opensles
- oboe
- sdl2
- waveout
\page deprecated Deprecated Functions
\section NewIn2_0_8 Whats new in 2.0.8?
This page contains functions that have been marked obsolete.
Functions listed here will be removed in the next major release.
It is therefore not wise to use them in new code.
- fluid_sample_set_sound_data() caused broken sound when copying sample data
\section NewIn2_0_7 Whats new in 2.0.7?
- fluid_free() has been added to allow proper deallocation by programming languages other than C/C++
\section NewIn2_0_6 Whats new in 2.0.6?
- the MIDI player did not emit any audio when calling fluid_player_play() after fluid_player_stop()
\section NewIn2_0_5 Whats new in 2.0.5?
- fluid_synth_process() omitted audio samples when called with arbitrary sample counts that were not a multiple of fluid_synth_get_internal_bufsize()
- fluid_synth_sfunload() was not releasing sample buffers of SoundFont3 files if <a href="fluidsettings.xml#synth.dynamic-sample-loading">"synth.dynamic-sample-loading"</a> was set to FALSE
\section NewIn2_0_3 Whats new in 2.0.3?
- fix incorrect behaviour of fluid_sample_set_sound_data()
- add missing getters for midi events:
- fluid_midi_event_get_text()
- fluid_midi_event_get_lyrics()
\section NewIn2_0_2 Whats new in 2.0.2?
- fluid_synth_error() has been deprecated, use fluid_set_log_function() to interfere log messages
\section NewIn2_0_0 Whats new in 2.0.0?
FluidSynths major version was bumped. The API was reworked, deprecated functions were removed.
<strong><span style="color:red">Important changes that may not result in a compilation error but may cause your app to misbehave:</span></strong>
- all public \c fluid_settings_* functions that return an integer which is not meant to be interpreted as bool consistently return either FLUID_OK or FLUID_FAILED
- fluid_settings_setstr() cannot be used to set integer (toggle) settings with "yes" or "no" values anymore. Use fluid_settings_setint() instead, for example: <br /><code>fluid_settings_setint(settings, "synth.reverb.active", 0)</code> instead of <code>fluid_settings_setstr(settings, "synth.reverb.active", "no")</code>
- explicit client unregistering is required for fluid_sequencer_register_client() and fluid_sequencer_register_fluidsynth()
- all public functions consistently receive signed integers for soundfont ids, bank and program numbers
- use unique device names for the "audio.portaudio.device" setting
- fluid_synth_process() received a new more flexible implementation, but now requires zeroed-out sample buffers
<strong>Other changes in FluidSynth 2.0.0 concerning developers:</strong>
- all public \c delete_* functions return void and are safe when called with NULL
- the shell command handler was decoupled internally, as a consequence the param list of new_fluid_server() and new_fluid_cmd_handler() was adapted
- \c fluid_settings_set* functions no longer silently register unknown settings but return an error instead
- reverb: roomsize is now limited to an upper threshold of 1.0 to avoid exponential volume increase
- rename \c fluid_mod_new() and \c fluid_mod_delete() to match naming conventions: new_fluid_mod() and delete_fluid_mod()
- rename chorus getters to match naming conventions: fluid_synth_get_chorus_speed() and fluid_synth_get_chorus_depth()
- fluid_synth_remove_sfont() returns FLUID_OK or FLUID_FAILED
- introduce a separate data type for sequencer client IDs: #fluid_seq_id_t
- fluid_get_userconf() has been implemented for Windows
<strong>New Features and API additions:</strong>
- add <a href="fluidsettings.xml#midi.autoconnect">"midi.autoconnect"</a> a setting for automatically connecting fluidsynth to available MIDI input ports
- add <a href="fluidsettings.xml#synth.overflow.important">"synth.overflow.important"</a> and <a href="fluidsettings.xml#synth.overflow.important-channels">"synth.overflow.important-channels"</a> settings to take midi channels during overflow calculation into account that are considered to be "important"
- add <a href="fluidsettings.xml#synth.dynamic-sample-loading">"synth.dynamic-sample-loading"</a> a setting for enabling on demand sample loading
- add support for polyphonic key pressure events, see fluid_event_key_pressure() and fluid_synth_key_pressure()
- add fluid_synth_add_default_mod() and fluid_synth_remove_default_mod() for manipulating default modulators
- add individual reverb setters: fluid_synth_set_reverb_roomsize(), fluid_synth_set_reverb_damp(), fluid_synth_set_reverb_width(), fluid_synth_set_reverb_level()
- add individual chorus setters: fluid_synth_set_chorus_nr(), fluid_synth_set_chorus_level(), fluid_synth_set_chorus_speed(), fluid_synth_set_chorus_depth(), fluid_synth_set_chorus_type()
- add realtime settings for <a href="fluidsettings.xml#synth.reverb.damp">reverb</a> and <a href="fluidsettings.xml#synth.chorus.depth">chorus</a> parameters
- add seek support to midi-player, see fluid_player_seek()
- expose functions to manipulate the ladspa effects unit (see ladspa.h)
- add support for text and lyrics midi events, see fluid_midi_event_set_lyrics() and fluid_midi_event_set_text()
- complete rewrite of the soundfont loader API, see sfont.h
- support for 24 bit audio samples, see fluid_sample_set_sound_data()
- expose new_fluid_defsfloader() to support loading soundfonts from memory, see fluid_sfloader_set_callbacks() and <a href="fluidsynth_sfload_mem_8c-example.html">fluidsynth_sfload_mem.c</a>
- remove these structs from the public API and provide proper getter and setter functions instead:
- struct _fluid_sfloader_t
- struct _fluid_sample_t
- struct _fluid_sfont_t
- struct _fluid_preset_t
- add an additional general-purpose IIR filter, see fluid_synth_set_custom_filter()
- add a custom sinusoidal modulator mapping function, see #FLUID_MOD_SIN
- implement polymono support according to MIDI specs:
- add basic channel support, see fluid_synth_reset_basic_channel(), fluid_synth_set_basic_channel(), fluid_synth_get_basic_channel()
- implement MIDI modes Omni On, Omni Off, Poly, Mono, see #fluid_basic_channel_modes
- implement portamento control, see fluid_synth_set_portamento_mode(), fluid_synth_get_portamento_mode()
- implement legato control, see fluid_synth_set_legato_mode(), fluid_synth_get_legato_mode()
- implement breath control, see fluid_synth_set_breath_mode(), fluid_synth_get_breath_mode()
<strong>API cleanups:</strong>
- the ramsfont has been removed, because it is unmaintained and believed to be unused; please get in touch with the mailing list if you still need it
- remove deprecated fluid_synth_get_channel_info() in favour of fluid_synth_get_program() and fluid_synth_get_channel_preset()
- remove deprecated fluid_settings_getstr()
- remove deprecated fluid_synth_set_midi_router(), instead supply the midi-router instance when creating a command handler with new_fluid_cmd_handler()
- remove deprecated fluid_get_hinstance() and fluid_set_hinstance() (dsound driver now uses the desktop window)
- remove deprecated fluid_synth_create_key_tuning(), use fluid_synth_activate_key_tuning(synth, bank, prog, name, pitch, FALSE) instead
- remove deprecated fluid_synth_create_octave_tuning(), use fluid_synth_activate_octave_tuning(synth, bank, prog, name, pitch, FALSE) instead
- remove deprecated fluid_synth_select_tuning(), use fluid_synth_activate_tuning(synth, chan, bank, prog, FALSE) instead
- remove deprecated fluid_synth_reset_tuning(), use fluid_synth_deactivate_tuning(synth, chan, FALSE) instead
- remove deprecated FLUID_HINT_INTEGER
- remove deprecated fluid_synth_set_gen2() as there doesn't seem to be a use case for absolute generator values
- remove deprecated "synth.parallel-render" setting
- remove obsolete "audio.[out|in]put-channels" settings
- remove unimplemented "synth.dump" setting
- remove fluid_cmd_handler_register() and fluid_cmd_handler_unregister() from public API, as they seem to be unused downstream
- remove misspelled FLUID_SEQ_PITCHWHHELSENS macro
- remove struct _fluid_mod_t from public API, use the getters and setters of mod.h instead
- remove struct _fluid_gen_t, fluid_gen_set_default_values() and enum fluid_gen_flags from public API
- remove macros fluid_sfont_get_id() and fluid_sample_refcount() from public API
- remove FLUID_NUM_MOD macro from public API
- remove the following deprecated enum values from public API:
- GEN_LAST
- LAST_LOG_LEVEL
- FLUID_SEQ_LASTEVENT
- FLUID_MIDI_ROUTER_RULE_COUNT
\section CreatingSettings Creating and changing the settings
Before you can use the synthesizer, you have to create a settings object. The settings objects is used by many components of the FluidSynth library. It gives a unified API to set the parameters of the audio drivers, the midi drivers, the synthesizer, and so forth. A number of default settings are defined by the current implementation.
All settings have a name that follows the "dotted-name" notation. For example, "synth.polyphony" refers to the number of voices (polyphony) allocated by the synthesizer. The settings also have a type. There are currently three types: strings, numbers (double floats), and integers. You can change the values of a setting using the fluid_settings_setstr(), fluid_settings_setnum(), and fluid_settings_setint() functions. For example:
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings = new_fluid_settings();
fluid_settings_setint(settings, "synth.polyphony", 128);
/* ... */
delete_fluid_settings(settings);
return 0;
}
\endcode
The API contains the functions to query the type, the current value, the default value, the range and the "hints" of a setting. The range is the minimum and maximum value of the setting. The hints gives additional information about a setting. For example, whether a string represents a filename. Or whether a number should be interpreted on on a logarithmic scale. Check the settings.h API documentation for a description of all functions.
\section CreatingSynth Creating the synthesizer
To create the synthesizer, you pass it the settings object, as in the following example:
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_synth_t* synth;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
/* Do useful things here */
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
For a full list of available <strong>synthesizer settings</strong>, please refer to <a href="fluidsettings.xml" target="_blank"><b>FluidSettings Documentation</b></a>.
\section CreatingAudioDriver Creating the Audio Driver
The synthesizer itself does not write any audio to the audio output. This allows application developers to manage the audio output themselves if they wish. The next section describes the use of the synthesizer without an audio driver in more detail.
Creating the audio driver is straightforward: set the <code>audio.driver</code> settings and create the driver object. Because the FluidSynth has support for several audio systems, you may want to change which one you want to use. The list below shows the audio systems that are currently supported. It displays the name, as used by the fluidsynth library, and a description.
- jack: JACK Audio Connection Kit (Linux, Mac OS X, Windows)
- alsa: Advanced Linux Sound Architecture (Linux)
- oss: Open Sound System (Linux, Unix)
- pulseaudio: PulseAudio (Linux, Mac OS X, Windows)
- coreaudio: Apple CoreAudio (Mac OS X)
- dsound: Microsoft DirectSound (Windows)
- portaudio: PortAudio Library (Mac OS 9 & X, Windows, Linux)
- sndman: Apple SoundManager (Mac OS Classic)
- dart: DART sound driver (OS/2)
- opensles: OpenSL ES (Android)
- oboe: Oboe (Android)
- waveout: Microsoft WaveOut, alternative to DirectSound (Windows CE x86, Windows Mobile 2003 for ARMv5, Windows 98 SE, Windows NT 4.0, Windows XP and later)
- file: Driver to output audio to a file
- sdl2*: Simple DirectMedia Layer (Linux, Windows, Mac OS X, iOS, Android, FreeBSD, Haiku, etc.)
The default audio driver depends on the settings with which FluidSynth was compiled. You can get the default driver with fluid_settings_getstr_default(). To get the list of available drivers use the fluid_settings_foreach_option() function. Finally, you can set the driver with fluid_settings_setstr(). In most cases, the default driver should work out of the box.
Additional options that define the audio quality and latency are "audio.sample-format", "audio.period-size", and "audio.periods". The details are described later.
You create the audio driver with the new_fluid_audio_driver() function. This function takes the settings and synthesizer object as arguments. For example:
\code
void init()
{
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
/* Set the synthesizer settings, if necessary */
synth = new_fluid_synth(settings);
fluid_settings_setstr(settings, "audio.driver", "jack");
adriver = new_fluid_audio_driver(settings, synth);
}
\endcode
As soon as the audio driver is created, it will start playing. The audio driver creates a separate thread that uses the synthesizer object to generate the audio.
There are a number of general audio driver settings. The audio.driver settings define the audio subsystem that will be used. The audio.periods and audio.period-size settings define the latency and robustness against scheduling delays. There are additional settings for the audio subsystems used. For a full list of available <strong>audio driver settings</strong>, please refer to <a href="fluidsettings.xml" target="_blank"><strong>FluidSettings Documentation</strong></a>.
<strong>*Note:</strong> In order to use sdl2 as audio driver, the application is responsible for initializing SDL (e.g. with SDL_Init()). This must be done <strong>before</strong> the first call to <code>new_fluid_settings()</code>! Also make sure to call SDL_Quit() after all fluidsynth instances have been destroyed.
\section UsingSynth Using the synthesizer without an audio driver
It is possible to use the synthesizer object without creating an audio driver. This is desirable if the application using FluidSynth manages the audio output itself. The synthesizer has several API functions that can be used to obtain the audio output:
fluid_synth_write_s16() fills two buffers (left and right channel) with samples coded as signed 16 bits (the endian-ness is machine dependent). fluid_synth_write_float() fills a left and right audio buffer with 32 bits floating point samples. The function fluid_synth_process() is the generic interface for synthesizing audio, which is also capable of multi channel audio output.
\section LoadingSoundfonts Loading and managing SoundFonts
Before any sound can be produced, the synthesizer needs a SoundFont.
SoundFonts are loaded with the fluid_synth_sfload() function. The function takes the path to a SoundFont file and a boolean to indicate whether the presets of the MIDI channels should be updated after the SoundFont is loaded. When the boolean value is TRUE, all MIDI channel bank and program numbers will be refreshed, which may cause new instruments to be selected from the newly loaded SoundFont.
The synthesizer can load any number of SoundFonts. The loaded SoundFonts are treated as a stack, where each new loaded SoundFont is placed at the top of the stack. When selecting presets by bank and program numbers, SoundFonts are searched beginning at the top of the stack. In the case where there are presets in different SoundFonts with identical bank and program numbers, the preset from the most recently loaded SoundFont is used. The fluid_synth_program_select() can be used for unambiguously selecting a preset or bank offsets could be applied to each SoundFont with fluid_synth_set_bank_offset(), to try and ensure that each preset has unique bank and program numbers.
The fluid_synth_sfload() function returns the unique identifier of the loaded SoundFont, or -1 in case of an error. This identifier is used in subsequent management functions: fluid_synth_sfunload() removes the SoundFont, fluid_synth_sfreload() reloads the SoundFont. When a SoundFont is reloaded, it retains it's ID and position on the SoundFont stack.
Additional API functions are provided to get the number of loaded SoundFonts and to get a pointer to the SoundFont.
\section SendingMIDI Sending MIDI Events
Once the synthesizer is up and running and a SoundFont is loaded, most people will want to do something useful with it. Make noise, for example. MIDI messages can be sent using the fluid_synth_noteon(), fluid_synth_noteoff(), fluid_synth_cc(), fluid_synth_pitch_bend(), fluid_synth_pitch_wheel_sens(), and fluid_synth_program_change() functions. For convenience, there's also a fluid_synth_bank_select() function (the bank select message is normally sent using a control change message).
The following example show a generic graphical button that plays a note when clicked:
\code
class SoundButton : public SomeButton
{
public:
SoundButton() : SomeButton() {
if (!_synth) {
initSynth();
}
}
static void initSynth() {
_settings = new_fluid_settings();
_synth = new_fluid_synth(_settings);
_adriver = new_fluid_audio_driver(_settings, _synth);
}
/* ... */
virtual int handleMouseDown(int x, int y) {
/* Play a note on key 60 with velocity 100 on MIDI channel 0 */
fluid_synth_noteon(_synth, 0, 60, 100);
}
virtual int handleMouseUp(int x, int y) {
/* Release the note on key 60 */
fluid_synth_noteoff(_synth, 0, 60);
}
protected:
static fluid_settings_t* _settings;
static fluid_synth_t* _synth;
static fluid_audio_driver_t* _adriver;
};
\endcode
\section RealtimeMIDI Creating a Real-time MIDI Driver
FluidSynth can process real-time MIDI events received from hardware MIDI ports or other applications. To do so, the client must create a MIDI input driver. It is a very similar process to the creation of the audio driver: you initialize some properties in a settings instance and call the new_fluid_midi_driver() function providing a callback function that will be invoked when a MIDI event is received. The following MIDI drivers are currently supported:
- jack: JACK Audio Connection Kit MIDI driver (Linux, Mac OS X)
- oss: Open Sound System raw MIDI (Linux, Unix)
- alsa_raw: ALSA raw MIDI interface (Linux)
- alsa_seq: ALSA sequencer MIDI interface (Linux)
- winmidi: Microsoft Windows MM System (Windows)
- midishare: MIDI Share (Linux, Mac OS X)
- coremidi: Apple CoreMIDI (Mac OS X)
\code
#include <fluidsynth.h>
int handle_midi_event(void* data, fluid_midi_event_t* event)
{
printf("event type: %d\n", fluid_midi_event_get_type(event));
}
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_midi_driver_t* mdriver;
settings = new_fluid_settings();
mdriver = new_fluid_midi_driver(settings, handle_midi_event, NULL);
/* ... */
delete_fluid_midi_driver(mdriver);
return 0;
}
\endcode
There are a number of general MIDI driver settings. The midi.driver setting
defines the MIDI subsystem that will be used. There are additional settings for
the MIDI subsystems used. For a full list of available <strong>midi driver settings</strong>, please refer to <a href="fluidsettings.xml" target="_blank"><strong>FluidSettings Documentation</strong></a>.
\section MIDIPlayer Loading and Playing a MIDI file
FluidSynth can be used to play MIDI files, using the MIDI File Player interface. It follows a high level implementation, though its implementation is currently incomplete. After initializing the synthesizer, create the player passing the synth instance to new_fluid_player(). Then, you can add some SMF file names to the player using fluid_player_add(), and finally call fluid_player_play() to start the playback. You can check if the player has finished by calling fluid_player_get_status(), or wait for the player to terminate using fluid_player_join().
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
int i;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
player = new_fluid_player(synth);
/* process command line arguments */
for (i = 1; i < argc; i++) {
if (fluid_is_soundfont(argv[i])) {
fluid_synth_sfload(synth, argv[1], 1);
}
if (fluid_is_midifile(argv[i])) {
fluid_player_add(player, argv[i]);
}
}
/* start the synthesizer thread */
adriver = new_fluid_audio_driver(settings, synth);
/* play the midi files, if any */
fluid_player_play(player);
/* wait for playback termination */
fluid_player_join(player);
/* cleanup */
delete_fluid_audio_driver(adriver);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
A list of available <strong>MIDI player settings</strong> can be found in <a href="fluidsettings.xml" target="_blank"><b>FluidSettings Documentation</b></a>.
\section FileRenderer Fast file renderer for non-realtime MIDI file rendering
Instead of creating an audio driver as described in section \ref MIDIPlayer one may chose to use the file renderer, which is the fastest way to synthesize MIDI files.
\code
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_file_renderer_t* renderer;
settings = new_fluid_settings();
// specify the file to store the audio to
// make sure you compiled fluidsynth with libsndfile to get a real wave file
// otherwise this file will only contain raw s16 stereo PCM
fluid_settings_setstr(settings, "audio.file.name", "/path/to/output.wav");
// use number of samples processed as timing source, rather than the system timer
fluid_settings_setstr(settings, "player.timing-source", "sample");
// since this is a non-realtime szenario, there is no need to pin the sample data
fluid_settings_setint(settings, "synth.lock-memory", 0);
synth = new_fluid_synth(settings);
// *** loading of a soundfont omitted ***
player = new_fluid_player(synth);
fluid_player_add(player, "/path/to/midifile.mid");
fluid_player_play(player);
renderer = new_fluid_file_renderer (synth);
while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING)
{
if (fluid_file_renderer_process_block(renderer) != FLUID_OK)
{
break;
}
}
// just for sure: stop the playback explicitly and wait until finished
fluid_player_stop(player);
fluid_player_join(player);
delete_fluid_file_renderer(renderer);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
\endcode
Various output files types are supported, if compiled with libsndfile. Those can be specified via the \c settings object as well. Refer to the <a href="fluidsettings.xml#audio.file.endian" target="_blank"><b>FluidSettings Documentation</b></a> for more \c audio.file\.\* options.
\section MIDIPlayerMem Playing a MIDI file from memory
FluidSynth can be also play MIDI files directly from a buffer in memory. If you need to play a file from a stream (such as stdin, a network, or a high-level file interface), you can load the entire file into a buffer first, and then use this approach. Use the same technique as above, but rather than calling fluid_player_add(), load it into memory and call fluid_player_add_mem() instead. Once you have passed a buffer to fluid_player_add_mem(), it is copied, so you may use it again or free it immediately (it is your responsibility to free it if you allocated it).
\code
#include <stdlib.h>
#include <string.h>
#include <fluidsynth.h>
/* An example midi file */
const char MIDIFILE[] = {
0x4d, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06,
0x00, 0x01, 0x00, 0x01, 0x01, 0xe0, 0x4d, 0x54,
0x72, 0x6b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x90,
0x3c, 0x64, 0x87, 0x40, 0x80, 0x3c, 0x7f, 0x00,
0x90, 0x43, 0x64, 0x87, 0x40, 0x80, 0x43, 0x7f,
0x00, 0x90, 0x48, 0x64, 0x87, 0x40, 0x80, 0x48,
0x7f, 0x83, 0x60, 0xff, 0x2f, 0x00
};
int main(int argc, char** argv)
{
int i;
void* buffer;
size_t buffer_len;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
player = new_fluid_player(synth);
adriver = new_fluid_audio_driver(settings, synth);
/* process command line arguments */
for (i = 1; i < argc; i++) {
if (fluid_is_soundfont(argv[i])) {
fluid_synth_sfload(synth, argv[1], 1);
}
}
/* queue up the in-memory midi file */
fluid_player_add_mem(player, MIDIFILE, sizeof(MIDIFILE));
/* play the midi file */
fluid_player_play(player);
/* wait for playback termination */
fluid_player_join(player);
/* cleanup */
delete_fluid_audio_driver(adriver);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
\section MIDIRouter Real-time MIDI router
The MIDI router is one more processing layer directly behind the MIDI input. It processes incoming MIDI events and generates control events for the synth. It can be used to filter or modify events prior to sending them to the synthesizer. When created, the MIDI router is transparent and simply passes all MIDI events. Router "rules" must be added to actually make use of its capabilities.
Some examples of MIDI router usage:
- Filter messages (Example: Pass sustain pedal CCs only to selected channels)
- Split the keyboard (Example: noteon with notenr < x: to ch 1, >x to ch 2)
- Layer sounds (Example: for each noteon received on ch 1, create a noteon on ch1, ch2, ch3,...)
- Velocity scaling (Example: for each noteon event, scale the velocity by 1.27)
- Velocity switching (Example: v <= 100: "Angel Choir"; v > 100: "Hell's Bells")
- Get rid of aftertouch
The MIDI driver API has a clean separation between the midi thread and the synthesizer. That opens the door to add a midi router module.
MIDI events coming from the MIDI player do not pass through the MIDI router.
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_midi_router_t* router;
fluid_midi_router_rule_t* rule;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
/* Create the MIDI router and pass events to the synthesizer */
router = new_fluid_midi_router (settings, fluid_synth_handle_midi_event, synth);
/* Clear default rules */
fluid_midi_router_clear_rules (router);
/* Add rule to map all notes < MIDI note #60 on any channel to channel 4 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 0, 15, 0.0, 4); /* Map all to channel 4 */
fluid_midi_router_rule_set_param1 (rule, 0, 59, 1.0, 0); /* Match notes < 60 */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
/* Add rule to map all notes >= MIDI note #60 on any channel to channel 5 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 0, 15, 0.0, 5); /* Map all to channel 5 */
fluid_midi_router_rule_set_param1 (rule, 60, 127, 1.0, 0); /* Match notes >= 60 */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
/* Add rule to reverse direction of pitch bender on channel 7 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 7, 7, 1.0, 0); /* Match channel 7 only */
fluid_midi_router_rule_set_param1 (rule, 0, 16383, -1.0, 16383); /* Reverse pitch bender */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_PITCH_BEND);
/* ... Create audio driver, process events, etc ... */
/* cleanup */
delete_fluid_midi_router(router);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
\section Sequencer
FluidSynth's sequencer can be used to play MIDI events in a more flexible way than using the MIDI file player, which expects the events to be stored as Standard MIDI Files. Using the sequencer, you can provide the events one by one, with an optional timestamp for scheduling.
The client program should first initialize the sequencer instance using the function new_fluid_sequencer2(). There is a complementary function delete_fluid_sequencer() to delete it. After creating the sequencer instance, the destinations can be registered using fluid_sequencer_register_fluidsynth() for the synthesizer destination, and optionally using fluid_sequencer_register_client() for the client destination providing a suitable callback function. It can be unregistered using fluid_sequencer_unregister_client(). After the initialization, events can be sent with fluid_sequencer_send_now() and scheduled to the future with fluid_sequencer_send_at(). The registration functions return identifiers, that can be used as destinations of an event using fluid_event_set_dest().
The function fluid_sequencer_get_tick() returns the current playing position. A program may choose a new timescale in milliseconds using fluid_sequencer_set_time_scale().
The following example uses the fluidsynth sequencer to implement a sort of music box. FluidSynth internal clock is used to schedule repetitive sequences of notes. The next sequence is scheduled on advance before the end of the current one, using a timer event that triggers a callback function. The scheduling times are always absolute values, to avoid slippage.
\code
#include "fluidsynth.h"
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
fluid_sequencer_t* sequencer;
short synthSeqID, mySeqID;
unsigned int now;
unsigned int seqduration;
// prototype
void seq_callback(unsigned int time, fluid_event_t* event, fluid_sequencer_t* seq, void* data);
void createsynth()
{
fluid_settings_t* settings;
settings = new_fluid_settings();
fluid_settings_setint(settings, "synth.reverb.active", 0);
fluid_settings_setint(settings, "synth.chorus.active", 0);
synth = new_fluid_synth(settings);
adriver = new_fluid_audio_driver(settings, synth);
sequencer = new_fluid_sequencer2(0);
// register synth as first destination
synthSeqID = fluid_sequencer_register_fluidsynth(sequencer, synth);
// register myself as second destination
mySeqID = fluid_sequencer_register_client(sequencer, "me", seq_callback, NULL);
// the sequence duration, in ms
seqduration = 1000;
}
void deletesynth()
{
delete_fluid_sequencer(sequencer);
delete_fluid_audio_driver(adriver);
delete_fluid_synth(synth);
}
void loadsoundfont()
{
int fluid_res;
// put your own path here
fluid_res = fluid_synth_sfload(synth, "Inside:VintageDreamsWaves-v2.sf2", 1);
}
void sendnoteon(int chan, short key, unsigned int date)
{
int fluid_res;
fluid_event_t *evt = new_fluid_event();
fluid_event_set_source(evt, -1);
fluid_event_set_dest(evt, synthSeqID);
fluid_event_noteon(evt, chan, key, 127);
fluid_res = fluid_sequencer_send_at(sequencer, evt, date, 1);
delete_fluid_event(evt);
}
void schedule_next_callback()
{
int fluid_res;
// I want to be called back before the end of the next sequence
unsigned int callbackdate = now + seqduration/2;
fluid_event_t *evt = new_fluid_event();
fluid_event_set_source(evt, -1);
fluid_event_set_dest(evt, mySeqID);
fluid_event_timer(evt, NULL);
fluid_res = fluid_sequencer_send_at(sequencer, evt, callbackdate, 1);
delete_fluid_event(evt);
}
void schedule_next_sequence() {
// Called more or less before each sequence start
// the next sequence start date
now = now + seqduration;
// the sequence to play
// the beat : 2 beats per sequence
sendnoteon(0, 60, now + seqduration/2);
sendnoteon(0, 60, now + seqduration);
// melody
sendnoteon(1, 45, now + seqduration/10);
sendnoteon(1, 50, now + 4*seqduration/10);
sendnoteon(1, 55, now + 8*seqduration/10);
// so that we are called back early enough to schedule the next sequence
schedule_next_callback();
}
/* sequencer callback */
void seq_callback(unsigned int time, fluid_event_t* event, fluid_sequencer_t* seq, void* data) {
schedule_next_sequence();
}
int main(void) {
createsynth();
loadsoundfont();
// initialize our absolute date
now = fluid_sequencer_get_tick(sequencer);
schedule_next_sequence();
sleep(100000);
deletesynth();
return 0;
}
\endcode
\section Shell Shell interface
The shell interface allows you to send simple textual commands to the synthesizer, to parse a command file, or to read commands from the stdin or other input streams. To find the list of currently supported commands, please check the fluid_cmd.c file or type "help" in the fluidsynth command line shell. For a full list of available <strong>command line settings</strong>, please refer to <a href="fluidsettings.xml" target="_blank"><b>FluidSettings Documentation</b></a>.
\section Multi-channel Multi-Channel audio rendering
FluidSynth is capable of rendering all audio and all effects from all MIDI channels to separate stero buffers. Refer to the documentation of fluid_synth_process() and review the different use-cases in the example file for information on how to do that: \ref fluidsynth_process.c
\section Advanced Advanced features, not yet documented. API reference may contain more info.
- Accessing low-level voice parameters
- Reverb settings
- Chorus settings
- Interpolation settings (set_gen, get_gen, NRPN)
- Voice overflow settings
- LADSPA effects unit
- MIDI tunings
*/
/*!

View file

@ -13,7 +13,7 @@
.\" along with this program; see the file LICENSE. If not, write to
.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.\"
.TH FluidSynth 1 "Oct 27, 2019"
.TH FluidSynth 1 "Jan 1, 2022"
.\" Please update the above date whenever this man page is modified.
.\"
.\" Some roff macros, for reference:
@ -135,7 +135,7 @@ Start FluidSynth as a server process
Audio file type for fast rendering or aufile driver ("\T help" for list)
.TP
.B \-v, \-\-verbose
Print out verbose messages about midi events
Print out verbose messages about midi events (synth.verbose=1) as well as other debug messages
.TP
.B \-V, \-\-version
Show version of program
@ -144,7 +144,7 @@ Show version of program
Size of each audio buffer
.SH SETTINGS
The settings to be specified with \-o are documented in the fluidsettings.xml hopefully shipped with this distribution or online at http://www.fluidsynth.org/api/fluidsettings.xml . We recommend viewing this file in a webbrowser, favourably Firefox.
The settings to be specified with \-o are documented in the fluidsettings.xml hopefully shipped with this distribution or online at https://www.fluidsynth.org/api/fluidsettings.xml . We recommend viewing this file in a webbrowser, favourably Firefox.
.SH SHELL COMMANDS
.TP

2174
doc/images/fluid_mixer.svg Normal file

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 150 KiB

View file

@ -1,6 +1,6 @@
# FluidSynth LADSPA Interface
The [LADSPA](http://ladspa.org/) (Linux Audio Developer's Simple Plugin API)
The [LADSPA](https://ladspa.org/) (Linux Audio Developer's Simple Plugin API)
binding can be used to route the FluidSynth audio output through any number of
LADSPA plugins. Please note that even though the "L" in LADSPA stands for
"Linux", it can also be used on different platforms, for example Windows or
@ -31,7 +31,7 @@ file.
## Introduction to LADSPA
You don't need to to have detailed knowledge of LADSPA to use effects with
FluidSynth, but knowing some of it's concepts will help if you want to make the
FluidSynth, but knowing some of the LADSPA concepts will help if you want to make the
best use of it.
If you have the LADSPA SDK installed you should be able to use the `listplugins`
@ -76,13 +76,13 @@ that only have a single output port and no input at all (think of noise
generators...)
Also note the line `Has run_adding() Function: No`. This specifies that this
plugin can not mix it's audio output into an output buffer, but will always
plugin can not mix its audio output into an output buffer, but will always
replace anything that is already there. This will become important again later
on.
## FluidSynth Host Ports
Just as LADSPA plugins have input and output ports, FluidSynth provides it's
Just as LADSPA plugins have input and output ports, FluidSynth provides its
own audio ports that can be connected to plugins. On a standard stereo setup,
the following four ports are automatically created:
@ -135,7 +135,7 @@ Please note that we only specified the path to the library
`/usr/lib/ladspa/delay.so` when creating the "e1" effect, but not which plugin
from the library to use. This is possible because the delay.so library contains
only a single plugin. If you want to use a library that contains more than one
plugin, you would need to give the plugin name as well, as we've done when
plugin, you would need to specify the plugin name as well, as we've done when
creating the "e2" effect. The string to use here is what is called "Plugin
Label" in the `analyseplugin` output.
@ -230,8 +230,8 @@ send amount specified in the SoundFont.
If you want to replace the internal reverb or chorus effects with a LADSPA
plugin and you want to honour the decisions made by the SoundFont designer, you
should use the `Reverb:Send` or `Chorus:Send` ports as effect input and
`Main:L` and `Main:R` ports as effect outputs. (See the "Example Setups" section
should use the `Reverb:Send` or `Chorus:Send` ports as inputs to the effects and
`Main:L` and `Main:R` ports as outputs. (See the "Example Setups" section
below for an example on how to replace the internal reverb with a LADSPA plugin.)
Please note that FluidSynth uses a mono signal for both effects, that is why
@ -260,17 +260,16 @@ ladspa_effect <effect-name> <library-path> [plugin-name] [--mix [gain]]
```
Load the LADSPA plugin library given by `<library-path>` and create a new effect
(i.e. an instance of a plugin). `<effect-name>` can be chosen by the user and must
(i.e. an instance of a plugin). `<effect-name>` can be chosen by the user and must be
unique. `<plugin-name>` is optional if the library contains only one plugin.
If the optional `--mix` parameter is given, then the LADSPA engine will call the
`run_adding` interface of the plugin. This will make the effect add it's output
to the output buffers instead of replacing them. The `--mix` parameter takes an
`run_adding` interface of the plugin. This will tell the effect to mix its output into the output buffers instead of replacing them. The `--mix` parameter takes an
optional float value `gain`, which will be multiplied with each sample before
adding to the output buffers.
Please note that there is no command to delete a single effect once created. To
remove effects, please use `ladspa_reset` to clear everything start from
remove effects, please use `ladspa_reset` to clear everything and start from
scratch.
Can only be called when the effect unit is not active.
@ -281,8 +280,8 @@ Can only be called when the effect unit is not active.
ladspa_buffer <buffer-name>
```
Create a new audio buffer called `<buffer-name>`. The buffer is able to be used as
mono output or mono input to an effect. Buffers can be used to connect plugins
Create a new audio buffer called `<buffer-name>`. The buffer can be used as
mono output or mono input for an effect. Buffers can be used to connect plugins
between each other without overwriting the host ports with temporary data.
Please note that there is no command to delete a buffer. To remove buffers,
@ -296,7 +295,7 @@ Can only be used when the effect unit is not active.
ladspa_link <effect-name> <audio-port-name> <buffer-or-host-port-name>
```
Connects an effect input or output port with a buffer or a host port. This
Connects an effect input or output port to a buffer or a host port. This
command can be called multiple times and will overwrite the previous connection
made on that effect port.
@ -348,7 +347,7 @@ it can be started again with `ladspa_start`.
ladspa_reset
```
Deactivates the effects unit if active and clears all configuration and loaded
Deactivates the effects unit if it is currently active and clears all configuration and loaded
plugins.
@ -440,7 +439,7 @@ Explaining multi-channel output in detail is out of scope for this guide. But
using multiple output channels has an effect on the host ports that are
available to LADSPA plugins.
As soon as you configure more than one audio-channel, the main audio ports will
As soon as you configure more than one audio-group, the main audio ports will
not be called "Main:L" and "Main:R" anymore, but will have indices added to
their name. So if you start FluidSynth with `-o synth.audio-groups=2`, then the
following ports will be created:
@ -461,8 +460,8 @@ then you also need to increase the `synth.audio-channels` setting.
LADSPA is a very simple plugin architecture and only requires the ladspa.h
header file as compile-time dependency. To build FluidSynth on non-Linux
platform with LADSPA support, download the ladspa.h file from
http://www.ladspa.org and place it somewhere in your compiler include path. Then
configure and build LADSPA as you normally would.
https://www.ladspa.org and place it somewhere in your compiler include path. Then
configure and build FluidSynth as you normally would.
All information in the above documentation is valid for all other platforms as
well. Just make sure you use the file path format specific to your platform in
@ -476,7 +475,7 @@ ladspa_effect /path/to/ladspa/plugin.so
```
Audacity provides a large number of precompiled LADSPA plugins for Windows and
MacOS: http://www.audacityteam.org/download/plug-ins/
MacOS: https://www.audacityteam.org/download/plug-ins/
To get the `analyseplugin` and `listplugins` commands on Windows, you can either
compile them yourself using the LADSPA-SDK source code from ladspa.org or install

169
doc/recent_changes.txt Normal file
View file

@ -0,0 +1,169 @@
/*!
\page RecentChanges Recent Changes
\section NewIn2_2_7 What's new in 2.2.7?
- Most getter functions of the MIDI event API are now const correct
- fluid_event_from_midi_event() has been added
\section NewIn2_2_0 What's new in 2.2.0?
- #fluid_file_callbacks_t <span style="color:red">now uses <code>long long</code> as file-offset type (see #fluid_long_long_t).</span><span style="color:red;font-weight:bold">This is a breaking change</span>, which allows to load SoundFonts bigger than 2GiB on Windows. This change required to bump fluidsynth's SOVERSION.
- <span style="color:red">various fluid_event_*() functions that received a "value" argument of type <code>short</code> now receive an <code>int</code> argument</span> in preparation for MIDI 2.0 support
- fluid_event_any_control_change() has been removed
- the sequencer has received a major revisal. For you that means:
- the sequencer's queue no longer blocks the synthesizer thread, due to being busy arranging its events internally.
- events that share the same tick was given a new, documented order, see fluid_sequencer_send_at().
- the sequencer's scale can now be used for arbitrary tempo changes. Previously, the scale of the sequencer was limited to 1000. The only limitation now is >0.
- there is now a dedicated event type for changing the sequencer's time scale, see fluid_event_scale().
- the dynamic-sample-loader has learned support to pin samples, see fluid_synth_pin_preset() and fluid_synth_unpin_preset()
- added getter and setter functions for individual effect groups
- support for UTF-8 filenames under Windows, see fluid_synth_sfload()
- MIDI Tempo of the fluid_player can now be overridden, see fluid_player_set_tempo()
- a per-tick callback has been added to the MIDI player, see fluid_player_set_tick_callback()
- WASAPI audio driver is now available on Windows
- the following drivers have gained support for new_fluid_audio_driver2():
- DSound
- WaveOut
- WASAPI
\section NewIn2_1_7 What's new in 2.1.7?
- a regression introduced in 2.1.0 prevented chorus from being audible when fluid_synth_process() was used
\section NewIn2_1_4 What's new in 2.1.4?
- a regression introduced in 2.1.3 broke fluid_synth_start() for DLS presets
\section NewIn2_1_1 What's new in 2.1.1?
- requirements for explicit sequencer client unregistering have been relaxed: delete_fluid_sequencer() now correctly frees any registered sequencer clients (clients can still be explicitly unregistered)
- using the sequencer with the system timer as timing source has been deprecated
\section NewIn2_1_0 What's new in 2.1.0?
- <span style="color:red">refrain from using fluid_synth_set_sample_rate()</span>
- \setting{synth_sample-rate} is no real-time setting anymore, see note about fluid_synth_set_sample_rate()
- new reverb engine
- chorus is now stereophonic
- smallest allowed chorus speed is now 0.1 Hz (previously 0.29 Hz)
- the following audio drivers were added:
- opensles
- oboe
- sdl2
- waveout
\section NewIn2_0_8 What's new in 2.0.8?
- fluid_sample_set_sound_data() caused broken sound when copying sample data
\section NewIn2_0_7 What's new in 2.0.7?
- fluid_free() has been added to allow proper deallocation by programming languages other than C/C++
\section NewIn2_0_6 What's new in 2.0.6?
- the MIDI player did not emit any audio when calling fluid_player_play() after fluid_player_stop()
\section NewIn2_0_5 What's new in 2.0.5?
- fluid_synth_process() omitted audio samples when called with arbitrary sample counts that were not a multiple of fluid_synth_get_internal_bufsize()
- fluid_synth_sfunload() was not releasing sample buffers of SoundFont3 files if \setting{synth_dynamic-sample-loading} was set to FALSE
\section NewIn2_0_3 What's new in 2.0.3?
- fix incorrect behaviour of fluid_sample_set_sound_data()
- add missing getters for midi events:
- fluid_midi_event_get_text()
- fluid_midi_event_get_lyrics()
\section NewIn2_0_2 What's new in 2.0.2?
- fluid_synth_error() has been deprecated, use fluid_set_log_function() to interfere log messages
\section NewIn2_0_0 What's new in 2.0.0?
FluidSynths major version was bumped. The API was reworked, deprecated functions were removed.
<strong><span style="color:red">Important changes that may not result in a compilation error but may cause your app to misbehave:</span></strong>
- all public \c fluid_settings_* functions that return an integer which is not meant to be interpreted as bool consistently return either FLUID_OK or FLUID_FAILED
- fluid_settings_setstr() cannot be used to set integer (toggle) settings with "yes" or "no" values anymore. Use fluid_settings_setint() instead, for example: <br /><code>fluid_settings_setint(settings, "synth.reverb.active", 0)</code> instead of <code>fluid_settings_setstr(settings, "synth.reverb.active", "no")</code>
- <span style="text-decoration:line-through;">explicit client unregistering is required for fluid_sequencer_register_client() and fluid_sequencer_register_fluidsynth()</span> (since fluidsynth 2.1.1 not required anymore, but still recommend)
- all public functions consistently receive signed integers for soundfont ids, bank and program numbers
- use unique device names for the \setting{audio_portaudio_device} setting
- fluid_synth_process() received a new more flexible implementation, but now requires zeroed-out sample buffers
<strong>Other changes in FluidSynth 2.0.0 concerning developers:</strong>
- all public \c delete_* functions return void and are safe when called with NULL
- the shell command handler was decoupled internally, as a consequence the param list of new_fluid_server() and new_fluid_cmd_handler() was adapted
- \c fluid_settings_set* functions no longer silently register unknown settings but return an error instead
- reverb: roomsize is now limited to an upper threshold of 1.0 to avoid exponential volume increase
- rename \c fluid_mod_new() and \c fluid_mod_delete() to match naming conventions: new_fluid_mod() and delete_fluid_mod()
- rename chorus getters to match naming conventions: fluid_synth_get_chorus_speed() and fluid_synth_get_chorus_depth()
- fluid_synth_remove_sfont() returns FLUID_OK or FLUID_FAILED
- introduce a separate data type for sequencer client IDs: #fluid_seq_id_t
- fluid_get_userconf() has been implemented for Windows
<strong>New Features and API additions:</strong>
- add \setting{midi_autoconnect} a setting for automatically connecting fluidsynth to available MIDI input ports
- add \setting{synth_overflow_important} and \setting{synth_overflow_important-channels} settings to take midi channels during overflow calculation into account that are considered to be "important"
- add \setting{synth_dynamic-sample-loading} a setting for enabling on demand sample loading
- add support for polyphonic key pressure events, see fluid_event_key_pressure() and fluid_synth_key_pressure()
- add fluid_synth_add_default_mod() and fluid_synth_remove_default_mod() for manipulating default modulators
- add individual reverb setters: fluid_synth_set_reverb_roomsize(), fluid_synth_set_reverb_damp(), fluid_synth_set_reverb_width(), fluid_synth_set_reverb_level()
- add individual chorus setters: fluid_synth_set_chorus_nr(), fluid_synth_set_chorus_level(), fluid_synth_set_chorus_speed(), fluid_synth_set_chorus_depth(), fluid_synth_set_chorus_type()
- add realtime settings for \setting{synth_reverb_damp} and \setting{synth_chorus_depth} parameters
- add seek support to midi-player, see fluid_player_seek()
- expose functions to manipulate the ladspa effects unit (see ladspa.h)
- add support for text and lyrics midi events, see fluid_midi_event_set_lyrics() and fluid_midi_event_set_text()
- complete rewrite of the soundfont loader API, see sfont.h
- support for 24 bit audio samples, see fluid_sample_set_sound_data()
- expose new_fluid_defsfloader() to support loading soundfonts from memory, see fluid_sfloader_set_callbacks() and <a href="fluidsynth_sfload_mem_8c-example.html">fluidsynth_sfload_mem.c</a>
- remove these structs from the public API and provide proper getter and setter functions instead:
- struct _fluid_sfloader_t
- struct _fluid_sample_t
- struct _fluid_sfont_t
- struct _fluid_preset_t
- add an additional general-purpose IIR filter, see fluid_synth_set_custom_filter()
- add a custom sinusoidal modulator mapping function, see #FLUID_MOD_SIN
- implement polymono support according to MIDI specs:
- add basic channel support, see fluid_synth_reset_basic_channel(), fluid_synth_set_basic_channel(), fluid_synth_get_basic_channel()
- implement MIDI modes Omni On, Omni Off, Poly, Mono, see #fluid_basic_channel_modes
- implement portamento control, see fluid_synth_set_portamento_mode(), fluid_synth_get_portamento_mode()
- implement legato control, see fluid_synth_set_legato_mode(), fluid_synth_get_legato_mode()
- implement breath control, see fluid_synth_set_breath_mode(), fluid_synth_get_breath_mode()
<strong>API cleanups:</strong>
- the ramsfont has been removed, because it is unmaintained and believed to be unused; please get in touch with the mailing list if you still need it
- remove deprecated fluid_synth_get_channel_info() in favour of fluid_synth_get_program() and fluid_synth_get_channel_preset()
- remove deprecated fluid_settings_getstr()
- remove deprecated fluid_synth_set_midi_router(), instead supply the midi-router instance when creating a command handler with new_fluid_cmd_handler()
- remove deprecated fluid_get_hinstance() and fluid_set_hinstance() (dsound driver now uses the desktop window)
- remove deprecated fluid_synth_create_key_tuning(), use fluid_synth_activate_key_tuning(synth, bank, prog, name, pitch, FALSE) instead
- remove deprecated fluid_synth_create_octave_tuning(), use fluid_synth_activate_octave_tuning(synth, bank, prog, name, pitch, FALSE) instead
- remove deprecated fluid_synth_select_tuning(), use fluid_synth_activate_tuning(synth, chan, bank, prog, FALSE) instead
- remove deprecated fluid_synth_reset_tuning(), use fluid_synth_deactivate_tuning(synth, chan, FALSE) instead
- remove deprecated FLUID_HINT_INTEGER
- remove deprecated fluid_synth_set_gen2() as there doesn't seem to be a use case for absolute generator values
- remove deprecated "synth.parallel-render" setting
- remove obsolete "audio.[out|in]put-channels" settings
- remove unimplemented "synth.dump" setting
- remove fluid_cmd_handler_register() and fluid_cmd_handler_unregister() from public API, as they seem to be unused downstream
- remove misspelled FLUID_SEQ_PITCHWHHELSENS macro
- remove struct _fluid_mod_t from public API, use the getters and setters of mod.h instead
- remove struct _fluid_gen_t, fluid_gen_set_default_values() and enum fluid_gen_flags from public API
- remove macros fluid_sfont_get_id() and fluid_sample_refcount() from public API
- remove FLUID_NUM_MOD macro from public API
- remove the following deprecated enum values from public API:
- GEN_LAST
- LAST_LOG_LEVEL
- FLUID_SEQ_LASTEVENT
- FLUID_MIDI_ROUTER_RULE_COUNT
*/

21
doc/usage/_overview.txt Normal file
View file

@ -0,0 +1,21 @@
/*!
\page UsageGuide Usage Guide
- \subpage CreatingSettings
- \subpage CreatingSynth
- \subpage LoadingSoundfonts
- \subpage CreatingAudioDriver
- \subpage UsingSynth
- \subpage SendingMIDI
- \subpage RealtimeMIDI
- \subpage MIDIPlayer
- \subpage FileRenderer
- \subpage MIDIPlayerMem
- \subpage MIDIRouter
- \subpage Sequencer
- \subpage Shell
- \subpage Multi-channel
- \subpage synth-context
- \subpage Advanced
*/

16
doc/usage/advanced.txt Normal file
View file

@ -0,0 +1,16 @@
/*!
\page Advanced Advanced features
The following features are not yet fully documented. Some information can be
found in the API reference and in the GitHub Wiki.
- Accessing low-level voice parameters
- Reverb settings
- Chorus settings
- Interpolation settings (set_gen, get_gen, NRPN)
- Voice overflow settings
- LADSPA effects unit
- MIDI tunings
*/

View file

@ -0,0 +1,89 @@
/*!
\page CreatingAudioDriver Creating the audio driver
The synthesizer itself does not write any audio to the audio output. This
allows application developers to manage the audio output themselves if they
wish. The next section describes the use of the synthesizer without an audio
driver in more detail.
Creating the audio driver is straightforward: set the
<code>audio.driver</code> settings and create the driver object. Because the
FluidSynth has support for several audio systems, you may want to change
which one you want to use. The list below shows the audio systems that are
currently supported. It displays the name, as used by the fluidsynth library,
and a description.
- jack: JACK Audio Connection Kit (Linux, Mac OS X, Windows)
- alsa: Advanced Linux Sound Architecture (Linux)
- oss: Open Sound System (primarily needed on BSD, rarely also Linux and Unix in general)
- pulseaudio: PulseAudio (Linux, Mac OS X, Windows)
- coreaudio: Apple CoreAudio (Mac OS X)
- dsound: Microsoft DirectSound (Windows)
- portaudio: PortAudio Library (Mac OS 9 & X, Windows, Linux)
- sndman: Apple SoundManager (Mac OS Classic)
- dart: DART sound driver (OS/2)
- opensles: OpenSL ES (Android)
- oboe: Oboe (Android)
- waveout: Microsoft WaveOut, alternative to DirectSound (Windows CE x86,
Windows Mobile 2003 for ARMv5, Windows 98 SE, Windows NT 4.0, Windows XP
and later)
- file: Driver to output audio to a file
- sdl2*: Simple DirectMedia Layer (Linux, Windows, Mac OS X, iOS, Android,
FreeBSD, Haiku, etc.)
- pipewire**: PipeWire (Linux)
The default audio driver depends on the settings with which FluidSynth was
compiled. You can get the default driver with
fluid_settings_getstr_default(). To get the list of available drivers use the
fluid_settings_foreach_option() function. Finally, you can set the driver
with fluid_settings_setstr(). In most cases, the default driver should work
out of the box.
Additional options that define the audio quality and latency are
\setting{audio_sample-format}, \setting{audio_period-size}, and
\setting{audio_periods}. The details are described later.
You create the audio driver with the new_fluid_audio_driver() function. This
function takes the settings and synthesizer object as arguments. For example:
\code
void init()
{
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
/* Set the synthesizer settings, if necessary */
synth = new_fluid_synth(settings);
fluid_settings_setstr(settings, "audio.driver", "jack");
adriver = new_fluid_audio_driver(settings, synth);
}
\endcode
As soon as the audio driver is created, it will start playing. The audio
driver creates a separate thread that uses the synthesizer object to generate
the audio.
There are a number of general audio driver settings. The audio.driver settings
define the audio subsystem that will be used. The \setting{audio_periods} and
\setting{audio_period-size} settings define the latency and robustness against
scheduling delays. There are additional settings for the audio subsystems used.
For a full list of available <strong>audio driver settings</strong>, please
refer to the \setting{audio} documentation.
<strong>*Note:</strong> In order to use sdl2 as audio driver, the application
is responsible for initializing SDL (e.g. with SDL_Init()). This must be done
<strong>before</strong> the first call to <code>new_fluid_settings()</code>!
Also make sure to call SDL_Quit() after all fluidsynth instances have been
destroyed.
<strong>**Note:</strong> In order to use pipeiwre as audio driver, the application
is responsible for initializing PipeWire (e.g. with pw_init()). This must be done
<strong>before</strong> the first call to <code>new_fluid_settings()</code>!
Also make sure to call pw_deinit() after all fluidsynth instances have been
destroyed.
*/

View file

@ -0,0 +1,38 @@
/*!
\page CreatingSettings Creating and changing the settings
Before you can use the synthesizer, you have to create a settings object. The
settings objects is used by many components of the FluidSynth library. It gives
a unified API to set the parameters of the audio drivers, the midi drivers, the
synthesizer, and so forth. A number of default settings are defined by the
current implementation.
All settings have a name that follows the "dotted-name" notation. For example,
\setting{synth_polyphony} refers to the number of voices (polyphony) allocated
by the synthesizer. The settings also have a type. There are currently three
types: strings, numbers (double floats), and integers. You can change the
values of a setting using the fluid_settings_setstr(), fluid_settings_setnum(),
and fluid_settings_setint() functions. For example:
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings = new_fluid_settings();
fluid_settings_setint(settings, "synth.polyphony", 128);
/* ... */
delete_fluid_settings(settings);
return 0;
}
\endcode
The API contains the functions to query the type, the current value, the
default value, the range and the "hints" of a setting. The range is the minimum
and maximum value of the setting. The hints gives additional information about
a setting. For example, whether a string represents a filename. Or whether a
number should be interpreted on a logarithmic scale. Check the settings.h
API documentation for a description of all functions.
*/

View file

@ -0,0 +1,29 @@
/*!
\page CreatingSynth Creating the synthesizer
To create the synthesizer, you pass it the settings object, as in the
following example:
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_synth_t* synth;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
/* Do useful things here */
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
For a full list of available <strong>synthesizer settings</strong>, please
refer to the \setting{synth} documentation.
*/

View file

@ -0,0 +1,60 @@
/*!
\page FileRenderer Fast file renderer for non-realtime MIDI file rendering
Instead of creating an audio driver as described in section \ref MIDIPlayer
one may chose to use the file renderer, which is the fastest way to
synthesize MIDI files.
\code
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_file_renderer_t* renderer;
settings = new_fluid_settings();
// specify the file to store the audio to
// make sure you compiled fluidsynth with libsndfile to get a real wave file
// otherwise this file will only contain raw s16 stereo PCM
fluid_settings_setstr(settings, "audio.file.name", "/path/to/output.wav");
// use number of samples processed as timing source, rather than the system timer
fluid_settings_setstr(settings, "player.timing-source", "sample");
// since this is a non-realtime scenario, there is no need to pin the sample data
fluid_settings_setint(settings, "synth.lock-memory", 0);
synth = new_fluid_synth(settings);
// *** loading of a soundfont omitted ***
player = new_fluid_player(synth);
fluid_player_add(player, "/path/to/midifile.mid");
fluid_player_play(player);
renderer = new_fluid_file_renderer (synth);
while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING)
{
if (fluid_file_renderer_process_block(renderer) != FLUID_OK)
{
break;
}
}
// just for sure: stop the playback explicitly and wait until finished
fluid_player_stop(player);
fluid_player_join(player);
delete_fluid_file_renderer(renderer);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
\endcode
Various output files types are supported, if compiled with libsndfile. Those
can be specified via the \c settings object as well. Refer to the
\setting{audio} documentation for more \c audio.file\.\* options.
*/

View file

@ -0,0 +1,34 @@
/*!
\page LoadingSoundfonts Loading and managing SoundFonts
Before any sound can be produced, the synthesizer needs a SoundFont.
SoundFonts are loaded with the fluid_synth_sfload() function. The function
takes the path to a SoundFont file and a boolean to indicate whether the
presets of the MIDI channels should be updated after the SoundFont is loaded.
When the boolean value is TRUE, all MIDI channel bank and program numbers
will be refreshed, which may cause new instruments to be selected from the
newly loaded SoundFont.
The synthesizer can load any number of SoundFonts. The loaded SoundFonts are
treated as a stack, where each new loaded SoundFont is placed at the top of
the stack. When selecting presets by bank and program numbers, SoundFonts are
searched beginning at the top of the stack. In the case where there are
presets in different SoundFonts with identical bank and program numbers, the
preset from the most recently loaded SoundFont is used. The
fluid_synth_program_select() can be used for unambiguously selecting a preset
or bank offsets could be applied to each SoundFont with
fluid_synth_set_bank_offset(), to try and ensure that each preset has unique
bank and program numbers.
The fluid_synth_sfload() function returns the unique identifier of the loaded
SoundFont, or -1 in case of an error. This identifier is used in subsequent
management functions: fluid_synth_sfunload() removes the SoundFont,
fluid_synth_sfreload() reloads the SoundFont. When a SoundFont is reloaded,
it retains it's ID and position on the SoundFont stack.
Additional API functions are provided to get the number of loaded SoundFonts
and to get a pointer to the SoundFont.
*/

View file

@ -0,0 +1,17 @@
/*!
\page UsingSynth Using the synthesizer without an audio driver
It is possible to use the synthesizer object without creating an audio
driver. This is desirable if the application using FluidSynth manages the
audio output itself. The synthesizer has several API functions that can be
used to obtain the audio output:
fluid_synth_write_s16() fills two buffers (left and right channel) with
samples coded as signed 16 bits (the endian-ness is machine dependent).
fluid_synth_write_float() fills a left and right audio buffer with 32 bits
floating point samples. The function fluid_synth_process() is the generic
interface for synthesizing audio, which is also capable of multi channel
audio output.
*/

55
doc/usage/midi_player.txt Normal file
View file

@ -0,0 +1,55 @@
/*!
\page MIDIPlayer Loading and playing a MIDI file
FluidSynth can be used to play MIDI files, using the MIDI File Player
interface. It follows a high level implementation, though its implementation
is currently incomplete. After initializing the synthesizer, create the
player passing the synth instance to new_fluid_player(). Then, you can add
some SMF file names to the player using fluid_player_add(), and finally call
fluid_player_play() to start the playback. You can check if the player has
finished by calling fluid_player_get_status(), or wait for the player to
terminate using fluid_player_join().
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
int i;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
player = new_fluid_player(synth);
/* process command line arguments */
for (i = 1; i < argc; i++) {
if (fluid_is_soundfont(argv[i])) {
fluid_synth_sfload(synth, argv[1], 1);
}
if (fluid_is_midifile(argv[i])) {
fluid_player_add(player, argv[i]);
}
}
/* start the synthesizer thread */
adriver = new_fluid_audio_driver(settings, synth);
/* play the midi files, if any */
fluid_player_play(player);
/* wait for playback termination */
fluid_player_join(player);
/* cleanup */
delete_fluid_audio_driver(adriver);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
A list of available <strong>MIDI player settings</strong> can be found in the
\setting{player} documentation.
*/

View file

@ -0,0 +1,64 @@
/*!
\page MIDIPlayerMem Playing a MIDI file from memory
FluidSynth can be also play MIDI files directly from a buffer in memory. If
you need to play a file from a stream (such as stdin, a network, or a
high-level file interface), you can load the entire file into a buffer first,
and then use this approach. Use the same technique as above, but rather than
calling fluid_player_add(), load it into memory and call
fluid_player_add_mem() instead. Once you have passed a buffer to
fluid_player_add_mem(), it is copied, so you may use it again or free it
immediately (it is your responsibility to free it if you allocated it).
\code
#include <stdlib.h>
#include <string.h>
#include <fluidsynth.h>
/* An example midi file */
const char MIDIFILE[] = {
0x4d, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06,
0x00, 0x01, 0x00, 0x01, 0x01, 0xe0, 0x4d, 0x54,
0x72, 0x6b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x90,
0x3c, 0x64, 0x87, 0x40, 0x80, 0x3c, 0x7f, 0x00,
0x90, 0x43, 0x64, 0x87, 0x40, 0x80, 0x43, 0x7f,
0x00, 0x90, 0x48, 0x64, 0x87, 0x40, 0x80, 0x48,
0x7f, 0x83, 0x60, 0xff, 0x2f, 0x00
};
int main(int argc, char** argv)
{
int i;
void* buffer;
size_t buffer_len;
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_player_t* player;
fluid_audio_driver_t* adriver;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
player = new_fluid_player(synth);
adriver = new_fluid_audio_driver(settings, synth);
/* process command line arguments */
for (i = 1; i < argc; i++) {
if (fluid_is_soundfont(argv[i])) {
fluid_synth_sfload(synth, argv[1], 1);
}
}
/* queue up the in-memory midi file */
fluid_player_add_mem(player, MIDIFILE, sizeof(MIDIFILE));
/* play the midi file */
fluid_player_play(player);
/* wait for playback termination */
fluid_player_join(player);
/* cleanup */
delete_fluid_audio_driver(adriver);
delete_fluid_player(player);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
*/

76
doc/usage/midi_router.txt Normal file
View file

@ -0,0 +1,76 @@
/*!
\page MIDIRouter Real-time MIDI router
The MIDI router is one more processing layer directly behind the MIDI input.
It processes incoming MIDI events and generates control events for the synth.
It can be used to filter or modify events prior to sending them to the
synthesizer. When created, the MIDI router is transparent and simply passes
all MIDI events. Router "rules" must be added to actually make use of its
capabilities.
Some examples of MIDI router usage:
- Filter messages (Example: Pass sustain pedal CCs only to selected channels)
- Split the keyboard (Example: noteon with notenr < x: to ch 1, >x to ch 2)
- Layer sounds (Example: for each noteon received on ch 1, create a noteon on
ch1, ch2, ch3,...)
- Velocity scaling (Example: for each noteon event, scale the velocity by
1.27)
- Velocity switching (Example: v <= 100: "Angel Choir"; v > 100: "Hell's
Bells")
- Get rid of aftertouch
The MIDI driver API has a clean separation between the midi thread and the
synthesizer. That opens the door to add a midi router module.
MIDI events coming from the MIDI player do not pass through the MIDI router.
\code
#include <fluidsynth.h>
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_synth_t* synth;
fluid_midi_router_t* router;
fluid_midi_router_rule_t* rule;
settings = new_fluid_settings();
synth = new_fluid_synth(settings);
/* Create the MIDI router and pass events to the synthesizer */
router = new_fluid_midi_router (settings, fluid_synth_handle_midi_event, synth);
/* Clear default rules */
fluid_midi_router_clear_rules (router);
/* Add rule to map all notes < MIDI note #60 on any channel to channel 4 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 0, 15, 0.0, 4); /* Map all to channel 4 */
fluid_midi_router_rule_set_param1 (rule, 0, 59, 1.0, 0); /* Match notes < 60 */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
/* Add rule to map all notes >= MIDI note #60 on any channel to channel 5 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 0, 15, 0.0, 5); /* Map all to channel 5 */
fluid_midi_router_rule_set_param1 (rule, 60, 127, 1.0, 0); /* Match notes >= 60 */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
/* Add rule to reverse direction of pitch bender on channel 7 */
rule = new_fluid_midi_router_rule ();
fluid_midi_router_rule_set_chan (rule, 7, 7, 1.0, 0); /* Match channel 7 only */
fluid_midi_router_rule_set_param1 (rule, 0, 16383, -1.0, 16383); /* Reverse pitch bender */
fluid_midi_router_add_rule (router, rule, FLUID_MIDI_ROUTER_RULE_PITCH_BEND);
/* ... Create audio driver, process events, etc ... */
/* cleanup */
delete_fluid_midi_router(router);
delete_fluid_synth(synth);
delete_fluid_settings(settings);
return 0;
}
\endcode
*/

View file

@ -0,0 +1,15 @@
/*!
\page Multi-channel Multi-channel audio rendering
FluidSynth is capable of rendering all audio and all effects from all MIDI
channels to separate stereo buffers. Refer to the documentation of
fluid_synth_process() and review the different use-cases in the example file
for information on how to do that: \ref fluidsynth_process.c
The following chart illustrates how the voices (produced by MIDI NoteOns) are
dispatched or mapped to their dry/effects audio buffers.
\image html fluid_mixer.svg "FluidSynth Mixer Chart"
*/

View file

@ -0,0 +1,46 @@
/*!
\page RealtimeMIDI Creating a real-time MIDI driver
FluidSynth can process real-time MIDI events received from hardware MIDI
ports or other applications. To do so, the client must create a MIDI input
driver. It is a very similar process to the creation of the audio driver: you
initialize some properties in a settings instance and call the
new_fluid_midi_driver() function providing a callback function that will be
invoked when a MIDI event is received. The following MIDI drivers are
currently supported:
- jack: JACK Audio Connection Kit MIDI driver (Linux, Mac OS X)
- oss: Open Sound System raw MIDI (Linux, Unix)
- alsa_raw: ALSA raw MIDI interface (Linux)
- alsa_seq: ALSA sequencer MIDI interface (Linux)
- winmidi: Microsoft Windows MM System (Windows)
- midishare: MIDI Share (Linux, Mac OS X)
- coremidi: Apple CoreMIDI (Mac OS X)
\code
#include <fluidsynth.h>
int handle_midi_event(void* data, fluid_midi_event_t* event)
{
printf("event type: %d\n", fluid_midi_event_get_type(event));
}
int main(int argc, char** argv)
{
fluid_settings_t* settings;
fluid_midi_driver_t* mdriver;
settings = new_fluid_settings();
mdriver = new_fluid_midi_driver(settings, handle_midi_event, NULL);
/* ... */
delete_fluid_midi_driver(mdriver);
return 0;
}
\endcode
There are a number of general MIDI driver settings. The \setting{midi_driver} setting
defines the MIDI subsystem that will be used. There are additional settings
for the MIDI subsystems used. For a full list of available
<strong>midi driver settings</strong>, please refer to the \setting{midi} documentation.
*/

View file

@ -0,0 +1,53 @@
/*!
\page SendingMIDI Sending MIDI events
Once the synthesizer is up and running and a SoundFont is loaded, most people
will want to do something useful with it. Make noise, for example. MIDI
messages can be sent using the fluid_synth_noteon(), fluid_synth_noteoff(),
fluid_synth_cc(), fluid_synth_pitch_bend(), fluid_synth_pitch_wheel_sens(),
and fluid_synth_program_change() functions. For convenience, there's also a
fluid_synth_bank_select() function (the bank select message is normally sent
using a control change message).
The following example show a generic graphical button that plays a note when
clicked:
\code
class SoundButton : public SomeButton
{
public:
SoundButton() : SomeButton() {
if (!_synth) {
initSynth();
}
}
static void initSynth() {
_settings = new_fluid_settings();
_synth = new_fluid_synth(_settings);
_adriver = new_fluid_audio_driver(_settings, _synth);
}
/* ... */
virtual int handleMouseDown(int x, int y) {
/* Play a note on key 60 with velocity 100 on MIDI channel 0 */
fluid_synth_noteon(_synth, 0, 60, 100);
}
virtual int handleMouseUp(int x, int y) {
/* Release the note on key 60 */
fluid_synth_noteoff(_synth, 0, 60);
}
protected:
static fluid_settings_t* _settings;
static fluid_synth_t* _synth;
static fluid_audio_driver_t* _adriver;
};
\endcode
*/

142
doc/usage/sequencer.txt Normal file
View file

@ -0,0 +1,142 @@
/*!
\page Sequencer Using the MIDI sequencer
FluidSynth's sequencer can be used to play MIDI events in a more flexible way
than using the MIDI file player, which expects the events to be stored as
Standard MIDI Files. Using the sequencer, you can provide the events one by
one, with an optional timestamp for scheduling.
The client program should first initialize the sequencer instance using the
function new_fluid_sequencer2(). There is a complementary function
delete_fluid_sequencer() to delete it. After creating the sequencer instance,
the destinations can be registered using
fluid_sequencer_register_fluidsynth() for the synthesizer destination, and
optionally using fluid_sequencer_register_client() for the client destination
providing a suitable callback function. It can be unregistered using
fluid_sequencer_unregister_client(). After the initialization, events can be
sent with fluid_sequencer_send_now() and scheduled to the future with
fluid_sequencer_send_at(). The registration functions return identifiers,
that can be used as destinations of an event using fluid_event_set_dest().
The function fluid_sequencer_get_tick() returns the current playing position.
A program may choose a new timescale in milliseconds using
fluid_sequencer_set_time_scale().
The following example uses the fluidsynth sequencer to implement a sort of
music box. FluidSynth internal clock is used to schedule repetitive sequences
of notes. The next sequence is scheduled on advance before the end of the
current one, using a timer event that triggers a callback function. The
scheduling times are always absolute values, to avoid slippage.
\code
#include "fluidsynth.h"
fluid_synth_t* synth;
fluid_audio_driver_t* adriver;
fluid_sequencer_t* sequencer;
short synthSeqID, mySeqID;
unsigned int now;
unsigned int seqduration;
// prototype
void seq_callback(unsigned int time, fluid_event_t* event, fluid_sequencer_t* seq, void* data);
void createsynth()
{
fluid_settings_t* settings;
settings = new_fluid_settings();
fluid_settings_setint(settings, "synth.reverb.active", 0);
fluid_settings_setint(settings, "synth.chorus.active", 0);
synth = new_fluid_synth(settings);
adriver = new_fluid_audio_driver(settings, synth);
sequencer = new_fluid_sequencer2(0);
// register synth as first destination
synthSeqID = fluid_sequencer_register_fluidsynth(sequencer, synth);
// register myself as second destination
mySeqID = fluid_sequencer_register_client(sequencer, "me", seq_callback, NULL);
// the sequence duration, in ms
seqduration = 1000;
}
void deletesynth()
{
delete_fluid_sequencer(sequencer);
delete_fluid_audio_driver(adriver);
delete_fluid_synth(synth);
}
void loadsoundfont()
{
int fluid_res;
// put your own path here
fluid_res = fluid_synth_sfload(synth, "Inside:VintageDreamsWaves-v2.sf2", 1);
}
void sendnoteon(int chan, short key, unsigned int date)
{
int fluid_res;
fluid_event_t *evt = new_fluid_event();
fluid_event_set_source(evt, -1);
fluid_event_set_dest(evt, synthSeqID);
fluid_event_noteon(evt, chan, key, 127);
fluid_res = fluid_sequencer_send_at(sequencer, evt, date, 1);
delete_fluid_event(evt);
}
void schedule_next_callback()
{
int fluid_res;
// I want to be called back before the end of the next sequence
unsigned int callbackdate = now + seqduration/2;
fluid_event_t *evt = new_fluid_event();
fluid_event_set_source(evt, -1);
fluid_event_set_dest(evt, mySeqID);
fluid_event_timer(evt, NULL);
fluid_res = fluid_sequencer_send_at(sequencer, evt, callbackdate, 1);
delete_fluid_event(evt);
}
void schedule_next_sequence() {
// Called more or less before each sequence start
// the next sequence start date
now = now + seqduration;
// the sequence to play
// the beat : 2 beats per sequence
sendnoteon(0, 60, now + seqduration/2);
sendnoteon(0, 60, now + seqduration);
// melody
sendnoteon(1, 45, now + seqduration/10);
sendnoteon(1, 50, now + 4*seqduration/10);
sendnoteon(1, 55, now + 8*seqduration/10);
// so that we are called back early enough to schedule the next sequence
schedule_next_callback();
}
/* sequencer callback */
void seq_callback(unsigned int time, fluid_event_t* event, fluid_sequencer_t* seq, void* data) {
schedule_next_sequence();
}
int main(void) {
createsynth();
loadsoundfont();
// initialize our absolute date
now = fluid_sequencer_get_tick(sequencer);
schedule_next_sequence();
sleep(100000);
deletesynth();
return 0;
}
\endcode
*/

12
doc/usage/shell.txt Normal file
View file

@ -0,0 +1,12 @@
/*!
\page Shell Shell interface
The shell interface allows you to send simple textual commands to the
synthesizer, to parse a command file, or to read commands from the stdin or
other input streams. To find the list of currently supported commands, type
@c help in the fluidsynth command line shell. For a full list of available
<strong>command line settings</strong>, please refer to the \ref
settings_shell documentation.
*/

View file

@ -0,0 +1,30 @@
/*!
\page synth-context Understanding the "synthesis context"
When reading through the functions exposed via our API, you will often read the
note: "May or may not be called from synthesis context."
The reason for this is that some functions are intentionally not thread-safe.
Or they require to be called from this context to behave correctly.
FluidSynth's rendering engine is implemented by using the "Dispatcher Thread
Pattern". This means that a certain thread @c A which calls one of FluidSynth's
rendering functions, namely
- fluid_synth_process()
- fluid_synth_nwrite_float()
- fluid_synth_write_float()
- fluid_synth_write_s16()
automatically becomes the "synthesis thread". The terms "synthesis context" and
"synthesis thread" are equivalent. A few locations in our API provide hooks
that allow you to interfere this "synthesis context". At those locations you
can register your own custom functions that will always be called by thread
@c A. For this use-case, the following functions are of interest:
- new_fluid_audio_driver2()
- fluid_player_set_playback_callback()
- fluid_sequencer_register_client()
*/

View file

@ -6,5 +6,7 @@ includedir=@includedir@
Name: FluidSynth
Description: Software SoundFont synth
Version: @VERSION@
Requires.private: @PC_REQUIRES_PRIV_JOINED@
Libs: -L${libdir} -lfluidsynth
Libs.private: @LIBS_PRIVATE_JOINED@ @LIBS_PRIVATE_WITH_PATH_JOINED@
Cflags: -I${includedir}

View file

@ -8,8 +8,8 @@ Type=notify
NotifyAccess=main
EnvironmentFile=@FLUID_DAEMON_ENV_FILE@
EnvironmentFile=-%h/.config/fluidsynth
ExecStart=@CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT
[Install]
WantedBy=multi-user.target
WantedBy=default.target

View file

@ -1,76 +0,0 @@
%define name @PACKAGE@
%define version @VERSION@
%define release 1
%define prefix /usr
Summary: A real-time software synthesizer based on SoundFont 2 specifications.
Name: %{name}
Version: %{version}
Release: %{release}
Prefix: %{prefix}
Copyright: LGPL
Group: Sound
Source: http://savannah.nongnu.org/download/fluid/stable.pkg/%{version}/fluidsynth-%{version}.tar.gz
URL: http://www.fluidsynth.org/
BuildRoot: /var/tmp/%{name}-%{version}
%description
FluidSynth is a real-time software synthesizer based on the SoundFont
2 specifications. FluidSynth can read MIDI events from MIDI input
devices and render them to audio devices using SoundFont files to
define the instrument sounds. It can also play MIDI files and supports
real time effect control via SoundFont modulators and MIDI
controls. FluidSynth can be interfaced to other programs in different
ways, including linking as a shared library.
%package devel
Summary: Libraries and includes to build FluidSynth into other applications
Group: Development/Libraries
%description devel
FluidSynth is a real-time software synthesizer based on the SoundFont
2 specifications. FluidSynth can read MIDI events from MIDI input
devices and render them to audio devices using SoundFont files to
define the instrument sounds. It can also play MIDI files and supports
real time effect control via SoundFont modulators and MIDI
controls. FluidSynth can be interfaced to other programs in different
ways, including linking as a shared library.
This package contains libraries and includes for building applications
with FluidSynth support.
%prep
%setup
%build
./configure --prefix=%{prefix}
make
%install
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
mkdir -p $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install
%clean
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%{prefix}/bin/fluidsynth
%{prefix}/lib/libfluidsynth.so*
%{prefix}/man/man1/*
%files devel
%defattr(-,root,root)
%doc doc/example.c doc/example.sf2 doc/api doc/html/*
%{prefix}/lib/libfluidsynth.a
%{prefix}/lib/libfluidsynth.la
%{prefix}/lib/pkgconfig/fluidsynth.pc
%{prefix}/include/fluidsynth.h
%{prefix}/include/fluidsynth
%changelog
* Mon Aug 25 2003 Josh Green <jgreen@users.sourceforge.net>
- Created initial fluidsynth.spec.in

View file

@ -43,6 +43,9 @@ extern "C" {
#elif defined(MACOS9)
#define FLUIDSYNTH_API __declspec(export)
#elif defined(__OS2__)
#define FLUIDSYNTH_API __declspec(dllexport)
#elif defined(__GNUC__)
#define FLUIDSYNTH_API __attribute__ ((visibility ("default")))

Some files were not shown because too many files have changed in this diff Show more