From dc24dcd435428c2f4a0b9206dde2840c0e4204b5 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 21 Dec 2021 13:01:42 +0100 Subject: [PATCH 01/12] Deprecate MidiShare driver --- src/drivers/fluid_midishare.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/drivers/fluid_midishare.c b/src/drivers/fluid_midishare.c index 29fe729e..6d01d424 100644 --- a/src/drivers/fluid_midishare.c +++ b/src/drivers/fluid_midishare.c @@ -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) { From 3229899a34e2730829f76eda2092d42579a63240 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 21 Dec 2021 13:01:58 +0100 Subject: [PATCH 02/12] Deprecate OSS driver --- src/drivers/fluid_oss.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/drivers/fluid_oss.c b/src/drivers/fluid_oss.c index 0cd359d5..9f27735d 100644 --- a/src/drivers/fluid_oss.c +++ b/src/drivers/fluid_oss.c @@ -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) { From b7a02644595bea0c48657be326d742325eeeb1ab Mon Sep 17 00:00:00 2001 From: Tom M Date: Sun, 16 Jan 2022 14:33:52 +0100 Subject: [PATCH 03/12] Show a warning when file renderer is use with more than one stereo channel (#1028) Resolves #1026 --- src/bindings/fluid_filerenderer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bindings/fluid_filerenderer.c b/src/bindings/fluid_filerenderer.c index 8c244386..401daadb 100644 --- a/src/bindings/fluid_filerenderer.c +++ b/src/bindings/fluid_filerenderer.c @@ -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; From e3d8b3f2c3a981440b7c0d99949c74740a314968 Mon Sep 17 00:00:00 2001 From: Tom M Date: Sun, 16 Jan 2022 14:35:53 +0100 Subject: [PATCH 04/12] Prevent samples accidentally having their loops disabled (#1018) If a SoundFont sets `loopstart == loopend` and then uses loop-offset-modulators to fix up those loops assigning them with a valid position, the sample was previously switched to unlooped mode erroneously. For the long story, see #1017. --- src/sfloader/fluid_defsfont.c | 31 +++++++++++++++++++++++++++---- src/sfloader/fluid_sfont.c | 19 +++++++++++++------ 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/sfloader/fluid_defsfont.c b/src/sfloader/fluid_defsfont.c index f1539808..3b953493 100644 --- a/src/sfloader/fluid_defsfont.c +++ b/src/sfloader/fluid_defsfont.c @@ -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; } diff --git a/src/sfloader/fluid_sfont.c b/src/sfloader/fluid_sfont.c index 8b4d4f17..26dbac65 100644 --- a/src/sfloader/fluid_sfont.c +++ b/src/sfloader/fluid_sfont.c @@ -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) { From dbd7e728b6204369267a6e27bead8ef320e67cdb Mon Sep 17 00:00:00 2001 From: derselbst Date: Sun, 16 Jan 2022 15:48:31 +0100 Subject: [PATCH 05/12] Bump to 2.2.5 --- CMakeLists.txt | 6 +++--- doc/fluidsynth-v20-devdoc.txt | 6 +++--- doc/fluidsynth.1 | 2 +- src/fluidsynth.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26befb96..93000f71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -38,7 +38,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}\"" ) @@ -53,7 +53,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}" ) diff --git a/doc/fluidsynth-v20-devdoc.txt b/doc/fluidsynth-v20-devdoc.txt index b722b11d..636d8e31 100644 --- a/doc/fluidsynth-v20-devdoc.txt +++ b/doc/fluidsynth-v20-devdoc.txt @@ -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. diff --git a/doc/fluidsynth.1 b/doc/fluidsynth.1 index 272d54da..ad669510 100644 --- a/doc/fluidsynth.1 +++ b/doc/fluidsynth.1 @@ -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: diff --git a/src/fluidsynth.c b/src/fluidsynth.c index 4661cbe0..55d1000f 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -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()); From f4f897d3bf389a225a78b8015613f4af97d68ded Mon Sep 17 00:00:00 2001 From: derselbst Date: Fri, 14 Jan 2022 17:30:54 +0100 Subject: [PATCH 06/12] Update MacCI pipeline from master --- .azure/azure-pipelines-mac.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.azure/azure-pipelines-mac.yml b/.azure/azure-pipelines-mac.yml index 18b87dea..2bf8b007 100644 --- a/.azure/azure-pipelines-mac.yml +++ b/.azure/azure-pipelines-mac.yml @@ -17,12 +17,15 @@ jobs: - job: macOS strategy: matrix: - 10_14: - imageName: 'macOS-10.14' + UnixLibs: + imageName: 'macos-11' + CMakeFlags: '-Denable-framework=0' 10_15: imageName: 'macOS-10.15' + CMakeFlags: '' 11_0: imageName: 'macos-11' + CMakeFlags: '' pool: vmImage: $(imageName) @@ -39,7 +42,7 @@ 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) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. + cmake -Werror=dev -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) $(CMakeFlags) -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. make -j3 displayName: 'Compile fluidsynth' - script: | From bee42dd5cc127ca63a2def010bc16f90785e5e37 Mon Sep 17 00:00:00 2001 From: derselbst Date: Fri, 14 Jan 2022 17:31:13 +0100 Subject: [PATCH 07/12] Call make install in Mac CI pipeline --- .azure/azure-pipelines-mac.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.azure/azure-pipelines-mac.yml b/.azure/azure-pipelines-mac.yml index 2bf8b007..7cb44680 100644 --- a/.azure/azure-pipelines-mac.yml +++ b/.azure/azure-pipelines-mac.yml @@ -42,7 +42,7 @@ 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: | @@ -50,3 +50,15 @@ jobs: cd build || exit -1 make -j3 check || exit -1 displayName: 'Execute Unittests' + - 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' From 8a96ec9c3a8de78a5fcf638e9a1e45f1a9969d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Lo=CC=81pez-Cabanillas?= Date: Fri, 14 Jan 2022 19:56:50 +0100 Subject: [PATCH 08/12] cmake macos frameworks update The framework target needs to know about the headers, so cmake tries to copy the framework files into the bundle. The macro set_source_files_properties() is a modern (cmake >= 3.0) replacement of the general set_property(). --- cmake_admin/DefaultDirs.cmake | 4 ++-- src/CMakeLists.txt | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmake_admin/DefaultDirs.cmake b/cmake_admin/DefaultDirs.cmake index 0110bac7..e1fb668e 100644 --- a/cmake_admin/DefaultDirs.cmake +++ b/cmake_admin/DefaultDirs.cmake @@ -12,12 +12,12 @@ endif ( WIN32 ) mark_as_advanced (DEFAULT_SOUNDFONT) # 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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f3ef86a..565bea04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -303,11 +303,15 @@ endif ( LIBFLUID_CPPFLAGS ) # 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 $ ) +add_library ( libfluidsynth + $ + ${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 From 166f7677672c294daa0ecc5ab832dc69a6584e58 Mon Sep 17 00:00:00 2001 From: derselbst Date: Fri, 14 Jan 2022 22:23:05 +0100 Subject: [PATCH 09/12] Add a note about headers and MacOS frameworks --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 565bea04..b4b37f79 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -301,8 +301,10 @@ 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. +# Further note: The headers must be explicitly added here to have CMake install +# them correctly in case of MACOSX_FRAMEWORK add_library ( libfluidsynth $ ${public_main_HEADER} From 634a8b0c04cb7becf93813e2184b55bb8c431813 Mon Sep 17 00:00:00 2001 From: derselbst Date: Fri, 14 Jan 2022 22:33:38 +0100 Subject: [PATCH 10/12] Correctly override MacOS Framework installation prefix --- cmake_admin/DefaultDirs.cmake | 9 +++++++-- src/CMakeLists.txt | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake_admin/DefaultDirs.cmake b/cmake_admin/DefaultDirs.cmake index e1fb668e..b747cbba 100644 --- a/cmake_admin/DefaultDirs.cmake +++ b/cmake_admin/DefaultDirs.cmake @@ -11,15 +11,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 "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 "The install dir for framework bundles") -mark_as_advanced (FRAMEWORK_INSTALL_DIR) +mark_as_advanced (FRAMEWORK_INSTALL_DIR) # BIN_INSTALL_DIR - the directory where executables will be installed set (BIN_INSTALL_DIR "bin" CACHE STRING "The install dir for executables") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b4b37f79..2803ca88 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -406,8 +406,8 @@ target_link_libraries ( fluidsynth if ( MACOSX_FRAMEWORK ) install ( TARGETS fluidsynth libfluidsynth RUNTIME DESTINATION ${BIN_INSTALL_DIR} - 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 From 290ab8402bde486baf10de6b2fb0e363b9436363 Mon Sep 17 00:00:00 2001 From: derselbst Date: Sat, 22 Jan 2022 12:04:43 +0100 Subject: [PATCH 11/12] Extend error logging for SysEx DT1 messages Related to #1035 --- src/synth/fluid_synth.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index fc0d35fc..b6a8c3ee 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -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); From 59fdc3795b55a388cddac631d05b7b0e58c6d85c Mon Sep 17 00:00:00 2001 From: Tom M Date: Sun, 23 Jan 2022 15:33:33 +0100 Subject: [PATCH 12/12] Compile demos during CI builds (#1037) --- .azure/azure-pipelines-mac.yml | 9 +++++++-- .azure/azure-pipelines-vcpkg.yml | 4 ++++ .azure/azure-pipelines-win.yml | 21 +++++++++++++++++++++ .github/workflows/linux.yml | 5 +++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.azure/azure-pipelines-mac.yml b/.azure/azure-pipelines-mac.yml index 7cb44680..5665acef 100644 --- a/.azure/azure-pipelines-mac.yml +++ b/.azure/azure-pipelines-mac.yml @@ -47,9 +47,14 @@ jobs: 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 diff --git a/.azure/azure-pipelines-vcpkg.yml b/.azure/azure-pipelines-vcpkg.yml index 5af3e227..b730d4d5 100644 --- a/.azure/azure-pipelines-vcpkg.yml +++ b/.azure/azure-pipelines-vcpkg.yml @@ -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 diff --git a/.azure/azure-pipelines-win.yml b/.azure/azure-pipelines-win.yml index 5aa74727..dc7b4f16 100644 --- a/.azure/azure-pipelines-win.yml +++ b/.azure/azure-pipelines-win.yml @@ -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 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f9fd4286..9d7fc5fa 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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