From 634bff6831d7801ba7078bb43832e157c8f8fa98 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Feb 03 2008 19:01:09 +0000 Subject: - Fix an error in unsf's tremolo settings export --- diff --git a/gt-0.4-config-default-velocity-layer.patch b/gt-0.4-config-default-velocity-layer.patch index 7fb9bee..90eb8dd 100644 --- a/gt-0.4-config-default-velocity-layer.patch +++ b/gt-0.4-config-default-velocity-layer.patch @@ -7,8 +7,8 @@ diff -ur gt-0.4/utils/unsf.c gt-0.4.new/utils/unsf.c +/* 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 char melody_velocity_override[128][128]; -+static char drum_velocity_override[128][128]; ++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; diff --git a/gt-0.4-unsf-bigendian-fix.patch b/gt-0.4-unsf-bigendian-fix.patch new file mode 100644 index 0000000..b643b57 --- /dev/null +++ b/gt-0.4-unsf-bigendian-fix.patch @@ -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 + #include + #include ++#include + + #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); diff --git a/gt-0.4-unsf-tremolo.patch b/gt-0.4-unsf-tremolo.patch new file mode 100644 index 0000000..f7ccedd --- /dev/null +++ b/gt-0.4-unsf-tremolo.patch @@ -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; + diff --git a/gt.spec b/gt.spec index 7abd879..1147f48 100644 --- a/gt.spec +++ b/gt.spec @@ -1,6 +1,6 @@ Name: gt Version: 0.4 -Release: 3%{?dist} +Release: 7%{?dist} Summary: Modified Timidity which supportes enhanced gus format patches Group: Applications/Multimedia License: GPLv2+ @@ -15,6 +15,8 @@ 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 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: alsa-lib-devel libvorbis-devel Requires: timidity++-patches @@ -40,13 +42,15 @@ disassembler. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 cp -p src/README README.timidity %build +export CFLAGS="$RPM_OPT_FLAGS -fsigned-char" %configure -# doesn't build properly with %{?_smp_mflags} -make +make %{?_smp_mflags} %install @@ -79,6 +83,18 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Feb 3 2008 Hans de Goede 0.4-7 +- Fix an error in unsf's tremolo settings export + +* Sat Feb 2 2008 Hans de Goede 0.4-6 +- Fix hopefully the last endian issue in unsf + +* Fri Feb 1 2008 Hans de Goede 0.4-5 +- And fix unsf for char being unsigned on ppc + +* Fri Feb 1 2008 Hans de Goede 0.4-4 +- Fix unsf running on big endian systems + * Wed Jan 30 2008 Hans de Goede 0.4-3 - Correct license field from GPLv2 to GPLv2+