[filein] interpreting SMF.mid data when LONG

Jan 26, 2011 at 8:02pm

[filein] interpreting SMF.mid data when LONG

aloha,

i am reading a midifile using [filein].

i ask for “long 0, word 8, word 10, word 12″ and get what i want:
make sure it is midi, get format, get number of tracks, and get ppq.

now ivve noticed that the way i am using it (or eventualy the way
how one can use filein in maxmsp) has a dumb limit.

because when reading LONG at byte n, any MSB greater than around
9 can no longer be represented as decimal number in max, since
that is also limited to LONG.

if you search for “MTrk” you can do that by searching for 1297379947,
but what if i want to read FF FF FF FF ? that does not fit into 24 bits
as decimal.

do i really need to handle stuff at word lenght?
 

#54622
Jan 27, 2011 at 1:20pm

i am adding one more question.

when reading in an SMF, would you search for track 2 or would you
count on the lenght info in the header of track 1?

_can one count on the lenght info of tracks or are there files with
wrong or missing lenght info?

is the lenght info of an MTrk header working like the header of the
header, i.e. does it describe the lenght behind/without the header
of the track? (like the header of the header is always 6 bytes long)

#196691

You must be logged in to reply to this topic.