remove broken DLS instruments support: it was never good enough.
authorOzkan Sezer <sezero@users.sourceforge.net>
Sat, 21 Oct 2017 09:04:55 +0300
changeset 79982dcc7ce6d20
parent 798 9b6d7d1b3a23
child 800 cc4aef7fef64
remove broken DLS instruments support: it was never good enough.
VisualC/timidity/timidity.vcxproj
Xcode-iOS/SDL_mixer.xcodeproj/project.pbxproj
Xcode/SDL_mixer.xcodeproj/project.pbxproj
timidity/dls1.h
timidity/dls2.h
timidity/instrum.c
timidity/instrum_dls.c
timidity/instrum_dls.h
timidity/playmidi.c
timidity/timidity.c
timidity/timidity.h
     1.1 --- a/VisualC/timidity/timidity.vcxproj	Sat Oct 21 00:53:21 2017 -0700
     1.2 +++ b/VisualC/timidity/timidity.vcxproj	Sat Oct 21 09:04:55 2017 +0300
     1.3 @@ -21,7 +21,6 @@
     1.4    <ItemGroup>
     1.5      <ClCompile Include="..\..\timidity\common.c" />
     1.6      <ClCompile Include="..\..\timidity\instrum.c" />
     1.7 -    <ClCompile Include="..\..\timidity\instrum_dls.c" />
     1.8      <ClCompile Include="..\..\timidity\mix.c" />
     1.9      <ClCompile Include="..\..\timidity\output.c" />
    1.10      <ClCompile Include="..\..\timidity\playmidi.c" />
    1.11 @@ -32,10 +31,7 @@
    1.12    </ItemGroup>
    1.13    <ItemGroup>
    1.14      <ClInclude Include="..\..\timidity\common.h" />
    1.15 -    <ClInclude Include="..\..\timidity\dls1.h" />
    1.16 -    <ClInclude Include="..\..\timidity\dls2.h" />
    1.17      <ClInclude Include="..\..\timidity\instrum.h" />
    1.18 -    <ClInclude Include="..\..\timidity\instrum_dls.h" />
    1.19      <ClInclude Include="..\..\timidity\mix.h" />
    1.20      <ClInclude Include="..\..\timidity\options.h" />
    1.21      <ClInclude Include="..\..\timidity\output.h" />
     2.1 --- a/Xcode-iOS/SDL_mixer.xcodeproj/project.pbxproj	Sat Oct 21 00:53:21 2017 -0700
     2.2 +++ b/Xcode-iOS/SDL_mixer.xcodeproj/project.pbxproj	Sat Oct 21 09:04:55 2017 +0300
     2.3 @@ -111,19 +111,15 @@
     2.4  		AAE883A51F973261007B6569 /* timidity.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE8838E1F97325E007B6569 /* timidity.h */; };
     2.5  		AAE883A61F973261007B6569 /* playmidi.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE8838F1F97325E007B6569 /* playmidi.h */; };
     2.6  		AAE883A71F973261007B6569 /* resample.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883901F97325E007B6569 /* resample.c */; };
     2.7 -		AAE883A81F973261007B6569 /* instrum_dls.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883911F97325E007B6569 /* instrum_dls.h */; };
     2.8  		AAE883A91F973261007B6569 /* mix.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883921F97325E007B6569 /* mix.h */; };
     2.9  		AAE883AA1F973261007B6569 /* options.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883931F97325F007B6569 /* options.h */; };
    2.10  		AAE883AB1F973261007B6569 /* timidity.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883941F97325F007B6569 /* timidity.c */; };
    2.11  		AAE883AC1F973261007B6569 /* instrum.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883951F97325F007B6569 /* instrum.c */; };
    2.12  		AAE883AD1F973261007B6569 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883961F97325F007B6569 /* common.c */; };
    2.13 -		AAE883AE1F973261007B6569 /* dls1.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883971F97325F007B6569 /* dls1.h */; };
    2.14  		AAE883AF1F973261007B6569 /* output.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883981F97325F007B6569 /* output.c */; };
    2.15 -		AAE883B01F973261007B6569 /* dls2.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883991F97325F007B6569 /* dls2.h */; };
    2.16  		AAE883B11F973261007B6569 /* playmidi.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE8839A1F97325F007B6569 /* playmidi.c */; };
    2.17  		AAE883B21F973261007B6569 /* readmidi.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE8839B1F97325F007B6569 /* readmidi.c */; };
    2.18  		AAE883B31F973261007B6569 /* readmidi.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE8839C1F973260007B6569 /* readmidi.h */; };
    2.19 -		AAE883B41F973261007B6569 /* instrum_dls.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE8839D1F973260007B6569 /* instrum_dls.c */; };
    2.20  		AAE883B51F973261007B6569 /* output.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE8839E1F973260007B6569 /* output.h */; };
    2.21  		AAE883B61F973261007B6569 /* resample.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE8839F1F973260007B6569 /* resample.h */; };
    2.22  		AAE883B71F973261007B6569 /* tables.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883A01F973260007B6569 /* tables.c */; };
    2.23 @@ -237,19 +233,15 @@
    2.24  		AAE8838E1F97325E007B6569 /* timidity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = timidity.h; sourceTree = "<group>"; };
    2.25  		AAE8838F1F97325E007B6569 /* playmidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = playmidi.h; sourceTree = "<group>"; };
    2.26  		AAE883901F97325E007B6569 /* resample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resample.c; sourceTree = "<group>"; };
    2.27 -		AAE883911F97325E007B6569 /* instrum_dls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = instrum_dls.h; sourceTree = "<group>"; };
    2.28  		AAE883921F97325E007B6569 /* mix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mix.h; sourceTree = "<group>"; };
    2.29  		AAE883931F97325F007B6569 /* options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = options.h; sourceTree = "<group>"; };
    2.30  		AAE883941F97325F007B6569 /* timidity.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = timidity.c; sourceTree = "<group>"; };
    2.31  		AAE883951F97325F007B6569 /* instrum.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = instrum.c; sourceTree = "<group>"; };
    2.32  		AAE883961F97325F007B6569 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = "<group>"; };
    2.33 -		AAE883971F97325F007B6569 /* dls1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dls1.h; sourceTree = "<group>"; };
    2.34  		AAE883981F97325F007B6569 /* output.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = output.c; sourceTree = "<group>"; };
    2.35 -		AAE883991F97325F007B6569 /* dls2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dls2.h; sourceTree = "<group>"; };
    2.36  		AAE8839A1F97325F007B6569 /* playmidi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = playmidi.c; sourceTree = "<group>"; };
    2.37  		AAE8839B1F97325F007B6569 /* readmidi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = readmidi.c; sourceTree = "<group>"; };
    2.38  		AAE8839C1F973260007B6569 /* readmidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readmidi.h; sourceTree = "<group>"; };
    2.39 -		AAE8839D1F973260007B6569 /* instrum_dls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = instrum_dls.c; sourceTree = "<group>"; };
    2.40  		AAE8839E1F973260007B6569 /* output.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = output.h; sourceTree = "<group>"; };
    2.41  		AAE8839F1F973260007B6569 /* resample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resample.h; sourceTree = "<group>"; };
    2.42  		AAE883A01F973260007B6569 /* tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables.c; sourceTree = "<group>"; };
    2.43 @@ -350,10 +342,6 @@
    2.44  			children = (
    2.45  				AAE883961F97325F007B6569 /* common.c */,
    2.46  				AAE8838C1F97325E007B6569 /* common.h */,
    2.47 -				AAE883971F97325F007B6569 /* dls1.h */,
    2.48 -				AAE883991F97325F007B6569 /* dls2.h */,
    2.49 -				AAE8839D1F973260007B6569 /* instrum_dls.c */,
    2.50 -				AAE883911F97325E007B6569 /* instrum_dls.h */,
    2.51  				AAE883951F97325F007B6569 /* instrum.c */,
    2.52  				AAE8838D1F97325E007B6569 /* instrum.h */,
    2.53  				AAE883A21F973260007B6569 /* mix.c */,
    2.54 @@ -479,7 +467,6 @@
    2.55  				AA6442A1175B0E2500A2125A /* block.h in Headers */,
    2.56  				AA6442A3175B0E2500A2125A /* codebook.h in Headers */,
    2.57  				AAE883A41F973261007B6569 /* instrum.h in Headers */,
    2.58 -				AAE883B01F973261007B6569 /* dls2.h in Headers */,
    2.59  				AA6442A4175B0E2500A2125A /* codec_internal.h in Headers */,
    2.60  				AAE406391F9609BD00EDAF53 /* music_mpg123.h in Headers */,
    2.61  				AA6442A5175B0E2500A2125A /* config_types.h in Headers */,
    2.62 @@ -492,7 +479,6 @@
    2.63  				AAE883A61F973261007B6569 /* playmidi.h in Headers */,
    2.64  				AAE4062D1F9609BD00EDAF53 /* music_modplug.h in Headers */,
    2.65  				AAE883B81F973261007B6569 /* tables.h in Headers */,
    2.66 -				AAE883A81F973261007B6569 /* instrum_dls.h in Headers */,
    2.67  				AAE406401F9609BD00EDAF53 /* music_nativemidi.h in Headers */,
    2.68  				AAE883A91F973261007B6569 /* mix.h in Headers */,
    2.69  				AA6442C4175B0E5000A2125A /* mdct.h in Headers */,
    2.70 @@ -512,7 +498,6 @@
    2.71  				AA60219017653A9800662B9C /* modplug.h in Headers */,
    2.72  				AAE406371F9609BD00EDAF53 /* music_ogg.h in Headers */,
    2.73  				AA60219617653A9800662B9C /* tables.h in Headers */,
    2.74 -				AAE883AE1F973261007B6569 /* dls1.h in Headers */,
    2.75  				AAE406301F9609BD00EDAF53 /* music_wav.h in Headers */,
    2.76  			);
    2.77  			runOnlyForDeploymentPostprocessing = 0;
    2.78 @@ -642,7 +627,6 @@
    2.79  				AA60218A17653A9800662B9C /* load_ult.cpp in Sources */,
    2.80  				AA60218B17653A9800662B9C /* load_umx.cpp in Sources */,
    2.81  				AAE4063F1F9609BD00EDAF53 /* music_ogg.c in Sources */,
    2.82 -				AAE883B41F973261007B6569 /* instrum_dls.c in Sources */,
    2.83  				AA60218C17653A9800662B9C /* load_wav.cpp in Sources */,
    2.84  				AAE883AF1F973261007B6569 /* output.c in Sources */,
    2.85  				AA60218D17653A9800662B9C /* load_xm.cpp in Sources */,
     3.1 --- a/Xcode/SDL_mixer.xcodeproj/project.pbxproj	Sat Oct 21 00:53:21 2017 -0700
     3.2 +++ b/Xcode/SDL_mixer.xcodeproj/project.pbxproj	Sat Oct 21 09:04:55 2017 +0300
     3.3 @@ -58,19 +58,15 @@
     3.4  		AAE883771F97321E007B6569 /* timidity.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883601F97321C007B6569 /* timidity.h */; };
     3.5  		AAE883781F97321E007B6569 /* playmidi.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883611F97321C007B6569 /* playmidi.h */; };
     3.6  		AAE883791F97321E007B6569 /* resample.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883621F97321C007B6569 /* resample.c */; };
     3.7 -		AAE8837A1F97321E007B6569 /* instrum_dls.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883631F97321C007B6569 /* instrum_dls.h */; };
     3.8  		AAE8837B1F97321E007B6569 /* mix.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883641F97321C007B6569 /* mix.h */; };
     3.9  		AAE8837C1F97321E007B6569 /* options.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883651F97321C007B6569 /* options.h */; };
    3.10  		AAE8837D1F97321E007B6569 /* timidity.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883661F97321C007B6569 /* timidity.c */; };
    3.11  		AAE8837E1F97321E007B6569 /* instrum.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883671F97321C007B6569 /* instrum.c */; };
    3.12  		AAE8837F1F97321E007B6569 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883681F97321D007B6569 /* common.c */; };
    3.13 -		AAE883801F97321E007B6569 /* dls1.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883691F97321D007B6569 /* dls1.h */; };
    3.14  		AAE883811F97321E007B6569 /* output.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE8836A1F97321D007B6569 /* output.c */; };
    3.15 -		AAE883821F97321E007B6569 /* dls2.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE8836B1F97321D007B6569 /* dls2.h */; };
    3.16  		AAE883831F97321E007B6569 /* playmidi.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE8836C1F97321D007B6569 /* playmidi.c */; };
    3.17  		AAE883841F97321E007B6569 /* readmidi.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE8836D1F97321D007B6569 /* readmidi.c */; };
    3.18  		AAE883851F97321E007B6569 /* readmidi.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE8836E1F97321D007B6569 /* readmidi.h */; };
    3.19 -		AAE883861F97321E007B6569 /* instrum_dls.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE8836F1F97321D007B6569 /* instrum_dls.c */; };
    3.20  		AAE883871F97321E007B6569 /* output.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883701F97321D007B6569 /* output.h */; };
    3.21  		AAE883881F97321E007B6569 /* resample.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE883711F97321E007B6569 /* resample.h */; };
    3.22  		AAE883891F97321E007B6569 /* tables.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE883721F97321E007B6569 /* tables.c */; };
    3.23 @@ -160,19 +156,15 @@
    3.24  		AAE883601F97321C007B6569 /* timidity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = timidity.h; sourceTree = "<group>"; };
    3.25  		AAE883611F97321C007B6569 /* playmidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = playmidi.h; sourceTree = "<group>"; };
    3.26  		AAE883621F97321C007B6569 /* resample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resample.c; sourceTree = "<group>"; };
    3.27 -		AAE883631F97321C007B6569 /* instrum_dls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = instrum_dls.h; sourceTree = "<group>"; };
    3.28  		AAE883641F97321C007B6569 /* mix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mix.h; sourceTree = "<group>"; };
    3.29  		AAE883651F97321C007B6569 /* options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = options.h; sourceTree = "<group>"; };
    3.30  		AAE883661F97321C007B6569 /* timidity.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = timidity.c; sourceTree = "<group>"; };
    3.31  		AAE883671F97321C007B6569 /* instrum.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = instrum.c; sourceTree = "<group>"; };
    3.32  		AAE883681F97321D007B6569 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = "<group>"; };
    3.33 -		AAE883691F97321D007B6569 /* dls1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dls1.h; sourceTree = "<group>"; };
    3.34  		AAE8836A1F97321D007B6569 /* output.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = output.c; sourceTree = "<group>"; };
    3.35 -		AAE8836B1F97321D007B6569 /* dls2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dls2.h; sourceTree = "<group>"; };
    3.36  		AAE8836C1F97321D007B6569 /* playmidi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = playmidi.c; sourceTree = "<group>"; };
    3.37  		AAE8836D1F97321D007B6569 /* readmidi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = readmidi.c; sourceTree = "<group>"; };
    3.38  		AAE8836E1F97321D007B6569 /* readmidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readmidi.h; sourceTree = "<group>"; };
    3.39 -		AAE8836F1F97321D007B6569 /* instrum_dls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = instrum_dls.c; sourceTree = "<group>"; };
    3.40  		AAE883701F97321D007B6569 /* output.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = output.h; sourceTree = "<group>"; };
    3.41  		AAE883711F97321E007B6569 /* resample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resample.h; sourceTree = "<group>"; };
    3.42  		AAE883721F97321E007B6569 /* tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tables.c; sourceTree = "<group>"; };
    3.43 @@ -300,10 +292,6 @@
    3.44  			children = (
    3.45  				AAE883681F97321D007B6569 /* common.c */,
    3.46  				AAE8835E1F97321C007B6569 /* common.h */,
    3.47 -				AAE883691F97321D007B6569 /* dls1.h */,
    3.48 -				AAE8836B1F97321D007B6569 /* dls2.h */,
    3.49 -				AAE8836F1F97321D007B6569 /* instrum_dls.c */,
    3.50 -				AAE883631F97321C007B6569 /* instrum_dls.h */,
    3.51  				AAE883671F97321C007B6569 /* instrum.c */,
    3.52  				AAE8835F1F97321C007B6569 /* instrum.h */,
    3.53  				AAE883741F97321E007B6569 /* mix.c */,
    3.54 @@ -385,10 +373,8 @@
    3.55  			isa = PBXHeadersBuildPhase;
    3.56  			buildActionMask = 2147483647;
    3.57  			files = (
    3.58 -				AAE883801F97321E007B6569 /* dls1.h in Headers */,
    3.59  				AAE405E31F9607C300EDAF53 /* music_fluidsynth.h in Headers */,
    3.60  				AAE405EF1F9607C300EDAF53 /* music_smpeg.h in Headers */,
    3.61 -				AAE8837A1F97321E007B6569 /* instrum_dls.h in Headers */,
    3.62  				AAE405F31F9607C300EDAF53 /* music_mikmod.h in Headers */,
    3.63  				AAE883781F97321E007B6569 /* playmidi.h in Headers */,
    3.64  				AAE883771F97321E007B6569 /* timidity.h in Headers */,
    3.65 @@ -415,7 +401,6 @@
    3.66  				AAE405E61F9607C300EDAF53 /* music.h in Headers */,
    3.67  				BE1FA8CD07AF96B2004B6283 /* SDL_mixer.h in Headers */,
    3.68  				AAE405F51F9607C300EDAF53 /* music_ogg.h in Headers */,
    3.69 -				AAE883821F97321E007B6569 /* dls2.h in Headers */,
    3.70  			);
    3.71  			runOnlyForDeploymentPostprocessing = 0;
    3.72  		};
    3.73 @@ -604,7 +589,6 @@
    3.74  				AAE406021F9607C300EDAF53 /* music_cmd.c in Sources */,
    3.75  				AAE405FB1F9607C300EDAF53 /* music_timidity.c in Sources */,
    3.76  				AAE405F11F9607C300EDAF53 /* music.c in Sources */,
    3.77 -				AAE883861F97321E007B6569 /* instrum_dls.c in Sources */,
    3.78  				AAE8837E1F97321E007B6569 /* instrum.c in Sources */,
    3.79  				AAE405F91F9607C300EDAF53 /* music_nativemidi.c in Sources */,
    3.80  				AAE406031F9607C300EDAF53 /* music_mpg123.c in Sources */,
     4.1 --- a/timidity/dls1.h	Sat Oct 21 00:53:21 2017 -0700
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,266 +0,0 @@
     4.4 -/*==========================================================================;
     4.5 -//
     4.6 -//  dls1.h
     4.7 -//
     4.8 -//
     4.9 -//  Description:
    4.10 -//
    4.11 -//  Interface defines and structures for the Instrument Collection Form
    4.12 -//  RIFF DLS.
    4.13 -//
    4.14 -//
    4.15 -//  Written by Sonic Foundry 1996.  Released for public use.
    4.16 -//
    4.17 -//=========================================================================*/
    4.18 -
    4.19 -#ifndef _INC_DLS1
    4.20 -#define _INC_DLS1
    4.21 -
    4.22 -/*//////////////////////////////////////////////////////////////////////////
    4.23 -//
    4.24 -//
    4.25 -// Layout of an instrument collection:
    4.26 -//
    4.27 -//
    4.28 -// RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST]
    4.29 -//
    4.30 -// INSTLIST
    4.31 -// LIST [] 'lins'
    4.32 -//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
    4.33 -//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
    4.34 -//               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
    4.35 -//
    4.36 -// RGNLIST
    4.37 -// LIST [] 'lrgn' 
    4.38 -//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
    4.39 -//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
    4.40 -//               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
    4.41 -//
    4.42 -// ARTLIST
    4.43 -// LIST [] 'lart'
    4.44 -//         'art1' level 1 Articulation connection graph
    4.45 -//         'art2' level 2 Articulation connection graph
    4.46 -//         '3rd1' Possible 3rd party articulation structure 1
    4.47 -//         '3rd2' Possible 3rd party articulation structure 2 .... and so on
    4.48 -//
    4.49 -// WAVEPOOL 
    4.50 -// ptbl [] [pool table]
    4.51 -// LIST [] 'wvpl'
    4.52 -//               [path],
    4.53 -//               [path],
    4.54 -//               LIST [] 'wave' [dlid,RIFFWAVE]
    4.55 -//               LIST [] 'wave' [dlid,RIFFWAVE]
    4.56 -//               LIST [] 'wave' [dlid,RIFFWAVE]
    4.57 -//               LIST [] 'wave' [dlid,RIFFWAVE]
    4.58 -//               LIST [] 'wave' [dlid,RIFFWAVE]
    4.59 -//
    4.60 -// INFOLIST
    4.61 -// LIST [] 'INFO' 
    4.62 -//               'icmt' 'One of those crazy comments.'
    4.63 -//               'icop' 'Copyright (C) 1996 Sonic Foundry'
    4.64 -//
    4.65 -/////////////////////////////////////////////////////////////////////////*/
    4.66 -
    4.67 -
    4.68 -/*/////////////////////////////////////////////////////////////////////////
    4.69 -// FOURCC's used in the DLS file
    4.70 -/////////////////////////////////////////////////////////////////////////*/
    4.71 -
    4.72 -#define FOURCC_DLS   mmioFOURCC('D','L','S',' ')
    4.73 -#define FOURCC_DLID  mmioFOURCC('d','l','i','d')
    4.74 -#define FOURCC_COLH  mmioFOURCC('c','o','l','h')
    4.75 -#define FOURCC_WVPL  mmioFOURCC('w','v','p','l')
    4.76 -#define FOURCC_PTBL  mmioFOURCC('p','t','b','l')
    4.77 -#define FOURCC_PATH  mmioFOURCC('p','a','t','h')
    4.78 -#define FOURCC_wave  mmioFOURCC('w','a','v','e')
    4.79 -#define FOURCC_LINS  mmioFOURCC('l','i','n','s')
    4.80 -#define FOURCC_INS   mmioFOURCC('i','n','s',' ')
    4.81 -#define FOURCC_INSH  mmioFOURCC('i','n','s','h')
    4.82 -#define FOURCC_LRGN  mmioFOURCC('l','r','g','n')
    4.83 -#define FOURCC_RGN   mmioFOURCC('r','g','n',' ')
    4.84 -#define FOURCC_RGNH  mmioFOURCC('r','g','n','h')
    4.85 -#define FOURCC_LART  mmioFOURCC('l','a','r','t')
    4.86 -#define FOURCC_ART1  mmioFOURCC('a','r','t','1')
    4.87 -#define FOURCC_WLNK  mmioFOURCC('w','l','n','k')
    4.88 -#define FOURCC_WSMP  mmioFOURCC('w','s','m','p')
    4.89 -#define FOURCC_VERS  mmioFOURCC('v','e','r','s')
    4.90 -
    4.91 -/*/////////////////////////////////////////////////////////////////////////
    4.92 -// Articulation connection graph definitions 
    4.93 -/////////////////////////////////////////////////////////////////////////*/
    4.94 -
    4.95 -/* Generic Sources */
    4.96 -#define CONN_SRC_NONE              0x0000
    4.97 -#define CONN_SRC_LFO               0x0001
    4.98 -#define CONN_SRC_KEYONVELOCITY     0x0002
    4.99 -#define CONN_SRC_KEYNUMBER         0x0003
   4.100 -#define CONN_SRC_EG1               0x0004
   4.101 -#define CONN_SRC_EG2               0x0005
   4.102 -#define CONN_SRC_PITCHWHEEL        0x0006
   4.103 -
   4.104 -/* Midi Controllers 0-127 */
   4.105 -#define CONN_SRC_CC1               0x0081
   4.106 -#define CONN_SRC_CC7               0x0087
   4.107 -#define CONN_SRC_CC10              0x008a
   4.108 -#define CONN_SRC_CC11              0x008b
   4.109 -
   4.110 -/* Generic Destinations */
   4.111 -#define CONN_DST_NONE              0x0000
   4.112 -#define CONN_DST_ATTENUATION       0x0001
   4.113 -#define CONN_DST_PITCH             0x0003
   4.114 -#define CONN_DST_PAN               0x0004
   4.115 -
   4.116 -/* LFO Destinations */
   4.117 -#define CONN_DST_LFO_FREQUENCY     0x0104
   4.118 -#define CONN_DST_LFO_STARTDELAY    0x0105
   4.119 -
   4.120 -/* EG1 Destinations */
   4.121 -#define CONN_DST_EG1_ATTACKTIME    0x0206
   4.122 -#define CONN_DST_EG1_DECAYTIME     0x0207
   4.123 -#define CONN_DST_EG1_RELEASETIME   0x0209
   4.124 -#define CONN_DST_EG1_SUSTAINLEVEL  0x020a
   4.125 -
   4.126 -/* EG2 Destinations */
   4.127 -#define CONN_DST_EG2_ATTACKTIME    0x030a
   4.128 -#define CONN_DST_EG2_DECAYTIME     0x030b
   4.129 -#define CONN_DST_EG2_RELEASETIME   0x030d
   4.130 -#define CONN_DST_EG2_SUSTAINLEVEL  0x030e
   4.131 -
   4.132 -#define CONN_TRN_NONE              0x0000
   4.133 -#define CONN_TRN_CONCAVE           0x0001
   4.134 -
   4.135 -typedef struct _DLSID {
   4.136 -  ULONG    ulData1;
   4.137 -  USHORT   usData2;
   4.138 -  USHORT   usData3;
   4.139 -  BYTE     abData4[8];
   4.140 -} DLSID, FAR *LPDLSID;
   4.141 -
   4.142 -typedef struct _DLSVERSION {
   4.143 -  DWORD    dwVersionMS;
   4.144 -  DWORD    dwVersionLS;
   4.145 -} DLSVERSION, FAR *LPDLSVERSION;
   4.146 -                   
   4.147 -
   4.148 -typedef struct _CONNECTION {
   4.149 -  USHORT   usSource;
   4.150 -  USHORT   usControl;
   4.151 -  USHORT   usDestination;
   4.152 -  USHORT   usTransform;
   4.153 -  LONG     lScale;
   4.154 -} CONNECTION, FAR *LPCONNECTION;
   4.155 -
   4.156 -
   4.157 -/* Level 1 Articulation Data */
   4.158 -
   4.159 -typedef struct _CONNECTIONLIST {
   4.160 -  ULONG    cbSize;            /* size of the connection list structure */
   4.161 -  ULONG    cConnections;      /* count of connections in the list */
   4.162 -} CONNECTIONLIST, FAR *LPCONNECTIONLIST;
   4.163 -
   4.164 -
   4.165 -
   4.166 -/*/////////////////////////////////////////////////////////////////////////
   4.167 -// Generic type defines for regions and instruments
   4.168 -/////////////////////////////////////////////////////////////////////////*/
   4.169 -
   4.170 -typedef struct _RGNRANGE {
   4.171 -  USHORT usLow;
   4.172 -  USHORT usHigh;
   4.173 -} RGNRANGE, FAR * LPRGNRANGE;
   4.174 -
   4.175 -#define F_INSTRUMENT_DRUMS      0x80000000
   4.176 -
   4.177 -typedef struct _MIDILOCALE {
   4.178 -  ULONG ulBank;
   4.179 -  ULONG ulInstrument;
   4.180 -} MIDILOCALE, FAR *LPMIDILOCALE;
   4.181 -
   4.182 -/*/////////////////////////////////////////////////////////////////////////
   4.183 -// Header structures found in an DLS file for collection, instruments, and
   4.184 -// regions.
   4.185 -/////////////////////////////////////////////////////////////////////////*/
   4.186 -
   4.187 -#define F_RGN_OPTION_SELFNONEXCLUSIVE  0x0001
   4.188 -
   4.189 -typedef struct _RGNHEADER {
   4.190 -  RGNRANGE RangeKey;            /* Key range  */
   4.191 -  RGNRANGE RangeVelocity;       /* Velocity Range  */
   4.192 -  USHORT   fusOptions;          /* Synthesis options for this range */
   4.193 -  USHORT   usKeyGroup;          /* Key grouping for non simultaneous play */
   4.194 -                                /* 0 = no group, 1 up is group */
   4.195 -                                /* for Level 1 only groups 1-15 are allowed */
   4.196 -} RGNHEADER, FAR *LPRGNHEADER;
   4.197 -
   4.198 -typedef struct _INSTHEADER {
   4.199 -  ULONG      cRegions;          /* Count of regions in this instrument */
   4.200 -  MIDILOCALE Locale;            /* Intended MIDI locale of this instrument */
   4.201 -} INSTHEADER, FAR *LPINSTHEADER;
   4.202 -
   4.203 -typedef struct _DLSHEADER {
   4.204 -  ULONG      cInstruments;      /* Count of instruments in the collection */
   4.205 -} DLSHEADER, FAR *LPDLSHEADER;
   4.206 -
   4.207 -/*////////////////////////////////////////////////////////////////////////////
   4.208 -// definitions for the Wave link structure
   4.209 -////////////////////////////////////////////////////////////////////////////*/
   4.210 -
   4.211 -/* ****  For level 1 only WAVELINK_CHANNEL_MONO is valid  **** */
   4.212 -/* ulChannel allows for up to 32 channels of audio with each bit position */
   4.213 -/* specifiying a channel of playback */
   4.214 -
   4.215 -#define WAVELINK_CHANNEL_LEFT    0x0001l
   4.216 -#define WAVELINK_CHANNEL_RIGHT   0x0002l
   4.217 -
   4.218 -#define F_WAVELINK_PHASE_MASTER  0x0001
   4.219 -
   4.220 -typedef struct _WAVELINK { /* any paths or links are stored right after struct */
   4.221 -  USHORT   fusOptions;     /* options flags for this wave */
   4.222 -  USHORT   usPhaseGroup;   /* Phase grouping for locking channels */
   4.223 -  ULONG    ulChannel;      /* channel placement */
   4.224 -  ULONG    ulTableIndex;   /* index into the wave pool table, 0 based */
   4.225 -} WAVELINK, FAR *LPWAVELINK;
   4.226 -
   4.227 -#define POOL_CUE_NULL  0xffffffffl
   4.228 -
   4.229 -typedef struct _POOLCUE { 
   4.230 -  ULONG    ulOffset;       /* Offset to the entry in the list */
   4.231 -} POOLCUE, FAR *LPPOOLCUE;
   4.232 -
   4.233 -typedef struct _POOLTABLE {
   4.234 -  ULONG    cbSize;            /* size of the pool table structure */
   4.235 -  ULONG    cCues;             /* count of cues in the list */
   4.236 -} POOLTABLE, FAR *LPPOOLTABLE;
   4.237 -
   4.238 -/*////////////////////////////////////////////////////////////////////////////
   4.239 -// Structures for the "wsmp" chunk
   4.240 -////////////////////////////////////////////////////////////////////////////*/
   4.241 -
   4.242 -#define F_WSMP_NO_TRUNCATION     0x0001l
   4.243 -#define F_WSMP_NO_COMPRESSION    0x0002l
   4.244 -
   4.245 -
   4.246 -typedef struct _rwsmp {
   4.247 -  ULONG   cbSize;
   4.248 -  USHORT  usUnityNote;         /* MIDI Unity Playback Note */
   4.249 -  SHORT   sFineTune;           /* Fine Tune in log tuning */
   4.250 -  LONG    lAttenuation;        /* Overall Attenuation to be applied to data */
   4.251 -  ULONG   fulOptions;          /* Flag options  */
   4.252 -  ULONG   cSampleLoops;        /* Count of Sample loops, 0 loops is one shot */
   4.253 -} WSMPL, FAR *LPWSMPL;
   4.254 -
   4.255 -
   4.256 -/* This loop type is a normal forward playing loop which is continually */
   4.257 -/* played until the envelope reaches an off threshold in the release */
   4.258 -/* portion of the volume envelope */
   4.259 -
   4.260 -#define WLOOP_TYPE_FORWARD   0
   4.261 -
   4.262 -typedef struct _rloop {
   4.263 -  ULONG cbSize;
   4.264 -  ULONG ulType;              /* Loop Type */
   4.265 -  ULONG ulStart;             /* Start of loop in samples */
   4.266 -  ULONG ulLength;            /* Length of loop in samples */
   4.267 -} WLOOP, FAR *LPWLOOP;
   4.268 -
   4.269 -#endif /*_INC_DLS1 */
     5.1 --- a/timidity/dls2.h	Sat Oct 21 00:53:21 2017 -0700
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,130 +0,0 @@
     5.4 -/*
     5.5 - 
     5.6 - 	dls2.h
     5.7 - 	
     5.8 - 	Description:
     5.9 - 
    5.10 - 	Interface defines and structures for the DLS2 extensions of DLS.
    5.11 - 
    5.12 - 
    5.13 -     Written by Microsoft 1998.  Released for public use.
    5.14 - 
    5.15 -*/
    5.16 - 
    5.17 -#ifndef _INC_DLS2
    5.18 -#define _INC_DLS2
    5.19 - 
    5.20 -/*
    5.21 -     FOURCC's used in the DLS2 file, in addition to DLS1 chunks
    5.22 -*/
    5.23 - 
    5.24 -#define FOURCC_RGN2  mmioFOURCC('r','g','n','2')
    5.25 -#define FOURCC_LAR2  mmioFOURCC('l','a','r','2')
    5.26 -#define FOURCC_ART2  mmioFOURCC('a','r','t','2')
    5.27 -#define FOURCC_CDL   mmioFOURCC('c','d','l',' ')
    5.28 -#define FOURCC_DLID	 mmioFOURCC('d','l','i','d')
    5.29 - 
    5.30 -/*
    5.31 -     Articulation connection graph definitions. These are in addition to
    5.32 -     the definitions in the DLS1 header.
    5.33 -*/
    5.34 - 
    5.35 -/* Generic Sources (in addition to DLS1 sources. */
    5.36 -#define CONN_SRC_POLYPRESSURE		0x0007	/* Polyphonic Pressure */
    5.37 -#define CONN_SRC_CHANNELPRESSURE		0x0008	/* Channel Pressure */
    5.38 -#define CONN_SRC_VIBRATO			0x0009	/* Vibrato LFO */
    5.39 -#define CONN_SRC_MONOPRESSURE       	0x000a  /* MIDI Mono pressure */
    5.40 - 
    5.41 - 
    5.42 -/* Midi Controllers */
    5.43 -#define CONN_SRC_CC91			0x00db	/* Reverb Send */
    5.44 -#define CONN_SRC_CC93			0x00dd	/* Chorus Send */
    5.45 - 
    5.46 - 
    5.47 -/* Generic Destinations */
    5.48 -#define CONN_DST_GAIN			0x0001	/* Same as CONN_DST_ ATTENUATION, but more appropriate terminology. */
    5.49 -#define CONN_DST_KEYNUMBER 0x0005  /* Key Number Generator */
    5.50 - 
    5.51 -/* Audio Channel Output Destinations */
    5.52 -#define CONN_DST_LEFT			0x0010	/* Left Channel Send */
    5.53 -#define CONN_DST_RIGHT			0x0011	/* Right Channel Send */
    5.54 -#define CONN_DST_CENTER			0x0012	/* Center Channel Send */
    5.55 -#define CONN_DST_LEFTREAR			0x0013	/* Left Rear Channel Send */
    5.56 -#define CONN_DST_RIGHTREAR			0x0014	/* Right Rear Channel Send */
    5.57 -#define CONN_DST_LFE_CHANNEL		0x0015	/* LFE Channel Send */
    5.58 -#define CONN_DST_CHORUS			0x0080	/* Chorus Send */
    5.59 -#define CONN_DST_REVERB			0x0081	/* Reverb Send */
    5.60 - 
    5.61 -/* Vibrato LFO Destinations */
    5.62 -#define CONN_DST_VIB_FREQUENCY		0x0114	/* Vibrato Frequency */
    5.63 -#define CONN_DST_VIB_STARTDELAY		0x0115	/* Vibrato Start Delay */
    5.64 - 
    5.65 -/* EG1 Destinations */
    5.66 -#define CONN_DST_EG1_DELAYTIME		0x020B	/* EG1 Delay Time */
    5.67 -#define CONN_DST_EG1_HOLDTIME		0x020C	/* EG1 Hold Time */
    5.68 -#define CONN_DST_EG1_SHUTDOWNTIME		0x020D	/* EG1 Shutdown Time */
    5.69 - 
    5.70 - 
    5.71 -/*	EG2 Destinations */
    5.72 -#define CONN_DST_EG2_DELAYTIME		0x030F	/* EG2 Delay Time */
    5.73 -#define CONN_DST_EG2_HOLDTIME		0x0310	/* EG2 Hold Time */
    5.74 - 
    5.75 - 
    5.76 -/* Filter Destinations */
    5.77 -#define CONN_DST_FILTER_CUTOFF		0x0500	/* Filter Cutoff Frequency */
    5.78 -#define CONN_DST_FILTER_Q			0x0501	/* Filter Resonance */
    5.79 - 
    5.80 - 
    5.81 -/* Transforms */
    5.82 -#define CONN_TRN_CONVEX			0x0002	/* Convex Transform */
    5.83 -#define CONN_TRN_SWITCH			0x0003	/* Switch Transform */
    5.84 - 
    5.85 - 
    5.86 -/*	Conditional chunk operators */
    5.87 - #define DLS_CDL_AND			0x0001	/* X = X & Y */
    5.88 - #define DLS_CDL_OR			0x0002	/* X = X | Y */
    5.89 - #define DLS_CDL_XOR			0x0003	/* X = X ^ Y */
    5.90 - #define DLS_CDL_ADD			0x0004	/* X = X + Y */
    5.91 - #define DLS_CDL_SUBTRACT		0x0005	/* X = X - Y */
    5.92 - #define DLS_CDL_MULTIPLY		0x0006	/* X = X * Y */
    5.93 - #define DLS_CDL_DIVIDE		0x0007	/* X = X / Y */
    5.94 - #define DLS_CDL_LOGICAL_AND	0x0008	/* X = X && Y */
    5.95 - #define DLS_CDL_LOGICAL_OR		0x0009	/* X = X || Y */
    5.96 - #define DLS_CDL_LT			0x000A	/* X = (X < Y) */
    5.97 - #define DLS_CDL_LE			0x000B	/* X = (X <= Y) */
    5.98 - #define DLS_CDL_GT			0x000C	/* X = (X > Y) */
    5.99 - #define DLS_CDL_GE			0x000D	/* X = (X >= Y) */
   5.100 - #define DLS_CDL_EQ			0x000E	/* X = (X == Y) */
   5.101 - #define DLS_CDL_NOT			0x000F	/* X = !X */
   5.102 - #define DLS_CDL_CONST		0x0010	/* 32-bit constant */
   5.103 - #define DLS_CDL_QUERY		0x0011	/* 32-bit value returned from query */
   5.104 - #define DLS_CDL_QUERYSUPPORTED	0x0012	/* Test to see if query is supported by synth */
   5.105 - 
   5.106 -/*
   5.107 -  Loop and release
   5.108 -*/
   5.109 -
   5.110 -#define WLOOP_TYPE_RELEASE 1
   5.111 -
   5.112 -/*
   5.113 -  WaveLink chunk <wlnk-ck>
   5.114 -*/
   5.115 -
   5.116 -#define F_WAVELINK_MULTICHANNEL 0x0002
   5.117 -
   5.118 -
   5.119 -/*
   5.120 -  DLSID queries for <cdl-ck>
   5.121 -*/
   5.122 -
   5.123 -DEFINE_GUID(DLSID_GMInHardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
   5.124 -DEFINE_GUID(DLSID_GSInHardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
   5.125 -DEFINE_GUID(DLSID_XGInHardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
   5.126 -DEFINE_GUID(DLSID_SupportsDLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
   5.127 -DEFINE_GUID(DLSID_SupportsDLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
   5.128 -DEFINE_GUID(DLSID_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
   5.129 -DEFINE_GUID(DLSID_ManufacturersID, 0xb03e1181, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
   5.130 -DEFINE_GUID(DLSID_ProductID, 0xb03e1182, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
   5.131 -DEFINE_GUID(DLSID_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
   5.132 -
   5.133 -#endif	/* _INC_DLS2 */
     6.1 --- a/timidity/instrum.c	Sat Oct 21 00:53:21 2017 -0700
     6.2 +++ b/timidity/instrum.c	Sat Oct 21 09:04:55 2017 +0300
     6.3 @@ -26,7 +26,6 @@
     6.4  #include "options.h"
     6.5  #include "common.h"
     6.6  #include "instrum.h"
     6.7 -#include "instrum_dls.h"
     6.8  #include "resample.h"
     6.9  #include "tables.h"
    6.10  
    6.11 @@ -260,8 +259,6 @@
    6.12        READ_LONG(sp->low_freq);
    6.13        READ_LONG(sp->high_freq);
    6.14        READ_LONG(sp->root_freq);
    6.15 -      sp->low_vel = 0;
    6.16 -      sp->high_vel = 127;
    6.17        SDL_RWseek(rw, 2, RW_SEEK_CUR); /* Why have a "root frequency" and then
    6.18  				    * "tuning"?? */
    6.19        
    6.20 @@ -516,11 +513,6 @@
    6.21      {
    6.22        if (bank->instrument[i]==MAGIC_LOAD_INSTRUMENT)
    6.23  	{
    6.24 -          bank->instrument[i]=load_instrument_dls(song, dr, b, i);
    6.25 -          if (bank->instrument[i])
    6.26 -            {
    6.27 -              continue;
    6.28 -            }
    6.29  	  if (!(bank->tone[i].name))
    6.30  	    {
    6.31  	      SNDDBG(("No instrument mapped to %s %d, program %d%s\n",
     7.1 --- a/timidity/instrum_dls.c	Sat Oct 21 00:53:21 2017 -0700
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,1254 +0,0 @@
     7.4 -/*
     7.5 -
     7.6 -    TiMidity -- Experimental MIDI to WAVE converter
     7.7 -    Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
     7.8 -
     7.9 -    This program is free software; you can redistribute it and/or modify
    7.10 -    it under the terms of the Perl Artistic License, available in COPYING.
    7.11 -
    7.12 -   instrum.h
    7.13 -
    7.14 -   */
    7.15 -
    7.16 -#include <stdlib.h>
    7.17 -#include <string.h>
    7.18 -
    7.19 -#include "SDL.h"
    7.20 -#include "SDL_endian.h"
    7.21 -#include "SDL_rwops.h"
    7.22 -
    7.23 -#include "SDL.h"
    7.24 -
    7.25 -#include "timidity.h"
    7.26 -#include "options.h"
    7.27 -#include "instrum.h"
    7.28 -#include "tables.h"
    7.29 -#include "common.h"
    7.30 -
    7.31 -/*-------------------------------------------------------------------------*/
    7.32 -/* * * * * * * * * * * * * * * * * load_riff.h * * * * * * * * * * * * * * */
    7.33 -/*-------------------------------------------------------------------------*/
    7.34 -typedef struct _RIFF_Chunk {
    7.35 -    Uint32 magic;
    7.36 -    Uint32 length;
    7.37 -    Uint32 subtype;
    7.38 -    Uint8  *data;
    7.39 -    struct _RIFF_Chunk *child;
    7.40 -    struct _RIFF_Chunk *next;
    7.41 -} RIFF_Chunk;
    7.42 -
    7.43 -extern RIFF_Chunk* LoadRIFF(SDL_RWops *src);
    7.44 -extern void FreeRIFF(RIFF_Chunk *chunk);
    7.45 -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    7.46 -
    7.47 -/*-------------------------------------------------------------------------*/
    7.48 -/* * * * * * * * * * * * * * * * * load_riff.c * * * * * * * * * * * * * * */
    7.49 -/*-------------------------------------------------------------------------*/
    7.50 -#define RIFF        0x46464952        /* "RIFF" */
    7.51 -#define LIST        0x5453494c        /* "LIST" */
    7.52 -
    7.53 -static RIFF_Chunk *AllocRIFFChunk()
    7.54 -{
    7.55 -    RIFF_Chunk *chunk = (RIFF_Chunk *)malloc(sizeof(*chunk));
    7.56 -    if ( !chunk ) {
    7.57 -        SDL_Error(SDL_ENOMEM);
    7.58 -        return NULL;
    7.59 -    }
    7.60 -    memset(chunk, 0, sizeof(*chunk));
    7.61 -    return chunk;
    7.62 -}
    7.63 -
    7.64 -static void FreeRIFFChunk(RIFF_Chunk *chunk)
    7.65 -{
    7.66 -    if ( chunk->child ) {
    7.67 -        FreeRIFFChunk(chunk->child);
    7.68 -    }
    7.69 -    if ( chunk->next ) {
    7.70 -        FreeRIFFChunk(chunk->next);
    7.71 -    }
    7.72 -    free(chunk);
    7.73 -}
    7.74 -
    7.75 -static int ChunkHasSubType(Uint32 magic)
    7.76 -{
    7.77 -    static Uint32 chunk_list[] = {
    7.78 -        RIFF, LIST
    7.79 -    };
    7.80 -    int i;
    7.81 -    for ( i = 0; i < SDL_TABLESIZE(chunk_list); ++i ) {
    7.82 -        if ( magic == chunk_list[i] ) {
    7.83 -            return 1;
    7.84 -        }
    7.85 -    }
    7.86 -    return 0;
    7.87 -}
    7.88 -
    7.89 -static int ChunkHasSubChunks(Uint32 magic)
    7.90 -{
    7.91 -    static Uint32 chunk_list[] = {
    7.92 -        RIFF, LIST
    7.93 -    };
    7.94 -    int i;
    7.95 -    for ( i = 0; i < SDL_TABLESIZE(chunk_list); ++i ) {
    7.96 -        if ( magic == chunk_list[i] ) {
    7.97 -            return 1;
    7.98 -        }
    7.99 -    }
   7.100 -    return 0;
   7.101 -}
   7.102 -
   7.103 -static void LoadSubChunks(RIFF_Chunk *chunk, Uint8 *data, Uint32 left)
   7.104 -{
   7.105 -    Uint8 *subchunkData;
   7.106 -    Uint32 subchunkDataLen;
   7.107 -
   7.108 -    while ( left > 8 ) {
   7.109 -        RIFF_Chunk *child = AllocRIFFChunk();
   7.110 -        RIFF_Chunk *next, *prev = NULL;
   7.111 -        for ( next = chunk->child; next; next = next->next ) {
   7.112 -            prev = next;
   7.113 -        }
   7.114 -        if ( prev ) {
   7.115 -            prev->next = child;
   7.116 -        } else {
   7.117 -            chunk->child = child;
   7.118 -        }
   7.119 -            
   7.120 -        child->magic = (data[0] <<  0) |
   7.121 -                       (data[1] <<  8) |
   7.122 -                       (data[2] << 16) |
   7.123 -                       (data[3] << 24);
   7.124 -        data += 4;
   7.125 -        left -= 4;
   7.126 -        child->length = (data[0] <<  0) |
   7.127 -                        (data[1] <<  8) |
   7.128 -                        (data[2] << 16) |
   7.129 -                        (data[3] << 24);
   7.130 -        data += 4;
   7.131 -        left -= 4;
   7.132 -        child->data = data;
   7.133 -
   7.134 -        if ( child->length > left ) {
   7.135 -            child->length = left;
   7.136 -        }
   7.137 -
   7.138 -        subchunkData = child->data;
   7.139 -        subchunkDataLen = child->length;
   7.140 -        if ( ChunkHasSubType(child->magic) && subchunkDataLen >= 4 ) {
   7.141 -            child->subtype = (subchunkData[0] <<  0) |
   7.142 -                     (subchunkData[1] <<  8) |
   7.143 -                     (subchunkData[2] << 16) |
   7.144 -                     (subchunkData[3] << 24);
   7.145 -            subchunkData += 4;
   7.146 -            subchunkDataLen -= 4;
   7.147 -        }
   7.148 -        if ( ChunkHasSubChunks(child->magic) ) {
   7.149 -            LoadSubChunks(child, subchunkData, subchunkDataLen);
   7.150 -        }
   7.151 -
   7.152 -        data += child->length;
   7.153 -        left -= child->length;
   7.154 -    }
   7.155 -}
   7.156 -
   7.157 -RIFF_Chunk *LoadRIFF(SDL_RWops *src)
   7.158 -{
   7.159 -    RIFF_Chunk *chunk;
   7.160 -    Uint8 *subchunkData;
   7.161 -    Uint32 subchunkDataLen;
   7.162 -
   7.163 -    /* Allocate the chunk structure */
   7.164 -    chunk = AllocRIFFChunk();
   7.165 -
   7.166 -    /* Make sure the file is in RIFF format */
   7.167 -    chunk->magic    = SDL_ReadLE32(src);
   7.168 -    chunk->length    = SDL_ReadLE32(src);
   7.169 -    if ( chunk->magic != RIFF ) {
   7.170 -        SDL_SetError("Not a RIFF file");
   7.171 -        FreeRIFFChunk(chunk);
   7.172 -        return NULL;
   7.173 -    }
   7.174 -    chunk->data = (Uint8 *)malloc(chunk->length);
   7.175 -    if ( chunk->data == NULL ) {
   7.176 -        SDL_Error(SDL_ENOMEM);
   7.177 -        FreeRIFFChunk(chunk);
   7.178 -        return NULL;
   7.179 -    }
   7.180 -    if ( SDL_RWread(src, chunk->data, chunk->length, 1) != 1 ) {
   7.181 -        SDL_Error(SDL_EFREAD);
   7.182 -        FreeRIFF(chunk);
   7.183 -        return NULL;
   7.184 -    }
   7.185 -    subchunkData = chunk->data;
   7.186 -    subchunkDataLen = chunk->length;
   7.187 -    if ( ChunkHasSubType(chunk->magic) && subchunkDataLen >= 4 ) {
   7.188 -        chunk->subtype = (subchunkData[0] <<  0) |
   7.189 -                 (subchunkData[1] <<  8) |
   7.190 -                 (subchunkData[2] << 16) |
   7.191 -                 (subchunkData[3] << 24);
   7.192 -        subchunkData += 4;
   7.193 -        subchunkDataLen -= 4;
   7.194 -    }
   7.195 -    if ( ChunkHasSubChunks(chunk->magic) ) {
   7.196 -        LoadSubChunks(chunk, subchunkData, subchunkDataLen);
   7.197 -    }
   7.198 -    return chunk;
   7.199 -}
   7.200 -
   7.201 -void FreeRIFF(RIFF_Chunk *chunk)
   7.202 -{
   7.203 -    free(chunk->data);
   7.204 -    FreeRIFFChunk(chunk);
   7.205 -}
   7.206 -
   7.207 -#ifdef TEST_MAIN_RIFF
   7.208 -
   7.209 -void PrintRIFF(RIFF_Chunk *chunk, int level)
   7.210 -{
   7.211 -    static char prefix[128];
   7.212 -
   7.213 -    if ( level == sizeof(prefix)-1 ) {
   7.214 -        return;
   7.215 -    }
   7.216 -    if ( level > 0 ) {
   7.217 -        prefix[(level-1)*2] = ' ';
   7.218 -        prefix[(level-1)*2+1] = ' ';
   7.219 -    }
   7.220 -    prefix[level*2] = '\0';
   7.221 -    printf("%sChunk: %c%c%c%c (%d bytes)", prefix,
   7.222 -        ((chunk->magic >>  0) & 0xFF),
   7.223 -        ((chunk->magic >>  8) & 0xFF),
   7.224 -        ((chunk->magic >> 16) & 0xFF),
   7.225 -        ((chunk->magic >> 24) & 0xFF), chunk->length);
   7.226 -    if ( chunk->subtype ) {
   7.227 -        printf(" subtype: %c%c%c%c",
   7.228 -            ((chunk->subtype >>  0) & 0xFF),
   7.229 -            ((chunk->subtype >>  8) & 0xFF),
   7.230 -            ((chunk->subtype >> 16) & 0xFF),
   7.231 -            ((chunk->subtype >> 24) & 0xFF));
   7.232 -    }
   7.233 -    printf("\n");
   7.234 -    if ( chunk->child ) {
   7.235 -        printf("%s{\n", prefix);
   7.236 -        PrintRIFF(chunk->child, level + 1);
   7.237 -        printf("%s}\n", prefix);
   7.238 -    }
   7.239 -    if ( chunk->next ) {
   7.240 -        PrintRIFF(chunk->next, level);
   7.241 -    }
   7.242 -    if ( level > 0 ) {
   7.243 -        prefix[(level-1)*2] = '\0';
   7.244 -    }
   7.245 -}
   7.246 -
   7.247 -main(int argc, char *argv[])
   7.248 -{
   7.249 -    int i;
   7.250 -    for ( i = 1; i < argc; ++i ) {
   7.251 -        RIFF_Chunk *chunk;
   7.252 -        SDL_RWops *src = SDL_RWFromFile(argv[i], "rb");
   7.253 -        if ( !src ) {
   7.254 -            fprintf(stderr, "Couldn't open %s: %s", argv[i], SDL_GetError());
   7.255 -            continue;
   7.256 -        }
   7.257 -        chunk = LoadRIFF(src);
   7.258 -        if ( chunk ) {
   7.259 -            PrintRIFF(chunk, 0);
   7.260 -            FreeRIFF(chunk);
   7.261 -        } else {
   7.262 -            fprintf(stderr, "Couldn't load %s: %s\n", argv[i], SDL_GetError());
   7.263 -        }
   7.264 -        SDL_RWclose(src);
   7.265 -    }
   7.266 -}
   7.267 -
   7.268 -#endif // TEST_MAIN
   7.269 -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   7.270 -
   7.271 -/*-------------------------------------------------------------------------*/
   7.272 -/* * * * * * * * * * * * * * * * * load_dls.h  * * * * * * * * * * * * * * */
   7.273 -/*-------------------------------------------------------------------------*/
   7.274 -/* This code is based on the DLS spec version 1.1, available at:
   7.275 -    http://www.midi.org/about-midi/dls/dlsspec.shtml
   7.276 -*/
   7.277 -
   7.278 -/* Some typedefs so the public dls headers don't need to be modified */
   7.279 -#define FAR
   7.280 -typedef Uint8   BYTE;
   7.281 -typedef Sint16  SHORT;
   7.282 -typedef Uint16  USHORT;
   7.283 -typedef Uint16  WORD;
   7.284 -typedef Sint32  LONG;
   7.285 -typedef Uint32  ULONG;
   7.286 -typedef Uint32  DWORD;
   7.287 -#define mmioFOURCC(A, B, C, D)    \
   7.288 -    (((A) <<  0) | ((B) <<  8) | ((C) << 16) | ((D) << 24))
   7.289 -#define DEFINE_GUID(A, B, C, E, F, G, H, I, J, K, L, M)
   7.290 -
   7.291 -#include "dls1.h"
   7.292 -#include "dls2.h"
   7.293 -
   7.294 -typedef struct _WaveFMT {
   7.295 -    WORD wFormatTag;
   7.296 -    WORD wChannels;
   7.297 -    DWORD dwSamplesPerSec;
   7.298 -    DWORD dwAvgBytesPerSec;
   7.299 -    WORD wBlockAlign;
   7.300 -    WORD wBitsPerSample;
   7.301 -} WaveFMT;
   7.302 -
   7.303 -typedef struct _DLS_Wave {
   7.304 -    WaveFMT *format;
   7.305 -    Uint8 *data;
   7.306 -    Uint32 length;
   7.307 -    WSMPL *wsmp;
   7.308 -    WLOOP *wsmp_loop;
   7.309 -} DLS_Wave;
   7.310 -
   7.311 -typedef struct _DLS_Region {
   7.312 -    RGNHEADER *header;
   7.313 -    WAVELINK *wlnk;
   7.314 -    WSMPL *wsmp;
   7.315 -    WLOOP *wsmp_loop;
   7.316 -    CONNECTIONLIST *art;
   7.317 -    CONNECTION *artList;
   7.318 -} DLS_Region;
   7.319 -
   7.320 -typedef struct _DLS_Instrument {
   7.321 -    const char *name;
   7.322 -    INSTHEADER *header;
   7.323 -    DLS_Region *regions;
   7.324 -    CONNECTIONLIST *art;
   7.325 -    CONNECTION *artList;
   7.326 -} DLS_Instrument;
   7.327 -
   7.328 -typedef struct _DLS_Data {
   7.329 -    struct _RIFF_Chunk *chunk;
   7.330 -
   7.331 -    Uint32 cInstruments;
   7.332 -    DLS_Instrument *instruments;
   7.333 -
   7.334 -    POOLTABLE *ptbl;
   7.335 -    POOLCUE *ptblList;
   7.336 -    DLS_Wave *waveList;
   7.337 -
   7.338 -    const char *name;
   7.339 -    const char *artist;
   7.340 -    const char *copyright;
   7.341 -    const char *comments;
   7.342 -} DLS_Data;
   7.343 -
   7.344 -extern DLS_Data* LoadDLS(SDL_RWops *src);
   7.345 -extern void FreeDLS(DLS_Data *chunk);
   7.346 -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
   7.347 -
   7.348 -/*-------------------------------------------------------------------------*/
   7.349 -/* * * * * * * * * * * * * * * * * load_dls.c  * * * * * * * * * * * * * * */
   7.350 -/*-------------------------------------------------------------------------*/
   7.351 -
   7.352 -#define FOURCC_LIST    0x5453494c   /* "LIST" */
   7.353 -#define FOURCC_FMT     0x20746D66   /* "fmt " */
   7.354 -#define FOURCC_DATA    0x61746164   /* "data" */
   7.355 -#define FOURCC_INFO    mmioFOURCC('I','N','F','O')
   7.356 -#define FOURCC_IARL    mmioFOURCC('I','A','R','L')
   7.357 -#define FOURCC_IART    mmioFOURCC('I','A','R','T')
   7.358 -#define FOURCC_ICMS    mmioFOURCC('I','C','M','S')
   7.359 -#define FOURCC_ICMT    mmioFOURCC('I','C','M','T')
   7.360 -#define FOURCC_ICOP    mmioFOURCC('I','C','O','P')
   7.361 -#define FOURCC_ICRD    mmioFOURCC('I','C','R','D')
   7.362 -#define FOURCC_IENG    mmioFOURCC('I','E','N','G')
   7.363 -#define FOURCC_IGNR    mmioFOURCC('I','G','N','R')
   7.364 -#define FOURCC_IKEY    mmioFOURCC('I','K','E','Y')
   7.365 -#define FOURCC_IMED    mmioFOURCC('I','M','E','D')
   7.366 -#define FOURCC_INAM    mmioFOURCC('I','N','A','M')
   7.367 -#define FOURCC_IPRD    mmioFOURCC('I','P','R','D')
   7.368 -#define FOURCC_ISBJ    mmioFOURCC('I','S','B','J')
   7.369 -#define FOURCC_ISFT    mmioFOURCC('I','S','F','T')
   7.370 -#define FOURCC_ISRC    mmioFOURCC('I','S','R','C')
   7.371 -#define FOURCC_ISRF    mmioFOURCC('I','S','R','F')
   7.372 -#define FOURCC_ITCH    mmioFOURCC('I','T','C','H')
   7.373 -
   7.374 -
   7.375 -static void FreeRegions(DLS_Instrument *instrument)
   7.376 -{
   7.377 -    if ( instrument->regions ) {
   7.378 -        free(instrument->regions);
   7.379 -    }
   7.380 -}
   7.381 -
   7.382 -static void AllocRegions(DLS_Instrument *instrument)
   7.383 -{
   7.384 -    int datalen = (instrument->header->cRegions * sizeof(DLS_Region));
   7.385 -    FreeRegions(instrument);
   7.386 -    instrument->regions = (DLS_Region *)malloc(datalen);
   7.387 -    if ( instrument->regions ) {
   7.388 -        memset(instrument->regions, 0, datalen);
   7.389 -    }
   7.390 -}
   7.391 -
   7.392 -static void FreeInstruments(DLS_Data *data)
   7.393 -{
   7.394 -    if ( data->instruments ) {
   7.395 -        Uint32 i;
   7.396 -        for ( i = 0; i < data->cInstruments; ++i ) {
   7.397 -            FreeRegions(&data->instruments[i]);
   7.398 -        }
   7.399 -        free(data->instruments);
   7.400 -    }
   7.401 -}
   7.402 -
   7.403 -static void AllocInstruments(DLS_Data *data)
   7.404 -{
   7.405 -    int datalen = (data->cInstruments * sizeof(DLS_Instrument));
   7.406 -    FreeInstruments(data);
   7.407 -    data->instruments = (DLS_Instrument *)malloc(datalen);
   7.408 -    if ( data->instruments ) {
   7.409 -        memset(data->instruments, 0, datalen);
   7.410 -    }
   7.411 -}
   7.412 -
   7.413 -static void FreeWaveList(DLS_Data *data)
   7.414 -{
   7.415 -    if ( data->waveList ) {
   7.416 -        free(data->waveList);
   7.417 -    }
   7.418 -}
   7.419 -
   7.420 -static void AllocWaveList(DLS_Data *data)
   7.421 -{
   7.422 -    int datalen = (data->ptbl->cCues * sizeof(DLS_Wave));
   7.423 -    FreeWaveList(data);
   7.424 -    data->waveList = (DLS_Wave *)malloc(datalen);
   7.425 -    if ( data->waveList ) {
   7.426 -        memset(data->waveList, 0, datalen);
   7.427 -    }
   7.428 -}
   7.429 -
   7.430 -static void Parse_colh(DLS_Data *data, RIFF_Chunk *chunk)
   7.431 -{
   7.432 -    data->cInstruments = SDL_SwapLE32(*(Uint32 *)chunk->data);
   7.433 -    AllocInstruments(data);
   7.434 -}
   7.435 -
   7.436 -static void Parse_insh(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
   7.437 -{
   7.438 -    INSTHEADER *header = (INSTHEADER *)chunk->data;
   7.439 -    header->cRegions = SDL_SwapLE32(header->cRegions);
   7.440 -    header->Locale.ulBank = SDL_SwapLE32(header->Locale.ulBank);
   7.441 -    header->Locale.ulInstrument = SDL_SwapLE32(header->Locale.ulInstrument);
   7.442 -    instrument->header = header;
   7.443 -    AllocRegions(instrument);
   7.444 -}
   7.445 -
   7.446 -static void Parse_rgnh(DLS_Data *data, RIFF_Chunk *chunk, DLS_Region *region)
   7.447 -{
   7.448 -    RGNHEADER *header = (RGNHEADER *)chunk->data;
   7.449 -    header->RangeKey.usLow = SDL_SwapLE16(header->RangeKey.usLow);
   7.450 -    header->RangeKey.usHigh = SDL_SwapLE16(header->RangeKey.usHigh);
   7.451 -    header->RangeVelocity.usLow = SDL_SwapLE16(header->RangeVelocity.usLow);
   7.452 -    header->RangeVelocity.usHigh = SDL_SwapLE16(header->RangeVelocity.usHigh);
   7.453 -    header->fusOptions = SDL_SwapLE16(header->fusOptions);
   7.454 -    header->usKeyGroup = SDL_SwapLE16(header->usKeyGroup);
   7.455 -    region->header = header;
   7.456 -}
   7.457 -
   7.458 -static void Parse_wlnk(DLS_Data *data, RIFF_Chunk *chunk, DLS_Region *region)
   7.459 -{
   7.460 -    WAVELINK *wlnk = (WAVELINK *)chunk->data;
   7.461 -    wlnk->fusOptions = SDL_SwapLE16(wlnk->fusOptions);
   7.462 -    wlnk->usPhaseGroup = SDL_SwapLE16(wlnk->usPhaseGroup);
   7.463 -    wlnk->ulChannel = SDL_SwapLE16(wlnk->ulChannel);
   7.464 -    wlnk->ulTableIndex = SDL_SwapLE16(wlnk->ulTableIndex);
   7.465 -    region->wlnk = wlnk;
   7.466 -}
   7.467 -
   7.468 -static void Parse_wsmp(DLS_Data *data, RIFF_Chunk *chunk, WSMPL **wsmp_ptr, WLOOP **wsmp_loop_ptr)
   7.469 -{
   7.470 -    Uint32 i;
   7.471 -    WSMPL *wsmp = (WSMPL *)chunk->data;
   7.472 -    WLOOP *loop;
   7.473 -    wsmp->cbSize = SDL_SwapLE32(wsmp->cbSize);
   7.474 -    wsmp->usUnityNote = SDL_SwapLE16(wsmp->usUnityNote);
   7.475 -    wsmp->sFineTune = SDL_SwapLE16(wsmp->sFineTune);
   7.476 -    wsmp->lAttenuation = SDL_SwapLE32(wsmp->lAttenuation);
   7.477 -    wsmp->fulOptions = SDL_SwapLE32(wsmp->fulOptions);
   7.478 -    wsmp->cSampleLoops = SDL_SwapLE32(wsmp->cSampleLoops);
   7.479 -    loop = (WLOOP *)((Uint8 *)chunk->data + wsmp->cbSize);
   7.480 -    *wsmp_ptr = wsmp;
   7.481 -    *wsmp_loop_ptr = loop;
   7.482 -    for ( i = 0; i < wsmp->cSampleLoops; ++i ) {
   7.483 -        loop->cbSize = SDL_SwapLE32(loop->cbSize);
   7.484 -        loop->ulType = SDL_SwapLE32(loop->ulType);
   7.485 -        loop->ulStart = SDL_SwapLE32(loop->ulStart);
   7.486 -        loop->ulLength = SDL_SwapLE32(loop->ulLength);
   7.487 -        ++loop;
   7.488 -    }
   7.489 -}
   7.490 -
   7.491 -static void Parse_art(DLS_Data *data, RIFF_Chunk *chunk, CONNECTIONLIST **art_ptr, CONNECTION **artList_ptr)
   7.492 -{
   7.493 -    Uint32 i;
   7.494 -    CONNECTIONLIST *art = (CONNECTIONLIST *)chunk->data;
   7.495 -    CONNECTION *artList;
   7.496 -    art->cbSize = SDL_SwapLE32(art->cbSize);
   7.497 -    art->cConnections = SDL_SwapLE32(art->cConnections);
   7.498 -    artList = (CONNECTION *)((Uint8 *)chunk->data + art->cbSize);
   7.499 -    *art_ptr = art;
   7.500 -    *artList_ptr = artList;
   7.501 -    for ( i = 0; i < art->cConnections; ++i ) {
   7.502 -        artList->usSource = SDL_SwapLE16(artList->usSource);
   7.503 -        artList->usControl = SDL_SwapLE16(artList->usControl);
   7.504 -        artList->usDestination = SDL_SwapLE16(artList->usDestination);
   7.505 -        artList->usTransform = SDL_SwapLE16(artList->usTransform);
   7.506 -        artList->lScale = SDL_SwapLE32(artList->lScale);
   7.507 -        ++artList;
   7.508 -    }
   7.509 -}
   7.510 -
   7.511 -static void Parse_lart(DLS_Data *data, RIFF_Chunk *chunk, CONNECTIONLIST **conn_ptr, CONNECTION **connList_ptr)
   7.512 -{
   7.513 -    /* FIXME: This only supports one set of connections */
   7.514 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.515 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.516 -        switch(magic) {
   7.517 -            case FOURCC_ART1:
   7.518 -            case FOURCC_ART2:
   7.519 -                Parse_art(data, chunk, conn_ptr, connList_ptr);
   7.520 -                return;
   7.521 -        }
   7.522 -    }
   7.523 -}
   7.524 -
   7.525 -static void Parse_rgn(DLS_Data *data, RIFF_Chunk *chunk, DLS_Region *region)
   7.526 -{
   7.527 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.528 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.529 -        switch(magic) {
   7.530 -            case FOURCC_RGNH:
   7.531 -                Parse_rgnh(data, chunk, region);
   7.532 -                break;
   7.533 -            case FOURCC_WLNK:
   7.534 -                Parse_wlnk(data, chunk, region);
   7.535 -                break;
   7.536 -            case FOURCC_WSMP:
   7.537 -                Parse_wsmp(data, chunk, &region->wsmp, &region->wsmp_loop);
   7.538 -                break;
   7.539 -            case FOURCC_LART:
   7.540 -            case FOURCC_LAR2:
   7.541 -                Parse_lart(data, chunk, &region->art, &region->artList);
   7.542 -                break;
   7.543 -        }
   7.544 -    }
   7.545 -}
   7.546 -
   7.547 -static void Parse_lrgn(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
   7.548 -{
   7.549 -    Uint32 region = 0;
   7.550 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.551 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.552 -        switch(magic) {
   7.553 -            case FOURCC_RGN:
   7.554 -            case FOURCC_RGN2:
   7.555 -                if ( region < instrument->header->cRegions ) {
   7.556 -                    Parse_rgn(data, chunk, &instrument->regions[region++]);
   7.557 -                }
   7.558 -                break;
   7.559 -        }
   7.560 -    }
   7.561 -}
   7.562 -
   7.563 -static void Parse_INFO_INS(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
   7.564 -{
   7.565 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.566 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.567 -        switch(magic) {
   7.568 -            case FOURCC_INAM: /* Name */
   7.569 -                instrument->name = (char *)chunk->data;
   7.570 -                break;
   7.571 -        }
   7.572 -    }
   7.573 -}
   7.574 -
   7.575 -static void Parse_ins(DLS_Data *data, RIFF_Chunk *chunk, DLS_Instrument *instrument)
   7.576 -{
   7.577 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.578 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.579 -        switch(magic) {
   7.580 -            case FOURCC_INSH:
   7.581 -                Parse_insh(data, chunk, instrument);
   7.582 -                break;
   7.583 -            case FOURCC_LRGN:
   7.584 -                Parse_lrgn(data, chunk, instrument);
   7.585 -                break;
   7.586 -            case FOURCC_LART:
   7.587 -            case FOURCC_LAR2:
   7.588 -                Parse_lart(data, chunk, &instrument->art, &instrument->artList);
   7.589 -                break;
   7.590 -            case FOURCC_INFO:
   7.591 -                Parse_INFO_INS(data, chunk, instrument);
   7.592 -                break;
   7.593 -        }
   7.594 -    }
   7.595 -}
   7.596 -
   7.597 -static void Parse_lins(DLS_Data *data, RIFF_Chunk *chunk)
   7.598 -{
   7.599 -    Uint32 instrument = 0;
   7.600 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.601 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.602 -        switch(magic) {
   7.603 -            case FOURCC_INS:
   7.604 -                if ( instrument < data->cInstruments ) {
   7.605 -                    Parse_ins(data, chunk, &data->instruments[instrument++]);
   7.606 -                }
   7.607 -                break;
   7.608 -        }
   7.609 -    }
   7.610 -}
   7.611 -
   7.612 -static void Parse_ptbl(DLS_Data *data, RIFF_Chunk *chunk)
   7.613 -{
   7.614 -    Uint32 i;
   7.615 -    POOLTABLE *ptbl = (POOLTABLE *)chunk->data;
   7.616 -    ptbl->cbSize = SDL_SwapLE32(ptbl->cbSize);
   7.617 -    ptbl->cCues = SDL_SwapLE32(ptbl->cCues);
   7.618 -    data->ptbl = ptbl;
   7.619 -    data->ptblList = (POOLCUE *)((Uint8 *)chunk->data + ptbl->cbSize);
   7.620 -    for ( i = 0; i < ptbl->cCues; ++i ) {
   7.621 -        data->ptblList[i].ulOffset = SDL_SwapLE32(data->ptblList[i].ulOffset);
   7.622 -    }
   7.623 -    AllocWaveList(data);
   7.624 -}
   7.625 -
   7.626 -static void Parse_fmt(DLS_Data *data, RIFF_Chunk *chunk, DLS_Wave *wave)
   7.627 -{
   7.628 -    WaveFMT *fmt = (WaveFMT *)chunk->data;
   7.629 -    fmt->wFormatTag = SDL_SwapLE16(fmt->wFormatTag);
   7.630 -    fmt->wChannels = SDL_SwapLE16(fmt->wChannels);
   7.631 -    fmt->dwSamplesPerSec = SDL_SwapLE32(fmt->dwSamplesPerSec);
   7.632 -    fmt->dwAvgBytesPerSec = SDL_SwapLE32(fmt->dwAvgBytesPerSec);
   7.633 -    fmt->wBlockAlign = SDL_SwapLE16(fmt->wBlockAlign);
   7.634 -    fmt->wBitsPerSample = SDL_SwapLE16(fmt->wBitsPerSample);
   7.635 -    wave->format = fmt;
   7.636 -}
   7.637 -
   7.638 -static void Parse_data(DLS_Data *data, RIFF_Chunk *chunk, DLS_Wave *wave)
   7.639 -{
   7.640 -    wave->data = chunk->data;
   7.641 -    wave->length = chunk->length;
   7.642 -}
   7.643 -
   7.644 -static void Parse_wave(DLS_Data *data, RIFF_Chunk *chunk, DLS_Wave *wave)
   7.645 -{
   7.646 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.647 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.648 -        switch(magic) {
   7.649 -            case FOURCC_FMT:
   7.650 -                Parse_fmt(data, chunk, wave);
   7.651 -                break;
   7.652 -            case FOURCC_DATA:
   7.653 -                Parse_data(data, chunk, wave);
   7.654 -                break;
   7.655 -            case FOURCC_WSMP:
   7.656 -                Parse_wsmp(data, chunk, &wave->wsmp, &wave->wsmp_loop);
   7.657 -                break;
   7.658 -        }
   7.659 -    }
   7.660 -}
   7.661 -
   7.662 -static void Parse_wvpl(DLS_Data *data, RIFF_Chunk *chunk)
   7.663 -{
   7.664 -    Uint32 wave = 0;
   7.665 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.666 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.667 -        switch(magic) {
   7.668 -            case FOURCC_wave:
   7.669 -                if ( wave < data->ptbl->cCues ) {
   7.670 -                    Parse_wave(data, chunk, &data->waveList[wave++]);
   7.671 -                }
   7.672 -                break;
   7.673 -        }
   7.674 -    }
   7.675 -}
   7.676 -
   7.677 -static void Parse_INFO_DLS(DLS_Data *data, RIFF_Chunk *chunk)
   7.678 -{
   7.679 -    for ( chunk = chunk->child; chunk; chunk = chunk->next ) {
   7.680 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.681 -        switch(magic) {
   7.682 -            case FOURCC_IARL: /* Archival Location */
   7.683 -                break;
   7.684 -            case FOURCC_IART: /* Artist */
   7.685 -                data->artist = (char *)chunk->data;
   7.686 -                break;
   7.687 -            case FOURCC_ICMS: /* Commisioned */
   7.688 -                break;
   7.689 -            case FOURCC_ICMT: /* Comments */
   7.690 -                data->comments = (char *)chunk->data;
   7.691 -                break;
   7.692 -            case FOURCC_ICOP: /* Copyright */
   7.693 -                data->copyright = (char *)chunk->data;
   7.694 -                break;
   7.695 -            case FOURCC_ICRD: /* Creation Date */
   7.696 -                break;
   7.697 -            case FOURCC_IENG: /* Engineer */
   7.698 -                break;
   7.699 -            case FOURCC_IGNR: /* Genre */
   7.700 -                break;
   7.701 -            case FOURCC_IKEY: /* Keywords */
   7.702 -                break;
   7.703 -            case FOURCC_IMED: /* Medium */
   7.704 -                break;
   7.705 -            case FOURCC_INAM: /* Name */
   7.706 -                data->name = (char *)chunk->data;
   7.707 -                break;
   7.708 -            case FOURCC_IPRD: /* Product */
   7.709 -                break;
   7.710 -            case FOURCC_ISBJ: /* Subject */
   7.711 -                break;
   7.712 -            case FOURCC_ISFT: /* Software */
   7.713 -                break;
   7.714 -            case FOURCC_ISRC: /* Source */
   7.715 -                break;
   7.716 -            case FOURCC_ISRF: /* Source Form */
   7.717 -                break;
   7.718 -            case FOURCC_ITCH: /* Technician */
   7.719 -                break;
   7.720 -        }
   7.721 -    }
   7.722 -}
   7.723 -
   7.724 -DLS_Data *LoadDLS(SDL_RWops *src)
   7.725 -{
   7.726 -    RIFF_Chunk *chunk;
   7.727 -    DLS_Data *data = (DLS_Data *)malloc(sizeof(*data));
   7.728 -    if ( !data ) {
   7.729 -        SDL_Error(SDL_ENOMEM);
   7.730 -        return NULL;
   7.731 -    }
   7.732 -    memset(data, 0, sizeof(*data));
   7.733 -
   7.734 -    data->chunk = LoadRIFF(src);
   7.735 -    if ( !data->chunk ) {
   7.736 -        FreeDLS(data);
   7.737 -        return NULL;
   7.738 -    }
   7.739 -
   7.740 -    for ( chunk = data->chunk->child; chunk; chunk = chunk->next ) {
   7.741 -        Uint32 magic = (chunk->magic == FOURCC_LIST) ? chunk->subtype : chunk->magic;
   7.742 -        switch(magic) {
   7.743 -            case FOURCC_COLH:
   7.744 -                Parse_colh(data, chunk);
   7.745 -                break;
   7.746 -            case FOURCC_LINS:
   7.747 -                Parse_lins(data, chunk);
   7.748 -                break;
   7.749 -            case FOURCC_PTBL:
   7.750 -                Parse_ptbl(data, chunk);
   7.751 -                break;
   7.752 -            case FOURCC_WVPL:
   7.753 -                Parse_wvpl(data, chunk);
   7.754 -                break;
   7.755 -            case FOURCC_INFO:
   7.756 -                Parse_INFO_DLS(data, chunk);
   7.757 -                break;
   7.758 -        }
   7.759 -    }
   7.760 -    return data;
   7.761 -}
   7.762 -
   7.763 -void FreeDLS(DLS_Data *data)
   7.764 -{
   7.765 -    if ( data->chunk ) {
   7.766 -        FreeRIFF(data->chunk);
   7.767 -    }
   7.768 -    FreeInstruments(data);
   7.769 -    FreeWaveList(data);
   7.770 -    free(data);
   7.771 -}
   7.772 -
   7.773 -#ifdef TEST_MAIN_DLS
   7.774 -
   7.775 -static const char *SourceToString(USHORT usSource)
   7.776 -{
   7.777 -    switch(usSource) {
   7.778 -        case CONN_SRC_NONE:
   7.779 -            return "NONE";
   7.780 -        case CONN_SRC_LFO:
   7.781 -            return "LFO";
   7.782 -        case CONN_SRC_KEYONVELOCITY:
   7.783 -            return "KEYONVELOCITY";
   7.784 -        case CONN_SRC_KEYNUMBER:
   7.785 -            return "KEYNUMBER";
   7.786 -        case CONN_SRC_EG1:
   7.787 -            return "EG1";
   7.788 -        case CONN_SRC_EG2:
   7.789 -            return "EG2";
   7.790 -        case CONN_SRC_PITCHWHEEL:
   7.791 -            return "PITCHWHEEL";
   7.792 -        case CONN_SRC_CC1:
   7.793 -            return "CC1";
   7.794 -        case CONN_SRC_CC7:
   7.795 -            return "CC7";
   7.796 -        case CONN_SRC_CC10:
   7.797 -            return "CC10";
   7.798 -        case CONN_SRC_CC11:
   7.799 -            return "CC11";
   7.800 -        case CONN_SRC_POLYPRESSURE:
   7.801 -            return "POLYPRESSURE";
   7.802 -        case CONN_SRC_CHANNELPRESSURE:
   7.803 -            return "CHANNELPRESSURE";
   7.804 -        case CONN_SRC_VIBRATO:
   7.805 -            return "VIBRATO";
   7.806 -        case CONN_SRC_MONOPRESSURE:
   7.807 -            return "MONOPRESSURE";
   7.808 -        case CONN_SRC_CC91:
   7.809 -            return "CC91";
   7.810 -        case CONN_SRC_CC93:
   7.811 -            return "CC93";
   7.812 -        default:
   7.813 -            return "UNKNOWN";
   7.814 -    }
   7.815 -}
   7.816 -
   7.817 -static const char *TransformToString(USHORT usTransform)
   7.818 -{
   7.819 -    switch (usTransform) {
   7.820 -        case CONN_TRN_NONE:
   7.821 -            return "NONE";
   7.822 -        case CONN_TRN_CONCAVE:
   7.823 -            return "CONCAVE";
   7.824 -        case CONN_TRN_CONVEX:
   7.825 -            return "CONVEX";
   7.826 -        case CONN_TRN_SWITCH:
   7.827 -            return "SWITCH";
   7.828 -        default:
   7.829 -            return "UNKNOWN";
   7.830 -    }
   7.831 -}
   7.832 -
   7.833 -static const char *DestinationToString(USHORT usDestination)
   7.834 -{
   7.835 -    switch (usDestination) {
   7.836 -        case CONN_DST_NONE:
   7.837 -            return "NONE";
   7.838 -        case CONN_DST_ATTENUATION:
   7.839 -            return "ATTENUATION";
   7.840 -        case CONN_DST_PITCH:
   7.841 -            return "PITCH";
   7.842 -        case CONN_DST_PAN:
   7.843 -            return "PAN";
   7.844 -        case CONN_DST_LFO_FREQUENCY:
   7.845 -            return "LFO_FREQUENCY";
   7.846 -        case CONN_DST_LFO_STARTDELAY:
   7.847 -            return "LFO_STARTDELAY";
   7.848 -        case CONN_DST_EG1_ATTACKTIME:
   7.849 -            return "EG1_ATTACKTIME";
   7.850 -        case CONN_DST_EG1_DECAYTIME:
   7.851 -            return "EG1_DECAYTIME";
   7.852 -        case CONN_DST_EG1_RELEASETIME:
   7.853 -            return "EG1_RELEASETIME";
   7.854 -        case CONN_DST_EG1_SUSTAINLEVEL:
   7.855 -            return "EG1_SUSTAINLEVEL";
   7.856 -        case CONN_DST_EG2_ATTACKTIME:
   7.857 -            return "EG2_ATTACKTIME";
   7.858 -        case CONN_DST_EG2_DECAYTIME:
   7.859 -            return "EG2_DECAYTIME";
   7.860 -        case CONN_DST_EG2_RELEASETIME:
   7.861 -            return "EG2_RELEASETIME";
   7.862 -        case CONN_DST_EG2_SUSTAINLEVEL:
   7.863 -            return "EG2_SUSTAINLEVEL";
   7.864 -        case CONN_DST_KEYNUMBER:
   7.865 -            return "KEYNUMBER";
   7.866 -        case CONN_DST_LEFT:
   7.867 -            return "LEFT";
   7.868 -        case CONN_DST_RIGHT:
   7.869 -            return "RIGHT";
   7.870 -        case CONN_DST_CENTER:
   7.871 -            return "CENTER";
   7.872 -        case CONN_DST_LEFTREAR:
   7.873 -            return "LEFTREAR";
   7.874 -        case CONN_DST_RIGHTREAR:
   7.875 -            return "RIGHTREAR";
   7.876 -        case CONN_DST_LFE_CHANNEL:
   7.877 -            return "LFE_CHANNEL";
   7.878 -        case CONN_DST_CHORUS:
   7.879 -            return "CHORUS";
   7.880 -        case CONN_DST_REVERB:
   7.881 -            return "REVERB";
   7.882 -        case CONN_DST_VIB_FREQUENCY:
   7.883 -            return "VIB_FREQUENCY";
   7.884 -        case CONN_DST_VIB_STARTDELAY:
   7.885 -            return "VIB_STARTDELAY";
   7.886 -        case CONN_DST_EG1_DELAYTIME:
   7.887 -            return "EG1_DELAYTIME";
   7.888 -        case CONN_DST_EG1_HOLDTIME:
   7.889 -            return "EG1_HOLDTIME";
   7.890 -        case CONN_DST_EG1_SHUTDOWNTIME:
   7.891 -            return "EG1_SHUTDOWNTIME";
   7.892 -        case CONN_DST_EG2_DELAYTIME:
   7.893 -            return "EG2_DELAYTIME";
   7.894 -        case CONN_DST_EG2_HOLDTIME:
   7.895 -            return "EG2_HOLDTIME";
   7.896 -        case CONN_DST_FILTER_CUTOFF:
   7.897 -            return "FILTER_CUTOFF";
   7.898 -        case CONN_DST_FILTER_Q:
   7.899 -            return "FILTER_Q";
   7.900 -        default:
   7.901 -            return "UNKOWN";
   7.902 -    }
   7.903 -}
   7.904 -
   7.905 -static void PrintArt(const char *type, CONNECTIONLIST *art, CONNECTION *artList)
   7.906 -{
   7.907 -    Uint32 i;
   7.908 -    printf("%s Connections:\n", type);
   7.909 -    for ( i = 0; i < art->cConnections; ++i ) {
   7.910 -        printf("  Source: %s, Control: %s, Destination: %s, Transform: %s, Scale: %d\n",
   7.911 -            SourceToString(artList[i].usSource),
   7.912 -            SourceToString(artList[i].usControl),
   7.913 -            DestinationToString(artList[i].usDestination),
   7.914 -            TransformToString(artList[i].usTransform),
   7.915 -            artList[i].lScale);
   7.916 -    }
   7.917 -}
   7.918 -
   7.919 -static void PrintWave(DLS_Wave *wave, Uint32 index)
   7.920 -{
   7.921 -    WaveFMT *format = wave->format;
   7.922 -    if ( format ) {
   7.923 -        printf("  Wave %u: Format: %hu, %hu channels, %u Hz, %hu bits (length = %u)\n", index, format->wFormatTag, format->wChannels, format->dwSamplesPerSec, format->wBitsPerSample, wave->length);
   7.924 -    }
   7.925 -    if ( wave->wsmp ) {
   7.926 -        Uint32 i;
   7.927 -        printf("    wsmp->usUnityNote = %hu\n", wave->wsmp->usUnityNote);
   7.928 -        printf("    wsmp->sFineTune = %hd\n", wave->wsmp->sFineTune);
   7.929 -        printf("    wsmp->lAttenuation = %d\n", wave->wsmp->lAttenuation);
   7.930 -        printf("    wsmp->fulOptions = 0x%8.8x\n", wave->wsmp->fulOptions);
   7.931 -        printf("    wsmp->cSampleLoops = %u\n", wave->wsmp->cSampleLoops);
   7.932 -        for ( i = 0; i < wave->wsmp->cSampleLoops; ++i ) {
   7.933 -            WLOOP *loop = &wave->wsmp_loop[i];
   7.934 -            printf("    Loop %u:\n", i);
   7.935 -            printf("      ulStart = %u\n", loop->ulStart);
   7.936 -            printf("      ulLength = %u\n", loop->ulLength);
   7.937 -        }
   7.938 -    }
   7.939 -}
   7.940 -
   7.941 -static void PrintRegion(DLS_Region *region, Uint32 index)
   7.942 -{
   7.943 -    printf("  Region %u:\n", index);
   7.944 -    if ( region->header ) {
   7.945 -        printf("    RangeKey = { %hu - %hu }\n", region->header->RangeKey.usLow, region->header->RangeKey.usHigh);
   7.946 -        printf("    RangeVelocity = { %hu - %hu }\n", region->header->RangeVelocity.usLow, region->header->RangeVelocity.usHigh);
   7.947 -        printf("    fusOptions = 0x%4.4hx\n", region->header->fusOptions);
   7.948 -        printf("    usKeyGroup = %hu\n", region->header->usKeyGroup);
   7.949 -    }
   7.950 -    if ( region->wlnk ) {
   7.951 -        printf("    wlnk->fusOptions = 0x%4.4hx\n", region->wlnk->fusOptions);
   7.952 -        printf("    wlnk->usPhaseGroup = %hu\n", region->wlnk->usPhaseGroup);
   7.953 -        printf("    wlnk->ulChannel = %u\n", region->wlnk->ulChannel);
   7.954 -        printf("    wlnk->ulTableIndex = %u\n", region->wlnk->ulTableIndex);
   7.955 -    }
   7.956 -    if ( region->wsmp ) {
   7.957 -        Uint32 i;
   7.958 -        printf("    wsmp->usUnityNote = %hu\n", region->wsmp->usUnityNote);
   7.959 -        printf("    wsmp->sFineTune = %hd\n", region->wsmp->sFineTune);
   7.960 -        printf("    wsmp->lAttenuation = %d\n", region->wsmp->lAttenuation);
   7.961 -        printf("    wsmp->fulOptions = 0x%8.8x\n", region->wsmp->fulOptions);
   7.962 -        printf("    wsmp->cSampleLoops = %u\n", region->wsmp->cSampleLoops);
   7.963 -        for ( i = 0; i < region->wsmp->cSampleLoops; ++i ) {
   7.964 -            WLOOP *loop = &region->wsmp_loop[i];
   7.965 -            printf("    Loop %u:\n", i);
   7.966 -            printf("      ulStart = %u\n", loop->ulStart);
   7.967 -            printf("      ulLength = %u\n", loop->ulLength);
   7.968 -        }
   7.969 -    }
   7.970 -    if ( region->art && region->art->cConnections > 0 ) {
   7.971 -        PrintArt("Region", region->art, region->artList);
   7.972 -    }
   7.973 -}
   7.974 -
   7.975 -static void PrintInstrument(DLS_Instrument *instrument, Uint32 index)
   7.976 -{
   7.977 -    printf("Instrument %u:\n", index);
   7.978 -    if ( instrument->name ) {
   7.979 -        printf("  Name: %s\n", instrument->name);
   7.980 -    }
   7.981 -    if ( instrument->header ) {
   7.982 -        Uint32 i;
   7.983 -        printf("  ulBank = 0x%8.8x\n", instrument->header->Locale.ulBank);
   7.984 -        printf("  ulInstrument = %u\n", instrument->header->Locale.ulInstrument);
   7.985 -        printf("  Regions: %u\n", instrument->header->cRegions);
   7.986 -        for ( i = 0; i < instrument->header->cRegions; ++i ) {
   7.987 -            PrintRegion(&instrument->regions[i], i);
   7.988 -        }
   7.989 -    }
   7.990 -    if ( instrument->art && instrument->art->cConnections > 0 ) {
   7.991 -        PrintArt("Instrument", instrument->art, instrument->artList);
   7.992 -    }
   7.993 -};
   7.994 -
   7.995 -void PrintDLS(DLS_Data *data)
   7.996 -{
   7.997 -    printf("DLS Data:\n");
   7.998 -    printf("cInstruments = %u\n", data->cInstruments); 
   7.999 -    if ( data->instruments ) {
  7.1000 -        Uint32 i;
  7.1001 -        for ( i = 0; i < data->cInstruments; ++i ) {
  7.1002 -            PrintInstrument(&data->instruments[i], i);
  7.1003 -        }
  7.1004 -    }
  7.1005 -    if ( data->ptbl && data->ptbl->cCues > 0 ) {
  7.1006 -        Uint32 i;
  7.1007 -        printf("Cues: ");
  7.1008 -        for ( i = 0; i < data->ptbl->cCues; ++i ) {
  7.1009 -            if ( i > 0 ) {
  7.1010 -                printf(", ");
  7.1011 -            }
  7.1012 -            printf("%u", data->ptblList[i].ulOffset);
  7.1013 -        }
  7.1014 -        printf("\n");
  7.1015 -    }
  7.1016 -    if ( data->waveList ) {
  7.1017 -        Uint32 i;
  7.1018 -        printf("Waves:\n");
  7.1019 -        for ( i = 0; i < data->ptbl->cCues; ++i ) {
  7.1020 -            PrintWave(&data->waveList[i], i);
  7.1021 -        }
  7.1022 -    }
  7.1023 -    if ( data->name ) {
  7.1024 -        printf("Name: %s\n", data->name);
  7.1025 -    }
  7.1026 -    if ( data->artist ) {
  7.1027 -        printf("Artist: %s\n", data->artist);
  7.1028 -    }
  7.1029 -    if ( data->copyright ) {
  7.1030 -        printf("Copyright: %s\n", data->copyright);
  7.1031 -    }
  7.1032 -    if ( data->comments ) {
  7.1033 -        printf("Comments: %s\n", data->comments);
  7.1034 -    }
  7.1035 -}
  7.1036 -
  7.1037 -main(int argc, char *argv[])
  7.1038 -{
  7.1039 -    int i;
  7.1040 -    for ( i = 1; i < argc; ++i ) {
  7.1041 -        DLS_Data *data;
  7.1042 -        SDL_RWops *src = SDL_RWFromFile(argv[i], "rb");
  7.1043 -        if ( !src ) {
  7.1044 -            fprintf(stderr, "Couldn't open %s: %s", argv[i], SDL_GetError());
  7.1045 -            continue;
  7.1046 -        }
  7.1047 -        data = LoadDLS(src);
  7.1048 -        if ( data ) {
  7.1049 -            PrintRIFF(data->chunk, 0);
  7.1050 -            PrintDLS(data);
  7.1051 -            FreeDLS(data);
  7.1052 -        } else {
  7.1053 -            fprintf(stderr, "Couldn't load %s: %s\n", argv[i], SDL_GetError());
  7.1054 -        }
  7.1055 -        SDL_RWclose(src);
  7.1056 -    }
  7.1057 -}
  7.1058 -
  7.1059 -#endif // TEST_MAIN
  7.1060 -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  7.1061 -
  7.1062 -/*-------------------------------------------------------------------------*/
  7.1063 -/* * * * * * * * * * * * * * * * * instrum_dls.c * * * * * * * * * * * * * */
  7.1064 -/*-------------------------------------------------------------------------*/
  7.1065 -
  7.1066 -DLS_Data *Timidity_LoadDLS(SDL_RWops *src)
  7.1067 -{
  7.1068 -  DLS_Data *patches = LoadDLS(src);
  7.1069 -  if (!patches) {
  7.1070 -    SNDDBG(("%s", SDL_GetError()));
  7.1071 -  }
  7.1072 -  return patches;
  7.1073 -}
  7.1074 -
  7.1075 -void Timidity_FreeDLS(DLS_Data *patches)
  7.1076 -{
  7.1077 -  FreeDLS(patches);
  7.1078 -}
  7.1079 -
  7.1080 -/* convert timecents to sec */
  7.1081 -static double to_msec(int timecent)
  7.1082 -{
  7.1083 -  if (timecent == 0x80000000 || timecent == 0)
  7.1084 -    return 0.0;
  7.1085 -  return 1000.0 * pow(2.0, (double)(timecent / 65536) / 1200.0);
  7.1086 -}
  7.1087 -
  7.1088 -/* convert decipercent to {0..1} */
  7.1089 -static double to_normalized_percent(int decipercent)
  7.1090 -{
  7.1091 -  return ((double)(decipercent / 65536)) / 1000.0;
  7.1092 -}
  7.1093 -
  7.1094 -/* convert from 8bit value to fractional offset (15.15) */
  7.1095 -static Sint32 to_offset(int offset)
  7.1096 -{
  7.1097 -	return (Sint32)offset << (7+15);
  7.1098 -}
  7.1099 -
  7.1100 -/* calculate ramp rate in fractional unit;
  7.1101 - * diff = 8bit, time = msec
  7.1102 - */
  7.1103 -static Sint32 calc_rate(MidiSong *song, int diff, int sample_rate, double msec)
  7.1104 -{
  7.1105 -    double rate;
  7.1106 -
  7.1107 -    if(msec < 6)
  7.1108 -      msec = 6;
  7.1109 -    if(diff == 0)
  7.1110 -      diff = 255;
  7.1111 -    diff <<= (7+15);
  7.1112 -    rate = ((double)diff / song->rate) * song->control_ratio * 1000.0 / msec;
  7.1113 -    return (Sint32)rate;
  7.1114 -}
  7.1115 -
  7.1116 -static int load_connection(ULONG cConnections, CONNECTION *artList, USHORT destination)
  7.1117 -{
  7.1118 -  ULONG i;
  7.1119 -  int value = 0;
  7.1120 -  for (i = 0; i < cConnections; ++i) {
  7.1121 -    CONNECTION *conn = &artList[i];
  7.1122 -    if(conn->usDestination == destination) {
  7.1123 -      // The formula for the destination is:
  7.1124 -      // usDestination = usDestination + usTransform(usSource * (usControl * lScale))
  7.1125 -      // Since we are only handling source/control of NONE and identity
  7.1126 -      // transform, this simplifies to: usDestination = usDestination + lScale
  7.1127 -      if (conn->usSource == CONN_SRC_NONE &&
  7.1128 -          conn->usControl == CONN_SRC_NONE &&
  7.1129 -          conn->usTransform == CONN_TRN_NONE)
  7.1130 -        value += conn->lScale;
  7.1131 -    }
  7.1132 -  }
  7.1133 -  return value;
  7.1134 -}
  7.1135 -
  7.1136 -static void load_region_dls(MidiSong *song, Sample *sample, DLS_Instrument *ins, Uint32 index)
  7.1137 -{
  7.1138 -  DLS_Region *rgn = &ins->regions[index];
  7.1139 -  DLS_Wave *wave = &song->patches->waveList[rgn->wlnk->ulTableIndex];
  7.1140 -
  7.1141 -  sample->low_freq = freq_table[rgn->header->RangeKey.usLow];
  7.1142 -  sample->high_freq = freq_table[rgn->header->RangeKey.usHigh];
  7.1143 -  sample->root_freq = freq_table[rgn->wsmp->usUnityNote];
  7.1144 -  sample->low_vel = rgn->header->RangeVelocity.usLow;
  7.1145 -  sample->high_vel = rgn->header->RangeVelocity.usHigh;
  7.1146 -
  7.1147 -  sample->modes = MODES_16BIT;
  7.1148 -  sample->sample_rate = wave->format->dwSamplesPerSec;
  7.1149 -  sample->data_length = wave->length / 2;
  7.1150 -  sample->data = (sample_t *)safe_malloc(wave->length);
  7.1151 -  memcpy(sample->data, wave->data, wave->length);
  7.1152 -  if (rgn->wsmp->cSampleLoops) {
  7.1153 -    sample->modes |= (MODES_LOOPING|MODES_SUSTAIN);
  7.1154 -    sample->loop_start = rgn->wsmp_loop->ulStart / 2;
  7.1155 -    sample->loop_end = sample->loop_start + (rgn->wsmp_loop->ulLength / 2);
  7.1156 -  }
  7.1157 -  sample->volume = 1.0f;
  7.1158 -
  7.1159 -  if (sample->modes & MODES_SUSTAIN) {
  7.1160 -    int value;
  7.1161 -    double attack, hold, decay, release; int sustain;
  7.1162 -    CONNECTIONLIST *art = NULL;
  7.1163 -    CONNECTION *artList = NULL;
  7.1164 -
  7.1165 -    if (ins->art && ins->art->cConnections > 0 && ins->artList) {
  7.1166 -      art = ins->art;
  7.1167 -      artList = ins->artList;
  7.1168 -    } else {
  7.1169 -      art = rgn->art;
  7.1170 -      artList = rgn->artList;
  7.1171 -    }
  7.1172 -
  7.1173 -    value = load_connection(art->cConnections, artList, CONN_DST_EG1_ATTACKTIME);
  7.1174 -    attack = to_msec(value);
  7.1175 -    value = load_connection(art->cConnections, artList, CONN_DST_EG1_HOLDTIME);
  7.1176 -    hold = to_msec(value);
  7.1177 -    value = load_connection(art->cConnections, artList, CONN_DST_EG1_DECAYTIME);
  7.1178 -    decay = to_msec(value);
  7.1179 -    value = load_connection(art->cConnections, artList, CONN_DST_EG1_RELEASETIME);
  7.1180 -    release = to_msec(value);
  7.1181 -    value = load_connection(art->cConnections, artList, CONN_DST_EG1_SUSTAINLEVEL);
  7.1182 -    sustain = (int)((1.0 - to_normalized_percent(value)) * 250.0);
  7.1183 -    value = load_connection(art->cConnections, artList, CONN_DST_PAN);
  7.1184 -    sample->panning = (int)((0.5 + to_normalized_percent(value)) * 127.0);
  7.1185 -
  7.1186 -/*
  7.1187 -printf("%d, Rate=%d LV=%d HV=%d Low=%d Hi=%d Root=%d Pan=%d Attack=%f Hold=%f Sustain=%d Decay=%f Release=%f\n", index, sample->sample_rate, rgn->header->RangeVelocity.usLow, rgn->header->RangeVelocity.usHigh, sample->low_freq, sample->high_freq, sample->root_freq, sample->panning, attack, hold, sustain, decay, release);
  7.1188 -*/
  7.1189 -
  7.1190 -    sample->envelope_offset[0] = to_offset(255);
  7.1191 -    sample->envelope_rate[0] = calc_rate(song, 255, sample->sample_rate, attack);
  7.1192 -
  7.1193 -    sample->envelope_offset[1] = to_offset(250);
  7.1194 -    sample->envelope_rate[1] = calc_rate(song, 5, sample->sample_rate, hold);
  7.1195 -
  7.1196 -    sample->envelope_offset[2] = to_offset(sustain);
  7.1197 -    sample->envelope_rate[2] = calc_rate(song, 255 - sustain, sample->sample_rate, decay);
  7.1198 -
  7.1199 -    sample->envelope_offset[3] = to_offset(0);
  7.1200 -    sample->envelope_rate[3] = calc_rate(song, 5 + sustain, sample->sample_rate, release);
  7.1201 -
  7.1202 -    sample->envelope_offset[4] = to_offset(0);
  7.1203 -    sample->envelope_rate[4] = to_offset(1);
  7.1204 -
  7.1205 -    sample->envelope_offset[5] = to_offset(0);
  7.1206 -    sample->envelope_rate[5] = to_offset(1);
  7.1207 -
  7.1208 -    sample->modes |= MODES_ENVELOPE;
  7.1209 -  }
  7.1210 -
  7.1211 -  sample->data_length <<= FRACTION_BITS;
  7.1212 -  sample->loop_start <<= FRACTION_BITS;
  7.1213 -  sample->loop_end <<= FRACTION_BITS;
  7.1214 -}
  7.1215 -
  7.1216 -Instrument *load_instrument_dls(MidiSong *song, int drum, int bank, int instrument)
  7.1217 -{
  7.1218 -  Instrument *inst;
  7.1219 -  Uint32 i;
  7.1220 -  DLS_Instrument *dls_ins;
  7.1221 -
  7.1222 -  if (!song->patches)
  7.1223 -   return(NULL);
  7.1224 -
  7.1225 -  drum = drum ? 0x80000000 : 0;
  7.1226 -  for (i = 0; i < song->patches->cInstruments; ++i) {
  7.1227 -    dls_ins = &song->patches->instruments[i];
  7.1228 -    if ((dls_ins->header->Locale.ulBank & 0x80000000) == drum &&
  7.1229 -        ((dls_ins->header->Locale.ulBank >> 8) & 0xFF) == bank &&
  7.1230 -        dls_ins->header->Locale.ulInstrument == instrument)
  7.1231 -      break;
  7.1232 -  }
  7.1233 -  if (i == song->patches->cInstruments && !bank) {
  7.1234 -    for (i = 0; i < song->patches->cInstruments; ++i) {
  7.1235 -      dls_ins = &song->patches->instruments[i];
  7.1236 -      if ((dls_ins->header->Locale.ulBank & 0x80000000) == drum &&
  7.1237 -          dls_ins->header->Locale.ulInstrument == instrument)
  7.1238 -        break;
  7.1239 -    }
  7.1240 -  }
  7.1241 -  if (i == song->patches->cInstruments) {
  7.1242 -    SNDDBG(("Couldn't find %s instrument %d in bank %d\n", drum ? "drum" : "melodic", instrument, bank));
  7.1243 -    return(NULL);
  7.1244 -  }
  7.1245 -
  7.1246 -  inst = (Instrument *)safe_malloc(sizeof(*inst));
  7.1247 -  inst->samples = dls_ins->header->cRegions;
  7.1248 -  inst->sample = (Sample *)safe_malloc(inst->samples * sizeof(*inst->sample));
  7.1249 -  memset(inst->sample, 0, inst->samples * sizeof(*inst->sample));
  7.1250 -/*
  7.1251 -printf("Found %s instrument %d in bank %d named %s with %d regions\n", drum ? "drum" : "melodic", instrument, bank, dls_ins->name, inst->samples);
  7.1252 -*/
  7.1253 -  for (i = 0; i < dls_ins->header->cRegions; ++i) {
  7.1254 -    load_region_dls(song, &inst->sample[i], dls_ins, i);
  7.1255 -  }
  7.1256 -  return(inst);
  7.1257 -}
     8.1 --- a/timidity/instrum_dls.h	Sat Oct 21 00:53:21 2017 -0700
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,13 +0,0 @@
     8.4 -/*
     8.5 -
     8.6 -    TiMidity -- Experimental MIDI to WAVE converter
     8.7 -    Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
     8.8 -
     8.9 -    This program is free software; you can redistribute it and/or modify
    8.10 -    it under the terms of the Perl Artistic License, available in COPYING.
    8.11 -
    8.12 -   instrum.h
    8.13 -
    8.14 -   */
    8.15 -
    8.16 -extern Instrument *load_instrument_dls(MidiSong *song, int drum, int bank, int instrument);
     9.1 --- a/timidity/playmidi.c	Sat Oct 21 00:53:21 2017 -0700
     9.2 +++ b/timidity/playmidi.c	Sat Oct 21 09:04:55 2017 +0300
     9.3 @@ -83,8 +83,7 @@
     9.4    f=song->voice[v].orig_frequency;
     9.5    for (i=0; i<s; i++)
     9.6      {
     9.7 -      if (sp->low_vel <= vel && sp->high_vel >= vel &&
     9.8 -          sp->low_freq <= f && sp->high_freq >= f)
     9.9 +      if (sp->low_freq <= f && sp->high_freq >= f)
    9.10  	{
    9.11  	  song->voice[v].sample=sp;
    9.12  	  return;
    10.1 --- a/timidity/timidity.c	Sat Oct 21 00:53:21 2017 -0700
    10.2 +++ b/timidity/timidity.c	Sat Oct 21 09:04:55 2017 +0300
    10.3 @@ -452,7 +452,7 @@
    10.4    return 0;
    10.5  }
    10.6  
    10.7 -MidiSong *Timidity_LoadDLSSong(SDL_RWops *rw, DLS_Patches *patches, SDL_AudioSpec *audio)
    10.8 +MidiSong *Timidity_LoadSong(SDL_RWops *rw, SDL_AudioSpec *audio)
    10.9  {
   10.10    MidiSong *song;
   10.11    int i;
   10.12 @@ -463,7 +463,6 @@
   10.13    /* Allocate memory for the song */
   10.14    song = (MidiSong *)safe_malloc(sizeof(*song));
   10.15    memset(song, 0, sizeof(*song));
   10.16 -  song->patches = patches;
   10.17  
   10.18    for (i = 0; i < MAXBANK; i++)
   10.19    {
   10.20 @@ -554,11 +553,6 @@
   10.21    return(song);
   10.22  }
   10.23  
   10.24 -MidiSong *Timidity_LoadSong(SDL_RWops *rw, SDL_AudioSpec *audio)
   10.25 -{
   10.26 -  return Timidity_LoadDLSSong(rw, NULL, audio);
   10.27 -}
   10.28 -
   10.29  void Timidity_FreeSong(MidiSong *song)
   10.30  {
   10.31    int i;
    11.1 --- a/timidity/timidity.h	Sat Oct 21 00:53:21 2017 -0700
    11.2 +++ b/timidity/timidity.h	Sat Oct 21 09:04:55 2017 +0300
    11.3 @@ -28,7 +28,7 @@
    11.4  typedef struct {
    11.5    Sint32
    11.6      loop_start, loop_end, data_length,
    11.7 -    sample_rate, low_vel, high_vel, low_freq, high_freq, root_freq;
    11.8 +    sample_rate, low_freq, high_freq, root_freq;
    11.9    Sint32
   11.10      envelope_rate[6], envelope_offset[6];
   11.11    float
   11.12 @@ -105,9 +105,6 @@
   11.13      void *next;
   11.14  } MidiEventList;
   11.15  
   11.16 -struct _DLS_Data;
   11.17 -typedef struct _DLS_Data DLS_Patches;
   11.18 -
   11.19  typedef struct {
   11.20      int playing;
   11.21      SDL_RWops *rw;
   11.22 @@ -115,7 +112,6 @@
   11.23      Sint32 encoding;
   11.24      float master_volume;
   11.25      Sint32 amplification;
   11.26 -    DLS_Patches *patches;
   11.27      ToneBank *tonebank[MAXBANK];
   11.28      ToneBank *drumset[MAXBANK];
   11.29      Instrument *default_instrument;
   11.30 @@ -154,9 +150,6 @@
   11.31  extern int Timidity_Init_NoConfig(void);
   11.32  extern void Timidity_SetVolume(MidiSong *song, int volume);
   11.33  extern int Timidity_PlaySome(MidiSong *song, void *stream, Sint32 len);
   11.34 -extern DLS_Patches *Timidity_LoadDLS(SDL_RWops *rw);
   11.35 -extern void Timidity_FreeDLS(DLS_Patches *patches);
   11.36 -extern MidiSong *Timidity_LoadDLSSong(SDL_RWops *rw, DLS_Patches *patches, SDL_AudioSpec *audio);
   11.37  extern MidiSong *Timidity_LoadSong(SDL_RWops *rw, SDL_AudioSpec *audio);
   11.38  extern void Timidity_Start(MidiSong *song);
   11.39  extern void Timidity_Seek(MidiSong *song, Uint32 ms);