Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
Bug Assessment: Dropping an instrument preset on an instrument track adds a new track
- Slug: preset-drop-new-track
- Created: 2026-10-11
- Source: pasted text
- Verdict: valid (behaviour as coded; the user expects in-place replacement)
- Severity: medium
Report (verbatim or summarized)
перемещаешь пресет из браузера на аранжировку, добавляется инструмент с пресетом. Потом перещаешь другой пресет на ту же дорожку, добавляется новая дорожка (а хотелось бы чтобы на старой обновлялся)
Symptom
Dragging an instrument preset onto an existing instrument track in the arrangement always creates a new track. Expected: the preset loads into that track's instrument (swapping the instrument if it is a different kind), as dropping a bare instrument already does.
Reproduction
- Drag any instrument preset (e.g. a Nota Mosaic factory preset) to empty arrangement space → a new track with that preset.
- Drag another instrument preset onto that same track's lane.
- A second track is created; the first is unchanged.
Suspected Code Paths
src/managed/Nota.Presentation/DeviceInsertService.cs:176DropOnArrangement()— bare instruments tryTryReplaceInstrumentfirst; presets go toRouteToTrack.src/managed/Nota.Presentation/DeviceInsertService.cs:307RouteToTrack()— callsApplyPreset(item, new InsertTarget(trackId)), i.e.InPlace = false.src/managed/Nota.Presentation/DeviceInsertService.cs:358ApplyPresetCore()— the in-place branch exists but only for factory presets withtarget.InPlace(the command palette,PaletteProviders.cs:196). Otherwise_factory.Apply/_presets.ApplyFromFile→PresetService.Apply(Nota.Infrastructure/Persistence/PresetService.cs:172), whosebuiltin-instrument/plugin-instrumentcases always add a track.- File-based instrument presets (user presets, Mosaic pack presets) have no in-place path in the
insert service at all;
IPresetStoreonly hasApplyFromFile.PresetService.ApplyInPlace(:298) andIMosaicPacks.ApplyInPlaceexist and are used by the device card's preset picker.
Root Cause Hypothesis
Design gap rather than a regression: the arrangement drop never asks for in-place application, and only factory presets could do it anyway. Confidence: high.
Proposed Remediation
Preferred:
- In
DropOnArrangement, route instrument presets withInPlace: truewhen the drop target is a plain instrument track (CanReplaceInstrument); otherwise keep today's new-track behaviour (empty space, audio / group / return tracks, racks). - Extend the in-place branch of
ApplyPresetCoreto file presets: addIPresetStore.ApplyInPlaceFromFile(engine, path, trackId)(inPresetStore) that loads the document and, forbuiltin-instrument, swaps the track's built-in instrument if the kind differs then callsPresetService.ApplyInPlace; forplugin-instrument, sets the track's instrument plugin then restores its state. It reports whether the instrument was swapped so the result carriesInstrumentReplaced(card state reset). Effect presets and kits are unchanged. - Keep
PresetLandedpopulated so the card's preset label updates.
Alternatives:
- Only fix factory presets (one-line
InPlace: true) — leaves Mosaic pack and user presets still spawning tracks, which is exactly the pack workflow frommosaic-packs-expand. - A modifier key (e.g. ⌥-drop) to force a new track — could be added later; the default should match bare-instrument drops.
Files likely to change:
src/managed/Nota.Presentation/DeviceInsertService.cssrc/managed/Nota.Application/Ports/IPresetStore.cssrc/managed/Nota.Infrastructure/Persistence/PresetStore.cs(+PresetService.cshelper)tests/Nota.SmokeTest/(insertion test)
Tests to add or update:
- Factory instrument preset dropped on an instrument track of the same kind → track count unchanged, preset params applied.
- Preset of a different built-in kind → same track,
TrackInstrumentKindswitched. - Mosaic pack / user file preset → same track, Mosaic program set.
- Preset dropped on empty space / an audio track → still creates a new track.
Risks & Considerations
- Behaviour change: users who relied on "drop preset = new track" lose it on instrument lanes; dropping below the last track still creates one.
- Swapping the instrument kind discards the old instrument's state — same as a bare-instrument
drop today, and one undo step (
Group). - Session view drops (
OnSessionDrop) and Devices-panel drops route separately; decide whether they should match (Devices panel probably yes). - Racks (kinds 3/4) excluded by
CanReplaceInstrument— a preset there keeps making a new track.
Open Questions
- Should the Session view and Devices panel drops get the same in-place behaviour? [NEEDS CLARIFICATION]