If you wonder what a specific exception means exactly, then you can lookup its API documentation:
javax.sound.midi.InvalidMidiDataException
This is probably happening because the value of the variable
timing (the parameter
divisionType) in line 6 of your code is not correct:
The API documentation of the
constructor of class Sequence that you are using says:
API documentation wrote:
Constructs a new MIDI sequence with the specified timing division type and timing resolution. The division type must be one of the recognized MIDI timing types.
...
Throws:
InvalidMidiDataException - if divisionType is not valid
This means that the value of the first parameter that you pass to the constructor must be one of the constants declared in class Sequence: PPQ, SMPTE_24, SMPTE_25, SMPTE_30DROP, SMPTE_30
What is the variable
timing, and what is its value? You haven't declared it in the code that you posted above, so your code doesn't compile.