script to calculate song length from midi