Commit graph

1294 commits

Author SHA1 Message Date
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
derselbst
14ab1ec6ab Merge branch '2.1.x' into master 2021-03-13 18:32:41 +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
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
derselbst
9690c0dd73 Merge branch '2.1.x' into master 2021-02-07 13:52:19 +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
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
641605294c Introduce audio.oboe.sample-rate-conversion-quality setting 2021-01-30 19:31:51 +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
derselbst
b84e8b83e0 Merge branch '2.1.x' into master 2021-01-29 14:42:04 +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
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
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
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
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
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
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
derselbst
1be0e5ae7c Log error when audio callback function fails
Addresses #724
2020-12-28 18:08:38 +01:00