Skip to content

Commit dd4f39a

Browse files
committed
updated FluidSynth to 2.4.8
1 parent 4f4b160 commit dd4f39a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2830
-1920
lines changed

thirdparty/fluidsynth/include/fluidsynth/midi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ FLUIDSYNTH_API int fluid_player_get_status(fluid_player_t *player);
283283
FLUIDSYNTH_API int fluid_player_get_current_tick(fluid_player_t *player);
284284
FLUIDSYNTH_API int fluid_player_get_total_ticks(fluid_player_t *player);
285285
FLUIDSYNTH_API int fluid_player_get_bpm(fluid_player_t *player);
286+
FLUIDSYNTH_API int fluid_player_get_division(fluid_player_t *player);
286287
FLUIDSYNTH_API int fluid_player_get_midi_tempo(fluid_player_t *player);
287288
FLUIDSYNTH_API int fluid_player_seek(fluid_player_t *player, int ticks);
288289
/* @} */

thirdparty/fluidsynth/include/fluidsynth/mod.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ enum fluid_mod_flags
5757
FLUID_MOD_SIN = 0x80, /**< Custom non-standard sinus mapping function */
5858
};
5959

60+
/**
61+
* Transform types for the SoundFont2 modulators as defined by SoundFont 2.04 section 8.3.
62+
*/
63+
enum fluid_mod_transforms
64+
{
65+
FLUID_MOD_TRANSFORM_LINEAR = 0, /**< Linear: directly add the computed value to summing node */
66+
FLUID_MOD_TRANSFORM_ABS = 2 /**< Abs: add the absolute value of the computed to summing node */
67+
};
68+
6069
/**
6170
* General controller (if #FLUID_MOD_GC in flags). This
6271
* corresponds to SoundFont 2.04 PDF section 8.2.1
@@ -83,13 +92,15 @@ FLUIDSYNTH_API void fluid_mod_set_source1(fluid_mod_t *mod, int src, int flags);
8392
FLUIDSYNTH_API void fluid_mod_set_source2(fluid_mod_t *mod, int src, int flags);
8493
FLUIDSYNTH_API void fluid_mod_set_dest(fluid_mod_t *mod, int dst);
8594
FLUIDSYNTH_API void fluid_mod_set_amount(fluid_mod_t *mod, double amount);
95+
FLUIDSYNTH_API void fluid_mod_set_transform(fluid_mod_t *mod, int type);
8696

8797
FLUIDSYNTH_API int fluid_mod_get_source1(const fluid_mod_t *mod);
8898
FLUIDSYNTH_API int fluid_mod_get_flags1(const fluid_mod_t *mod);
8999
FLUIDSYNTH_API int fluid_mod_get_source2(const fluid_mod_t *mod);
90100
FLUIDSYNTH_API int fluid_mod_get_flags2(const fluid_mod_t *mod);
91101
FLUIDSYNTH_API int fluid_mod_get_dest(const fluid_mod_t *mod);
92102
FLUIDSYNTH_API double fluid_mod_get_amount(const fluid_mod_t *mod);
103+
FLUIDSYNTH_API int fluid_mod_get_transform(fluid_mod_t *mod);
93104

94105
FLUIDSYNTH_API int fluid_mod_test_identity(const fluid_mod_t *mod1, const fluid_mod_t *mod2);
95106
FLUIDSYNTH_API int fluid_mod_has_source(const fluid_mod_t *mod, int cc, int ctrl);

thirdparty/fluidsynth/include/fluidsynth/types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ typedef struct _fluid_shell_t fluid_shell_t; /**< Command she
5555
typedef struct _fluid_server_t fluid_server_t; /**< TCP/IP shell server instance */
5656
typedef struct _fluid_event_t fluid_event_t; /**< Sequencer event */
5757
typedef struct _fluid_sequencer_t fluid_sequencer_t; /**< Sequencer instance */
58-
typedef struct _fluid_ramsfont_t fluid_ramsfont_t; /**< RAM SoundFont */
59-
typedef struct _fluid_rampreset_t fluid_rampreset_t; /**< RAM SoundFont preset */
6058
typedef struct _fluid_cmd_handler_t fluid_cmd_handler_t; /**< Shell Command Handler */
6159
typedef struct _fluid_ladspa_fx_t fluid_ladspa_fx_t; /**< LADSPA effects instance */
6260
typedef struct _fluid_file_callbacks_t fluid_file_callbacks_t; /**< Callback struct to perform custom file loading of soundfonts */

thirdparty/fluidsynth/include/fluidsynth/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ extern "C" {
3131
*
3232
* @{
3333
*/
34-
#define FLUIDSYNTH_VERSION "2.2.8" /**< String constant of libfluidsynth version. */
34+
#define FLUIDSYNTH_VERSION "2.4.8" /**< String constant of libfluidsynth version. */
3535
#define FLUIDSYNTH_VERSION_MAJOR 2 /**< libfluidsynth major version integer constant. */
36-
#define FLUIDSYNTH_VERSION_MINOR 2 /**< libfluidsynth minor version integer constant. */
36+
#define FLUIDSYNTH_VERSION_MINOR 4 /**< libfluidsynth minor version integer constant. */
3737
#define FLUIDSYNTH_VERSION_MICRO 8 /**< libfluidsynth micro version integer constant. */
3838

3939
FLUIDSYNTH_API void fluid_version(int *major, int *minor, int *micro);

thirdparty/fluidsynth/src/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FluidSynth - A Software Synthesizer
22
#
3-
# Copyright (C) 2003-2010 Peter Hanappe and others.
3+
# Copyright (C) 2003-2025 Peter Hanappe and others.
44
#
55
# This library is free software; you can redistribute it and/or
66
# modify it under the terms of the GNU Lesser General Public License
@@ -55,11 +55,12 @@ set ( fluidsynth_SOURCES
5555
rvoice/fluid_chorus.h
5656
rvoice/fluid_iir_filter.c
5757
rvoice/fluid_iir_filter.h
58+
rvoice/fluid_iir_filter_impl.cpp
5859
rvoice/fluid_lfo.c
5960
rvoice/fluid_lfo.h
6061
rvoice/fluid_rvoice.h
6162
rvoice/fluid_rvoice.c
62-
rvoice/fluid_rvoice_dsp.c
63+
rvoice/fluid_rvoice_dsp.cpp
6364
rvoice/fluid_rvoice_event.h
6465
rvoice/fluid_rvoice_event.c
6566
rvoice/fluid_rvoice_mixer.h

thirdparty/fluidsynth/src/bindings/fluid_filerenderer.c

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,43 @@ new_fluid_file_renderer(fluid_synth_t *synth)
288288
FLUID_LOG(FLUID_ERR, "Invalid or unsupported audio file format settings");
289289
goto error_recovery;
290290
}
291-
291+
292+
#if defined( _WIN32 ) && defined( _UNICODE )
293+
if (0 == FLUID_STRCMP("-", filename))
294+
{
295+
dev->sndfile = sf_open(filename, SFM_WRITE, &info);
296+
}
297+
else
298+
{
299+
int u16_count;
300+
LPWSTR wc_filename;
301+
dev->sndfile = NULL;
302+
303+
// utf-8 filename to utf-16 wc_filename
304+
if (1 > (u16_count = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename, -1, NULL, 0)))
305+
{
306+
FLUID_LOG(FLUID_ERR, "Failed to convert UTF8 string to wide char string");
307+
}
308+
else if (NULL == (wc_filename = (LPWSTR)FLUID_ARRAY(WCHAR, u16_count)))
309+
{
310+
FLUID_LOG(FLUID_ERR, "Out of memory");
311+
}
312+
else
313+
{
314+
if (u16_count != MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename, -1, wc_filename, u16_count))
315+
{
316+
FLUID_LOG(FLUID_ERR, "Failed to convert UTF8 string to wide char string");
317+
}
318+
else
319+
{
320+
dev->sndfile = sf_wchar_open(wc_filename, SFM_WRITE, &info);
321+
}
322+
FLUID_FREE(wc_filename);
323+
}
324+
}
325+
#else
292326
dev->sndfile = sf_open(filename, SFM_WRITE, &info);
293-
327+
#endif
294328
if(!dev->sndfile)
295329
{
296330
FLUID_LOG(FLUID_ERR, "Failed to open audio file '%s' for writing", filename);

thirdparty/fluidsynth/src/drivers/fluid_adriver.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ static const fluid_audriver_definition_t fluid_audio_drivers[] =
170170
},
171171
#endif
172172

173+
#if KAI_SUPPORT
174+
{
175+
"kai",
176+
new_fluid_kai_audio_driver,
177+
NULL,
178+
delete_fluid_kai_audio_driver,
179+
fluid_kai_audio_driver_settings
180+
},
181+
#endif
182+
173183
#if DART_SUPPORT
174184
{
175185
"dart",
@@ -180,6 +190,16 @@ static const fluid_audriver_definition_t fluid_audio_drivers[] =
180190
},
181191
#endif
182192

193+
#if SDL3_SUPPORT
194+
{
195+
"sdl3",
196+
new_fluid_sdl3_audio_driver,
197+
NULL,
198+
delete_fluid_sdl3_audio_driver,
199+
fluid_sdl3_audio_driver_settings
200+
},
201+
#endif
202+
183203
#if SDL2_SUPPORT
184204
{
185205
"sdl2",
@@ -220,7 +240,7 @@ void fluid_audio_driver_settings(fluid_settings_t *settings)
220240
fluid_settings_add_option(settings, "audio.sample-format", "16bits");
221241
fluid_settings_add_option(settings, "audio.sample-format", "float");
222242

223-
#if defined(WIN32)
243+
#if defined(_WIN32)
224244
fluid_settings_register_int(settings, "audio.period-size", 512, 64, 8192, 0);
225245
fluid_settings_register_int(settings, "audio.periods", 8, 2, 64, 0);
226246
#elif defined(MACOS9)
@@ -446,7 +466,7 @@ delete_fluid_audio_driver(fluid_audio_driver_t *driver)
446466
*
447467
* @warning This function may only be called if no thread is residing in fluidsynth's API and no instances of any kind
448468
* are alive (e.g. as it would be the case right after fluidsynth's initial creation). Else the behaviour is undefined.
449-
* Furtermore any attempt of using audio drivers that have not been registered is undefined behaviour!
469+
* Furthermore any attempt of using audio drivers that have not been registered is undefined behaviour!
450470
*
451471
* @note This function is not thread safe and will never be!
452472
*

thirdparty/fluidsynth/src/drivers/fluid_adriver.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ fluid_audio_driver_t *new_fluid_sndmgr_audio_driver2(fluid_settings_t *settings,
159159
void delete_fluid_sndmgr_audio_driver(fluid_audio_driver_t *p);
160160
#endif
161161

162+
#if KAI_SUPPORT
163+
fluid_audio_driver_t *new_fluid_kai_audio_driver(fluid_settings_t *settings,
164+
fluid_synth_t *synth);
165+
void delete_fluid_kai_audio_driver(fluid_audio_driver_t *p);
166+
void fluid_kai_audio_driver_settings(fluid_settings_t *settings);
167+
#endif
168+
162169
#if DART_SUPPORT
163170
fluid_audio_driver_t *new_fluid_dart_audio_driver(fluid_settings_t *settings,
164171
fluid_synth_t *synth);
@@ -173,6 +180,13 @@ void delete_fluid_sdl2_audio_driver(fluid_audio_driver_t *p);
173180
void fluid_sdl2_audio_driver_settings(fluid_settings_t *settings);
174181
#endif
175182

183+
#if SDL3_SUPPORT
184+
fluid_audio_driver_t *new_fluid_sdl3_audio_driver(fluid_settings_t *settings,
185+
fluid_synth_t *synth);
186+
void delete_fluid_sdl3_audio_driver(fluid_audio_driver_t *p);
187+
void fluid_sdl3_audio_driver_settings(fluid_settings_t *settings);
188+
#endif
189+
176190
#if AUFILE_SUPPORT
177191
fluid_audio_driver_t *new_fluid_file_audio_driver(fluid_settings_t *settings,
178192
fluid_synth_t *synth);

thirdparty/fluidsynth/src/gentables/CMakeLists.txt

Lines changed: 0 additions & 36 deletions
This file was deleted.

thirdparty/fluidsynth/src/gentables/gen_conv.c

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)