On Wednesday 02 Oct 2002 17:44, Takashi Iwai wrote:
> At Fri, 27 Sep 2002 22:57:15 +0100,
>
> Peter L Jones wrote:
> > Hi all,
> >
> > I've tried to subscribe to Eric A Walsh's TiMidity mailing list but it
> > doesn't appear to be working... (or there's too little latency in my
> > patience...) So... would anyone be even vaguely interested in...
> >
> > a) an aRtsd patch (trivial, really)
> >
> > b) an extension to the "order=o" soundfont parameter to make it somewhat
> > more interesting
> >
> > c) some minor "fixes" (hopefully just code tidy-ups)
> >
> > d) some documentation I've written while reading the code (I've been
> > trying to get a handle on exactly what TiMidity++ does and doesn't do as
> > a soft-synth)
> >
> > ...being posted to this list? (Feel free to pick'n'choose.)
>
> nice features.
>
> could you give me your patch?
>
> timidity has been developed recently by some japanese people fairly
> intensively. most of changes are for windows but effects engine and
> the handling of soundfonts are changed since the last pre version
> found on timidity's web page.
>
> unfortunately, the development is discussed only in japanese, so if
> you don't understand the language, it's difficult to join it...
>
> i'll send the patch to the ml to integrate to the new tree, and put
> the resultant patch on my web page for convenience.
>
>
> Takashi
Takashi,
I've attached my current patch version. Sorry, it's not split out but it's
fairly short. (I'm not convinced I've quite got order and font exclude
working together...)
I've also attached the config doc - it could do with be merged with the
timidity-cfg(5) manpage.
Thanks - 2.12.0-pre1 has been a solid and useful tool.
-- Peter
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/acinclude.m4 TiMidity++-2.12.0-pre1-pj/acinclude.m4
--- /usr/src/TiMidity++-2.12.0-pre1/acinclude.m4 2002-01-16 10:14:44.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/acinclude.m4 2002-09-07 19:00:38.000000000 +0100
@@ -175,6 +175,166 @@
])
dnl alsa.m4 ends here
+dnl This should be pulled in from arts.m4
+dnl
+dnl Oh my word, I've never hacked automake before - let me know if this is a
+dnl complete rubbish!
+dnl Peter L Jones 2002-05-12
+dnl Snarfed from the ESD code below - but the faults are all mine!
+
+
+dnl AM_PATH_ARTS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for aRts, and define ARTS_CFLAGS and ARTS_LIBS
+dnl
+AC_DEFUN(AM_PATH_ARTS,
+ [dnl
+dnl Get the cflags and libraries from the arts-config script
+dnl
+AC_ARG_WITH(arts-prefix,[ --with-arts-prefix=PFX Prefix where ARTS is installed (optional)],
+ arts_prefix="$withval", arts_prefix="")
+AC_ARG_ENABLE(artstest, [ --disable-artstest Do not try to compile and run a test ARTS program],
+ , enable_artstest=yes)
+
+ if test x$arts_prefix != x ; then
+ arts_args="$arts_args --prefix=$arts_prefix"
+ if test x${ARTS_CONFIG+set} != xset ; then
+ ARTS_CONFIG=$arts_prefix/bin/artsc-config
+ fi
+ fi
+
+ AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
+ min_arts_version=ifelse([$1], ,0.9.5,$1)
+ AC_MSG_CHECKING(for ARTS - version >= $min_arts_version)
+ no_arts=""
+ if test "$ARTS_CONFIG" = "no" ; then
+ no_arts=yes
+ else
+ ARTS_CFLAGS=`$ARTS_CONFIG $artsconf_args --cflags`
+ ARTS_LIBS=`$ARTS_CONFIG $artsconf_args --libs`
+
+ arts_major_version=`$ARTS_CONFIG $arts_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ arts_minor_version=`$ARTS_CONFIG $arts_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ arts_micro_version=`$ARTS_CONFIG $arts_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_artstest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $ARTS_CFLAGS"
+ LIBS="$LIBS $ARTS_LIBS"
+dnl
+dnl Now check if the installed ARTS is sufficiently new. (Also sanity
+dnl checks the results of arts-config to some extent
+dnl
+ rm -f conf.artstest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <artsc.h>
+
+char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main ()
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ system ("touch conf.artstest");
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_arts_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
+ printf("%s, bad version string\n", "$min_arts_version");
+ exit(1);
+ }
+
+ if (($arts_major_version > major) ||
+ (($arts_major_version == major) && ($arts_minor_version > minor)) ||
+ (($arts_major_version == major) && ($arts_minor_version == minor) && ($arts_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'artsc-config --version' returned %d.%d.%d, but the minimum version\n", $arts_major_version, $arts_minor_version, $arts_micro_version);
+ printf("*** of ARTS required is %d.%d.%d. If artsc-config is correct, then it is\n", major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If artsc-config was wrong, set the environment variable ARTS_CONFIG\n");
+ printf("*** to point to the correct copy of artsc-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+}
+
+],, no_arts=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_arts" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$ARTS_CONFIG" = "no" ; then
+ echo "*** The artsc-config script installed by ARTS could not be found"
+ echo "*** If ARTS was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the ARTS_CONFIG environment variable to the"
+ echo "*** full path to artsc-config."
+ else
+ if test -f conf.artstest ; then
+ :
+ else
+ echo "*** Could not run ARTS test program, checking why..."
+ CFLAGS="$CFLAGS $ARTS_CFLAGS"
+ LIBS="$LIBS $ARTS_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <artsc.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding ARTS or finding the wrong"
+ echo "*** version of ARTS. If it is not finding ARTS, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means ARTS was incorrectly installed"
+ echo "*** or that you have moved ARTS since it was installed. In the latter case, you"
+ echo "*** may want to edit the arts-config script: $ARTS_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ ARTS_CFLAGS=""
+ ARTS_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(ARTS_CFLAGS)
+ AC_SUBST(ARTS_LIBS)
+ rm -f conf.artstest
+])
+dnl End of aRts
+
# Configure paths for ESD
# Manish Singh 98-9-30
# stolen back from Frank Belew
@@ -971,4 +1131,4 @@
rm -f conf.vorbistest
])
-# end of vorbis.m4
\ No newline at end of file
+# end of vorbis.m4
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/autoconfig.pj TiMidity++-2.12.0-pre1-pj/autoconfig.pj
--- /usr/src/TiMidity++-2.12.0-pre1/autoconfig.pj 1970-01-01 01:00:00.000000000 +0100
+++ TiMidity++-2.12.0-pre1-pj/autoconfig.pj 2002-09-27 22:23:13.000000000 +0100
@@ -0,0 +1,5 @@
+aclocal
+autoheader
+automake
+autoconf
+./configure --prefix=/usr --enable-audio=alsa,default,oss,nas,arts,esd,vorbis --enable-dynamic=ncurses,slang,motif,tcltk,vt100,xaw,xskin,gtk,server,alsaseq --enable-network --enable-spectrogram --enable-spline=cubic CPPFLAGS='-I /usr/include/tcl8.3'
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/ChangeLog TiMidity++-2.12.0-pre1-pj/ChangeLog
--- /usr/src/TiMidity++-2.12.0-pre1/ChangeLog 2002-01-18 02:25:18.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/ChangeLog 2002-05-12 21:59:44.000000000 +0100
@@ -1,3 +1,7 @@
+2002-05-12 Peter L Jones <[EMAIL PROTECTED]>
+ * aRts_a.c
+ Hacked up aRts output module
+
2002-01-17 Daisuke Aoki <[EMAIL PROTECTED]>
* configs/msc-config.h,interface/{w32g_i.c,w32g_pref.c,w32g_res.h,
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/configure.ac TiMidity++-2.12.0-pre1-pj/configure.ac
--- /usr/src/TiMidity++-2.12.0-pre1/configure.ac 2002-01-17 23:51:32.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/configure.ac 2002-05-12 22:32:41.000000000 +0100
@@ -440,11 +440,12 @@
dnl alsa(s): ALSA pcm device
dnl alib(A): HPUX network audio (Alib)
dnl nas(n): Network Audio System
+dnl arts(R): aRts
dnl esd(e): EsounD
dnl vorbis(v): Ogg Vorbis
dnl gogo(g): MP3 GOGO
-audio_targets='default oss alsa sun hpux irix mme sb_dsp w32 alib nas esd vorbis gogo'
+audio_targets='default oss alsa sun hpux irix mme sb_dsp w32 alib nas arts esd vorbis gogo'
AC_ARG_WITH(nas-library,
[ --with-nas-library=library NAS absolute library path (Don't use -laudio)])
@@ -465,6 +466,7 @@
alsa: ALSA pcm device
alib: HPUX network audio (Alib)
nas: NAS - Network Audio System
+ arts: aRts
esd: EsounD
vorbis: Ogg Vorbis
gogo: MP3 GOGO (Only Windows is supported)],
@@ -486,7 +488,7 @@
DEFAULT_PLAYMODE=
AC_ARG_WITH(default-output,
[ --with-default-output=<mode> Specify default output mode (optional):
- default|alsa|alib|nas|esd|wav|au|aiff|list|vorbis|gogo],
+ default|alsa|alib|nas|arts|esd|wav|au|aiff|list|vorbis|gogo],
[ if test "$enable_audio" != no; then
DEFAULT_PLAYMODE=$withval
eval "au_enable_$DEFAULT_PLAYMODE=yes"
@@ -763,6 +765,29 @@
AC_MSG_RESULT(no)
fi
+AC_MSG_CHECKING(enable_audio=arts)
+if test "x$au_enable_arts" = xyes; then
+ AC_MSG_RESULT()
+ KEEPCFLAGS=$CFLAGS
+ KEEPLIBS=$LIBS
+ KEEPLDFLAGS=$LDFLAGS
+ AM_PATH_ARTS()
+ CFLAGS=$KEEPCFLAGS
+ LIBS=$KEEPLIBS
+ LDFLAGS=$KEEPLDFLAGS
+ if test "x$no_arts" = x; then
+ AC_MSG_RESULT(aRts: Enabled)
+ EXTRADEFS="$EXTRADEFS -DAU_ARTS"
+ SYSEXTRAS="$SYSEXTRAS aRts_a.c"
+ EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$ARTS_CFLAGS)
+ LIBS="$LIBS $ARTS_LIBS"
+ else
+ AC_MSG_WARN(aRts: Couldn't configure)
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
AC_MSG_CHECKING(enable_audio=esd)
if test "x$au_enable_esd" = xyes; then
AC_MSG_RESULT()
@@ -850,6 +875,7 @@
.w32) TIMIDITY_OUTPUT_ID=d ;;
.alib) TIMIDITY_OUTPUT_ID=A ;;
.nas) TIMIDITY_OUTPUT_ID=n ;;
+ .arts) TIMIDITY_OUTPUT_ID=R ;;
.esd) TIMIDITY_OUTPUT_ID=e ;;
.wav) TIMIDITY_OUTPUT_ID=w ;;
.au) TIMIDITY_OUTPUT_ID=u ;;
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/interface/alsaseq_c.c TiMidity++-2.12.0-pre1-pj/interface/alsaseq_c.c
--- /usr/src/TiMidity++-2.12.0-pre1/interface/alsaseq_c.c 2002-01-16 10:21:49.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/interface/alsaseq_c.c 2002-09-23 18:32:39.000000000 +0100
@@ -45,7 +45,7 @@
#endif
#include <signal.h>
-#include <sys/asoundlib.h>
+#include <alsa/asoundlib.h>
#include "timidity.h"
#include "common.h"
@@ -59,7 +59,7 @@
#include "timer.h"
-#define NUM_PORTS 2 /* number of ports;
+#define NUM_PORTS 4 /* number of ports;
* this should be configurable via command line..
*/
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/timidity/alsa_a.c TiMidity++-2.12.0-pre1-pj/timidity/alsa_a.c
--- /usr/src/TiMidity++-2.12.0-pre1/timidity/alsa_a.c 2002-01-16 10:15:20.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/timidity/alsa_a.c 2002-09-23 18:34:38.000000000 +0100
@@ -41,7 +41,7 @@
#endif
/*ALSA header file*/
-#include <sys/asoundlib.h>
+#include <alsa/asoundlib.h>
#if defined(SND_LIB_MINOR)
#define ALSA_LIB SND_LIB_MINOR
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/timidity/aRts_a.c TiMidity++-2.12.0-pre1-pj/timidity/aRts_a.c
--- /usr/src/TiMidity++-2.12.0-pre1/timidity/aRts_a.c 1970-01-01 01:00:00.000000000 +0100
+++ TiMidity++-2.12.0-pre1-pj/timidity/aRts_a.c 2002-09-07 19:08:19.000000000 +0100
@@ -0,0 +1,182 @@
+/*
+ TiMidity++ -- MIDI to WAVE converter and player
+ Copyright (C) 1999-2002 Masanao Izumo <[EMAIL PROTECTED]>
+ Copyright (C) 1995 Tuukka Toivonen <[EMAIL PROTECTED]>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ aRts_a.c by Peter L Jones <[EMAIL PROTECTED]>
+ based on esd_a.c
+
+ Functions to play sound through aRts
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#ifndef NO_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <artsc.h>
+
+#include "timidity.h"
+#include "common.h"
+#include "output.h"
+#include "controls.h"
+#include "timer.h"
+#include "instrum.h"
+#include "playmidi.h"
+#include "miditrace.h"
+
+static int open_output(void); /* 0=success, 1=warning, -1=fatal error */
+static void close_output(void);
+static int output_data(char *buf, int32 nbytes);
+static int acntl(int request, void *arg);
+
+/* export the playback mode */
+
+#define dpm arts_play_mode
+
+PlayMode dpm = {
+ /*rate*/ DEFAULT_RATE,
+ /*encoding*/ PE_16BIT|PE_SIGNED,
+ /*flag*/ PF_PCM_STREAM/*|PF_BUFF_FRAGM_OPT/**/,
+ /*fd*/ -1,
+ /*extra_param*/ {0}, /* default: get all the buffer fragments you can */
+ /*id*/ "aRts",
+ /*id char*/ 'R',
+ /*name*/ "arts",
+ open_output,
+ close_output,
+ output_data,
+ acntl
+};
+
+
+/*************************************************************************/
+/* We currently only honor the PE_MONO bit, and the sample rate. */
+
+static int open_output(void)
+{
+ arts_stream_t fd = 0;
+ int i, include_enc, exclude_enc;
+
+ include_enc = 0;
+ exclude_enc = PE_ULAW|PE_ALAW|PE_BYTESWAP; /* They can't mean these */
+ if(dpm.encoding & PE_16BIT)
+ include_enc |= PE_SIGNED;
+ else
+ exclude_enc |= PE_SIGNED;
+ dpm.encoding = validate_encoding(dpm.encoding, include_enc, exclude_enc);
+
+ /* Open the audio device */
+ if((i = arts_init()) != 0)
+ {
+ ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
+ dpm.name, arts_error_text(i));
+ return -1;
+ }
+ fd = arts_play_stream(dpm.rate,
+ (dpm.encoding & PE_16BIT) ? 16 : 8,
+ (dpm.encoding & PE_MONO) ? 1 : 2,
+ "timidity");
+ dpm.fd = (int) fd;
+ /* "this aRts function isnot yet implemented"
+ *
+ if (dpm.extra_param[0]) {
+ i = arts_stream_set((arts_stream_t) dpm.fd,
+ ARTS_P_PACKET_COUNT,
+ dpm.extra_param[0]);
+ if (i < 0) {
+ ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
+ dpm.name, arts_error_text(i));
+ return 1;
+ }
+ }
+ *
+ */
+ return 0;
+}
+
+static int output_data(char *buf, int32 nbytes)
+{
+ int n;
+
+ if (dpm.fd == -1) return -1;
+
+ while(nbytes > 0)
+ {
+ if((n = arts_write((arts_stream_t) dpm.fd, buf, nbytes)) < 0)
+ {
+ ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
+ "%s: %s", dpm.name, arts_error_text(n));
+ return -1;
+ }
+ buf += n;
+ nbytes -= n;
+ }
+
+ return 0;
+}
+
+static void close_output(void)
+{
+ if(dpm.fd == -1)
+ return;
+ arts_close_stream((arts_stream_t) dpm.fd);
+ arts_free();
+ dpm.fd = -1;
+}
+
+static int acntl(int request, void *arg)
+{
+ int n;
+
+ switch(request) {
+ case PM_REQ_MIDI:
+ case PM_REQ_INST_NAME:
+ case PM_REQ_DISCARD:
+ case PM_REQ_GETQSIZ:
+ case PM_REQ_SETQSIZ:
+ case PM_REQ_RATE:
+ case PM_REQ_GETSAMPLES:
+ case PM_REQ_GETFILLABLE:
+ case PM_REQ_GETFILLED:
+ return -1;
+ case PM_REQ_FLUSH:
+ case PM_REQ_PLAY_START:
+ case PM_REQ_PLAY_END:
+ case PM_REQ_OUTPUT_FINISH:
+ break;
+ case PM_REQ_GETFRAGSIZ:
+ if (dpm.fd != -1) {
+ n = arts_stream_get((arts_stream_t) dpm.fd, ARTS_P_PACKET_SIZE);
+ if (n >= 0) {
+ *(int *)arg = n;
+ return 0;
+ }
+ }
+ return -1;
+ }
+ return 0;
+}
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/timidity/Makefile.am TiMidity++-2.12.0-pre1-pj/timidity/Makefile.am
--- /usr/src/TiMidity++-2.12.0-pre1/timidity/Makefile.am 2002-01-15 10:53:21.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/timidity/Makefile.am 2002-05-12 21:57:22.000000000 +0100
@@ -107,6 +107,7 @@
dl_dlopen.c \
dl_hpux.c \
bsd20_a.c \
+ aRts_a.c \
esd_a.c \
hpux_a.c \
hpux_d_a.c \
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/timidity/mod2midi.c TiMidity++-2.12.0-pre1-pj/timidity/mod2midi.c
--- /usr/src/TiMidity++-2.12.0-pre1/timidity/mod2midi.c 2002-01-15 10:53:21.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/timidity/mod2midi.c 2002-09-23 18:35:36.000000000 +0100
@@ -243,7 +243,7 @@
/* MOD volume --> MIDI volume */
vol >>= 1;
- if (vol < 0) vol = 0;
+ /* if (vol < 0) vol = 0; /* UNSIGNED! */
if (vol > 127) vol = 127;
if (ModV[v].vol != vol) {
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/timidity/output.c TiMidity++-2.12.0-pre1-pj/timidity/output.c
--- /usr/src/TiMidity++-2.12.0-pre1/timidity/output.c 2002-01-15 10:53:21.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/timidity/output.c 2002-05-12 22:36:56.000000000 +0100
@@ -76,6 +76,10 @@
extern PlayMode hpux_nplay_mode;
#endif /* AU_HPUX_ALIB */
+#ifdef AU_ARTS
+extern PlayMode arts_play_mode;
+#endif /* AU_ARTS */
+
#ifdef AU_ESD
extern PlayMode esd_play_mode;
#endif /* AU_ESD */
@@ -111,6 +115,10 @@
&hpux_nplay_mode,
#endif /* AU_HPUX_ALIB */
+#if defined(AU_ARTS)
+ &arts_play_mode,
+#endif /* AU_ARTS */
+
#if defined(AU_ESD)
&esd_play_mode,
#endif /* AU_ESD */
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/timidity/playmidi.c TiMidity++-2.12.0-pre1-pj/timidity/playmidi.c
--- /usr/src/TiMidity++-2.12.0-pre1/timidity/playmidi.c 2002-01-16 10:03:03.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/timidity/playmidi.c 2002-09-27 22:14:10.000000000 +0100
@@ -682,52 +682,27 @@
bk = 0;
load_success = 0;
- if(opt_realtime_playing != 2)
+ if((ip = bank[bk]->tone[prog].instrument) == ( (opt_realtime_playing == 2) ? NULL : MAGIC_LOAD_INSTRUMENT ))
{
- if((ip = bank[bk]->tone[prog].instrument) == MAGIC_LOAD_INSTRUMENT)
- {
- ip = bank[bk]->tone[prog].instrument =
- load_instrument(dr, bk, prog);
- if(ip != NULL)
- load_success = 1;
- }
- if(ip == NULL && bk != 0)
- {
- /* Instrument is not found.
- Retry to load the instrument from bank 0 */
-
- if((ip = bank[0]->tone[prog].instrument) == MAGIC_LOAD_INSTRUMENT)
- ip = bank[0]->tone[prog].instrument =
- load_instrument(dr, 0, prog);
- if(ip != NULL)
- {
- bank[bk]->tone[prog].instrument = ip;
- load_success = 1;
- }
+ ip = bank[bk]->tone[prog].instrument =
+ load_instrument(dr, bk, prog);
+ if(ip != NULL)
+ load_success = 1;
}
}
- else
+ if(ip == NULL && bk != 0)
{
- if((ip = bank[bk]->tone[prog].instrument) == NULL)
- {
- ip = bank[bk]->tone[prog].instrument =
- load_instrument(dr, bk, prog);
- if(ip != NULL)
- load_success = 1;
- }
- if(ip == NULL && bk != 0)
- {
- /* Instrument is not found.
- Retry to load the instrument from bank 0 */
- if((ip = bank[0]->tone[prog].instrument) == NULL)
- ip = bank[0]->tone[prog].instrument =
- load_instrument(dr, 0, prog);
- if(ip != NULL)
- {
- bank[bk]->tone[prog].instrument = ip;
- load_success = 1;
- }
- }
+ /* Instrument is not found.
+ Retry to load the instrument from bank 0 */
+
+ if((ip = bank[0]->tone[prog].instrument) == MAGIC_LOAD_INSTRUMENT)
+ ip = bank[0]->tone[prog].instrument =
+ load_instrument(dr, 0, prog);
+ if(ip != NULL)
+ {
+ bank[bk]->tone[prog].instrument = ip;
+ load_success = 1;
+ }
}
if(load_success)
@@ -2469,38 +2444,42 @@
break;
}
- if(dr)
- {
- channel[ch].bank = prog; /* newbank is ignored */
- if(drumset[prog] == NULL || drumset[prog]->alt == NULL)
- channel[ch].altassign = drumset[0]->alt;
- else
- channel[ch].altassign = drumset[prog]->alt;
- ctl_mode_event(CTLE_DRUMPART, 1, ch, 1);
- }
- else
+ if(!dr)
{
if(special_tonebank >= 0)
newbank = special_tonebank;
+
channel[ch].bank = newbank;
channel[ch].altassign = NULL;
+
ctl_mode_event(CTLE_DRUMPART, 1, ch, 0);
- }
- if(!dr && default_program[ch] == SPECIAL_PROGRAM)
- channel[ch].program = SPECIAL_PROGRAM;
- else
- channel[ch].program = prog;
+ if(default_program[ch] == SPECIAL_PROGRAM)
+ channel[ch].program = SPECIAL_PROGRAM;
+ else
+ channel[ch].program = prog;
- if(opt_realtime_playing == 2 && !dr && (play_mode->flag & PF_PCM_STREAM))
+ if(opt_realtime_playing == 2 && (play_mode->flag & PF_PCM_STREAM))
+ {
+ int b, p;
+
+ p = prog;
+ b = channel[ch].bank;
+ instrument_map(channel[ch].mapID, &b, &p);
+ play_midi_load_instrument(0, b, p);
+ }
+ }
+ else
{
- int b, p;
+ channel[ch].bank = prog; /* newbank is ignored */
+ if(drumset[prog] == NULL || drumset[prog]->alt == NULL)
+ channel[ch].altassign = drumset[0]->alt;
+ else
+ channel[ch].altassign = drumset[prog]->alt;
- p = prog;
- b = channel[ch].bank;
- instrument_map(channel[ch].mapID, &b, &p);
- play_midi_load_instrument(0, b, p);
+ ctl_mode_event(CTLE_DRUMPART, 1, ch, 1);
}
+
}
static void play_midi_prescan(MidiEvent *ev)
diff -Nru /usr/src/TiMidity++-2.12.0-pre1/timidity/sndfont.c TiMidity++-2.12.0-pre1-pj/timidity/sndfont.c
--- /usr/src/TiMidity++-2.12.0-pre1/timidity/sndfont.c 2002-01-16 06:24:57.000000000 +0000
+++ TiMidity++-2.12.0-pre1-pj/timidity/sndfont.c 2002-09-27 21:43:16.000000000 +0100
@@ -235,29 +235,22 @@
{
SFInsts *sf;
- if((sf = find_soundfont(sf_file)) != NULL)
+ if((sf = find_soundfont(sf_file)) == NULL)
{
- if(sf_order >= 0)
- sf->def_order = sf_order;
- if(sf_cutoff >= 0)
- sf->def_cutoff_allowed = sf_cutoff;
- if(sf_resonance >= 0)
- sf->def_resonance_allowed = sf_resonance;
- if(amp >= 0)
- sf->amptune = (FLOAT_T)amp * 0.01;
- current_sfrec = sf;
- return;
+ sf = new_soundfont(sf_file);
+ sf->next = sfrecs;
+ sfrecs = sf;
}
- sf = new_soundfont(sf_file);
if(sf_order >= 0)
- sf->def_order = sf_order;
- if(sf_cutoff > 0)
- sf->def_cutoff_allowed = 1;
+ sf->def_order = sf_order;
+ if(sf_cutoff >= 0)
+ sf->def_cutoff_allowed = sf_cutoff;
+ if(sf_resonance >= 0)
+ sf->def_resonance_allowed = sf_resonance;
if(amp >= 0)
- sf->amptune = (FLOAT_T)amp * 0.01;
- sf->next = sfrecs;
- current_sfrec = sfrecs = sf;
+ sf->amptune = (FLOAT_T)amp * 0.01;
+ current_sfrec = sf;
}
void remove_soundfont(char *sf_file)
@@ -324,6 +317,7 @@
int preset = sfinfo.preset[i].preset;
if (bank == 128)
+ /* FIXME: why not allow exclusion of drumsets? */
alloc_instrument_bank(1, preset);
else {
if (is_excluded(rec, bank, preset, -1))
@@ -442,13 +436,19 @@
{
SFInsts *rec;
Instrument *ip;
+ /*
+ * Search through all ordered soundfonts
+ */
+ int o = order;
+
for(rec = sfrecs; rec != NULL; rec = rec->next)
{
if(rec->fname != NULL)
{
- ip = try_load_soundfont(rec, order, bank, preset, keynote);
+ ip = try_load_soundfont(rec, o, bank, preset, keynote);
if(ip != NULL)
return ip;
+ if (o > 0) o++;
}
}
return NULL;
TiMidity++ Config File
----------------------
(see timidity.cfg(5) for extra details)
HTTPproxy <proxy>
<proxy> is host:port
Sets the url_http_proxy_host and _port
FTPproxy <proxy>
<proxy> is host:port
Sets the url_ftp_proxy_host and _port
mailaddr <mailaddr>
<mailaddr> is something@somethingelse
Sets user_mailaddr
opt <command_line_option>
Sets a command line option from the config file
dir <dir>
Add <dir> to path list
source <file>
read config from <file>
default <name>
Set default instrument name to <name>
progbase <base>
Sets progbase to <base> for use when processing
- <preset> in font statements
- map statements
- <prog> in drumset or bank statements
- <prog> statements (except drumset banks)
Also used in some UIs for display
map <mapname> <from set> <from elem> <to set> <to elem>
<mapname> is
For tonemaps: sc55, sc88, sc88pro, xg | xgsfx64
For drummaps: sc55drum, sc88drum, sc88prodrum, xgsfx126, xgdrum
set_instrument_map(<mapname> <from set> <from elem> <to set> <to elem>)
When looking up a sample, <elem> in <set>, as part of playing a note, use the
redirected sample instead.
bank <bank>
Allocate a new tone bank, <bank>
Make this the current bank
drumset <prog>
Allocate a new drumset bank, <prog>
Make this the current bank
bank <bank> <prog> <patch> { amp=<a>, note=<n>, pan=<p>, keep={env, loop}, strip={env,
loop, tail}, comm=<c> }
bank <bank> <prog> %font <file> <bank> <preset> { <keynote> } { amp=<a>, note=<n>,
pan=<p>, keep={env, loop}, strip={env, loop, tail}, comm=<c> }
drumset <bank> <prog> <patch> { amp=<a>, note=<n>, pan=<p>, keep={env, loop},
strip={env, loop, tail}, comm=<c> }
drumset <bank> 128 <prog> <patch> { amp=<a>, note=<n>, pan=<p>, keep={env, loop},
strip={env, loop, tail}, comm=<c> }
See <prog> below but <bank> only for this statement, it doesn't become current.
<prog> <patch> { amp=<a>, note=<n>, pan=<p>, keep={env, loop}, strip={env, loop,
tail}, comm=<c> }
Applies to the current bank
Sets this GUS bank/prog to use the indicated patchfile
amp=<a> - amplitude tuning factor
note=<n> - set fixed note for this patch (for overriding patch's note value in a
drumset, really)
pan=<p> - set pan position (left|-100..center|0..right|100)
keep=env - keep sample's envelope
keep=loop - keep sample's looping
strip=env - remove envelope from sample
strip=loop - remove loop from sample
strip=tail - cut sample playback after loop
comm=<c> - stores <c> as the comment for this <prog> in the current bank
<prog> %font <file> <bank> <preset> { <keynote> } { amp=<a>, note=<n>, pan=<p>,
keep={env, loop}, strip={env, loop, tail}, comm=<c> }
<prog> %font <file> 128 <bank> <preset> { amp=<a>, note=<n>, pan=<p>, keep={env,
loop}, strip={env, loop, tail}, comm=<c> }
Applies to the current bank
Sets this GUS bank/prog to use a patch from a soundfont (use bank 128 for drumset)
Trailing options as above.
comm <prog> <comment>
Applies to the current bank
Stores <comment> as the comment for this <prog> in the current bank
timeout <prog> <seconds>
Applies to the current bank
Stores <seconds> as the loop_timeout for this <prog> in the current bank
altassign { clear } <range> ...
Applies to the current drumset
It looks (and is doc'd) as if a note_on for any note in the <range> causes any other
note in the range to be killed.
<range> - { <patch> <patch> { <patch> ... } | <patch>-<patch> }
undef <prog>
Applies to the current bank
Clear name and comment from <prog> in the current bank (without a name, the bank is
essentially gone)
copybank <bank>
Applies to the current bank
Copies <bank> to the current bank
copydrumset <drumset>
Applies to the current bank (preferably a drumset - but this bank will become a
drumset)
Copies <drumset> to the current bank
soundfont <file> {remove | {order=<o>, cutoff=<c>, reso=<r>, amp=<a>} }
Remove or add a soundfont
order=<o> - See below
cutoff=<c> - Set default cutoff setting for sf
reso=<r> - Set default resonance setting for sf
amp=<a> - Set default amplitude tuning for sf
(There was a bug, I think, in add_soundfont - if the SFfile was known, all parms were
actioned; otherwise only order and amp were.)
(Actually, "reso" causes nasty hissing noises, so I can understand it not being
wanted...)
Order works like this:
- "<prog> %font" takes priority over order=0
- order=0 takes priority over "<prog> <patch>"
- "<prog> <patch>" takes priority over order>=1
- then soundfont entries are tried from order=1 upwards (with my fix - was order=1)
font exclude <tonebank> { <preset> { <keynote> } }
font exclude 128 { <drumset> { <preset> } }
Applies to the current soundfont
Adds an exclude entry to the current soundfont for <tonebank> or <drumset>, <preset>
(-1=any) and <keynote> (-1=any).
The excluded entry won't be used.
font order <order> <tonebank> { <preset> { <keynote> } }
font order <order> 128 { <drumset> { <preset> }
Applies to the current soundfont
Adds an order entry to the current soundfont for <tonebank> or <drumset>, <preset>
(-1=any) and <keynote> (-1=any). See soundfont order=<o> above.