Various bug fixes.

This commit is contained in:
Element Green 2005-06-12 01:19:37 +00:00
parent 4a173dafec
commit f2f00b3c5f
11 changed files with 127 additions and 118 deletions

View file

@ -1,3 +1,28 @@
2005-06-11 <jgreen@users.sourceforge.net>
* Released FluidSynth 1.0.6 "Music to my ears"
* README-OSX: Update from Ebrahim Mayat.
* acinclude.m4: Midishare support now defaults to auto.
* configure.ac: Added LT_CURRENT, LT_REVISION and LT_AGE in place of
LIBFLUIDSYNTH_MAJ and LIBFLUIDSYNTH_MIN to make better use of
libtool library versioning. Fixed use of AC_ARG_ENABLE (was setting
variables to yes even when disable was specified), fixes --disable-SSE
which was reported by Mikhail Yakshin, added warning when SSE is
enabled to let users know that this feature isn't really desirable
currently.
* src/Makefile.am: Now using LT_VERSION_INFO to substitute the libtool
version.
* src/fluid_cmd.c (fluid_cmd_handler_handle): Modified to avoid GCC
"type-punned" cast warning.
* src/fluid_defsfont.c (fluid_preset_zone_import_sfont): Fixed
assignment of modulator amtsrc flags (should be assigned to flags2
not flags1), thanks to Stephan Tassart for reporting this.
(fluid_inst_zone_import_sfont): Same fixes as for above.
* src/fluid_sys.c (fluid_log): Now using vsnprintf for formatting
error messages to fix buffer overflow as reported by Axioplase.
(fluid_debug): Same as above.
2005-06-11 <jgreen@users.sourceforge.net>
* fluidsynth.prj: Added Anjuta project file.

View file

@ -2,7 +2,7 @@
SUBDIRS = macbuild sf2 winbuild src doc include
EXTRA_DIST = TODO acinclude.m4 autogen.sh fluidsynth.pc.in \
fluidsynth.spec.in fluidsynth.spec
fluidsynth.spec.in fluidsynth.spec fluidsynth.prj
DISTCLEANFILES = fluidsynth.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = fluidsynth.pc

View file

@ -1,6 +1,6 @@
Compiling fluidsynth-1.0.5 on Mac OS X.4 (Tiger)
--------------------------------------------
1. Install Apple's Developer Tools.
1. Install the XcodeTools.mpkg and the DevSDK.pkg packages from the Tiger Install DVD.
2. Install the Fink Project's Package manager, fink, obtainable at http://fink.sourceforge.net
@ -19,7 +19,10 @@ Compiling fluidsynth-1.0.5 on Mac OS X.4 (Tiger)
7. cd to the fluidsynth directory and in the configure script, substitute "-lmidishare" with "-framework MidiShare".
8. Run configure with the following options (all on one line in a text editor, then copy and paste into Terminal):
./configure --enable-midishare --enable-ladspa --enable-functioncheck --enable-debug --enable-profiling --enable-jack-support "CPPFLAGS=-I/usr/local/include -I/sw/include -I/sw/include/liboss -I/System/Library/Frameworks/MidiShare.framework/Versions/A/Headers -I/System/Library/Frameworks/CoreAudio.framework/Versions/A/Headers -I/Library/Frameworks/Jack.framework/Headers" "LDFLAGS=-L/usr/local/lib -L/sw/lib -framework MidiShare -framework CoreAudio -framework Jack"
./configure --enable-midishare --enable-ladspa --enable-functioncheck --enable-debug --enable-profiling --enable-jack-support "CPPFLAGS=-I/usr/local/include
-I/sw/include -I/System/Library/Frameworks/MidiShare.framework/Versions/A/Headers
-I/System/Library/Frameworks/CoreAudio.framework/Versions/A/Headers -I/Library/Frameworks/Jack.framework/Headers"
"LDFLAGS=-L/usr/local/lib -L/sw/lib -framework MidiShare -framework CoreAudio -framework Jack"
This should result in
**************************************************************
@ -43,5 +46,5 @@ Pentium 3+ SSE: no
8. make install as root.
Ebrahim Mayat <emayat@users.sourceforge.net>
19th May 2005
11th June 2005

View file

@ -2,9 +2,9 @@ dnl Some additional autoconf macros
AC_DEFUN(AC_MIDISHARE,
[
AC_ARG_ENABLE(midishare,
[ --enable-midishare Compile MIDISHARE support (default=no)],
midishare=$enableval, midishare=no)
AC_ARG_ENABLE(midishare, AS_HELP_STRING([--enable-midishare],
[Compile MIDISHARE support (default=auto)]),
midishare=$enableval, midishare=yes)
MIDISHARE_SUPPORT=0

View file

@ -1,12 +1,14 @@
dnl --------------------------------------------------
dnl configure.in for the If I Were U Synthesizer
dnl configure.in for FluidSynth
dnl --------------------------------------------------
AC_INIT(src/fluidsynth.c)
dnl *** NOTE *** Don't forget to update library version below also
FLUIDSYNTH_VERSION_MAJOR=1
FLUIDSYNTH_VERSION_MINOR=0
FLUIDSYNTH_VERSION_MICRO=5
FLUIDSYNTH_VERSION_MICRO=6
FLUIDSYNTH_VERSION=$FLUIDSYNTH_VERSION_MAJOR.$FLUIDSYNTH_VERSION_MINOR.$FLUIDSYNTH_VERSION_MICRO
AC_SUBST(FLUIDSYNTH_VERSION_MAJOR)
@ -19,10 +21,19 @@ AM_INIT_AUTOMAKE(fluidsynth, $FLUIDSYNTH_VERSION)
dnl Convert to quoted string for version.h substitution
FLUIDSYNTH_VERSION="\"$VERSION\""
LIBFLUIDSYNTH_MAJ=1
LIBFLUIDSYNTH_MIN=0
AC_SUBST(LIBFLUIDSYNTH_MAJ)
AC_SUBST(LIBFLUIDSYNTH_MIN)
dnl *** NOTICE ***
dnl Update library version upon each release (follow these steps in order)
dnl if any source code changes: LT_REVISION++
dnl if any interfaces added/removed/changed: LT_CURRENT++ and LT_REVISION=0
dnl if any interfaces have been added: LT_AGE++
dnl if any interfaces have been removed/changed (compatibility broken): LT_AGE=0
LT_CURRENT=2
LT_REVISION=0
LT_AGE=1
LT_VERSION_INFO="${LT_CURRENT}:${LT_REVISION}:${LT_AGE}"
AC_SUBST(LT_VERSION_INFO)
AM_CONFIG_HEADER(src/config.h)
@ -72,46 +83,41 @@ AC_SUBST(FLUID_CPPFLAGS)
AM_CONDITIONAL(MINGW32_SUPPORT, test "$mingw32_support" == "yes")
ENABLE_FLOAT_SAMPLES=yes
AC_ARG_ENABLE(double,
[ --enable-double double floating point for dsp (default=float)],
ENABLE_FLOAT_SAMPLES=no,
AC_ARG_ENABLE(double, AS_HELP_STRING([--enable-double],
[double floating point for dsp (default=float)]),
ENABLE_FLOAT_SAMPLES=$enableval,
ENABLE_FLOAT_SAMPLES=yes)
if test "x$ENABLE_FLOAT_SAMPLES" = "xyes" ; then
AC_DEFINE(WITH_FLOAT, 1, [Define to do all DSP in single floating point precision])
fi
profiling_flag=no
AC_ARG_ENABLE(profiling,
[ --enable-profiling profile the dsp code (default=no)],
profiling_flag=yes,
AC_ARG_ENABLE(profiling, AS_HELP_STRING([--enable-profiling],
[profile the dsp code (default=no)]),
profiling_flag=$enableval,
profiling_flag=no)
if test "x$profiling_flag" = "xyes" ; then
AC_DEFINE(WITH_PROFILING, 1, [Define to profile the DSP code])
fi
longlong=no
AC_ARG_ENABLE(longlong,
[ --enable-longlong use long long integers, where appropriate (default=yes)],
longlong=yes,
AC_ARG_ENABLE(longlong, AS_HELP_STRING([--enable-longlong],
[use long long integers, where appropriate (default=no)]),
longlong=$enableval,
longlong=no)
if test "x$longlong" = "xyes" ; then
AC_DEFINE(USE_LONGLONG, 1, [Define to use long long type, where appropriate])
fi
SSE=no
AC_ARG_ENABLE(SSE,
[ --enable-SSE Use the SSE instructions of Pentium3+ (default=no)],
SSE=yes,
AC_ARG_ENABLE(SSE, AS_HELP_STRING([--enable-SSE],
[Use SSE instructions of Pentium3+ (not recommended)]),
SSE=$enableval,
SSE=no)
if test "x$SSE" = "xyes" ; then
AC_DEFINE(ENABLE_SSE, 1, [Use the SSE instructions of Pentium 3 and higher])
AC_DEFINE(ENABLE_SSE, 1, [Use the SSE instructions of Pentium3+ (not recommended)])
fi
ENABLE_LADSPA=no
AC_ARG_ENABLE(ladspa,
[ --enable-ladspa Include LADSPA effect unit (default=no)],
ENABLE_LADSPA=yes,
AC_ARG_ENABLE(ladspa, AS_HELP_STRING([--enable-ladspa],
[Include LADSPA effect unit (default=no)]),
ENABLE_LADSPA=$enableval,
ENABLE_LADSPA=no)
if test "x$ENABLE_LADSPA" = "xyes" ; then
AC_DEFINE(LADSPA, 1, [Include the LADSPA Fx unit])
@ -121,10 +127,9 @@ if test "x$ENABLE_LADSPA" = "xyes" ; then
fi
ENABLE_FUNCTIONCHECK=no
AC_ARG_ENABLE(functioncheck,
[ --enable-functioncheck enable profiling using FunctionCheck. Turns on debugging. (default=no)],
ENABLE_FUNCTIONCHECK=yes,
AC_ARG_ENABLE(functioncheck, AS_HELP_STRING([--enable-functioncheck],
[profiling using FunctionCheck, turns on debugging (default=no)]),
ENABLE_FUNCTIONCHECK=$enableval,
ENABLE_FUNCTIONCHECK=no)
FCLDFLAGS=""
@ -143,32 +148,21 @@ else
ENABLE_DEBUG=no
fi
AC_ARG_ENABLE(debug,
[ --enable-debug enable debugging (default=no)],
ENABLE_DEBUG=yes)
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
[enable debugging (default=no)]),
ENABLE_DEBUG=$enableval)
case "$ENABLE_DEBUG" in
no)
CFLAGS="${CFLAGS} ${FCCFLAGS} -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused -Winline"
AC_DEFINE(DEBUG, 0, [Define to activate debugging message])
;;
yes)
if test "$ENABLE_DEBUG" = "yes"; then
if test "${ENABLE_FUNCTIONCHECK}" = "yes"; then
CFLAGS="${CFLAGS} ${FCCFLAGS} -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused"
else
CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused"
fi
AC_DEFINE(DEBUG, 1, [Define to activate debugging message])
;;
*)
else
CFLAGS="${CFLAGS} ${FCCFLAGS} -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused -Winline"
AC_DEFINE(DEBUG, 0, [Define to activate debugging message])
;;
esac
fi
dnl
@ -191,9 +185,9 @@ dnl fi
dnl - Check support for ALSA
AC_ARG_ENABLE(alsa-support,
[ --disable-alsa-support Do not compile ALSA support (default=auto)],
[enable_alsa_support=$enableval], enable_alsa_support="yes")
AC_ARG_ENABLE(alsa-support, AS_HELP_STRING([--disable-alsa-support],
[Do not compile ALSA support (default=auto)]),
enable_alsa_support=$enableval, enable_alsa_support="yes")
if test "x$enable_alsa_support" != "xno"; then
PKG_CHECK_MODULES(ALSA, alsa >= 0.9.1, ALSA_SUPPORT=1, ALSA_SUPPORT=0)
@ -219,9 +213,9 @@ AC_MIDISHARE
dnl - Check support for JACK
AC_ARG_ENABLE(jack-support,
[ --disable-jack-support disable JACK support (default=auto)],
[enable_jack=$enableval], enable_jack="yes")
AC_ARG_ENABLE(jack-support, AS_HELP_STRING([--disable-jack-support],
[disable JACK support (default=auto)]),
enable_jack=$enableval, enable_jack="yes")
if test "x$enable_jack" != "xno"; then
PKG_CHECK_MODULES(JACK, jack, JACK_SUPPORT=1, JACK_SUPPORT=0)
@ -242,8 +236,8 @@ dnl - Check support for CoreAudio
dnl
AC_CHECK_HEADER(CoreAudio/AudioHardware.h, COREAUDIO_FOUND="yes",
COREAUDIO_FOUND="no")
AC_ARG_ENABLE(coreaudio,
[ --disable-coreaudio disable CoreAudio support (default=auto)],
AC_ARG_ENABLE(coreaudio, AS_HELP_STRING([--disable-coreaudio],
[disable CoreAudio support (default=auto)]),
enable_coreaudio=$enableval, enable_coreaudio="yes")
COREAUDIO_SUPPORT=0
@ -299,20 +293,10 @@ fi
dnl
dnl ladcca stuff
dnl
fluid_enable_ladcca="yes"
AC_ARG_ENABLE(ladcca,
[ --disable-ladcca disable LADCCA support],[
case "$enableval" in
"yes")
;;
"no")
fluid_enable_ladcca="no"
;;
*)
AC_MSG_ERROR([must use --enable-ladcca(=yes/no) or --disable-ladcca])
;;
esac
])
AC_ARG_ENABLE(ladcca, AS_HELP_STRING([--disable-ladcca],
[disable LADCCA support (default=auto)]),
fluid_enable_ladcca=$enableval,
fluid_enable_ladcca="yes")
if test "$fluid_enable_ladcca" = "yes"; then
PKG_CHECK_MODULES(LADCCA, ladcca-1.0 >= 0.3, LADCCA_FOUND="yes", LADCCA_FOUND="no")
@ -381,6 +365,18 @@ else
echo "CoreAudio: no"
fi
if test "${ENABLE_LADSPA}" = "yes"; then
echo "LADSPA support: yes"
else
echo "LADSPA support: no"
fi
if test "${LADCCA_FOUND}" = "yes"; then
echo "LADCCA support: yes"
else
echo "LADCCA support: no"
fi
dnl if test "${AUFILE_SUPPORT}" = "1"; then
dnl echo "Sound file: yes"
dnl else
@ -393,12 +389,6 @@ else
echo "Readline: no"
fi
if test "${LADCCA_FOUND}" = "yes"; then
echo "LADCCA support: yes"
else
echo "LADCCA support: no"
fi
if test "${ENABLE_DEBUG}" = "yes"; then
echo "Debug: yes"
else
@ -417,12 +407,6 @@ dnl else
dnl echo "FunctionCheck: no"
dnl fi
if test "${ENABLE_LADSPA}" = "yes"; then
echo "LADSPA support: yes"
else
echo "LADSPA support: no"
fi
if test "${longlong}" = "yes"; then
echo "use long long: yes"
else
@ -430,7 +414,7 @@ else
fi
if test "${SSE}" = "yes"; then
echo "Pentium 3+ SSE: yes"
echo "Pentium 3+ SSE: yes (experimental and may actually decrease performance!)"
else
echo "Pentium 3+ SSE: no"
fi

View file

@ -368,10 +368,10 @@ FLUIDSYNTH_API void fluid_synth_set_gain(fluid_synth_t* synth, float gain);
/** Get the master gain */
FLUIDSYNTH_API float fluid_synth_get_gain(fluid_synth_t* synth);
/** Set the polyphony limit */
/** Set the polyphony limit (FluidSynth >= 1.0.6) */
FLUIDSYNTH_API int fluid_synth_set_polyphony(fluid_synth_t* synth, int polyphony);
/** Get the polyphony limit */
/** Get the polyphony limit (FluidSynth >= 1.0.6) */
FLUIDSYNTH_API int fluid_synth_get_polyphony(fluid_synth_t* synth);
/** Get the internal buffer size. The internal buffer size if not the

View file

@ -99,7 +99,7 @@ INCLUDES = -I$(srcdir)/../include $(LADCCA_CFLAGS) $(READLINE_CFLAGS) \
libfluidsynth_la_LIBADD = $(LIBFLUID_LIBS) $(LADCCA_LIBS) $(READLINE_LIBS) \
$(COREAUDIO_LIBS) $(JACK_LIBS) $(ALSA_LIBS)
libfluidsynth_la_LDFLAGS = \
-version-info @LIBFLUIDSYNTH_MAJ@:@LIBFLUIDSYNTH_MIN@:0 \
-version-info @LT_VERSION_INFO@ \
-export-dynamic @FCLDFLAGS@ $(LIBFLUID_LDFLAGS)
libfluidsynth_la_CPPFLAGS = $(LIBFLUID_CPPFLAGS)

View file

@ -12,7 +12,7 @@
/* Define to activate debugging message */
#undef DEBUG
/* Use the SSE instructions of Pentium 3 and higher */
/* Use the SSE instructions of Pentium3+ (not recommended) */
#undef ENABLE_SSE
/* Define to 1 if you have the <arpa/inet.h> header file. */

View file

@ -1624,8 +1624,12 @@ int fluid_cmd_handler_unregister(fluid_cmd_handler_t* handler, char* cmd)
int fluid_cmd_handler_handle(fluid_cmd_handler_t* handler, int ac, char** av, fluid_ostream_t out)
{
fluid_cmd_t* cmd;
if (fluid_hashtable_lookup(handler, av[0], (void**) &cmd, NULL) && cmd->handler) {
void *vp; /* use a void pointer to avoid GCC "type-punned pointer" warning */
fluid_cmd_t* cmd;
if (fluid_hashtable_lookup(handler, av[0], &vp, NULL)
&& ((fluid_cmd_t *)vp)->handler) {
cmd = vp;
return (*cmd->handler)(cmd->data, ac - 1, av + 1, out);
} else {
fluid_ostream_printf(out, "unknown command: %s (try help)\n", av[0]);

View file

@ -1054,30 +1054,27 @@ fluid_preset_zone_import_sfont(fluid_preset_zone_t* zone, SFZone *sfzone, fluid_
/* *** Amount source *** */
mod_dest->src2 = mod_src->amtsrc & 127; /* index of source 2, seven-bit value, SF2.01 section 8.2, p.50 */
type = (mod_src->amtsrc) >> 10;
type &= 63; /* type is a 6-bit value */
mod_dest->flags2 = 0;
/* Bit 7: CC flag SF 2.01 section 8.2.1 page 50*/
if (mod_src->amtsrc & (1<<7)){
mod_dest->flags1 |= FLUID_MOD_CC;
mod_dest->flags2 |= FLUID_MOD_CC;
} else {
mod_dest->flags1 |= FLUID_MOD_GC;
mod_dest->flags2 |= FLUID_MOD_GC;
}
/* Bit 8: D flag SF 2.01 section 8.2.2 page 51*/
if (mod_src->amtsrc & (1<<8)){
mod_dest->flags1 |= FLUID_MOD_NEGATIVE;
mod_dest->flags2 |= FLUID_MOD_NEGATIVE;
} else {
mod_dest->flags1 |= FLUID_MOD_POSITIVE;
mod_dest->flags2 |= FLUID_MOD_POSITIVE;
}
/* Bit 9: P flag SF 2.01 section 8.2.3 page 51*/
if (mod_src->amtsrc & (1<<9)){
mod_dest->flags1 |= FLUID_MOD_BIPOLAR;
mod_dest->flags2 |= FLUID_MOD_BIPOLAR;
} else {
mod_dest->flags1 |= FLUID_MOD_UNIPOLAR;
mod_dest->flags2 |= FLUID_MOD_UNIPOLAR;
}
/* modulator source types: SF2.01 section 8.2.1 page 52 */
@ -1454,30 +1451,27 @@ fluid_inst_zone_import_sfont(fluid_inst_zone_t* zone, SFZone *sfzone, fluid_defs
/* *** Amount source *** */
mod_dest->src2=mod_src->amtsrc & 127; /* index of source 2, seven-bit value, SF2.01 section 8.2, page 50 */
type = (mod_src->amtsrc) >> 10;
type &= 63; /* type is a 6-bit value */
mod_dest->flags2 = 0;
/* Bit 7: CC flag SF 2.01 section 8.2.1 page 50*/
if (mod_src->amtsrc & (1<<7)){
mod_dest->flags1 |= FLUID_MOD_CC;
mod_dest->flags2 |= FLUID_MOD_CC;
} else {
mod_dest->flags1 |= FLUID_MOD_GC;
mod_dest->flags2 |= FLUID_MOD_GC;
}
/* Bit 8: D flag SF 2.01 section 8.2.2 page 51*/
if (mod_src->amtsrc & (1<<8)){
mod_dest->flags1 |= FLUID_MOD_NEGATIVE;
mod_dest->flags2 |= FLUID_MOD_NEGATIVE;
} else {
mod_dest->flags1 |= FLUID_MOD_POSITIVE;
mod_dest->flags2 |= FLUID_MOD_POSITIVE;
}
/* Bit 9: P flag SF 2.01 section 8.2.3 page 51*/
if (mod_src->amtsrc & (1<<9)){
mod_dest->flags1 |= FLUID_MOD_BIPOLAR;
mod_dest->flags2 |= FLUID_MOD_BIPOLAR;
} else {
mod_dest->flags1 |= FLUID_MOD_UNIPOLAR;
mod_dest->flags2 |= FLUID_MOD_UNIPOLAR;
}
/* modulator source types: SF2.01 section 8.2.1 page 52 */

View file

@ -51,7 +51,7 @@ int fluid_debug(int level, char * fmt, ...)
va_list args;
va_start (args, fmt);
vsprintf(fluid_errbuf, fmt, args);
vsnprintf(fluid_errbuf, sizeof (fluid_errbuf), fmt, args);
va_end (args);
fun = fluid_log_function[FLUID_DBG];
@ -164,7 +164,7 @@ fluid_log(int level, char* fmt, ...)
va_list args;
va_start (args, fmt);
vsprintf(fluid_errbuf, fmt, args);
vsnprintf(fluid_errbuf, sizeof (fluid_errbuf), fmt, args);
va_end (args);
if ((level >= 0) && (level < LAST_LOG_LEVEL)) {
@ -1236,4 +1236,3 @@ int fluid_server_socket_join(fluid_server_socket_t* server_socket)
}
#endif