Ronan KERYELL wrote:
>To publish some music in MIDI format I need a MIDI version of the Unix
>cat...
>
>Rationale :
>My abc tunes are split in various X: tunes and abc2midi generates a MIDI
>file per X: tune. It would be more user friendly to have a single
>MIDI file for the
>whole tune so that I could also publish in MIDI format.
>
>Right now I also generate audio file by concatenating all the audio file
>generated by timidity on each MIDI file, which is a pain because there is
>a blank at the end of each partial audio file... :-(
>Generating all the audio from a single MIDI file should be better...
I don't think you can do this by simply concatenating the MIDI files.
A MIDI file consists of a header chunk followed by one or more track
chunks which contain the actual data:
MThd <length of header data>
<header data>
MTrk <length of track data>
<track data>
MTrk <length of track data>
<track data>
...
The header chunk specifies how the following track chunks are organised,
format. length, number of tracks etc. So, to concatenate two simple
MIDI files you will have to read the header of both files and generate
a new header which specifies which tracks are to be played together and
which consecutively, then add both sets of track chunks after that.
I'm sure that there must be MIDI editors around which can do this.
Alternatively you could do the joining of the tunes at the abc level
using the P: field so you have a single multi-part tune rather than
a series of separate tunes.
Phil Taylor
To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html