added improved pitch detection algorithm from pitch.js