Jim,
thanks for sharing this. Somethings wrong though. I'm using xp, sp2, gm.dls where it should be, but the exe plays maybe 20 samples then no more...it continues to run seemingly forever but the sonud just crackles out.
I was unable to build code using VC++ express here so I cant switch on debug and give you info. Sorry not much more help.
One suggestion for tiny trackers using this technique...you could make the code smaller by doing this:
1. Writing a parser to find the wav data and output start of data and length for each sample into say a .h file in a structure.
// Uncomment the instruments you want...
// each samples entry : address , size
// each samples entry : address , size
#ifndef __GM_H__
#define __GM_H__
typedef struct wsegmentstruct {
unsigned int address; // address in gm.dls of this sample
unsigned int length; // length of this sample
} wsegment;
wsegment GMsamples[]={
//280156,2890, //0
//283212,2848, //1
//286226,12024, //2
//298418,6250, //3
//304836,4820, //4
//309824,15356, //5
//325346,488, //6
//326000,202, //7
//326368,196, //8
//326730,2192, //9
.
.
.
}
then in your 4k code you only need to:
open file
loop:
read sample
create header
which should be (is) tiny.
Chris