DOTT: Hanging notes (regression?)
|Reported by:||eriktorbjorn||Owned by:||SF/jamieson630|
|Cc:||Game:||Day of the Tentacle|
[Extracted from bug report #775097]
English CD "talkie" version.
At the end of the game, when the kids are hiding from purple tentacle, the music changes. When it does, some notes are usually (always?) left hanging. The same thing also happens sometimes when I push nurse Edna out of her room, but that's harder for me to reproduce.
I've look a bit closer at the first of these cases, and I think it must have something to do with the "smart jumping" logic in the MIDI parser, because if I disable this property I no longer get any hanging notes.
From what I understand, smart jumping means that instead of silencing all notes at once and then jump to a new position, it leaves the current notes to fade out on their own, thus allowing for a smoother transition. This involves scanning the track for note off events or the end of the track, to see when the notes would have been turned off.
I don't know what the unit of time measurement is, so I don't know what are reasonable values and what aren't, but when the track loops the time_left parameter is somewhere around 10000, and it only has to scan a few events ahead to figure that out.
Which makes the following calls to hangingNote(), which I captured during one test run, look rather suspicious to me:
hangingNote(11, 67, 8099928, 0) hangingNote(11, 71, 8615520, 0) hangingNote(11, 74, 16625052, 0) hangingNote(1, 35, 72028872, 0) hangingNote(2, 67, 78392304, 0) hangingNote(6, 67, 104966496, 0)
Not only that, but it had to scan hundreds - maybe thousands - of events ahead to find them.
Ticket imported from: #775654. Ticket imported from: bugs/1063.