Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
C# audioaudio-unitavaloniacpp20cross-platformdawdigital-audio-workstationdspjucelinux-audiomcp-servermidimusicmusic-productionpiano-rollplugin-hostsequencersynthesizervstvst3
Research: Browser — sample folders, browse mode, Locate, Projects tab (spec 092)
Every decision below was taken from reading the current code on develop (c613167d).
R1. Where the list of sample folders lives, and what "the Samples folder" means afterwards
- Decision: Add
Settings.SampleFolders(a list of{ Path, Name?, IsDefault }) and keepSettings.SamplesFolderas a mirror of the default entry's path (written on every save).ISettingsService.ResolvedSamplesFolder()keeps its meaning — the default folder — and a newResolvedSampleFolders()returns every entry with availability. - Rationale: Six call sites use
ResolvedSamplesFolder()for a single folder and all of them mean "the default": pack installs (SampleStore), Nota Mosaic'ssamples:path root and refs (MosaicLibrary.ToRef/Resolve,NotaEngine.SetPathRoot), the import dialog's start folder, Preferences. Keeping it means Mosaic presets saved assamples:/…keep resolving, and an older Nota reading the same settings file still finds its folder (downgrade-safe). - Migration: On load, if
SampleFoldersis null/empty → one entry{ Path = SamplesFolder (or "" = default location), IsDefault = true }. Exactly one default is enforced on load (first entry wins if none/several). - Alternatives: Replace
SamplesFolderoutright (breaks downgrade and needs every call site touched); keep the default outside the list (two concepts for one thing in the UI).
R2. Indexing several folders
- Decision:
ISampleIndex.Watch(string root)becomesWatch(IReadOnlyList<string> roots); one scan thread walks the roots in list order (priority folders first, as today), and name hints (SampleNameHints.Parse(path, root)) use the root that contains the path. The stale-entry sweep (IsUnder(p, root)) runs per root; files under an unavailable root are kept (not swept), so an unplugged drive doesn't lose its analyses. - Rationale:
SampleLibraryIndexalready scans in the background with a cap and a progress counter; the only single-root assumptions are_root, the hint parse and the sweep. Nested roots are refused (FR-008), so no file belongs to two roots. - Alternatives: One index instance per folder (duplicates the similar-search space and the progress line).
R3. Files tab tree with several roots
- Decision:
BrowserViewModel.RebuildSamples()builds one top-levelFoldernode per entry (default first, then list order) and places files under it withGetOrCreateFolder(root, …)per root. The default root'sDownloadedpack folder keeps its icon and first place inside that root. A root node carries a newBrowserItem.RootIndex(or aIsPlaceflag) so the view can give it the Rename / Remove / Reveal menu, and anUnavailableflag that dims it. The per-folderMaxSamplescap applies per root. - Enumeration off the UI thread: today
RebuildSamplesenumerates synchronously. With several (possibly slow, external) roots it moves to a background task that builds the tree and swaps it in on the UI thread; first level of each root appears first (SC-005). - Rationale: Reuses the existing flattened-tree machinery (
_sampleTree,RebuildSampleVisible, filter chips, "similar").
R4. Browse mode
- Decision: A second presenter in the Files tab, toggled by a two-state control next to
the search field: Tree (today) / Browse. Browse is a flat
BrowserItemlist of one folder (folders first, then audio/MIDI files; hidden entries skipped) bound to the same list control, so preview, double-click, drag-and-drop and the sample player work unchanged. AFileBrowseStateinNota.Presentationholds the current folder and back/forward stacks; enumeration runs off the UI thread. - Above the root: "Computer" level = drives/volumes:
- Windows:
DriveInfo.GetDrives()that are ready. - macOS:
/(labelled with the system volume name) + each directory in/Volumesexcept the one that is a symlink to/. - Linux:
/,$HOME, and mount points under/media/$USER,/run/media/$USER,/mnt.
- Windows:
- Path bar: segments as buttons; clicking the bar's empty area (or ⌘L / Ctrl+L while the
Files tab has focus) turns it into a text field; Enter navigates, Esc cancels; a file path
opens its folder with the file selected;
~expands to home. - Persistence:
Settings.FilesBrowseMode(bool) andSettings.FilesBrowseFolder(string). - Alternatives: a "Computer" root inside the tree (rejected in clarification); the OS file dialog (not a browser — no preview/drag).
R5. Remembering a clip's original file (Locate after reopen)
- Finding: The engine keeps only audio; the managed
NotaEngineremembers a sample's file name per sample id (_sampleNames,RememberSampleName) for Sampler/Rack/Rhythm loads only — audio clip loads (AddAudioClip,AddAudioClipEx,AddSessionAudioClip,AddSessionAudioFile) remember nothing. On save,RegisterSamplecontent-hashes the buffer intosamples/<hash>.wav;AudioClipDtohasSample(bundle path) andNameonly. - Decision:
NotaEnginegains_sampleSources: Dictionary<long sampleId, string fullPath>withSampleSource(id)/SetSampleSource(id, path)onIAudioEngine, recorded by every audio-clip and session-audio load when the path is not inside a.notabundle'ssamples/folder (those are project copies, not sources).AudioClipDto.Source(string?, absolute path) is written byProjectServicefromengine.SampleSource(ac.SampleId)for arrangement clips, comp takes and session audio slots; on load, after the clip is restored,SetSampleSource(newSampleId, dto.Source).- Split / duplicate / copy share the sample id, so the source follows for free; consolidate, record, bounce, stems and reverse-render make new buffers with no source (correct per spec).
- Format: optional, additive; no
CurrentFormatVersionbump and no migration step (absent = unknown). Older Nota versions keep it via[JsonExtensionData] Extraon round-trip. - Sessions-named saves (
doc.SessionNames, autosave/recovery) write the same field. - Alternatives: search by file name (clarification rejected); session-only memory.
R6. Highlight of the selected clip's file
- Decision:
MainWindowalready hearsTimeline.ClipSelectionChanged; Session's slot selection gets the equivalent hook. On change it resolves the selected audio clip's source (engine.SampleSource(sampleId)) and callsBrowser.SetLocatedPath(path | null). The browser marks the matching row if it is in the visible (flattened) list — tree or browse — with a left accent bar + soft tint distinct from selection (nota-design: "orange soft tint for picked" is the selection; the located marker uses the orange line treatment). No expand/scroll/tab switch (FR-019). - Locate → In browser:
BrowserView.RevealFile(path): if under a root → switch to Tree, expand ancestors, scroll into view, select (no audition); else → Browse at its folder with it selected. Expands a collapsed browser first. - Locate → In Finder:
MainWindow.RevealInFileManager(path)(exists); for a clip with no known/existing source, reveal the bundle copy: the saved project'ssamples/<hash>.wavwhen the project is saved, otherwise the item is disabled.
R7. Projects tab summary
- Decision:
ProjectSummaryReader(Infrastructure) readsproject.jsonwithSystem.Text.JsonJsonDocument(no fullProjectDocumentbind, no engine): tempo =Transport.Bpm; key =Transport.Key; tracks =Tracks.Length(excluding returns/master — they live inMixer/Master); length = max clip end in beats over MIDI clips (StartBeat + LengthBeats), audio clips (warped:StartBeat + (WarpPlayEnd > 0 ? WarpPlayEnd - WarpPlayStart : WarpBeats); unwarped:LengthFramesor the WAV header's frame count ofSample, ÷ the WAV's sample rate × bpm/60), and session slots don't count; shown asm:ssat the project tempo. - Cache:
NOTA_DATA_DIR/cache/project-summaries.json, keyed by bundle path + the manifest's last-write time + size; read on a background task; rows update in place. - Date: the manifest's (
project.json) last-write time, falling back to the bundle directory's. Welcome uses the directory's time, but that changes only when entries are added/removed, while every save rewritesproject.json. Welcome switches to the same helper so both show the same date. Format reuses Welcome's"MM/dd/yyyy HH:mm"through one shared helper. - Sort:
Settings.ProjectsSort=Date(default) |Name. - Open marker:
BrowserViewModel.OpenProjectPathset by MainWindow on open/save/new.
R8. Rail icon size
- Finding:
GlyphKind.Folderis drawn procedurally at ±0.42 of the box; the other rail icons are 24-unit SVG paths inGlyph's path table with ~3–6 units of padding (e.g. Doc spans x 6–18.4, y 3.5–20.5). - Decision: Move
Folderto the path table as a 24-grid outline spanning x 3.5–20.5, y 5–19 (tab at top-left), same stroke as its neighbours. Check the other users of the glyph (group-tracks menu items, Rhythm card at 8 px, Reveal items).
R9. Tests
- Smoke test project (
tests/Nota.SmokeTest) is the only test harness; it already hasSampleStoreTests,SmartSampleTests,BrowserCategoryTests,BrowserTestSupport. - New smoke checks: settings migration (single folder → list; mirror kept), nested/duplicate
refusal, multi-root tree build, index hint root,
AudioClipDto.Sourcesave/load round-trip (incl. split + bundle-path exclusion), project summary reader (tempo, key, tracks, length incl. warped/unwarped audio, unreadable manifest), browse-state back/forward/up semantics, path parsing. - UI checked with the headless-app screenshot harness (rail icon, Files tab both modes, Settings → Library list, Projects rows, Locate highlight), all themes + classic look.