Apple has decided to rearrange the API for music with Lion. The MusicDeviceMIDIEvent routine is now within AudioUnit.framework instead of AudioToolbox.framework.
Add another dlload statement to dls_synth.rb to load AudioUnit.framework and all seems OK.