Commit graph

2454 commits

Author SHA1 Message Date
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