summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-04-19 15:25:47 +0200
committerRobin Gareus <robin@gareus.org>2019-04-19 15:44:14 +0200
commit1f982b532d17fea9126f2e62e84874e9c5598da5 (patch)
tree8f4758bed1aa7400c465a3cf1a999684bcd59a6f
parentbcd33a23814d9b86b09ebe930cc201f395b486fb (diff)
Update Fluidsynth to v2.0.5
-rw-r--r--libs/fluidsynth/README2
-rw-r--r--libs/fluidsynth/src/fluid_defsfont.c15
-rw-r--r--libs/fluidsynth/src/fluid_midi.c16
-rw-r--r--libs/fluidsynth/src/fluid_sffile.c8
-rw-r--r--libs/fluidsynth/src/fluid_sfont.c22
-rw-r--r--libs/fluidsynth/src/fluid_synth.c18
-rw-r--r--libs/fluidsynth/src/fluid_synth.h7
-rw-r--r--libs/fluidsynth/src/fluid_sys.c45
-rw-r--r--libs/fluidsynth/src/fluid_sys.h4
-rw-r--r--libs/fluidsynth/src/fluidsynth_priv.h2
-rw-r--r--tools/fluid-patches/ardour_fluidsynth.diff38
-rw-r--r--tools/fluid-patches/fluid_conv_tables.c2
-rwxr-xr-xtools/update_fluidsynth.sh5
13 files changed, 110 insertions, 74 deletions
diff --git a/libs/fluidsynth/README b/libs/fluidsynth/README
index 754d0e9117..07af555a29 100644
--- a/libs/fluidsynth/README
+++ b/libs/fluidsynth/README
@@ -1,7 +1,7 @@
This is a stripped down version of fluidsynth (library only)
from git://github.com/FluidSynth/fluidsynth.git
-rev. v2.0.4-32-g5f8fa6f5
+rev. v2.0.5-46-gc9a670d5
fluidsynth is licensed in terms of the LGPL-2+, see individual source
files for (C) holders.
diff --git a/libs/fluidsynth/src/fluid_defsfont.c b/libs/fluidsynth/src/fluid_defsfont.c
index ae8a9fb2da..8c0fd5ed98 100644
--- a/libs/fluidsynth/src/fluid_defsfont.c
+++ b/libs/fluidsynth/src/fluid_defsfont.c
@@ -246,7 +246,18 @@ int delete_fluid_defsfont(fluid_defsfont_t *defsfont)
for(list = defsfont->sample; list; list = fluid_list_next(list))
{
- delete_fluid_sample((fluid_sample_t *) fluid_list_get(list));
+ sample = (fluid_sample_t *) fluid_list_get(list);
+
+ /* If the sample data pointer is different to the sampledata chunk of
+ * the soundfont, then the sample has been loaded individually (SF3)
+ * and needs to be unloaded explicitly. This is safe even if using
+ * dynamic sample loading, as the sample_unload mechanism sets
+ * sample->data to NULL after unload. */
+ if ((sample->data != NULL) && (sample->data != defsfont->sampledata))
+ {
+ fluid_samplecache_unload(sample->data);
+ }
+ delete_fluid_sample(sample);
}
if(defsfont->sample)
@@ -425,7 +436,7 @@ int fluid_defsfont_load(fluid_defsfont_t *defsfont, const fluid_file_callbacks_t
if(sfdata == NULL)
{
- FLUID_LOG(FLUID_ERR, "Couldn't load soundfont file");
+ /* error message already printed */
return FLUID_FAILED;
}
diff --git a/libs/fluidsynth/src/fluid_midi.c b/libs/fluidsynth/src/fluid_midi.c
index 73551a6d8c..5b2efe0b9b 100644
--- a/libs/fluidsynth/src/fluid_midi.c
+++ b/libs/fluidsynth/src/fluid_midi.c
@@ -99,13 +99,7 @@ int fluid_is_midifile(const char *filename)
do
{
- if(!fluid_file_test(filename, G_FILE_TEST_IS_REGULAR))
- {
- return retcode;
- }
-
- // file seems to exist and is a regular file or a symlink to such
- if((fp = FLUID_FOPEN(filename, "rb")) == NULL)
+ if((fp = fluid_file_open(filename, NULL)) == NULL)
{
return retcode;
}
@@ -1677,7 +1671,7 @@ new_fluid_player(fluid_synth_t *synth)
player->currentfile = NULL;
player->division = 0;
player->send_program_change = 1;
- player->miditempo = 480000;
+ player->miditempo = 500000;
player->deltatime = 4.0;
player->cur_msec = 0;
player->cur_ticks = 0;
@@ -1761,7 +1755,7 @@ fluid_player_reset(fluid_player_t *player)
player->ntracks = 0;
player->division = 0;
player->send_program_change = 1;
- player->miditempo = 480000;
+ player->miditempo = 500000;
player->deltatime = 4.0;
return 0;
}
@@ -1892,14 +1886,14 @@ fluid_player_load(fluid_player_t *player, fluid_playlist_item *item)
buffer = fluid_file_read_full(fp, &buffer_length);
+ FLUID_FCLOSE(fp);
+
if(buffer == NULL)
{
- FLUID_FCLOSE(fp);
return FLUID_FAILED;
}
buffer_owned = 1;
- FLUID_FCLOSE(fp);
}
else
{
diff --git a/libs/fluidsynth/src/fluid_sffile.c b/libs/fluidsynth/src/fluid_sffile.c
index b5a641b63d..5fa34297aa 100644
--- a/libs/fluidsynth/src/fluid_sffile.c
+++ b/libs/fluidsynth/src/fluid_sffile.c
@@ -340,13 +340,7 @@ int fluid_is_soundfont(const char *filename)
do
{
- if(!fluid_file_test(filename, G_FILE_TEST_IS_REGULAR))
- {
- return retcode;
- }
-
- // file seems to exist and is a regular file or a symlink to such
- if((fp = FLUID_FOPEN(filename, "rb")) == NULL)
+ if((fp = fluid_file_open(filename, NULL)) == NULL)
{
return retcode;
}
diff --git a/libs/fluidsynth/src/fluid_sfont.c b/libs/fluidsynth/src/fluid_sfont.c
index d0ce264d0c..04dd001768 100644
--- a/libs/fluidsynth/src/fluid_sfont.c
+++ b/libs/fluidsynth/src/fluid_sfont.c
@@ -24,26 +24,14 @@
void *default_fopen(const char *path)
{
- FILE* handle;
+ const char* msg;
+ FILE* handle = fluid_file_open(path, &msg);
- if(!fluid_file_test(path, G_FILE_TEST_EXISTS))
+ if(handle == NULL)
{
- FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Unable to load non-existent file. ('%s')", path);
- return NULL;
- }
-
- if(!fluid_file_test(path, G_FILE_TEST_IS_REGULAR))
- {
- FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Refusing to load non-regular file! ('%s')", path);
- return NULL;
+ FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Failed to open '%s': %s", path, msg);
}
-
- if((handle = FLUID_FOPEN(path, "rb")) == NULL)
- {
- FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Specified file does not exists or insufficient permissions to open it! ('%s')", path);
- return NULL;
- }
-
+
return handle;
}
diff --git a/libs/fluidsynth/src/fluid_synth.c b/libs/fluidsynth/src/fluid_synth.c
index e267720733..83d427fcac 100644
--- a/libs/fluidsynth/src/fluid_synth.c
+++ b/libs/fluidsynth/src/fluid_synth.c
@@ -1235,7 +1235,7 @@ fluid_synth_noteoff_LOCAL(fluid_synth_t *synth, int chan, int key)
{
/* channel is poly and legato CC is Off) */
/* removes the note from the monophonic list */
- if(key == fluid_channel_last_note(channel))
+ if(channel->n_notes && key == fluid_channel_last_note(channel))
{
fluid_channel_clear_monolist(channel);
}
@@ -3639,12 +3639,19 @@ int
fluid_synth_process(fluid_synth_t *synth, int len, int nfx, float *fx[],
int nout, float *out[])
{
+ return fluid_synth_process_LOCAL(synth, len, nfx, fx, nout, out, fluid_synth_render_blocks);
+}
+
+int
+fluid_synth_process_LOCAL(fluid_synth_t *synth, int len, int nfx, float *fx[],
+ int nout, float *out[], int (*block_render_func)(fluid_synth_t *, int))
+{
fluid_real_t *left_in, *fx_left_in;
fluid_real_t *right_in, *fx_right_in;
int nfxchan, nfxunits, naudchan;
double time = fluid_utime();
- int i, f, num, count;
+ int i, f, num, count, buffered_blocks;
float cpu_load;
@@ -3668,9 +3675,10 @@ fluid_synth_process(fluid_synth_t *synth, int len, int nfx, float *fx[],
count = 0;
num = synth->cur;
- if(synth->cur < FLUID_BUFSIZE)
+ buffered_blocks = (synth->cur + FLUID_BUFSIZE - 1) / FLUID_BUFSIZE;
+ if(synth->cur < buffered_blocks * FLUID_BUFSIZE)
{
- int available = FLUID_BUFSIZE - synth->cur;
+ int available = (buffered_blocks * FLUID_BUFSIZE) - synth->cur;
num = (available > len) ? len : available;
if(nout != 0)
@@ -3712,7 +3720,7 @@ fluid_synth_process(fluid_synth_t *synth, int len, int nfx, float *fx[],
while(count < len)
{
int blocksleft = (len - count + FLUID_BUFSIZE - 1) / FLUID_BUFSIZE;
- int blockcount = fluid_synth_render_blocks(synth, blocksleft);
+ int blockcount = block_render_func(synth, blocksleft);
num = (blockcount * FLUID_BUFSIZE > len - count) ? len - count : blockcount * FLUID_BUFSIZE;
diff --git a/libs/fluidsynth/src/fluid_synth.h b/libs/fluidsynth/src/fluid_synth.h
index 9615cb1b53..2b35f1fcb0 100644
--- a/libs/fluidsynth/src/fluid_synth.h
+++ b/libs/fluidsynth/src/fluid_synth.h
@@ -209,6 +209,13 @@ void delete_fluid_sample_timer(fluid_synth_t *synth, fluid_sample_timer_t *timer
void fluid_synth_process_event_queue(fluid_synth_t *synth);
+int fluid_synth_set_gen2(fluid_synth_t *synth, int chan,
+ int param, float value,
+ int absolute, int normalized);
+
+int
+fluid_synth_process_LOCAL(fluid_synth_t *synth, int len, int nfx, float *fx[],
+ int nout, float *out[], int (*block_render_func)(fluid_synth_t *, int));
/*
* misc
*/
diff --git a/libs/fluidsynth/src/fluid_sys.c b/libs/fluidsynth/src/fluid_sys.c
index bcb86bac21..22694f21c5 100644
--- a/libs/fluidsynth/src/fluid_sys.c
+++ b/libs/fluidsynth/src/fluid_sys.c
@@ -934,7 +934,7 @@ fluid_thread_t *
new_fluid_thread(const char *name, fluid_thread_func_t func, void *data, int prio_level, int detach)
{
GThread *thread;
- fluid_thread_info_t *info;
+ fluid_thread_info_t *info = NULL;
GError *err = NULL;
g_return_val_if_fail(func != NULL, NULL);
@@ -971,25 +971,21 @@ new_fluid_thread(const char *name, fluid_thread_func_t func, void *data, int pri
#endif
}
-#if NEW_GLIB_THREAD_API
else
{
+#if NEW_GLIB_THREAD_API
thread = g_thread_try_new(name, (GThreadFunc)func, data, &err);
- }
-
#else
- else
- {
thread = g_thread_create((GThreadFunc)func, data, detach == FALSE, &err);
- }
-
#endif
+ }
if(!thread)
{
FLUID_LOG(FLUID_ERR, "Failed to create the thread: %s",
fluid_gerror_message(err));
g_clear_error(&err);
+ FLUID_FREE(info);
return NULL;
}
@@ -1603,3 +1599,36 @@ void delete_fluid_server_socket(fluid_server_socket_t *server_socket)
}
#endif // NETWORK_SUPPORT
+
+FILE* fluid_file_open(const char* path, const char** errMsg)
+{
+ static const char ErrExist[] = "File does not exist.";
+ static const char ErrRegular[] = "File is not regular, refusing to open it.";
+ static const char ErrNull[] = "File does not exists or insufficient permissions to open it.";
+
+ FILE* handle = NULL;
+
+ if(!g_file_test(path, G_FILE_TEST_EXISTS))
+ {
+ if(errMsg != NULL)
+ {
+ *errMsg = ErrExist;
+ }
+ }
+ else if(!g_file_test(path, G_FILE_TEST_IS_REGULAR))
+ {
+ if(errMsg != NULL)
+ {
+ *errMsg = ErrRegular;
+ }
+ }
+ else if((handle = FLUID_FOPEN(path, "rb")) == NULL)
+ {
+ if(errMsg != NULL)
+ {
+ *errMsg = ErrNull;
+ }
+ }
+
+ return handle;
+}
diff --git a/libs/fluidsynth/src/fluid_sys.h b/libs/fluidsynth/src/fluid_sys.h
index e3a6967411..5d82b686dd 100644
--- a/libs/fluidsynth/src/fluid_sys.h
+++ b/libs/fluidsynth/src/fluid_sys.h
@@ -19,7 +19,7 @@
*/
-/**
+/*
* @file fluid_sys.h
*
* This header contains a bunch of (mostly) system and machine
@@ -486,7 +486,7 @@ fluid_ostream_t fluid_socket_get_ostream(fluid_socket_t sock);
typedef GStatBuf fluid_stat_buf_t;
#endif
-#define fluid_file_test g_file_test
+FILE* fluid_file_open(const char* filename, const char** errMsg);
/* Profiling */
#if WITH_PROFILING
diff --git a/libs/fluidsynth/src/fluidsynth_priv.h b/libs/fluidsynth/src/fluidsynth_priv.h
index 7a3ce6d6d1..c8a59908cc 100644
--- a/libs/fluidsynth/src/fluidsynth_priv.h
+++ b/libs/fluidsynth/src/fluidsynth_priv.h
@@ -18,7 +18,7 @@
* 02110-1301, USA
*/
-/**
+/*
* @file fluidsynth_priv.h
*
* lightweight part of fluid_sys.h, containing forward declarations of fluidsynth's private types and private macros
diff --git a/tools/fluid-patches/ardour_fluidsynth.diff b/tools/fluid-patches/ardour_fluidsynth.diff
index 9ed5f38733..7fe7d494e8 100644
--- a/tools/fluid-patches/ardour_fluidsynth.diff
+++ b/tools/fluid-patches/ardour_fluidsynth.diff
@@ -1,5 +1,5 @@
diff --git b/libs/fluidsynth/fluidsynth/synth.h a/libs/fluidsynth/fluidsynth/synth.h
-index 369a2c261..87826809f 100644
+index 369a2c2615..87826809fd 100644
--- b/libs/fluidsynth/fluidsynth/synth.h
+++ a/libs/fluidsynth/fluidsynth/synth.h
@@ -233,7 +233,7 @@ FLUIDSYNTH_API int fluid_synth_tuning_dump(fluid_synth_t *synth, int bank, int p
@@ -31,7 +31,7 @@ index 369a2c261..87826809f 100644
/* API: Poly mono mode */
diff --git b/libs/fluidsynth/fluidsynth/types.h a/libs/fluidsynth/fluidsynth/types.h
-index 47ef18336..5ad29281a 100644
+index 47ef18336a..5ad29281ad 100644
--- b/libs/fluidsynth/fluidsynth/types.h
+++ a/libs/fluidsynth/fluidsynth/types.h
@@ -56,7 +56,9 @@ typedef struct _fluid_sequencer_t fluid_sequencer_t; /**< Sequencer i
@@ -45,7 +45,7 @@ index 47ef18336..5ad29281a 100644
typedef int fluid_istream_t; /**< Input stream descriptor */
diff --git b/libs/fluidsynth/src/fluid_conv.h a/libs/fluidsynth/src/fluid_conv.h
-index 60f441c49..e6455186e 100644
+index 60f441c49f..e6455186eb 100644
--- b/libs/fluidsynth/src/fluid_conv.h
+++ a/libs/fluidsynth/src/fluid_conv.h
@@ -22,7 +22,7 @@
@@ -58,7 +58,7 @@ index 60f441c49..e6455186e 100644
fluid_real_t fluid_ct2hz_real(fluid_real_t cents);
fluid_real_t fluid_ct2hz(fluid_real_t cents);
diff --git b/libs/fluidsynth/src/fluid_hash.c a/libs/fluidsynth/src/fluid_hash.c
-index 946a873bb..79f83a458 100644
+index 946a873bbf..79f83a4583 100644
--- b/libs/fluidsynth/src/fluid_hash.c
+++ a/libs/fluidsynth/src/fluid_hash.c
@@ -991,6 +991,7 @@ fluid_hashtable_remove_all(fluid_hashtable_t *hashtable)
@@ -78,7 +78,7 @@ index 946a873bb..79f83a458 100644
/*
* fluid_hashtable_foreach_remove_or_steal:
diff --git b/libs/fluidsynth/src/fluid_midi.c a/libs/fluidsynth/src/fluid_midi.c
-index 38c2bf6ef..73551a6d8 100644
+index 6e527b1822..5b2efe0b9b 100644
--- b/libs/fluidsynth/src/fluid_midi.c
+++ a/libs/fluidsynth/src/fluid_midi.c
@@ -77,7 +77,7 @@ static int fluid_midi_file_read_tracklen(fluid_midi_file *mf);
@@ -90,7 +90,7 @@ index 38c2bf6ef..73551a6d8 100644
/***************************************************************
*
* MIDIFILE
-@@ -1054,6 +1054,7 @@ fluid_midi_file_get_division(fluid_midi_file *midifile)
+@@ -1048,6 +1048,7 @@ fluid_midi_file_get_division(fluid_midi_file *midifile)
{
return midifile->division;
}
@@ -98,7 +98,7 @@ index 38c2bf6ef..73551a6d8 100644
/******************************************************
*
-@@ -1420,7 +1421,7 @@ static void fluid_midi_event_get_sysex_LOCAL(fluid_midi_event_t *evt, void **dat
+@@ -1414,7 +1415,7 @@ static void fluid_midi_event_get_sysex_LOCAL(fluid_midi_event_t *evt, void **dat
*
* fluid_track_t
*/
@@ -107,13 +107,13 @@ index 38c2bf6ef..73551a6d8 100644
/*
* new_fluid_track
*/
-@@ -2524,3 +2525,4 @@ fluid_midi_event_length(unsigned char event)
+@@ -2518,3 +2519,4 @@ fluid_midi_event_length(unsigned char event)
return 1;
}
+#endif
diff --git b/libs/fluidsynth/src/fluid_mod.c a/libs/fluidsynth/src/fluid_mod.c
-index 84e97731e..5e57455d4 100644
+index 84e97731e5..5e57455d4d 100644
--- b/libs/fluidsynth/src/fluid_mod.c
+++ a/libs/fluidsynth/src/fluid_mod.c
@@ -603,7 +603,7 @@ fluid_mod_check_cc_source(const fluid_mod_t *mod, unsigned char src1_select)
@@ -126,7 +126,7 @@ index 84e97731e..5e57455d4 100644
static const char *invalid_non_cc_src =
"Invalid modulator, using non-CC source %s.src%d=%d";
diff --git b/libs/fluidsynth/src/fluid_mod.h a/libs/fluidsynth/src/fluid_mod.h
-index 3e7661741..ec8e967a3 100644
+index 3e7661741f..ec8e967a35 100644
--- b/libs/fluidsynth/src/fluid_mod.h
+++ a/libs/fluidsynth/src/fluid_mod.h
@@ -44,7 +44,7 @@ struct _fluid_mod_t
@@ -139,7 +139,7 @@ index 3e7661741..ec8e967a3 100644
#ifdef DEBUG
void fluid_dump_modulator(fluid_mod_t *mod);
diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.c a/libs/fluidsynth/src/fluid_rvoice_mixer.c
-index 85c3fb914..5ea08ff6f 100644
+index 85c3fb9142..5ea08ff6fa 100644
--- b/libs/fluidsynth/src/fluid_rvoice_mixer.c
+++ a/libs/fluidsynth/src/fluid_rvoice_mixer.c
@@ -23,7 +23,6 @@
@@ -151,7 +151,7 @@ index 85c3fb914..5ea08ff6f 100644
diff --git b/libs/fluidsynth/src/fluid_rvoice_mixer.h a/libs/fluidsynth/src/fluid_rvoice_mixer.h
-index 4ee072e4b..1b3fceb34 100644
+index 4ee072e4b9..1b3fceb342 100644
--- b/libs/fluidsynth/src/fluid_rvoice_mixer.h
+++ a/libs/fluidsynth/src/fluid_rvoice_mixer.h
@@ -24,7 +24,6 @@
@@ -163,7 +163,7 @@ index 4ee072e4b..1b3fceb34 100644
typedef struct _fluid_rvoice_mixer_t fluid_rvoice_mixer_t;
diff --git b/libs/fluidsynth/src/fluid_settings.c a/libs/fluidsynth/src/fluid_settings.c
-index 5b2b08748..181116984 100644
+index 5b2b08748f..1811169846 100644
--- b/libs/fluidsynth/src/fluid_settings.c
+++ a/libs/fluidsynth/src/fluid_settings.c
@@ -21,9 +21,6 @@
@@ -191,7 +191,7 @@ index 5b2b08748..181116984 100644
static int
diff --git b/libs/fluidsynth/src/fluid_synth.c a/libs/fluidsynth/src/fluid_synth.c
-index 1c7a1f272..e26772073 100644
+index b72d5139ef..83d427fcac 100644
--- b/libs/fluidsynth/src/fluid_synth.c
+++ a/libs/fluidsynth/src/fluid_synth.c
@@ -267,7 +267,7 @@ void fluid_version(int *major, int *minor, int *micro)
@@ -203,7 +203,7 @@ index 1c7a1f272..e26772073 100644
fluid_version_str(void)
{
return FLUIDSYNTH_VERSION;
-@@ -6411,6 +6411,7 @@ int fluid_synth_set_channel_type(fluid_synth_t *synth, int chan, int type)
+@@ -6419,6 +6419,7 @@ int fluid_synth_set_channel_type(fluid_synth_t *synth, int chan, int type)
FLUID_API_RETURN(FLUID_OK);
}
@@ -211,7 +211,7 @@ index 1c7a1f272..e26772073 100644
/**
* Return the LADSPA effects instance used by FluidSynth
*
-@@ -6423,6 +6424,7 @@ fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth)
+@@ -6431,6 +6432,7 @@ fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth)
return synth->ladspa_fx;
}
@@ -220,7 +220,7 @@ index 1c7a1f272..e26772073 100644
/**
* Configure a general-purpose IIR biquad filter.
diff --git b/libs/fluidsynth/src/fluid_synth.h a/libs/fluidsynth/src/fluid_synth.h
-index 46c92ccf6..9615cb1b5 100644
+index f061aeaf38..2b35f1fcb0 100644
--- b/libs/fluidsynth/src/fluid_synth.h
+++ a/libs/fluidsynth/src/fluid_synth.h
@@ -33,8 +33,6 @@
@@ -243,7 +243,7 @@ index 46c92ccf6..9615cb1b5 100644
enum fluid_iir_filter_flags custom_filter_flags; /**< filter type of the user-defined filter currently used for all voices */
};
diff --git b/libs/fluidsynth/src/fluid_sys.c a/libs/fluidsynth/src/fluid_sys.c
-index b85fa3fbf..bcb86bac2 100644
+index 4225583481..22694f21c5 100644
--- b/libs/fluidsynth/src/fluid_sys.c
+++ a/libs/fluidsynth/src/fluid_sys.c
@@ -205,9 +205,10 @@ fluid_log(int level, const char *fmt, ...)
@@ -260,7 +260,7 @@ index b85fa3fbf..bcb86bac2 100644
if(str == NULL || delim == NULL || !*delim)
diff --git b/libs/fluidsynth/src/fluid_sys.h a/libs/fluidsynth/src/fluid_sys.h
-index 9f2d6f6c7..e3a696741 100644
+index 65c088ca3c..5d82b686dd 100644
--- b/libs/fluidsynth/src/fluid_sys.h
+++ a/libs/fluidsynth/src/fluid_sys.h
@@ -128,8 +128,9 @@ typedef guint64 uint64_t;
diff --git a/tools/fluid-patches/fluid_conv_tables.c b/tools/fluid-patches/fluid_conv_tables.c
index bb49e29038..a4fa85b464 100644
--- a/tools/fluid-patches/fluid_conv_tables.c
+++ b/tools/fluid-patches/fluid_conv_tables.c
@@ -1712,7 +1712,7 @@ static const fluid_real_t fluid_cb2amp_tab[1441] = {
2.985382618917960e-03, /* 505 */
2.951209226666387e-03, /* 506 */
2.917427014001166e-03, /* 507 */
- 2.884031503126605e-03, /* 508 */
+ 2.884031503126606e-03, /* 508 */
2.851018267503910e-03, /* 509 */
2.818382931264455e-03, /* 510 */
2.786121168629769e-03, /* 511 */
diff --git a/tools/update_fluidsynth.sh b/tools/update_fluidsynth.sh
index a1bcf8ae83..1fc43f50b0 100755
--- a/tools/update_fluidsynth.sh
+++ b/tools/update_fluidsynth.sh
@@ -108,7 +108,12 @@ rsync -auc --info=progress2 \
"$ASRC/libs/fluidsynth/fluidsynth/"
cd "$ASRC"
+## 1st: apply patch below, fix up any merge-conflicts and git commit the result.
+## 2nd run (after commiting the new version): re-create the patch to upstream & amend:
+# git diff -R libs/fluidsynth/ > tools/fluid-patches/ardour_fluidsynth.diff
+#exit
patch -p1 < tools/fluid-patches/ardour_fluidsynth.diff
+# auto-generated files
cp tools/fluid-patches/fluid_conv_tables.c libs/fluidsynth/src/
cp tools/fluid-patches/fluid_rvoice_dsp_tables.c libs/fluidsynth/src/