package created by autospec [release 0.4-1mamba;Thu Jul 08 2010]

This commit is contained in:
gil 2024-01-05 23:33:56 +01:00
parent f4de428295
commit b44727ab4f
9 changed files with 550 additions and 0 deletions

View File

@ -1,2 +1,5 @@
# gt
Modified timidity midi player which supportes enhanced gus format patches and
surround audio output.

12
gt-0.4-compile-fix.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up gt-0.4/src/instrum.c~ gt-0.4/src/instrum.c
--- gt-0.4/src/instrum.c~ 2008-01-27 14:21:17.000000000 +0100
+++ gt-0.4/src/instrum.c 2008-01-27 14:21:17.000000000 +0100
@@ -1170,7 +1170,7 @@ load_instrument (ToneBank *b, int bank,
sp->lfo_sweep_increment,
sp->lfo_phase_increment, sp->lfo_depth);
}
- READ_CHAR ((int8)sp->aps_parameter);
+ READ_CHAR (sp->aps_parameter);
/* skip (fp, 1); */
}
else {

View File

@ -0,0 +1,114 @@
diff -ur gt-0.4/utils/unsf.c gt-0.4.new/utils/unsf.c
--- gt-0.4/utils/unsf.c 2004-11-07 22:41:05.000000000 +0100
+++ gt-0.4.new/utils/unsf.c 2008-01-27 19:55:30.000000000 +0100
@@ -100,6 +100,11 @@
unsigned char other_patches[128];
} VelocityRangeList;
+/* allow the user to choose which velocity to write the first (as the first
+ one gets used by apps which do not know about the extended patch format) */
+static signed char melody_velocity_override[128][128];
+static signed char drum_velocity_override[128][128];
+
static int opt_8bit = FALSE;
static int opt_verbose = FALSE;
static int opt_veryverbose = FALSE;
@@ -2980,6 +2988,8 @@
width = vlist->velmax[k] - vlist->velmin[k];
}
}
+ if (melody_velocity_override[i][j] != -1)
+ widest = melody_velocity_override[i][j];
if (widest) {
velmin = vlist->velmin[0];
velmax = vlist->velmax[0];
@@ -3020,6 +3030,8 @@
width = vlist->velmax[k] - vlist->velmin[k];
}
}
+ if (drum_velocity_override[i][j] != -1)
+ widest = drum_velocity_override[i][j];
if (widest) {
velmin = vlist->velmin[0];
velmax = vlist->velmax[0];
@@ -3663,8 +3675,12 @@
int i, c;
char cfgname[80];
char *inname;
+ char *sep1, *sep2;
+
+ memset(melody_velocity_override, -1, 128*128);
+ memset(drum_velocity_override, -1, 128*128);
- while ((c = getopt (argc, argv, "FVvnsdm")) > 0)
+ while ((c = getopt (argc, argv, "FVvnsdmM:D:")) > 0)
switch (c) {
case 'v':
opt_verbose = 1;
@@ -3687,13 +3703,35 @@
case 'V':
opt_adjust_volume = 0;
break;
+ case 'M':
+ sep1 = strchr(optarg, ':');
+ sep2 = strchr(optarg, '=');
+ if (sep1 && sep2)
+ {
+ melody_velocity_override[atoi(optarg)]
+ [atoi(sep1 + 1)] = atoi(sep2 + 1);
+ break;
+ }
+ /* error fall through, check will fail again */
+ case 'D':
+ sep1 = strchr(optarg, ':');
+ sep2 = strchr(optarg, '=');
+ if (sep1 && sep2)
+ {
+ drum_velocity_override[atoi(optarg)]
+ [atoi(sep1 + 1)] = atoi(sep2 + 1);
+ break;
+ }
+ /* error fall through */
default:
- fprintf(stderr, "usage: unsf [-v] [-n] [-s] [-d] [-m] [-F] [-V] filename\n");
+ fprintf(stderr, "usage: unsf [-v] [-n] [-s] [-d] [-m] [-F] [-V] [-M <bank>:<instrument>=<layer>]\n"
+ " [-D <bank>:<instrument>=<layer>] <filename>\n");
return 1;
}
if (argc - optind != 1) {
- fprintf(stderr, "usage: unsf [-v] [-n] [-s] [-d] [-m] [-F] [-V] filename\n");
+ fprintf(stderr, "usage: unsf [-v] [-n] [-s] [-d] [-m] [-F] [-V] [-M <bank>:<instrument>=<layer>]\n"
+ " [-D <bank>:<instrument>=<layer>] <filename>\n");
exit(1);
}
diff -ur gt-0.4/utils/unsf.man gt-0.4.new/utils/unsf.man
--- gt-0.4/utils/unsf.man 2004-11-07 23:20:37.000000000 +0100
+++ gt-0.4.new/utils/unsf.man 2008-01-27 20:03:06.000000000 +0100
@@ -6,7 +6,8 @@
.SH SYNOPSIS
-.B unsf [-v|-s|-m|-d|-n|-V] \fBsoundfont-file\fR
+.B unsf
+[\fI-v|-s|-m|-d|-n|-V\fR] [\fI-M <bank>:<instrument>=<layer>\fR] [\fI-D <bank>:<instrument>=<layer>\fR] \fBsoundfont-file\fR
.SH DESCRIPTION
@@ -135,6 +136,15 @@
.TP
.B \-v
Verbose.
+.TP
+.B \-M \fI<bank>:<instrument>=<layer>\fR
+Make the given velocity \fIlayer\fR the default for \fIbank:instrument\fR,
+this affects programs which do not know howto handle the extended GUS patch
+format, as they will always play the default layer, and this determines which
+layer gets written when using \fB-s\fR.
+.TP
+.B \-D \fI<bank>:<instrument>=<layer>\fR
+Same as \fB-M\fR but then for drum banks.
.SH AUTHORS

97
gt-0.4-noac3.patch Normal file
View File

@ -0,0 +1,97 @@
diff -up gt-0.4/src/Makefile.in~ gt-0.4/src/Makefile.in
--- gt-0.4/src/Makefile.in~ 2008-01-27 14:17:25.000000000 +0100
+++ gt-0.4/src/Makefile.in 2008-01-27 14:17:25.000000000 +0100
@@ -141,7 +141,7 @@ gt_SOURCES = timidity.c common.c readmid
wave_a.c dumb_c.c $(CURSES_SOURCE) \
sndfont.c readsbk.c sfz.c \
resample.c resample32.c resample_l.c resample_f.c resample_s.c resample_m.c \
- cfg.c ac3enc.c ac3_a.c $(ALSA_SOURCE)
+ cfg.c $(ALSA_SOURCE)
sf2cfg_SOURCES = sf2cfg.c readsbk.c
@@ -149,7 +149,6 @@ sfz2pat_SOURCES = sfz2pat.c tables.c
noinst_HEADERS = gtim.h common.h readmidi.h playmidi.h resample.h mix.h instrum.h \
tables.h butter.h controls.h output.h filter.h sbk.h sflayer.h effects.h \
- ac3_codec.h ac3_common.h
man1_MANS = gt.man sf2cfg.man sfz2pat.man
@@ -168,7 +167,7 @@ am__gt_SOURCES_DIST = timidity.c common.
instrum.c tables.c controls.c output.c filter.c wave_a.c \
dumb_c.c ncurs_c.c sndfont.c readsbk.c sfz.c resample.c \
resample32.c resample_l.c resample_f.c resample_s.c \
- resample_m.c cfg.c ac3enc.c ac3_a.c alsa_a.c
+ resample_m.c cfg.c alsa_a.c
@HAS_CURSES_TRUE@am__objects_1 = ncurs_c.$(OBJEXT)
@HAS_ALSA_TRUE@am__objects_2 = alsa_a.$(OBJEXT)
am_gt_OBJECTS = timidity.$(OBJEXT) common.$(OBJEXT) readmidi.$(OBJEXT) \
@@ -178,8 +177,7 @@ am_gt_OBJECTS = timidity.$(OBJEXT) commo
$(am__objects_1) sndfont.$(OBJEXT) readsbk.$(OBJEXT) \
sfz.$(OBJEXT) resample.$(OBJEXT) resample32.$(OBJEXT) \
resample_l.$(OBJEXT) resample_f.$(OBJEXT) resample_s.$(OBJEXT) \
- resample_m.$(OBJEXT) cfg.$(OBJEXT) ac3enc.$(OBJEXT) \
- ac3_a.$(OBJEXT) $(am__objects_2)
+ resample_m.$(OBJEXT) cfg.$(OBJEXT) $(am__objects_2)
gt_OBJECTS = $(am_gt_OBJECTS)
gt_DEPENDENCIES =
gt_LDFLAGS =
@@ -201,8 +199,7 @@ wav2pat_LDFLAGS =
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ac3_a.Po ./$(DEPDIR)/ac3enc.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/alsa_a.Po ./$(DEPDIR)/cfg.Po \
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/alsa_a.Po ./$(DEPDIR)/cfg.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/common.Po ./$(DEPDIR)/controls.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/dumb_c.Po ./$(DEPDIR)/filter.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/instrum.Po ./$(DEPDIR)/mix.Po \
@@ -301,8 +298,6 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ac3_a.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ac3enc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alsa_a.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@
diff -up gt-0.4/src/Makefile.am~ gt-0.4/src/Makefile.am
--- gt-0.4/src/Makefile.am~ 2008-01-27 14:16:30.000000000 +0100
+++ gt-0.4/src/Makefile.am 2008-01-27 14:16:30.000000000 +0100
@@ -31,14 +31,13 @@ gt_SOURCES = timidity.c common.c readmid
wave_a.c dumb_c.c $(CURSES_SOURCE) \
sndfont.c readsbk.c sfz.c \
resample.c resample32.c resample_l.c resample_f.c resample_s.c resample_m.c \
- cfg.c ac3enc.c ac3_a.c $(ALSA_SOURCE)
+ cfg.c $(ALSA_SOURCE)
sf2cfg_SOURCES = sf2cfg.c readsbk.c
sfz2pat_SOURCES = sfz2pat.c tables.c
noinst_HEADERS = gtim.h common.h readmidi.h playmidi.h resample.h mix.h instrum.h \
tables.h butter.h controls.h output.h filter.h sbk.h sflayer.h effects.h \
- ac3_codec.h ac3_common.h
cfg.c: cfg.l
rm -f cfg.c
diff -up gt-0.4/src/output.c~ gt-0.4/src/output.c
--- gt-0.4/src/output.c~ 2008-01-27 14:21:53.000000000 +0100
+++ gt-0.4/src/output.c 2008-01-27 14:21:53.000000000 +0100
@@ -35,8 +35,6 @@ extern PlayMode alsa_play_mode;
#define DEFAULT_PLAY_MODE &alsa_play_mode
#endif
-extern PlayMode ac3_play_mode;
-
/* This is always compiled in. */
extern PlayMode wave_play_mode;
@@ -46,7 +44,6 @@ PlayMode *play_mode_list[] = {
DEFAULT_PLAY_MODE,
#endif
&wave_play_mode,
- &ac3_play_mode,
0
};

22
gt-0.4-optflags.patch Normal file
View File

@ -0,0 +1,22 @@
diff -up gt-0.4/src/Makefile.in~ gt-0.4/src/Makefile.in
--- gt-0.4/src/Makefile.in~ 2008-01-27 15:00:48.000000000 +0100
+++ gt-0.4/src/Makefile.in 2008-01-27 15:00:48.000000000 +0100
@@ -573,7 +573,6 @@ uninstall-man: uninstall-man1
uninstall-info-am uninstall-man uninstall-man1
-override CFLAGS = -O3 -g -fomit-frame-pointer -ffast-math
cfg.c: cfg.l
rm -f cfg.c
diff -up gt-0.4/src/Makefile.am~ gt-0.4/src/Makefile.am
--- gt-0.4/src/Makefile.am~ 2008-01-27 15:00:51.000000000 +0100
+++ gt-0.4/src/Makefile.am 2008-01-27 15:00:51.000000000 +0100
@@ -7,7 +7,6 @@ AM_INCLUDES = $(CURSES_INCLUDEDIR)
AM_CFLAGS = -DDEFAULT_PATH=\"$(TIMID_DIR)\" $(ALSA_CFLAGS) -Wall -W -Wshadow \
-Wpointer-arith -Wcast-align $(AM_INCLUDES) $(VORBIS_CFLAGS)
-override CFLAGS = -O3 -g -fomit-frame-pointer -ffast-math
#gt_LDADD = $(ALSA_LIBS) $(CURSES_LIBS) $(AVCODEC_LIBS) $(VORBIS_LIBS)

View File

@ -0,0 +1,22 @@
diff -up gt-0.4/src/sfz2pat.c~ gt-0.4/src/sfz2pat.c
--- gt-0.4/src/sfz2pat.c~ 2008-01-30 09:53:36.000000000 +0100
+++ gt-0.4/src/sfz2pat.c 2008-01-30 09:53:36.000000000 +0100
@@ -3897,7 +3897,6 @@ int read_sample(char *name)
}
}
#else
- else
/* convert to machine byte order */
{
int32 data_len = datasize / 2;
diff -up gt-0.4/src/sfz2pat.l~ gt-0.4/src/sfz2pat.l
--- gt-0.4/src/sfz2pat.l~ 2008-01-30 09:57:29.000000000 +0100
+++ gt-0.4/src/sfz2pat.l 2008-01-30 09:57:29.000000000 +0100
@@ -1878,7 +1878,6 @@ int read_sample(char *name)
}
}
#else
- else
/* convert to machine byte order */
{
int32 data_len = datasize / 2;

View File

@ -0,0 +1,171 @@
diff -up gt-0.4/utils/unsf.c.endian gt-0.4/utils/unsf.c
--- gt-0.4/utils/unsf.c.endian 2008-02-02 22:37:07.000000000 +0100
+++ gt-0.4/utils/unsf.c 2008-02-02 22:39:10.000000000 +0100
@@ -67,6 +67,7 @@
#include <math.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <endian.h>
#ifndef TRUE
#define TRUE -1
@@ -290,59 +291,6 @@ double bend_coarse[128] = {
1290.1591550923506, 1366.8760106701147, 1448.1546878700494, 1534.2664467217226
};
-typedef union {
- unsigned char c[4];
- unsigned long l;
-} long_end;
-typedef union {
- unsigned char c[2];
- unsigned short s;
-} short_end;
-
-static int big_endian = 1;
-
-static long longnum(unsigned char c1, unsigned char c2,
- unsigned char c3, unsigned char c4)
-{
- long_end lswitch;
- if (big_endian) {
- lswitch.c[0] = c4;
- lswitch.c[1] = c3;
- lswitch.c[2] = c2;
- lswitch.c[3] = c1;
- } else {
- lswitch.c[0] = c1;
- lswitch.c[1] = c2;
- lswitch.c[2] = c3;
- lswitch.c[3] = c4;
- }
- return(lswitch.l);
-}
-
-static short shortnum(unsigned char c1, unsigned char c2)
-{
- short_end sswitch;
- if (big_endian) {
- sswitch.c[0] = c2;
- sswitch.c[1] = c1;
- } else {
- sswitch.c[0] = c1;
- sswitch.c[1] = c2;
- }
- return(sswitch.s);
-}
-
-static void byteorder(void)
-{ long_end hexx;
-
- hexx.c[0] = 0x12;
- hexx.c[1] = 0x34;
- hexx.c[2] = 0x56;
- hexx.c[3] = 0x78;
- if (hexx.l == 0x78563412) big_endian = 0;
-}
-
-
static char *getname(char *p)
{
int i, j, e;
@@ -425,14 +373,8 @@ static void mem_write8(int val)
/* writes a word to the memory buffer (little endian) */
static void mem_write16(int val)
{
- if (big_endian) {
- mem_write8((val >> 8) & 0xFF);
- mem_write8(val & 0xFF);
- }
- else {
mem_write8(val & 0xFF);
mem_write8((val >> 8) & 0xFF);
- }
}
@@ -440,41 +382,13 @@ static void mem_write16(int val)
/* writes a long to the memory buffer (little endian) */
static void mem_write32(int val)
{
- if (big_endian) {
- mem_write8((val >> 24) & 0xFF);
- mem_write8((val >> 16) & 0xFF);
- mem_write8((val >> 8) & 0xFF);
- mem_write8(val & 0xFF);
- }
- else {
mem_write8(val & 0xFF);
mem_write8((val >> 8) & 0xFF);
mem_write8((val >> 16) & 0xFF);
mem_write8((val >> 24) & 0xFF);
- }
-}
-
-
-
-/* alters data already written to the memory buffer (little endian) */
-static void mem_modify32(int pos, int val)
-{
- if (big_endian) {
- mem[pos+3] = (val >> 24) & 0xFF;
- mem[pos+2] = (val >> 16) & 0xFF;
- mem[pos+1] = (val >> 8) & 0xFF;
- mem[pos] = val & 0xFF;
- }
- else {
- mem[pos] = val & 0xFF;
- mem[pos+1] = (val >> 8) & 0xFF;
- mem[pos+2] = (val >> 16) & 0xFF;
- mem[pos+3] = (val >> 24) & 0xFF;
- }
}
-
/* writes a block of data the memory buffer */
static void mem_write_block(void *data, int size)
{
@@ -708,8 +622,13 @@ static int sf_num_preset_indexes = 0;
/* SoundFont preset generators */
typedef struct rangesType
{
+#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned char byLo;
unsigned char byHi;
+#else
+ unsigned char byHi;
+ unsigned char byLo;
+#endif
} rangesType;
@@ -3254,9 +3173,6 @@ static int get16(FILE *f)
b1 = get8(f);
b2 = get8(f);
- if (big_endian)
- return ((b1 << 8) | b2);
- else
return ((b2 << 8) | b1);
}
@@ -3272,9 +3188,6 @@ static int get32(FILE *f)
b3 = get8(f);
b4 = get8(f);
- if (big_endian)
- return ((b1 << 24) | (b2 << 16) | (b3 << 8) | b4);
- else
return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
}
@@ -3753,8 +3666,6 @@ int main(int argc, char *argv[])
opt_soundfont = argv[optind];
- byteorder();
-
add_soundfont_patches();
if (!opt_no_write) fclose(cfg_fd);

12
gt-0.4-unsf-tremolo.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up gt-0.4/utils/unsf.c~ gt-0.4/utils/unsf.c
--- gt-0.4/utils/unsf.c~ 2008-02-03 13:45:08.000000000 +0100
+++ gt-0.4/utils/unsf.c 2008-02-03 13:45:08.000000000 +0100
@@ -1462,7 +1462,7 @@ convert_lfo (void)
static void convert_tremolo(void)
{
int level;
- unsigned int freq;
+ int freq;
sp_tremolo_phase_increment = sp_tremolo_sweep_increment = sp_tremolo_depth = 0;

97
gt.spec Normal file
View File

@ -0,0 +1,97 @@
Name: gt
Version: 0.4
Release: 1mamba
Summary: Modified Timidity which supportes enhanced gus format patches
Group: Applications/Multimedia
Vendor: openmamba
Distribution: openmamba
Packager: gil <puntogil@libero.it>
URL: http://alsa.opensrc.org/index.php/GusSoundfont
Source: ftp://ling.lll.hawaii.edu/pub/greg/gt-%{version}.tar.gz
License: GPL
Patch0: gt-0.4-noac3.patch
Patch1: gt-0.4-compile-fix.patch
Patch2: gt-0.4-optflags.patch
Patch3: gt-0.4-config-default-velocity-layer.patch
Patch4: gt-0.4-ppc-compile-fix.patch
Patch5: gt-0.4-unsf-bigendian-fix.patch
Patch6: gt-0.4-unsf-tremolo.patch
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libalsa-devel
BuildRequires: libncurses-devel
BuildRequires: libvorbis-devel
## AUTOBUILDREQ-END
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Modified timidity midi player which supportes enhanced gus format patches and
surround audio output.
%package -n soundfont-utils
Summary: Utilities for converting from / to various soundfont formats
Group: Applications/Multimedia
%description -n soundfont-utils
Utilities for converting from / to various soundfont formats and a midi file
disassembler.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
#%patch4 -p1
%patch5 -p1
%patch6 -p1
cp -p src/README README.timidity
# NON FREE
rm -rf examples/patch
rm -rf sfz
rm -rf src/ac3*
%build
export CFLAGS="%{optflags} -fsigned-char"
%configure
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
mv %{buildroot}%{_bindir}/dim %{buildroot}%{_bindir}/midi-disasm
mv %{buildroot}%{_mandir}/man1/dim.1 %{buildroot}%{_mandir}/man1/midi-disasm.1
sed -i 's/dim/midi-disasm/g' %{buildroot}%{_mandir}/man1/midi-disasm.1
touch -r utils/midifile.c %{buildroot}%{_mandir}/man1/midi-disasm.1
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_bindir}/gt
%{_mandir}/man1/gt.1.gz
%doc AUTHORS COPYING ChangeLog FEATURES NEWS README*
%files -n soundfont-utils
%defattr(-,root,root)
%{_bindir}/midi-disasm
%{_bindir}/patcat
%{_bindir}/patinfo
%{_bindir}/sf2cfg
%{_bindir}/sfz2pat
%{_bindir}/unsf
%{_bindir}/wav2pat
%{_mandir}/man1/midi-disasm.1.gz
%{_mandir}/man1/patcat.1.gz
%{_mandir}/man1/sf2cfg.1.gz
%{_mandir}/man1/sfz2pat.1.gz
%{_mandir}/man1/unsf.1.gz
%doc utils/README* utils/GUSSF2-SPEC
%changelog
* Thu Jul 08 2010 gil <puntogil@libero.it> 0.4-1mamba
- package created by autospec