See
this as an
example of how to use this script.
Replace the contents of the "bulkdata" folder with the output from
this script to swap out the song.
Output format is a list of binary-packed time "blocks" so that notes in
the song can be indexed in O(1) time.
Each block can be split into a sequence of 8-bit integers. Starting with
the least-significant bits, these 8-bit numbers represent as follows:
Bits 0-7: Starting time of the 1st note within the block. 1 represents
the start of the block; 255 represents the end of the block. 0 is a
sentinel value meaning "no note."
Bits 8-15: Frequency of the 1st note in semitones, where 60 is middle C.
Bits 16-23: Starting time of the 2nd note in the same format as Bits
0-7.
Bits 24-31: Frequency of the 2nd note in semitones in the same format as
Bits 8-15.