Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(feat) Label every note in the piano roll (#407)

rafi612b70b89372dcf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2fecd294..366e92e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -60,6 +60,11 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
palette (*Reset section name*, for the section at the playhead) — restores the automatic
name. Undo / redo bring back both the name and its mode. Sections named in earlier versions
keep their names; MCP `list_sections` reports which names are automatic.
+- **Label every note in the piano roll**: Settings → Appearance → Piano roll
+ now offers "Label every note in the piano roll" — the keys column shows all note names
+ (C, C#, D…) instead of only C, an aid for beginners learning note names. Off by default,
+ applies immediately, remembered between launches; folded scale rows and Drum Rack pads
+ keep their labels either way, and very short rows fall back to C-only to stay legible.
- **Dock the Mixer in the main window** (#39): View → Mixer (⌘⇧M / Ctrl+Shift+M) now shows
the full Mixer — strips, Stereo map and the pan law footer — as a panel under Arrangement,
Session or Modular, above the Devices / Clip panel; either, both or neither can be shown.
diff --git a/FEATURES.md b/FEATURES.md
index 1b34d1a4..982c742d 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -318,6 +318,9 @@ docks as a panel under any of the three, or floats in its own window — see
while a take is recording.
- **Playable keys**: click a key to hear it, ⇧-drag to glide, ⌘-click to select every note
of that pitch; a vertical drag on the keys zooms the rows.
+ - **Key labels**: only C by default; Settings → Appearance → Piano roll labels every note
+ (C, C#, D…) instead — an aid for beginners. Folded rows and Drum Rack pads are always
+ named either way.
- Click the roll's ruler to put the playhead there, or drag along it to scrub (snapped to
the grid, ⌥ free); the playhead line itself drags too, on the ruler or over empty grid.
The roll shows the playhead while stopped, where playback will start, and its ruler
diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.cs
index b0dd4869..28b9cb93 100644
--- a/src/managed/Nota.App/MainWindow.axaml.cs
+++ b/src/managed/Nota.App/MainWindow.axaml.cs
@@ -390,6 +390,9 @@ public partial class MainWindow : Window
PianoRollView.AuditionToggled += OnAuditionToggled;
PianoRollView.VelocityWheelReversed = vm.Settings.Current.PianoRollVelocityWheelReversed;
PianoRollView.VelocityWheelMultiplier = Nota.Application.Editing.VelocityWheel.ClampMultiplier(vm.Settings.Current.PianoRollVelocityWheelMultiplier);
+ // The piano roll's key labels (every note, not just C) persist the same way.
+ PianoRollView.SetLabelAllNotes(vm.Settings.Current.PianoRollLabelAllNotes);
+ vm.Settings.Changed += () => PianoRollView.SetLabelAllNotes(vm.Settings.Current.PianoRollLabelAllNotes);
vm.Transport.CountInBars = Math.Clamp(vm.Settings.Current.CountInBars, 0, 4);
vm.Transport.LoopRecordReplace = vm.Settings.Current.LoopRecordReplace;
SetArmOnSelect(vm.Settings.Current.ArmOnSelect);
diff --git a/src/managed/Nota.App/PianoRollView.cs b/src/managed/Nota.App/PianoRollView.cs
index 0d3345b0..5c26a2aa 100644
--- a/src/managed/Nota.App/PianoRollView.cs
+++ b/src/managed/Nota.App/PianoRollView.cs
@@ -65,6 +65,19 @@ public sealed partial class PianoRollView : UserControl
AuditionToggled?.Invoke();
}
+ /// <summary>Label every note of the keys column, not just C: a beginner aid
+ /// seeded from and saved to Settings by the host (cf. <see cref="AuditionEnabled"/>).
+ /// Off by default; folded rows and Drum Rack pads are always labelled either way.</summary>
+ public static bool LabelAllNotes { get; set; }
+ /// <summary>Fired when <see cref="LabelAllNotes"/> changes; the keys column repaints.</summary>
+ public static event Action? LabelModeChanged;
+ public static void SetLabelAllNotes(bool on)
+ {
+ if (LabelAllNotes == on) return;
+ LabelAllNotes = on;
+ LabelModeChanged?.Invoke();
+ }
+
// The one pitch sounding from the roll (−1 = none): a new audition ends the previous one,
// so a drag across pitches re-triggers instead of stacking notes.
private int _auditionPitch = -1;
@@ -156,6 +169,9 @@ public sealed partial class PianoRollView : UserControl
// Vertical zoom (specs/019-piano-roll-vertical-zoom): the row height is per-clip view
// state, driven by ⌘⌥+wheel, a drag on the keys, ⌥+pinch and Fit to notes.
private const double MinRowH = 6, DefaultRowH = 12, MaxRowH = 36;
+ // Full note labels need room for the 8pt mono name: below this height the
+ // keys column falls back to C-only labels so zoomed-out rows stay legible.
+ private const double MinLabelRowH = 10;
private double _rowH = DefaultRowH;
internal double RowH => _rowH;
@@ -1832,6 +1848,19 @@ public sealed partial class PianoRollView : UserControl
private int PitchAt(double y) => _o.PitchAtY(y);
private const float KeyVelocity = 0.8f;
+ // The label mode (C-only vs. every note) is app-wide: follow it while on
+ // screen only — a roll is rebuilt for every clip, so a lasting subscription would leak.
+ protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
+ {
+ base.OnAttachedToVisualTree(e);
+ LabelModeChanged += InvalidateVisual;
+ }
+ protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
+ {
+ base.OnDetachedFromVisualTree(e);
+ LabelModeChanged -= InvalidateVisual;
+ }
+
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed || _o._gridControl.Dragging) return;
@@ -1906,7 +1935,9 @@ public sealed partial class PianoRollView : UserControl
ctx.FillRectangle(KeysBg, new Rect(0, 0, w, Bounds.Height));
var rows = _o._rows;
// Folded, every row is labelled (there are few, and they aren't a keyboard any more).
- bool labelAll = !rows.IsChromatic;
+ // Chromatic too when the user asked for every note, provided the rows
+ // are tall enough to fit the names.
+ bool labelAll = !rows.IsChromatic || (LabelAllNotes && RowH >= MinLabelRowH);
for (int r = 0; r < rows.Count; r++)
{
int p = rows.PitchAt(r);
diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.cs
index acce4fd1..90d6bf57 100644
--- a/src/managed/Nota.App/PreferencesWindow.cs
+++ b/src/managed/Nota.App/PreferencesWindow.cs
@@ -1338,6 +1338,14 @@ public sealed partial class PreferencesWindow : NotaWindow
// Inactive.Set walks the visual tree, so the dimming waits until the pane is shown.
details.AttachedToVisualTree += (_, _) => Refresh();
+ // Piano-roll key labels: every note for beginners, C-only by default.
+ var labelAll = SwitchRow("Label every note in the piano roll", settings?.Current.PianoRollLabelAllNotes ?? false, on =>
+ {
+ if (settings is null) return;
+ settings.Current.PianoRollLabelAllNotes = on;
+ settings.Save();
+ });
+
return Sections(
Section("UI", 10,
TopRow("Colour theme", ThemePicker()),
@@ -1348,6 +1356,8 @@ public sealed partial class PreferencesWindow : NotaWindow
Row("", Caption("Which side of the arrangement the track list sits on. Right starts the timeline at the left edge, next to the browser. Also in the View menu.")),
Row("Interface scale", ScalePicker()),
Row("", Caption("Makes the whole interface larger or smaller. Timeline, piano roll and audio editor zoom work on top of it."))),
+ Section("Piano roll", 10, labelAll,
+ Caption("Shows every note name (C, D, E…) on the piano roll's keys instead of only C. Helpful when learning notes.")),
Section("AI control (MCP)", 12, enable, details));
}
diff --git a/src/managed/Nota.Application/Settings.cs b/src/managed/Nota.Application/Settings.cs
index 97b379a4..e4a9c1bb 100644
--- a/src/managed/Nota.Application/Settings.cs
+++ b/src/managed/Nota.Application/Settings.cs
@@ -188,6 +188,11 @@ public sealed class Settings
/// <summary>Arm-on-select (#332): selecting an instrument track arms it alone, so the
/// keyboard plays the track you're on. Transport ▸ Auto-arm selected track; off by default.</summary>
public bool ArmOnSelect { get; set; }
+
+ /// <summary>Label every note of the piano-roll keyboard: the keys column
+ /// shows all note names (C, C#, D …) instead of only C. Off by default; a beginner aid
+ /// set from Settings → Appearance.</summary>
+ public bool PianoRollLabelAllNotes { get; set; } = false;
}
public interface ISettingsService