import fluidsynth-1.0.8

FluidSynth is a real-time software synthesizer based on the SoundFont 2
specifications. 

Features: 
 * Cross platform support (Linux, Mac OSX and Windows to name a few) 
 * SoundFont 2 support 
 * Realtime effect modulation using SoundFont 2.01 modulators 
 * Shared library which can be used in other programs 
 * Built in command line shell 
 * Playback of MIDI files 


ok kili@
This commit is contained in:
jakemsr 2008-04-06 22:42:11 +00:00
parent e30a83d05d
commit bbe3d712ec
14 changed files with 449 additions and 0 deletions

35
audio/fluidsynth/Makefile Normal file
View File

@ -0,0 +1,35 @@
# $OpenBSD: Makefile,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
COMMENT = SoundFont2 software synthesizer
DISTNAME = fluidsynth-1.0.8
SHARED_LIBS = fluidsynth 0.0
CATEGORIES = audio
HOMEPAGE = http://fluidsynth.resonance.org/trac
MAINTAINER = Jacob Meuser <jakemsr@openbsd.org>
# LGPL
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB = c m ncurses ossaudio pthread readline
MASTER_SITES = http://download.savannah.gnu.org/releases/fluid/
DEV_FLAGS = -DDEVOSSAUDIO=\\\"/dev/audio\\\" \
-DDEVOSSMIDI=\\\"/dev/rmidi0\\\"
MAKE_FLAGS = CFLAGS="${CFLAGS} ${DEV_FLAGS}"
LIB_DEPENDS = jack::audio/jack
USE_LIBTOOL = Yes
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS += ${CONFIGURE_SHARED} \
--disable-lash \
--disable-ladcca
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (fluidsynth-1.0.8.tar.gz) = 4qv9Lmn9iyjZZd+WjX1E7g==
RMD160 (fluidsynth-1.0.8.tar.gz) = H2R2Je2JN/SAQBg287b3gZ+kark=
SHA1 (fluidsynth-1.0.8.tar.gz) = H1/ZlkpyEvdykFckSXq9RqseJTY=
SHA256 (fluidsynth-1.0.8.tar.gz) = RefJln0PsDRPTaU5qzQ/uXk4SzakKahZTJTPRm3/QyA=
SIZE (fluidsynth-1.0.8.tar.gz) = 1267922

View File

@ -0,0 +1,68 @@
$OpenBSD: patch-configure,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- configure.orig Sat Nov 17 13:32:16 2007
+++ configure Fri Feb 15 17:45:13 2008
@@ -19986,13 +19986,13 @@ fi
-{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for pthread_create in -pthread" >&5
+echo $ECHO_N "checking for pthread_create in -pthread... $ECHO_C" >&6; }
if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
+LIBS="-pthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -20052,7 +20052,7 @@ if test $ac_cv_lib_pthread_pthread_create = yes; then
#define HAVE_LIBPTHREAD 1
_ACEOF
- LIBS="-lpthread $LIBS"
+ LIBS="-pthread $LIBS"
fi
@@ -20727,7 +20727,7 @@ esac
- if test "$mingw32_support" == "yes"; then
+ if test "$mingw32_support" = "yes"; then
MINGW32_SUPPORT_TRUE=
MINGW32_SUPPORT_FALSE='#'
else
@@ -20899,7 +20899,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
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"
+ CFLAGS="${CFLAGS} ${FCCFLAGS} -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused -Winline"
cat >>confdefs.h <<\_ACEOF
#define DEBUG 0
@@ -21152,7 +21152,7 @@ fi
-for ac_header in fcntl.h sys/ioctl.h sys/soundcard.h machine/soundcard.h
+for ac_header in fcntl.h sys/ioctl.h sys/soundcard.h machine/soundcard.h soundcard.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -21294,8 +21294,9 @@ done
if test "${ac_cv_header_fcntl_h}" = "yes" && \
test "${ac_cv_header_sys_ioctl_h}" = "yes"; then
if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
- test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
- OSS_SUPPORT=1
+ test "${ac_cv_header_machine_soundcard_h}" = "yes" || \
+ test "${ac_cv_header_soundcard_h}" = "yes"; then
+ OSS_SUPPORT=1
cat >>confdefs.h <<\_ACEOF
#define OSS_SUPPORT 1

View File

@ -0,0 +1,10 @@
$OpenBSD: patch-fluidsynth_pc_in,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- fluidsynth.pc.in.orig Fri Feb 15 20:11:52 2008
+++ fluidsynth.pc.in Fri Feb 15 20:12:46 2008
@@ -6,5 +6,5 @@ includedir=@includedir@
Name: FluidSynth
Description: Software SoundFont synth
Version: @VERSION@
-Libs: -L${libdir} -lfluidsynth
+Libs: -L${libdir} -lfluidsynth @READLINE_LIBS@ @LIBFLUID_LIBS@ @LIBS@ -lossaudio
Cflags: -I${includedir}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_Makefile_in,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- src/Makefile.in.orig Fri Feb 15 17:43:01 2008
+++ src/Makefile.in Fri Feb 15 17:43:45 2008
@@ -356,7 +356,7 @@ INCLUDES = -I$(top_srcdir)/include $(LASH_CFLAGS) $(LA
$(READLINE_CFLAGS) $(JACK_CFLAGS) $(ALSA_CFLAGS)
libfluidsynth_la_LIBADD = $(LIBFLUID_LIBS) $(LASH_LIBS) $(LADCCA_LIBS) \
- $(READLINE_LIBS) $(COREAUDIO_LIBS) $(JACK_LIBS) $(ALSA_LIBS)
+ $(READLINE_LIBS) $(COREAUDIO_LIBS) $(JACK_LIBS) $(ALSA_LIBS) -lossaudio
libfluidsynth_la_LDFLAGS = \
-version-info @LT_VERSION_INFO@ \

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-src_config_h_in,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- src/config.h.in.orig Fri Feb 15 17:22:28 2008
+++ src/config.h.in Fri Feb 15 17:23:02 2008
@@ -72,6 +72,9 @@
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
+/* Define to 1 if you have the <soundcard.h> header file. */
+#undef HAVE_SOUNDCARD_H
+
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_fluid_jack_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- src/fluid_jack.c.orig Sat Apr 5 15:42:46 2008
+++ src/fluid_jack.c Sat Apr 5 15:43:54 2008
@@ -83,7 +83,7 @@ fluid_jack_audio_driver_settings(fluid_settings_t* set
{
fluid_settings_register_str(settings, "audio.jack.id", "fluidsynth", 0, NULL, NULL);
fluid_settings_register_str(settings, "audio.jack.multi", "no", 0, NULL, NULL);
- fluid_settings_register_int(settings, "audio.jack.autoconnect", 0, 0, 1, FLUID_HINT_TOGGLED, NULL, NULL);
+ fluid_settings_register_int(settings, "audio.jack.autoconnect", 1, 0, 1, FLUID_HINT_TOGGLED, NULL, NULL);
}

View File

@ -0,0 +1,162 @@
$OpenBSD: patch-src_fluid_oss_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- src/fluid_oss.c.orig Tue Sep 18 23:10:57 2007
+++ src/fluid_oss.c Sun Feb 17 21:36:28 2008
@@ -32,8 +32,13 @@
#if OSS_SUPPORT
+#ifdef HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h>
+#endif
#include <sys/ioctl.h>
+#ifdef HAVE_SOUNDCARD_H
+#include <soundcard.h>
+#endif
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -103,7 +108,7 @@ static void* fluid_oss_midi_run(void* d);
void
fluid_oss_audio_driver_settings(fluid_settings_t* settings)
{
- fluid_settings_register_str(settings, "audio.oss.device", "/dev/dsp", 0, NULL, NULL);
+ fluid_settings_register_str(settings, "audio.oss.device", DEVOSSAUDIO, 0, NULL, NULL);
}
/*
@@ -122,8 +127,10 @@ new_fluid_oss_audio_driver(fluid_settings_t* settings,
int format;
pthread_attr_t attr;
int err;
+#if !defined(__OpenBSD__)
int sched = SCHED_FIFO;
struct sched_param priority;
+#endif
dev = FLUID_NEW(fluid_oss_audio_driver_t);
if (dev == NULL) {
@@ -168,7 +175,7 @@ new_fluid_oss_audio_driver(fluid_settings_t* settings,
}
if (!fluid_settings_getstr(settings, "audio.oss.device", &devname)) {
- devname = "/dev/dsp";
+ devname = DEVOSSAUDIO;
}
if (stat(devname, &devstat) == -1) {
@@ -229,6 +236,13 @@ new_fluid_oss_audio_driver(fluid_settings_t* settings,
goto error_recovery;
}
+#if defined(__OpenBSD__)
+ err = pthread_create(&dev->thread, &attr, fluid_oss_audio_run, (void*) dev);
+ if (err) {
+ FLUID_LOG(FLUID_ERR, "Couldn't create audio thread");
+ goto error_recovery;
+ }
+#else
/* the pthread_create man page explains that
pthread_attr_setschedpolicy returns an error if the user is not
permitted the set SCHED_FIFO. it seems however that no error is
@@ -264,6 +278,7 @@ new_fluid_oss_audio_driver(fluid_settings_t* settings,
}
break;
}
+#endif /* __OpenBSD__ */
return (fluid_audio_driver_t*) dev;
@@ -285,8 +300,10 @@ new_fluid_oss_audio_driver2(fluid_settings_t* settings
int format;
pthread_attr_t attr;
int err;
+#if !defined(__OpenBSD__)
int sched = SCHED_FIFO;
struct sched_param priority;
+#endif
dev = FLUID_NEW(fluid_oss_audio_driver_t);
if (dev == NULL) {
@@ -311,7 +328,7 @@ new_fluid_oss_audio_driver2(fluid_settings_t* settings
if (!fluid_settings_getstr(settings, "audio.oss.device", &devname)) {
- devname = "/dev/dsp";
+ devname = DEVOSSAUDIO;
}
if (stat(devname, &devstat) == -1) {
FLUID_LOG(FLUID_ERR, "Device <%s> does not exists", devname);
@@ -380,6 +397,13 @@ new_fluid_oss_audio_driver2(fluid_settings_t* settings
goto error_recovery;
}
+#if defined(__OpenBSD__)
+ err = pthread_create(&dev->thread, &attr, fluid_oss_audio_run2, (void*) dev);
+ if (err) {
+ FLUID_LOG(FLUID_ERR, "Couldn't create audio2 thread");
+ goto error_recovery;
+ }
+#else
/* the pthread_create man page explains that
pthread_attr_setschedpolicy returns an error if the user is not
permitted the set SCHED_FIFO. it seems however that no error is
@@ -415,6 +439,7 @@ new_fluid_oss_audio_driver2(fluid_settings_t* settings
}
break;
}
+#endif /* __OpenBSD__ */
return (fluid_audio_driver_t*) dev;
@@ -642,7 +667,7 @@ fluid_oss_audio_run2(void* d)
void fluid_oss_midi_driver_settings(fluid_settings_t* settings)
{
- fluid_settings_register_str(settings, "midi.oss.device", "/dev/midi", 0, NULL, NULL);
+ fluid_settings_register_str(settings, "midi.oss.device", DEVOSSMIDI, 0, NULL, NULL);
}
/*
@@ -655,8 +680,10 @@ new_fluid_oss_midi_driver(fluid_settings_t* settings,
int err;
fluid_oss_midi_driver_t* dev;
pthread_attr_t attr;
+#if !defined(__OpenBSD__)
int sched = SCHED_FIFO;
struct sched_param priority;
+#endif
char* device;
/* not much use doing anything */
@@ -687,7 +714,7 @@ new_fluid_oss_midi_driver(fluid_settings_t* settings,
/* get the device name. if none is specified, use the default device. */
fluid_settings_getstr(settings, "midi.oss.device", &device);
if (device == NULL) {
- device = "/dev/midi";
+ device = DEVOSSMIDI;
}
/* open the default hardware device. only use midi in. */
@@ -704,6 +731,14 @@ new_fluid_oss_midi_driver(fluid_settings_t* settings,
FLUID_LOG(FLUID_ERR, "Couldn't initialize midi thread attributes");
goto error_recovery;
}
+
+#if defined(__OpenBSD__)
+ err = pthread_create(&dev->thread, &attr, fluid_oss_midi_run, (void*) dev);
+ if (err) {
+ FLUID_LOG(FLUID_ERR, "Couldn't create midi thread");
+ goto error_recovery;
+ }
+#else
/* use fifo scheduling. if it fails, use default scheduling. */
while (1) {
err = pthread_attr_setschedpolicy(&attr, sched);
@@ -735,6 +770,7 @@ new_fluid_oss_midi_driver(fluid_settings_t* settings,
}
break;
}
+#endif /* __OpenBSD__ */
return (fluid_midi_driver_t*) dev;
error_recovery:

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_fluid_synth_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- src/fluid_synth.c.orig Sat Apr 5 15:21:35 2008
+++ src/fluid_synth.c Sat Apr 5 15:21:51 2008
@@ -127,7 +127,7 @@ void fluid_synth_settings(fluid_settings_t* settings)
fluid_settings_register_int(settings, "synth.effects-channels",
2, 2, 2, 0, NULL, NULL);
fluid_settings_register_num(settings, "synth.sample-rate",
- 44100.0f, 22050.0f, 96000.0f,
+ 48000.0f, 22050.0f, 96000.0f,
0, NULL, NULL);
}

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-src_fluid_sys_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- src/fluid_sys.c.orig Sun Nov 11 11:47:30 2007
+++ src/fluid_sys.c Fri Feb 15 17:09:36 2008
@@ -709,8 +709,10 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
{
pthread_attr_t *attr = NULL;
pthread_attr_t rt_attr;
+#if !defined(__OpenBSD__)
int sched = SCHED_FIFO;
struct sched_param priority;
+#endif
int err;
fluid_timer_t* timer = FLUID_NEW(fluid_timer_t);
@@ -726,6 +728,7 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
timer->auto_destroy = auto_destroy;
err = pthread_attr_init(&rt_attr);
+#if !defined(__OpenBSD__)
if (err == 0) {
err = pthread_attr_setschedpolicy(&rt_attr, SCHED_FIFO);
if (err == 0) {
@@ -736,6 +739,7 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
}
}
}
+#endif
if (new_thread) {
err = pthread_create(&timer->thread, attr, fluid_timer_start, (void*) timer);

View File

@ -0,0 +1,51 @@
$OpenBSD: patch-src_fluidsynth_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
--- src/fluidsynth.c.orig Sun Nov 11 02:09:48 2007
+++ src/fluidsynth.c Fri Feb 15 17:09:36 2008
@@ -212,9 +212,9 @@ int main(int argc, char** argv)
int audio_channels = 0;
int with_server = 0;
int dump = 0;
- int connect_lash = 1;
char *optchars = "a:C:c:df:G:g:hijK:L:lm:no:R:r:sVvz:";
#ifdef LASH_ENABLED
+ int connect_lash = 1;
int enabled_lash = 0; /* set to TRUE if lash gets enabled */
fluid_lash_args_t *lash_args;
@@ -237,7 +237,9 @@ int main(int argc, char** argv)
{"audio-groups", 1, 0, 'G'},
{"chorus", 1, 0, 'C'},
{"connect-jack-outputs", 0, 0, 'j'},
+#ifdef LASH_ENABLED
{"disable-lash", 0, 0, 'l'},
+#endif
{"dump", 0, 0, 'd'},
{"gain", 1, 0, 'g'},
{"help", 0, 0, 'h'},
@@ -343,9 +345,11 @@ int main(int argc, char** argv)
audio_channels = atoi(optarg);
fluid_settings_setint(settings, "synth.audio-channels", audio_channels);
break;
+#ifdef LASH_ENABLED
case 'l': /* disable LASH */
connect_lash = 0;
break;
+#endif
case 'm':
fluid_settings_setstr(settings, "midi.driver", optarg);
break;
@@ -417,12 +421,14 @@ int main(int argc, char** argv)
#endif
#ifdef LASH_ENABLED
+#ifdef LASH_ENABLED
/* connect to the lash server */
if (connect_lash)
{
enabled_lash = fluid_lash_connect (lash_args);
fluid_settings_setint (settings, "lash.enable", enabled_lash ? 1 : 0);
}
+#endif
#endif
/* The 'groups' setting is only relevant for LADSPA operation

View File

@ -0,0 +1,10 @@
FluidSynth is a real-time software synthesizer based on the SoundFont 2
specifications.
Features:
* Cross platform support (Linux, Mac OSX and Windows to name a few)
* SoundFont 2 support
* Realtime effect modulation using SoundFont 2.01 modulators
* Shared library which can be used in other programs
* Built in command line shell
* Playback of MIDI files

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
@lib lib/libfluidsynth.so.${LIBfluidsynth_VERSION}

View File

@ -0,0 +1,27 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
%%SHARED%%
bin/fluidsynth
include/fluidsynth/
include/fluidsynth.h
include/fluidsynth/audio.h
include/fluidsynth/event.h
include/fluidsynth/gen.h
include/fluidsynth/log.h
include/fluidsynth/midi.h
include/fluidsynth/misc.h
include/fluidsynth/mod.h
include/fluidsynth/ramsfont.h
include/fluidsynth/seq.h
include/fluidsynth/seqbind.h
include/fluidsynth/settings.h
include/fluidsynth/sfont.h
include/fluidsynth/shell.h
include/fluidsynth/synth.h
include/fluidsynth/types.h
include/fluidsynth/version.h
include/fluidsynth/voice.h
lib/libfluidsynth.a
lib/libfluidsynth.la
lib/pkgconfig/
lib/pkgconfig/fluidsynth.pc
@man man/man1/fluidsynth.1