corrected syntax errors.
Corrected tempo error.
Removed unused codes.
Added an example to make sure 2 midi devices are in sync.