MIDI example sketch - initial note burst upon startup

I am using Arduino Uno, MIDI cable to Focusrite Safire LE, firewire into iMac loaded with Garageband for synth output.
I have loaded the MIDI example from the Sketchbook. It works fine, I get all the notes played on my synth as expected. What I don't understand is the burst of initial noise as the code is loaded and it starts up. Sometimes leaving some notes hanging on. To prevent this I swept through all notes with noteOn and velocity at zero, this killed the errant notes, but I can see on my synth volume metering a low level noise.
So two questions:
How to I avoid the initial burst of notes upon start of the program?
Do I need some sort of filtering on the output to reduce the 'noise'?
thanks.

If you are using the serial port to send MIDI messages as well as upload the program, you could get this type of effect. You need to break the MIDI connection with a switch before uploading from the computer.

What I don't understand is the burst of initial noise as the code is loaded and it starts up.

It sounds like it is the boot loader saying "do you want to upload code?" and this is being interpreted as some MIDI message.

As for a fix you could gate the signals going to the MIDI interface with another pin which you would set to allow signals through to the MIDI interface in the setup function. It would require a bit of extra hardware.