Fix bug when pitches or durations is not None