Restored from slopsmith/slopsmith-plugin-editor#56 — original issue, opened by @cambordas on 2026-06-14.
[restored-from: slopsmith/slopsmith-plugin-editor#56]
Bug: editorApplyOffset only shifts the current arrangement's notes
Steps to reproduce
- Create a song from a GP file with two or more arrangements (e.g. Lead + Rhythm)
- Apply an offset (e.g.
+1s) via the offset toolbar while on the Lead arrangement
- Switch to Rhythm - notes are still at the original position (not shifted)
- Type
2 in the offset field to shift Rhythm -> dataset.applied is now 2
- Open +Keys or +Drums and import
What happens
Audio: |----♪----♪----♪----|
Lead: |----♪----♪----♪----| <- user applies offset +1 here
Rhythm: |----♪----♪----♪----| <- NOT shifted (still at original position)
0 1 2 3
User switches to Rhythm, sees it's broken, types 2 to fix it:
Audio: |----♪----♪----♪----|
Lead: |----♪----♪----♪----| ✓ (at +1)
Rhythm: |----♪----♪----♪----| ✓ (at +1, but dataset.applied is now 2)
0 1 2 3
_effectiveAudioOffset() = S.offset + dataset.applied = 0 + 2 = 2
Next +Keys or +Drums import uses audio_offset=2 - lands 1s past everything else:
Audio: |----♪----♪----♪----|
Lead: |----♪----♪----♪----| at +1
Rhythm: |----♪----♪----♪----| at +1
Keys: |----♪----♪----♪----| at +2 ✗
0 1 2 3
Pattern: each arrangement the user manually fixes adds 1 to dataset.applied,
pushing every subsequent import 1s further off (+2, +3, +4 ...).
Root cause
editorApplyOffset shifts only S.arrangements[S.currentArr].notes.
Beats and sections are already shifted globally - notes were missing the all-arrangements loop.
Possible fix
- const nn = notes();
- for (const n of nn) n.time += delta;
+ for (const arr of S.arrangements) {
+ for (const n of (arr.notes || [])) n.time += delta;
+ for (const ch of (arr.chords || [])) {
+ ch.time += delta;
+ for (const cn of (ch.notes || [])) cn.time += delta;
+ }
+ }
All arrangements shift together in one apply - dataset.applied stays stable,
every subsequent +Keys / +Drums import gets the correct audio_offset.
Bug:
editorApplyOffsetonly shifts the current arrangement's notesSteps to reproduce
+1s) via the offset toolbar while on the Lead arrangement2in the offset field to shift Rhythm ->dataset.appliedis now2What happens
User switches to Rhythm, sees it's broken, types
2to fix it:Next +Keys or +Drums import uses
audio_offset=2- lands 1s past everything else:Pattern: each arrangement the user manually fixes adds 1 to
dataset.applied,pushing every subsequent import 1s further off (
+2,+3,+4...).Root cause
editorApplyOffsetshifts onlyS.arrangements[S.currentArr].notes.Beats and sections are already shifted globally - notes were missing the all-arrangements loop.
Possible fix
All arrangements shift together in one apply -
dataset.appliedstays stable,every subsequent +Keys / +Drums import gets the correct
audio_offset.