Commit graph

1401 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Bill Peterson
a3dd7fddcb
Rewind playlist if calling fluid_player_play after all loops complete (#994) 2021-10-30 15:01:58 +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
Yu Qing
7ef8652326
fix windows related encoding problems (#984) 2021-10-03 12:15:57 +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
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
Pedro López-Cabanillas
6a0d838f33 Fixed OpenMP detection and building, better PkgConfigHelpers.cmake 2021-09-11 18:09:52 +02:00
Pedro López-Cabanillas
b23dc4e961 fixed compilation of CLI client 2021-09-05 22:37:25 +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
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
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
Tom M
c1e286629f
Fix NULL deref in delete_fluid_ladspa_effect() (#963) 2021-08-23 20:04:44 +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
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
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
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
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
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
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
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
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
Paul
768fa225db
fix typo (#902) 2021-05-30 23:04:40 +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
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
8446023255
Add more test cases for UTF8 filenames (#889) 2021-05-12 17:41:55 +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
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
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
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
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
derselbst
d2754028b4 Merge branch 'master' into refactor-and-fix-sffile-defsfont 2021-04-10 16:30:05 +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
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
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
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