Allright, I translated my reading code directly to DBPro.
Maybe you could search it for errors, Sheldon?
remstart ******************************************
* Allright, here is a complete rewrite *
* to DarkBASIC on how my plugin reads *
* the .qmo format (v 1.4) *
****************************************** remend
file as integer
dim octaveData (10)
dim pitchData (7000, 10)
dim musicData (7000, 10, 27, 2)
dim channelData(10, 3)
open to read file, "filename.qmo"
read string file, verificationString$ `QMIDI v1.4 or similiar
`Read header data
read long file, totalBars `4 bytes longword. This is 'size' in your code, I believe
read long file, tempo `4 bytes longword
`Read octave data
for c = 1 to 10 step 1
read long file octaveData(c) `4 bytes longword
next c
`Read pitch data
for a = 0 to totalBars step 1
for b = 0 to 10 step 1
read byte file, pitchData(a, b) `One single byte
next b
next a
`Read main sequence
repeat
read byte file, breakLoop `One single byte. This would be 'qq' in your code
if breakLoop = 0
read long file, bar `4 bytes longword
read byte file, index `One single byte
read byte file, channel `One single byte
read byte file, musicData(bar, channel, index, 0) `One byte
read byte file, musicData(bar, channel, index, 1) `One byte
read byte file, musicData(bar, channel, index, 2) `One byte
endif
until breakLoop = 1
`Read channel data
for c = 1 to 10 step 1
read byte file, channelData(c, 0) `One byte. Patch (instrument) id
read byte file, channelData(c, 1) `One byte. Volume
read byte file, channelData(c, 2) `One byte. Pan
read byte file, channelData(c, 3) `One byte. Modwheel
next c
close file file
Also, how about "paying" for this plugin by writing a history essay?
"I kören hörs de brummande busarna Björnligan och Gondolen"
Graduation in less than two weeks.