You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are storing a single currentRepetition value (see repeat.go and repetitions.go) and using it to track the current repetition number that we are going through a repeated sequence of events.
However, a repeated sequence can itself contain repeated events, and the nesting can be arbitrarily deep.
I think it would probably make sense to refactor so that instead of a single "current repetition" value, we are working with a stack of "current repetition" values, where we use the topmost one and discard it when we exit the loop.
Steps to Reproduce
Repro case, adapted from the one @wesen provided on Slack:
period = r16
motif = a b c
(tempo! 100)
piano:
V1: o4 [{motif}8 period period <'2 ]*4
This behaves as expected. The motif is played twice in octave 4, then twice in octave 3, because on the second repetition, the "octave down" event is applied.
period = r16
motif = a b c
(tempo! 100)
piano:
V1: o4 [{motif}8 period*2 <'2 ]*4
This should behave the same, however the "octave down" event ends up getting applied on every repetition, so we play the motif in octave 4, then 3, then 2, then 1.
Environment
Alda version:
$ alda version
alda 2.0.5
$ alda-player info
alda-player 2.0.5
log path: /home/dave/.cache/alda/logs
The text was updated successfully, but these errors were encountered:
🐞 Bug report 🐞
Description
We are storing a single
currentRepetition
value (see repeat.go and repetitions.go) and using it to track the current repetition number that we are going through a repeated sequence of events.However, a repeated sequence can itself contain repeated events, and the nesting can be arbitrarily deep.
I think it would probably make sense to refactor so that instead of a single "current repetition" value, we are working with a stack of "current repetition" values, where we use the topmost one and discard it when we exit the loop.
Steps to Reproduce
Repro case, adapted from the one @wesen provided on Slack:
This behaves as expected. The motif is played twice in octave 4, then twice in octave 3, because on the second repetition, the "octave down" event is applied.
This should behave the same, however the "octave down" event ends up getting applied on every repetition, so we play the motif in octave 4, then 3, then 2, then 1.
Environment
Alda version:
The text was updated successfully, but these errors were encountered: