Merge remote-tracking branch 'origin/2.2.x' into master

This commit is contained in:
derselbst 2022-01-24 14:29:20 +01:00
commit 91515b09c4
16 changed files with 177 additions and 32 deletions

View file

@ -42,11 +42,28 @@ jobs:
set -ex
mkdir build && cd build
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
cmake -Werror=dev -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) $(CMakeFlags) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
cmake -Werror=dev $(CMakeFlags) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
make -j3
displayName: 'Compile fluidsynth'
- script: |
set -ex
cd build || exit -1
make -j3 check || exit -1
cd build
make -j3 check
displayName: 'Execute Unittests'
- script: |
set -ex
cd build
make -j3 demo
displayName: 'Compile demos'
- script: |
set -ex
cd build
sudo make install
rm -f install_manifest.txt
displayName: 'Install fluidsynth to default location'
- script: |
set -ex
cd build
cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) ..
make install
displayName: 'Install fluidsynth to artifact dir'

View file

@ -126,6 +126,10 @@ jobs:
cmake --build build --config $(configuration) --target check --parallel 3
displayName: 'Execute Unittests'
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
- bash: |
set -ex
cmake --build build --config $(configuration) --target demo --parallel 3
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build

View file

@ -73,6 +73,12 @@ jobs:
cd build || exit -1
cmake --build . --config Release --target check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
cd build || exit -1
cmake --build . --config Release --target demo || exit -1
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build
@ -140,6 +146,12 @@ jobs:
cd build || exit -1
cmake --build . --config $(CMAKE_CONFIG) --target check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
cd build || exit -1
cmake --build . --config $(CMAKE_CONFIG) --target demo || exit -1
displayName: 'Compile demos'
- job: WindowsMinGW
variables:
@ -208,6 +220,15 @@ jobs:
cd build || exit -1
mingw32-make.exe -j4 check || exit -1
displayName: 'Execute Unittests'
- script: |
@ECHO ON
SET "PATH=d:\deps\bin;%PATH%"
REM remove that path from PATH to make sure sh.exe is not found (cmake will complain otherwise)
set PATH=%PATH:C:\Program Files\Git\bin;=%
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
cd build || exit -1
mingw32-make.exe -j4 demo || exit -1
displayName: 'Compile demos'
- script: |
@ECHO ON
cd build

View file

@ -93,6 +93,11 @@ jobs:
# Execute tests defined by the CMake configuration.
run: make -j`nproc` check
- name: Demo
working-directory: ${{github.workspace}}/build
shell: bash
run: make -j`nproc` demo
- name: Install
working-directory: ${{github.workspace}}/build
run: make install

View file

@ -1,6 +1,6 @@
# FluidSynth - A Software Synthesizer
#
# Copyright (C) 2003-2021 Peter Hanappe and others.
# Copyright (C) 2003-2022 Peter Hanappe and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
@ -41,7 +41,7 @@ set ( PACKAGE "fluidsynth" )
# FluidSynth package version
set ( FLUIDSYNTH_VERSION_MAJOR 2 )
set ( FLUIDSYNTH_VERSION_MINOR 2 )
set ( FLUIDSYNTH_VERSION_MICRO 4 )
set ( FLUIDSYNTH_VERSION_MICRO 5 )
set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" )
set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
@ -56,7 +56,7 @@ set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
# This is not exactly the same algorithm as the libtool one, but the results are the same.
set ( LIB_VERSION_CURRENT 3 )
set ( LIB_VERSION_AGE 0 )
set ( LIB_VERSION_REVISION 4 )
set ( LIB_VERSION_REVISION 5 )
set ( LIB_VERSION_INFO
"${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )

View file

@ -14,15 +14,20 @@ else ( WIN32 )
endif ( WIN32 )
mark_as_advanced (DEFAULT_SOUNDFONT)
set(FRAMEWORK_INSTALL_PREFIX "")
if ( CMAKE_VERSION VERSION_GREATER "3.7.0" AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set(FRAMEWORK_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
endif()
# BUNDLE_INSTALL_DIR - Mac only: the directory for application bundles
set (BUNDLE_INSTALL_DIR "/Applications" CACHE STRING
set (BUNDLE_INSTALL_DIR "Applications" CACHE STRING
"The install dir for application bundles")
mark_as_advanced (BUNDLE_INSTALL_DIR)
# FRAMEWORK_INSTALL_DIR - Mac only: the directory for framework bundles
set (FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING
set (FRAMEWORK_INSTALL_DIR "Library/Frameworks" CACHE STRING
"The install dir for framework bundles")
mark_as_advanced (FRAMEWORK_INSTALL_DIR)
mark_as_advanced (FRAMEWORK_INSTALL_DIR)
# XDG_APPS_INSTALL_DIR - the XDG apps dir, where .desktop files are installed
set (XDG_APPS_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/applications" CACHE STRING "The XDG apps dir")

View file

@ -7,9 +7,9 @@
\author Josh Green
\author David Henningsson
\author Tom Moebert
\author Copyright © 2003-2021 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.2.4
\date 2021-11-21
\author Copyright © 2003-2022 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.2.5
\date 2022-01-16
All the source code examples in this document are in the public domain; you can use them as you please. This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth library is distributed under the GNU Lesser General Public License. A copy of the GNU Lesser General Public License is contained in the FluidSynth package; if not, visit https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

View file

@ -13,7 +13,7 @@
.\" along with this program; see the file LICENSE. If not, write to
.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.\"
.TH FluidSynth 1 "Jan 1, 2021"
.TH FluidSynth 1 "Jan 1, 2022"
.\" Please update the above date whenever this man page is modified.
.\"
.\" Some roff macros, for reference:

View file

@ -276,13 +276,19 @@ if ( LIBFLUID_CPPFLAGS )
PROPERTIES COMPILE_FLAGS ${LIBFLUID_CPPFLAGS} )
endif ( LIBFLUID_CPPFLAGS )
# note: by default this target creates a shared object (or dll). To build a
# Note: by default this target creates a shared object (or dll). To build a
# static library instead, set the option BUILD_SHARED_LIBS to FALSE.
add_library ( libfluidsynth $<TARGET_OBJECTS:libfluidsynth-OBJ> )
# Further note: The headers must be explicitly added here to have CMake install
# them correctly in case of MACOSX_FRAMEWORK
add_library ( libfluidsynth
$<TARGET_OBJECTS:libfluidsynth-OBJ>
${public_main_HEADER}
${public_HEADERS}
)
if ( MACOSX_FRAMEWORK )
set_property ( SOURCE ${public_HEADERS}
PROPERTY MACOSX_PACKAGE_LOCATION Headers/fluidsynth
set_source_files_properties ( ${public_HEADERS}
PROPERTIES MACOSX_PACKAGE_LOCATION Headers/fluidsynth
)
set_target_properties ( libfluidsynth
PROPERTIES
@ -496,8 +502,8 @@ if ( MACOSX_FRAMEWORK )
install ( TARGETS fluidsynth libfluidsynth
EXPORT FluidSynthTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
ARCHIVE DESTINATION ${FRAMEWORK_INSTALL_DIR}
FRAMEWORK DESTINATION "${FRAMEWORK_INSTALL_PREFIX}/${FRAMEWORK_INSTALL_DIR}"
ARCHIVE DESTINATION "${FRAMEWORK_INSTALL_PREFIX}/${FRAMEWORK_INSTALL_DIR}"
)
else ( MACOSX_FRAMEWORK )
install ( TARGETS fluidsynth libfluidsynth

View file

@ -199,6 +199,7 @@ new_fluid_file_renderer(fluid_synth_t *synth)
double samplerate;
int retval;
#endif
int audio_channels;
char *filename = NULL;
fluid_file_renderer_t *dev;
@ -233,6 +234,7 @@ new_fluid_file_renderer(fluid_synth_t *synth)
}
fluid_settings_dupstr(synth->settings, "audio.file.name", &filename);
fluid_settings_getint(synth->settings, "synth.audio-channels", &audio_channels);
if(filename == NULL)
{
@ -310,6 +312,11 @@ new_fluid_file_renderer(fluid_synth_t *synth)
#endif
if(audio_channels != 1)
{
FLUID_LOG(FLUID_WARN, "The file-renderer currently only supports a single stereo channel. You have provided %d stereo channels. Audio may sound strange or incomplete.", audio_channels);
}
FLUID_FREE(filename);
return dev;

View file

@ -87,6 +87,17 @@ new_fluid_midishare_midi_driver(fluid_settings_t *settings,
fluid_midishare_midi_driver_t *dev;
int i;
FLUID_LOG(FLUID_WARN,
"\n\n"
"================ MidiShare MIDI driver has been deprecated! =================\n"
"You're using the MidiShare driver. This driver is old, unmaintained and believed\n"
"to be unused. If you still need it, pls. let us know by posting to our\n"
"mailing list at fluid-dev@nongnu.org - otherwise this driver might be removed\n"
"in a future release of FluidSynth!\n"
"================ MidiShare MIDI driver has been deprecated! =================\n"
"\n"
);
/* not much use doing anything */
if(handler == NULL)
{

View file

@ -123,6 +123,17 @@ new_fluid_oss_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth)
char *devname = NULL;
int format;
FLUID_LOG(FLUID_WARN,
"\n\n"
"================= OSS audio driver has been deprecated! ==================\n"
"You're using the OSS driver. This driver is old, unmaintained and believed\n"
"to be unused. If you still need it, pls. let us know by posting to our\n"
"mailing list at fluid-dev@nongnu.org - otherwise this driver might be removed\n"
"in a future release of FluidSynth!\n"
"================= OSS audio driver has been deprecated! ==================\n"
"\n"
);
dev = FLUID_NEW(fluid_oss_audio_driver_t);
if(dev == NULL)
@ -296,6 +307,17 @@ new_fluid_oss_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func,
int realtime_prio = 0;
int format;
FLUID_LOG(FLUID_WARN,
"\n\n"
"================= OSS audio driver has been deprecated! ==================\n"
"You're using the OSS driver. This driver is old, unmaintained and believed\n"
"to be unused. If you still need it, pls. let us know by posting to our\n"
"mailing list at fluid-dev@nongnu.org - otherwise this driver might be removed\n"
"in a future release of FluidSynth!\n"
"================= OSS audio driver has been deprecated! ==================\n"
"\n"
);
dev = FLUID_NEW(fluid_oss_audio_driver_t);
if(dev == NULL)
@ -607,6 +629,17 @@ new_fluid_oss_midi_driver(fluid_settings_t *settings,
int realtime_prio = 0;
char *device = NULL;
FLUID_LOG(FLUID_WARN,
"\n\n"
"================= OSS MIDI driver has been deprecated! ==================\n"
"You're using the OSS driver. This driver is old, unmaintained and believed\n"
"to be unused. If you still need it, pls. let us know by posting to our\n"
"mailing list at fluid-dev@nongnu.org - otherwise this driver might be removed\n"
"in a future release of FluidSynth!\n"
"================= OSS MIDI driver has been deprecated! ==================\n"
"\n"
);
/* not much use doing anything */
if(handler == NULL)
{

View file

@ -1213,7 +1213,7 @@ void
print_welcome()
{
printf("FluidSynth runtime version %s\n"
"Copyright (C) 2000-2021 Peter Hanappe and others.\n"
"Copyright (C) 2000-2022 Peter Hanappe and others.\n"
"Distributed under the LGPL license.\n"
"SoundFont(R) is a registered trademark of Creative Technology Ltd.\n\n",
fluid_version_str());

View file

@ -376,6 +376,7 @@ int fluid_defsfont_load_all_sampledata(fluid_defsfont_t *defsfont, SFData *sfdat
fluid_sample_t *sample;
int sf3_file = (sfdata->version.major == 3);
int sample_parsing_result = FLUID_OK;
int invalid_loops_were_sanitized = FALSE;
/* For SF2 files, we load the sample data in one large block */
if(!sf3_file)
@ -404,7 +405,7 @@ int fluid_defsfont_load_all_sampledata(fluid_defsfont_t *defsfont, SFData *sfdat
{
/* SF3 samples get loaded individually, as most (or all) of them are in Ogg Vorbis format
* anyway */
#pragma omp task firstprivate(sample,sfdata,defsfont) shared(sample_parsing_result) default(none)
#pragma omp task firstprivate(sample,sfdata,defsfont) shared(sample_parsing_result, invalid_loops_were_sanitized) default(none)
{
if(fluid_defsfont_load_sampledata(defsfont, sfdata, sample) == FLUID_FAILED)
{
@ -416,24 +417,46 @@ int fluid_defsfont_load_all_sampledata(fluid_defsfont_t *defsfont, SFData *sfdat
}
else
{
fluid_sample_sanitize_loop(sample, (sample->end + 1) * sizeof(short));
int modified = fluid_sample_sanitize_loop(sample, (sample->end + 1) * sizeof(short));
if(modified)
{
#pragma omp critical
{
invalid_loops_were_sanitized = TRUE;
}
}
fluid_voice_optimize_sample(sample);
}
}
}
else
{
#pragma omp task firstprivate(sample, defsfont) default(none)
#pragma omp task firstprivate(sample, defsfont) shared(invalid_loops_were_sanitized) default(none)
{
int modified;
/* Data pointers of SF2 samples point to large sample data block loaded above */
sample->data = defsfont->sampledata;
sample->data24 = defsfont->sample24data;
fluid_sample_sanitize_loop(sample, defsfont->samplesize);
modified = fluid_sample_sanitize_loop(sample, defsfont->samplesize);
if(modified)
{
#pragma omp critical
{
invalid_loops_were_sanitized = TRUE;
}
}
fluid_voice_optimize_sample(sample);
}
}
}
if(invalid_loops_were_sanitized)
{
FLUID_LOG(FLUID_WARN,
"Some invalid sample loops were sanitized! If you experience audible glitches, "
"start fluidsynth in verbose mode for detailed information.");
}
return sample_parsing_result;
}

View file

@ -789,12 +789,19 @@ int fluid_sample_sanitize_loop(fluid_sample_t *sample, unsigned int buffer_size)
if(sample->loopstart == sample->loopend)
{
/* Some SoundFonts disable loops by setting loopstart = loopend. While
* technically invalid, we decided to accept those samples anyway. Just
* ensure that those two pointers are within the sampledata by setting
* them to 0. Don't report the modification, as this change has no audible
* effect. */
sample->loopstart = sample->loopend = 0;
return FALSE;
* technically invalid, we decided to accept those samples anyway.
* Before fluidsynth 2.2.5 we've set those indices to zero, as this
* change was believed to be inaudible. This turned out to be an
* incorrect assumption, as the loop points may still be modified by
* loop offset modulators afterwards.
*/
if(sample->loopstart != sample->start)
{
// Many soundfonts set loopstart == loopend == sample->start to disabled to loop.
// Only report cases where it's not equal to the sample->start, to avoid spam.
FLUID_LOG(FLUID_DBG, "Sample '%s': zero length loop detected: loopstart == loopend == '%d', sample start '%d', using it anyway",
sample->name, sample->loopstart, sample->start);
}
}
else if(sample->loopstart > sample->loopend)
{

View file

@ -2371,6 +2371,7 @@ fluid_synth_sysex_gs_dt1(fluid_synth_t *synth, const char *data, int len,
if(len < 9) // at least one byte of data should be transmitted
{
FLUID_LOG(FLUID_INFO, "SysEx DT1: message too short, dropping it.");
return FLUID_FAILED;
}
len_data = len - 8;
@ -2380,8 +2381,10 @@ fluid_synth_sysex_gs_dt1(fluid_synth_t *synth, const char *data, int len,
{
checksum += data[i];
}
if (0x80 - (checksum & 0x7F) != data[len - 1])
checksum = 0x80 - (checksum & 0x7F);
if (checksum != data[len - 1])
{
FLUID_LOG(FLUID_INFO, "SysEx DT1: dropping message on addr 0x%x due to incorrect checksum 0x%x. Correct checksum: 0x%x", addr, (int)data[len - 1], checksum);
return FLUID_FAILED;
}
@ -2389,6 +2392,7 @@ fluid_synth_sysex_gs_dt1(fluid_synth_t *synth, const char *data, int len,
{
if (len_data > 1 || (data[7] != 0 && data[7] != 0x7f))
{
FLUID_LOG(FLUID_INFO, "SysEx DT1: dropping invalid mode set message");
return FLUID_FAILED;
}
if (handled)
@ -2419,6 +2423,7 @@ fluid_synth_sysex_gs_dt1(fluid_synth_t *synth, const char *data, int len,
{
if (len_data > 1 || data[7] > 0x02)
{
FLUID_LOG(FLUID_INFO, "SysEx DT1: dropping invalid rhythm part message");
return FLUID_FAILED;
}
if (handled)
@ -2433,6 +2438,7 @@ fluid_synth_sysex_gs_dt1(fluid_synth_t *synth, const char *data, int len,
synth->channel[chan]->channel_type =
data[7] == 0x00 ? CHANNEL_TYPE_MELODIC : CHANNEL_TYPE_DRUM;
FLUID_LOG(FLUID_DBG, "SysEx DT1: setting MIDI channel %d to type %d", chan, (int)synth->channel[chan]->channel_type);
//Roland synths seem to "remember" the last instrument a channel
//used in the selected mode. This behavior is not replicated here.
fluid_synth_program_change(synth, chan, 0);