paulrosen / abcjs

javascript for rendering abc music notation
Other
1.94k stars 285 forks source link

TimingCallback EventCallback; Poor Overlapping Rhythms Handling #380

Open JonathanILevi opened 4 years ago

JonathanILevi commented 4 years ago

When 4 eighth-notes are played at the same time as a half-note the TimingCallback EventCallback does not share that half-note element lasts through all 4 callbacks.

To show the problem; Use this ABC in https://configurator.abcjs.net/ under Audio with Animate? on:

X:1
K:Gmaj
[V:s]  G4 | G4 | G4 | G4 | G4 | G4 |
[V:a]  DDDD | DDDD | DDDD | DDDD | DDDD | DDDD |

The half notes are only blue for the first eighth-note played underneath it.

I think a good solution would be to include the half-notes in ev.elements for all 4 callbacks (and maybe add an ev.newElements).

paulrosen commented 4 years ago

I can reproduce.

I need to think about the ramifications of your suggested change. I'd rather signal that the half-note is continuing than repeat it. I'll come up with something soon that won't break anyone's existing usage.

JonathanILevi commented 4 years ago

Glad to hear it.