Re: MIDI data in an AIFF file
Re: MIDI data in an AIFF file
- Subject: Re: MIDI data in an AIFF file
- From: "James Chandler Jr" <email@hidden>
- Date: Sat, 26 Feb 2005 11:28:07 -0500
----- Original Message -----
From: "Craig Bakalian" <email@hidden>
Hi,
After some gleaning and careful reading I have come to the conclusion that it
is possible to get MIDI data into a AIFF file. Yet, I do not know how to do
it, especially with CoreAudio. I understand that this is the structure that
must be made
#define MIDIDataID 'MIDI'
type struct{
ID chunkID;
long chunkSize;
unsigned char MIDIdata[ ];
} MIDIDataChunk;
ID is 4 ASCII bytes "described by Interchange File Format". But, now what?
Does anyone have any other information about pushing MIDI data into an AIFF
file?
Hi Craig
Apologies for a 'non-answer answer', but MIDI files are also chunked data. You
would just write to an AIFF file the MIDI chunkID, the size of the MIDI file,
and then stream the MIDI file into the AIFF.
If you don't have code to generate a MIDI file in memory, you could write a
simple program to open an AIFF file for writing, open a MIDI file for reading,
then append the MIDI data into the AIFF.
MIDI files will typically start with a short 'MThd' chunk, followed by other
chunks, especially 'MT
rk' chunks. A MIDI player needs to know how to parse the chunks, but for merging
into an AIFF, I think you would just splice the entire thing in without worrying
about the MIDI file's internal structure.
The AIFF MIDI header chunkSize will instruct any AIFF reading program how many
bytes to 'jump over' if the program is not interested in that MIDI file data. In
that way, an Audio-only AIFF program can safely ignore (or preserve without
supporting) any file chunk it doesn't care about, without needing to know
anything about the data format in that 'uninteresting' chunk.
JCJR
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden