diff --git a/patch.go b/patch.go index f9b7cd2..a8db243 100644 --- a/patch.go +++ b/patch.go @@ -422,7 +422,11 @@ func (p Patch) FirstVoiceForInstrument(instrIndex int) int { return 0 } instrIndex = min(instrIndex, len(p)) - return TotalVoices(p[:instrIndex]) + ret := 0 + for i := 0; i < instrIndex; i++ { + ret += p[i].NumVoices + } + return ret } // InstrumentForVoice returns the instrument number for the given voice index. diff --git a/song.go b/song.go index d89f0fc..ab1ad95 100644 --- a/song.go +++ b/song.go @@ -275,7 +275,11 @@ func (l Score) FirstVoiceForTrack(track int) int { return 0 } track = min(track, len(l.Tracks)) - return TotalVoices(l.Tracks[:track]) + ret := 0 + for i := 0; i < track; i++ { + ret += l.Tracks[i].NumVoices + } + return ret } // LengthInRows returns just RowsPerPattern * Length, as the length is the