added beat-synchronous melody parser