This pertains to the use of more than one group. If group 0 is uses, masterLength will be the largest offset of any track in that group. However, if you switch to group 1, masterLength will still be set to group 0's master length. Thus if group 1 has shorter tracks an undesired silence will be observed while masterCurrIdx passes group 1's largest track's endIdx until it reaches masterLength.
Alternatively, if group 1 has a longer track than group 0, group 0 will experience the silence.
Solution: make masterLength an array who's index is the selectedGroup.
This pertains to the use of more than one group. If group 0 is uses, masterLength will be the largest offset of any track in that group. However, if you switch to group 1, masterLength will still be set to group 0's master length. Thus if group 1 has shorter tracks an undesired silence will be observed while masterCurrIdx passes group 1's largest track's endIdx until it reaches masterLength.
Alternatively, if group 1 has a longer track than group 0, group 0 will experience the silence.
Solution: make masterLength an array who's index is the selectedGroup.