By using .recurse() you can get the details of a score in order, and if a measure has two voices it tells you where the first voice starts and where the second voice starts: print(len(partitura.measures(4,4).recurse().voices)) # Prints 4
But if a Score has multiple instruments, dividing it by instrument with instrument.partitionByInstrument(score), a Part type object is obtained with stream.Score(score), I transform it into Score, and when using .recurse() on that Score, the divisions by Voice no longer appear, they are mixed into one voice. print(len(stream.Score(instrument.partitionByInstrument(partitura)[0]).measures(4,4).recurse().voices)) # Prints 0
Is there another way to divide a score by instrument without losing the voices?
Using .recurse(): print(len(partitura.measures(4,4).recurse().voices)) # Prints 4
Try using partitionByInstrument(partitura[0]): print(len(stream.Score(instrument.partitionByInstrument(partitura[0]).measures(4,4).recurse().voices)) # Prints 0
Is there another way to divide a score by instrument without losing the voices?