The global offset is a correction for audio latency, which is measured
in wall-clock time, but TimingData elapsed time values represent offsets
into the sound file. To get the offset in the sound file that
corresponds to the wall-clock time of the global offset, we have to
multiply by the music rate.
On my Fedora 20 system, closedir apparently frees the dirent, and
reading it afterwards returns garbage data. This prevented my dance pad
from being detected.