Skip to content

Commit

Permalink
Import fluidsynth v2.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
komh committed Apr 23, 2024
1 parent 4c8d4ef commit 0bbb2b4
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ task:
name: FreeBSD
freebsd_instance:
matrix:
image_family: freebsd-14-0
image_family: freebsd-13-2
image_family: freebsd-12-4

install_script: pwd && ls -la && pkg update --force && pkg install -y cmake glib alsa-lib ladspa portaudio pulseaudio pkgconf sdl2

Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set ( PACKAGE "fluidsynth" )
# FluidSynth package version
set ( FLUIDSYNTH_VERSION_MAJOR 2 )
set ( FLUIDSYNTH_VERSION_MINOR 3 )
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}\"" )

Expand All @@ -62,7 +62,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 2 )
set ( LIB_VERSION_REVISION 2 )
set ( LIB_VERSION_REVISION 3 )
set ( LIB_VERSION_INFO
"${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )

Expand Down Expand Up @@ -102,7 +102,7 @@ option ( enable-openmp "enable OpenMP support (parallelization of soundfont deco

# Platform specific options
if ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" )
option ( enable-lash "compile LASH support (if it is available)" on )
option ( enable-lash "compile LASH support (if it is available)" off )
option ( enable-alsa "compile ALSA support (if it is available)" on )
endif ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" )

Expand Down Expand Up @@ -600,6 +600,7 @@ unset ( LASH_SUPPORT CACHE )
if ( enable-lash )
find_package ( LASH ${LASH_MINIMUM_VERSION} )
if ( LASH_FOUND )
message ( WARNING "LASH support has been deprecated and will be removed in fluidsynth 2.4.0" )
set ( LASH_SUPPORT 1 )
add_definitions ( -DHAVE_LASH )
list( APPEND PC_REQUIRES_PRIV "lash-1.0")
Expand Down
2 changes: 1 addition & 1 deletion cmake_admin/FindInstPatch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ find_path(

find_library(
InstPatch_LIBRARY
NAMES "instpatch-1.0"
NAMES "instpatch-1.0" "instpatch-2"
HINTS "${PC_INSTPATCH_LIBDIR}")

# Get version from pkg-config or read the config header
Expand Down
4 changes: 2 additions & 2 deletions cmake_admin/FindOpus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ find_library(

# Get the version from pkg-config
if(PC_OPUS_VERSION)
set(Opus_VERSION "${PC_OPUS_VERSION}")
set(Opus_VERSION "${PC_OPUS_VERSION}.0")
set(OPUS_VERSION "${Opus_VERSION}")
set(OPUS_VERSION_STRING "${Opus_VERSION}")
string(REPLACE "." ";" _opus_version_list "${Opus_VERSION}")
list(GET _opus_version_list 0 OPUS_VERSION_MAJOR)
list(GET _opus_version_list 1 OPUS_VERSION_MINOR)
list(GET _opus_version_list 2 OPUS_VERSION_PATCH)
list(GET _opus_version_list 2 OPUS_VERSION_PATCH) # might be missing if zero, hence adding the .0 above
else()
message(STATUS "Unable to get Opus version without pkg-config.")
set(Opus_VERSION)
Expand Down
5 changes: 3 additions & 2 deletions cmake_admin/FindSndFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ find_path(

find_library(
_sndfile_library
NAMES "sndfile"
NAMES "sndfile" "sndfile-1"
HINTS "${PC_SNDFILE_LIBDIR}")

# Get version from pkg-config or read the config header
Expand All @@ -69,7 +69,8 @@ elseif(SndFile_INCLUDE_DIR)
endif()

# Check the features SndFile was built with
if(PC_SNDFILE_FOUND)
# 2024-01-02: Recent versions of libsndfile don't seem to provide a pkgconfig file and older version who did are lacking private libraries like OGG.
if(FALSE) #PC_SNDFILE_FOUND
if("vorbis" IN_LIST PC_SNDFILE_STATIC_LIBRARIES)
set(SndFile_WITH_EXTERNAL_LIBS TRUE)
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake_admin/Findmpg123.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ find_package_handle_standard_args(
# Create the targets
foreach(_component libmpg123 libout123 libsyn123)
if(mpg123_${_component}_FOUND AND NOT TARGET MPG123::${_component})
add_library(MPG123::${_component})
add_library(MPG123::${_component} UNKNOWN IMPORTED)
set_target_properties(
MPG123::${_component}
PROPERTIES IMPORTED_LOCATION "${mpg123_${_component}_LIBRARY}"
Expand Down
4 changes: 2 additions & 2 deletions doc/fluidsynth-v20-devdoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
\author David Henningsson
\author Tom Moebert
\author Copyright © 2003-2023 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.3.4
\date 2023-09-24
\version Revision 2.3.5
\date 2024-01-11

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.

Expand Down
2 changes: 1 addition & 1 deletion doc/fluidsynth.1
Original file line number Diff line number Diff line change
Expand Up @@ -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, 2022"
.TH FluidSynth 1 "Jan 1, 2024"
.\" Please update the above date whenever this man page is modified.
.\"
.\" Some roff macros, for reference:
Expand Down
13 changes: 8 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,6 @@ if ( TARGET PipeWire::PipeWire AND PIPEWIRE_SUPPORT ) # because pw_init() etc.
target_link_libraries ( fluidsynth PRIVATE PipeWire::PipeWire )
endif()

if ( TARGET InstPatch::libinstpatch AND LIBINSTPATCH_SUPPORT )
target_link_libraries ( fluidsynth PRIVATE InstPatch::libinstpatch )
endif()

if ( TARGET LASH::LASH AND LASH_SUPPORT )
target_link_libraries ( fluidsynth PRIVATE LASH::LASH )
endif()
Expand Down Expand Up @@ -552,12 +548,19 @@ set (GENTAB_BDIR ${CMAKE_CURRENT_BINARY_DIR}/gentables)
# To fix cross-compiling fluidsynth from Win32 to ARM (using vcpkg), we need to pass the current generator
# on to the external project, otherwise (for some unknown reason) the target compiler will be used rather
# than the host compiler.
#
# Some use-cases however cannot rely on this logic, therefore, FLUID_HOST_COMPILER can be specified to
# force using a particular host compiler, see https://github.com/FluidSynth/fluidsynth/issues/1301
if ( FLUID_HOST_COMPILER )
set ( EXPLICIT_HOST_COMPILER_STR "-DCMAKE_C_COMPILER=${FLUID_HOST_COMPILER}" )
endif ()

ExternalProject_Add(gentables
DOWNLOAD_COMMAND ""
SOURCE_DIR ${GENTAB_SDIR}
BINARY_DIR ${GENTAB_BDIR}
CONFIGURE_COMMAND
"${CMAKE_COMMAND}" -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} -G "${CMAKE_GENERATOR}" -B "${GENTAB_BDIR}" "${GENTAB_SDIR}"
"${CMAKE_COMMAND}" -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} ${EXPLICIT_HOST_COMPILER_STR} -G "${CMAKE_GENERATOR}" -B "${GENTAB_BDIR}" "${GENTAB_SDIR}"
BUILD_COMMAND
"${CMAKE_COMMAND}" --build "${GENTAB_BDIR}"
INSTALL_COMMAND ${GENTAB_BDIR}/make_tables.exe "${FluidSynth_BINARY_DIR}/"
Expand Down
9 changes: 8 additions & 1 deletion src/drivers/fluid_pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ new_fluid_pipewire_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t
char *media_category = NULL;
float *buffer = NULL;
const struct spa_pod *params[1];
struct pw_properties *props;

drv = FLUID_NEW(fluid_pipewire_audio_driver_t);

Expand Down Expand Up @@ -196,7 +197,7 @@ new_fluid_pipewire_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t
goto driver_cleanup;
}

struct pw_properties *props = pw_properties_new(PW_KEY_MEDIA_TYPE, media_type, PW_KEY_MEDIA_CATEGORY, media_category, PW_KEY_MEDIA_ROLE, media_role, NULL);
props = pw_properties_new(PW_KEY_MEDIA_TYPE, media_type, PW_KEY_MEDIA_CATEGORY, media_category, PW_KEY_MEDIA_ROLE, media_role, NULL);

pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%d/%d", period_size, (int) sample_rate);
pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%d", (int) sample_rate);
Expand Down Expand Up @@ -294,13 +295,19 @@ void delete_fluid_pipewire_audio_driver(fluid_audio_driver_t *p)
fluid_pipewire_audio_driver_t *drv = (fluid_pipewire_audio_driver_t *)p;
fluid_return_if_fail(drv);

if (drv->pw_loop)
{
pw_thread_loop_lock(drv->pw_loop);
}

if(drv->pw_stream)
{
pw_stream_destroy(drv->pw_stream);
}

if(drv->pw_loop)
{
pw_thread_loop_unlock(drv->pw_loop);
pw_thread_loop_destroy(drv->pw_loop);
}

Expand Down
5 changes: 1 addition & 4 deletions src/fluidsynth.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#define GETOPT_SUPPORT 1
#endif

#ifdef LIBINSTPATCH_SUPPORT
#include <libinstpatch/libinstpatch.h>
#endif
#include "fluid_lash.h"

#ifdef SYSTEMD_SUPPORT
Expand Down Expand Up @@ -1222,7 +1219,7 @@ void
print_welcome()
{
printf("FluidSynth runtime version %s\n"
"Copyright (C) 2000-2023 Peter Hanappe and others.\n"
"Copyright (C) 2000-2024 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());
Expand Down
2 changes: 1 addition & 1 deletion src/midi/fluid_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ fluid_player_handle_reset_synth(void *data, const char *name, int value)
static int check_for_on_notes(fluid_synth_t *synth)
{
fluid_voice_t* v[1024];
int i, res=FALSE;
unsigned int i, res=FALSE;
fluid_synth_get_voicelist(synth, v, FLUID_N_ELEMENTS(v), -1);
for(i=0; i<FLUID_N_ELEMENTS(v) && v[i] != NULL; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/synth/fluid_chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ fluid_channel_set_bank_msb(fluid_channel_t *chan, int bankmsb)
/* XG bank, do drum-channel auto-switch */
/* The number "120" was based on several keyboards having drums at 120 - 127,
reference: https://lists.nongnu.org/archive/html/fluid-dev/2011-02/msg00003.html */
chan->channel_type = (120 <= bankmsb) ? CHANNEL_TYPE_DRUM : CHANNEL_TYPE_MELODIC;
chan->channel_type = (120 == bankmsb || 126 == bankmsb || 127 == bankmsb) ? CHANNEL_TYPE_DRUM : CHANNEL_TYPE_MELODIC;
return;
}

Expand Down
18 changes: 9 additions & 9 deletions src/synth/fluid_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ void fluid_synth_settings(fluid_settings_t *settings)
fluid_settings_register_int(settings, "synth.verbose", 0, 0, 1, FLUID_HINT_TOGGLED);

fluid_settings_register_int(settings, "synth.reverb.active", 1, 0, 1, FLUID_HINT_TOGGLED);
fluid_settings_register_num(settings, "synth.reverb.room-size", FLUID_REVERB_DEFAULT_ROOMSIZE, 0.0f, 1.0f, 0);
fluid_settings_register_num(settings, "synth.reverb.damp", FLUID_REVERB_DEFAULT_DAMP, 0.0f, 1.0f, 0);
fluid_settings_register_num(settings, "synth.reverb.width", FLUID_REVERB_DEFAULT_WIDTH, 0.0f, 100.0f, 0);
fluid_settings_register_num(settings, "synth.reverb.level", FLUID_REVERB_DEFAULT_LEVEL, 0.0f, 1.0f, 0);
fluid_settings_register_num(settings, "synth.reverb.room-size", FLUID_REVERB_DEFAULT_ROOMSIZE, 0.0, 1.0, 0);
fluid_settings_register_num(settings, "synth.reverb.damp", FLUID_REVERB_DEFAULT_DAMP, 0.0, 1.0, 0);
fluid_settings_register_num(settings, "synth.reverb.width", FLUID_REVERB_DEFAULT_WIDTH, 0.0, 100.0, 0);
fluid_settings_register_num(settings, "synth.reverb.level", FLUID_REVERB_DEFAULT_LEVEL, 0.0, 1.0, 0);

fluid_settings_register_int(settings, "synth.chorus.active", 1, 0, 1, FLUID_HINT_TOGGLED);
fluid_settings_register_int(settings, "synth.chorus.nr", FLUID_CHORUS_DEFAULT_N, 0, 99, 0);
fluid_settings_register_num(settings, "synth.chorus.level", FLUID_CHORUS_DEFAULT_LEVEL, 0.0f, 10.0f, 0);
fluid_settings_register_num(settings, "synth.chorus.speed", FLUID_CHORUS_DEFAULT_SPEED, 0.1f, 5.0f, 0);
fluid_settings_register_num(settings, "synth.chorus.depth", FLUID_CHORUS_DEFAULT_DEPTH, 0.0f, 256.0f, 0);
fluid_settings_register_num(settings, "synth.chorus.level", FLUID_CHORUS_DEFAULT_LEVEL, 0.0, 10.0, 0);
fluid_settings_register_num(settings, "synth.chorus.speed", FLUID_CHORUS_DEFAULT_SPEED, 0.1, 5.0, 0);
fluid_settings_register_num(settings, "synth.chorus.depth", FLUID_CHORUS_DEFAULT_DEPTH, 0.0, 256.0, 0);

fluid_settings_register_int(settings, "synth.ladspa.active", 0, 0, 1, FLUID_HINT_TOGGLED);
fluid_settings_register_int(settings, "synth.lock-memory", 1, 0, 1, FLUID_HINT_TOGGLED);
Expand All @@ -223,12 +223,12 @@ void fluid_synth_settings(fluid_settings_t *settings)

fluid_settings_register_int(settings, "synth.polyphony", 256, 1, 65535, 0);
fluid_settings_register_int(settings, "synth.midi-channels", 16, 16, 256, 0);
fluid_settings_register_num(settings, "synth.gain", 0.2f, 0.0f, 10.0f, 0);
fluid_settings_register_num(settings, "synth.gain", 0.2, 0.0, 10.0, 0);
fluid_settings_register_int(settings, "synth.audio-channels", 1, 1, 128, 0);
fluid_settings_register_int(settings, "synth.audio-groups", 1, 1, 128, 0);
fluid_settings_register_int(settings, "synth.effects-channels", 2, 2, 2, 0);
fluid_settings_register_int(settings, "synth.effects-groups", 1, 1, 128, 0);
fluid_settings_register_num(settings, "synth.sample-rate", 44100.0f, 8000.0f, 96000.0f, 0);
fluid_settings_register_num(settings, "synth.sample-rate", 44100.0, 8000.0, 96000.0, 0);
fluid_settings_register_int(settings, "synth.device-id", 0, 0, 127, 0);
#ifdef ENABLE_MIXER_THREADS
fluid_settings_register_int(settings, "synth.cpu-cores", 1, 1, 256, 0);
Expand Down

0 comments on commit 0bbb2b4

Please sign in to comment.