Save MIDI data to files.
The functions in this module allow
to be written into Standard MIDI files (
that can be read and played by music programs such as Cakewalk.
Directly write to a file. Since chunks lengths are not known before writing, we need to seek in a file. Thus you cannot write to pipes with this function.