Files
Dave Yarwood 4f4f4622ec fix(repl): Resolve accumulating delay when using voices
This commit fixes a bug where an accumulating delay would occur in the
REPL when using voices. The root cause was a faulty offset
synchronization mechanism that failed to account for the effective
offset of an instrument with active voices.

The fix involves several related changes:

1.  **Correct Offset Calculation:**
    - A new `CalculateEffectiveOffset` method on the `Part` struct now
      correctly calculates the furthest point in time reached by an
      instrument or any of its voices.

2.  **Robust Synchronization via Stable IDs:**
    - The synchronization mechanism between the REPL and the player,
      which is responsible for adjusting note offsets, has been
      refactored to be more robust.
    - It now uses a stable, unique string ID for each part instead of
      unstable memory pointers. This prevents synchronization failures.
    - The `syncOffsets` map in the transmitter and related functions
      have been updated from `map[*Part]float64` to `map[string]float64`.

3.  **Voice Logic Correction:**
    - A structural bug in `VoiceMarker.UpdateScore` that caused voices
      to be nested incorrectly has been fixed.
    - The logic in `VoiceGroupEndMarker.UpdateScore` has been corrected
      to properly propagate the instruments state forward after a
      voice group is collapsed.

4.  **User-Friendly Part IDs:**
    - As a follow-on improvement, the part IDs (which are exposed in
      the REPL) have been changed from their previous pointer-based
      representation to short, sequential, human-readable identifiers
      (e.g., "part001", "part002").
2025-11-08 18:31:08 -05:00
..
2021-06-06 21:09:55 -04:00
2024-06-08 16:44:10 -04:00
2024-06-08 16:44:10 -04:00
2024-09-25 16:06:14 +08:00
2022-02-22 23:06:28 -05:00
2024-09-25 16:06:14 +08:00
2024-06-08 16:44:10 -04:00
2024-06-08 16:44:10 -04:00
2024-06-08 16:44:10 -04:00
2024-06-08 16:50:01 -04:00
2022-02-22 23:06:28 -05:00
2025-05-20 10:16:43 +02:00
2020-11-14 20:34:04 -05:00