I just realized that you were indicating the conditional for weither or not we are at the end of our segment of data. Imagine if I tried to increment the address one more time... I'd get an error for trying to access memory that was not allocated. So... all it does is restrict the pointer from incrementing on it's last iteration through the data.

As for what I've done with this data before...

[pascal] {Sample Data}
for j := NumberOfSamples - XmInstrument.NumOfSamples to NumberOfSamples - 1 do
begin
GetMem(Samples[j].SampleData, Samples[j].SampleLength);

BlockRead(FileStream, Samples[j].SampleData^, Samples[j].SampleLength);
end;[/pascal]

This is the block of code that allocates the memory for each music sample/instrument and copies it. Samples[j].SampleLength is the length in bytes of the sample. Samples[j].SampleData is the Pointer that I use to address the data.

You may ask why the for loop is so odd looking. It has to do with the FastTracker2/XM format and how it's stored. [size=9px](Oh how I'm missing the ease and simplicity of S3M. :?)[/size]

If this really gives you guys no clue I can post the entire project up for download and trials on your own systems. It'll be all a part of an opensource api down the road anyhow.