The code snippet is from a popular Coursera course
midi_data = converter.parse(data_fn)
# Get melody part, compress into single voice.
melody_stream = midi_data[5] # For Metheny piece, Melody is Part #5.
melody1, melody2 = melody_stream.getElementsByClass(stream.Voice)
The error thrown is:-
ValueError: not enough values to unpack (expected 2, got 0)
and when using this:-
melody1, melody2 = melody_stream.recurse().getElementsByClass(stream.Voice)
the error thrown is:-
ValueError: too many values to unpack (expected 2)
Can you guide how to debug this?