kovaxis/midly

Writing SMF file with running status to reduce file size?

Closed this issue · 2 comments

It seems that currently running status is only used for encoding of live events but not when writing SMF files, right?
For many use cases where large midi files are generated (e.g. many 14-bit CC messages generated via algorithmic composition, or use cases like black mid where midi files are often huge), it would be very useful to make use of running status to reduce the file size.

And (if I understand it correctly), running status in a SMF file is per track (so if an event contains no status, the decoder will use the status of the last event from the same track, even if another track contained an event in the meantime). This allows optimizing file size even more by splitting events by kind onto separate tracks, e.g. having one channel only for all NoteOn events of a certain channel and another track for all NoteOff events of this channel, and another track for all CC msgs of that channel. This can save a lot of kb, especially when generating a lot of 14-bit CC curves :)

Hello! Sorry for the late reply.

I do believe midly is currently writing files with running status enabled. What makes you think otherwise?

Closing for inactivity. If it turns out there's a bug preventing running status from working, reopen this issue.