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.

Redesign of drum rack

Egor Khindikaynen4aaf13c4153d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39e11f77..b5edfe7b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,26 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
## [Unreleased]
### Added
+- **The Nota Drum Rack's editor is now the almanac's card, with a kit picker in its header.**
+ The header's **‹ Kit ⌄ ›** picker loads any factory kit into the rack in place (it
+ replaces the pads) and steps through them; a rack names its kit even after a project is
+ reopened or a pad or two is swapped. The body is the 700 × 260 card: **Pads** (the 4 × 4
+ grid, pad 1 bottom-left, each pad in its own hue, the choke group on the pad) and
+ **Mixer** (the bank's pads as rows: volume, pan, mute · solo · choke) under a strip with
+ the bank, swing, humanize and Fold, beside a **selected-pad** panel — its one-shot drawn
+ with a playhead, volume, pan, tune and decay, the choke group and a button into its
+ instrument — and a status line that reads the selection back in words. New: a **Chain**
+ view shows the selected pad's instrument and effects and adds effects to it (the panel's
+ *Open chain*), and a right-click on a pad **renames**, **re-chokes** or **removes** it.
+ An empty pad now also offers a Sampler.
+- **Fifteen new factory drum kits, 25 in all:** *Brass Room* (live rock kit in a big room),
+ *Breakline* (jungle break), *Bunker* (warehouse techno), *Pixel* (minimal clicks and
+ blips), *Velvet* (jazz brushes), *Circuit* (electro box), *Yard* (dub and reggae),
+ *Byte* (8-bit chip), *Lagoon* (amapiano log drums), *Titan* (trailer percussion),
+ *Shuffle* (UK garage), *Mirrorball* (70s disco), *Pit* (orchestral percussion), *Hyper*
+ (hyperpop) and *Crate* (90s boom bap). Like the first ten they are rendered on your
+ machine on first launch, sit on the General MIDI map with the hats choked together,
+ and bring their own swing and humanize.
- **Nota Bass grew performance wheels, a Legato switch and an output pan, and its editor
is now the almanac's card.** A **pitch-bend** wheel with a selectable **range** (±2 / ±5
/ ±12 semitones) and a **mod wheel** that opens the LFO onto the cutoff — a wobble you
diff --git a/FEATURES.md b/FEATURES.md
index dc99efbe..67a99d4f 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -399,14 +399,22 @@ and user presets, automation, persistence and cloning.
- **Nota Instrument Rack** — 8 named macros (mapped with Linear/Exp/Log/S curves), chains
with **key and velocity zones**, gain/meter/M·S, horizontal device cards (GUI / Params),
a zone map, rack output (Volume/Glide), Fold/Save.
-- **Nota Drum Rack** — 4×4 pads (banks C1–C4, up to 64 pads), Pads and Mixer views, per-pad
- Volume/Pan/Tune/Decay, named pads, choke groups (monophonic cut), Swing/Humanize,
- hot-swap. Its clips can be stepped in the detail panel's **Pattern** tab (see below).
-- **Ten factory kits** under Nota Drum Rack in the browser: *Volta* (warm analog boom),
- *Kompakt* (punchy analog house), *Micron* (small vintage rhythm box), *Linnwood* (80s PCM
- machine), *Atelier* (acoustic studio kit), *Cellar* (dusty vinyl break), *Neon* (modern
- sub-forward, tuned 808 bass), *Foundry* (industrial metal), *Terra* (hand percussion),
- *Aether* (ambient). 16 pads each on the General MIDI map (36–51), hats choked together,
+- **Nota Drum Rack** — 4×4 pads (banks C1–C4, up to 64 pads), Pads, Mixer and Chain views,
+ per-pad Volume/Pan/Tune/Decay, named pads (rename, re-choke or remove from a pad's
+ right-click menu), choke groups (monophonic cut), Swing/Humanize, hot-swap, a pad
+ oscillogram with a playhead, and each pad's own effect chain. A **kit picker** in the
+ card header loads any factory kit in place and names the kit a rack holds. Its clips can
+ be stepped in the detail panel's **Pattern** tab (see below).
+- **25 factory kits** under Nota Drum Rack in the browser and in the card's kit picker:
+ *Volta* (warm analog boom), *Kompakt* (punchy analog house), *Micron* (small vintage
+ rhythm box), *Linnwood* (80s PCM machine), *Atelier* (acoustic studio kit), *Cellar*
+ (dusty vinyl break), *Neon* (modern sub-forward, tuned 808 bass), *Foundry* (industrial
+ metal), *Terra* (hand percussion), *Aether* (ambient), *Brass Room* (live rock kit in a
+ big room), *Breakline* (jungle break), *Bunker* (warehouse techno), *Pixel* (minimal),
+ *Velvet* (jazz brushes), *Circuit* (electro box), *Yard* (dub and reggae), *Byte* (8-bit
+ chip), *Lagoon* (amapiano log drums), *Titan* (trailer percussion), *Shuffle* (UK
+ garage), *Mirrorball* (70s disco), *Pit* (orchestral percussion), *Hyper* (hyperpop) and
+ *Crate* (90s boom bap). 16 pads each on the General MIDI map (36–51), hats choked together,
with the kit's own swing and humanize. Load onto a new track or drop onto an existing
Drum Rack to replace its pads. The one-shots are synthesized on first launch rather than
shipped as audio (nothing added to the installer) and appear in the Files tab under
diff --git a/src/managed/Nota.App/Controls/PadWave.cs b/src/managed/Nota.App/Controls/PadWave.cs
new file mode 100644
index 00000000..a8d6df68
--- /dev/null
+++ b/src/managed/Nota.App/Controls/PadWave.cs
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// The Drum Rack's pad oscillogram: a pad's one-shot as mirrored peak bars in the pad's
+// own hue, inside the almanac graph window (well, hairline, radius 4), with the live
+// playback position as a Brass Light line while the pad sounds. Read-only — trimming a
+// sample is the Sampler's job.
+
+using System;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Media;
+
+namespace Nota.App;
+
+internal sealed class PadWave : Control
+{
+ private const double BarW = 2, BarGap = 1, Pad = 4;
+ private static readonly IPen MidLine = new Pen(NotaPalette.GridBeat, 1);
+ private static readonly IPen PlayPen = new Pen(NotaPalette.AccentBright, 1.2);
+
+ private float[] _peaks = Array.Empty<float>();
+ private double _play = -1;
+
+ /// <summary>The bar colour — the pad's hue slot, so it re-tints with the theme.</summary>
+ public IBrush Hue { get; set; } = NotaPalette.Accent;
+
+ /// <summary>Normalised peaks (0..1), one per bucket, drawn left to right.</summary>
+ public float[] Peaks { get => _peaks; set { _peaks = value ?? Array.Empty<float>(); InvalidateVisual(); } }
+
+ /// <summary>Space kept clear above the bars for the window's caption line.</summary>
+ public double TopInset { get; set; }
+
+ /// <summary>Playback position 0..1, or −1 while the pad is silent.</summary>
+ public double Play
+ {
+ get => _play;
+ set { if (Math.Abs(value - _play) < 1e-4) return; _play = value; InvalidateVisual(); }
+ }
+
+ public override void Render(DrawingContext ctx)
+ {
+ var r = new Rect(Bounds.Size);
+ NotaGraph.Window(ctx, r);
+ double mid = Math.Round(TopInset + (r.Height - TopInset) / 2) + 0.5;
+ ctx.DrawLine(MidLine, new Point(1, mid), new Point(r.Width - 1, mid));
+
+ int n = _peaks.Length;
+ if (n > 0)
+ {
+ // As many bars as fit, each the loudest of the peaks it covers.
+ double inner = r.Width - Pad * 2;
+ int bars = Math.Max(1, (int)((inner + BarGap) / (BarW + BarGap)));
+ double half = (r.Height - TopInset) / 2 - Pad;
+ var pen = new Pen(Hue, BarW);
+ for (int b = 0; b < bars; b++)
+ {
+ int lo = b * n / bars, hi = Math.Max(lo + 1, (b + 1) * n / bars);
+ float p = 0;
+ for (int i = lo; i < hi && i < n; i++) p = Math.Max(p, _peaks[i]);
+ double h = Math.Max(0.5, p * half);
+ double x = Pad + b * (BarW + BarGap) + BarW / 2;
+ ctx.DrawLine(pen, new Point(x, mid - h), new Point(x, mid + h));
+ }
+ }
+
+ if (_play >= 0)
+ {
+ double x = Math.Round(Pad + _play * (r.Width - Pad * 2)) + 0.5;
+ ctx.DrawLine(PlayPen, new Point(x, TopInset + 1), new Point(x, r.Height - 1));
+ }
+ }
+}
diff --git a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs
new file mode 100644
index 00000000..043e0d36
--- /dev/null
+++ b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs
@@ -0,0 +1,907 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// Detail · Devices — the Nota Drum Rack body (instrument kind 4), in the 700 × 260 card
+// the almanac draws for it. The shared shell draws the header: the kit picker (a factory
+// kit replaces the pads), A/B in its context menu, and the pad count.
+//
+// Pads 1fr three views on a tab strip, under a strip with the bank (C1–C4, sixteen
+// notes each), the kit's swing and humanize, and Fold:
+// Pads — a 4 × 4 grid, pad 1 bottom-left as on hardware. A click plays the
+// pad and selects it; right-click has rename, choke, chain and remove;
+// an empty pad offers an instrument; samples dropped on a pad load
+// there (several fill the pads after it). Fold hides the empty pads.
+// Mixer — the bank's loaded pads as rows: volume, pan, mute · solo · choke.
+// Chain — the selected pad's device chain: its instrument and insert effects.
+// Pad 186 the selected pad: its one-shot, volume · pan · tune · decay, the choke
+// group, and its instrument's editor.
+// Status the selection and the kit, in words.
+//
+// A pad's colour is its track-palette slot; brass means selection only, and a pad that is
+// sounding lights in its own hue.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.Primitives;
+using Avalonia.Input;
+using Avalonia.Layout;
+using Avalonia.Media;
+using Nota.Application;
+using static Nota.App.DeviceCardKit;
+
+namespace Nota.App;
+
+internal sealed partial class RackCardView
+{
+ private static int _drumView; // 0 Pads, 1 Mixer, 2 Chain
+ private static int _drumBank; // 0..3 → C1..C4 (notes 36 + bank × 16)
+ private static bool _drumFold; // Pads: hide the empty pads
+
+ private static readonly string[] DrumViews = { "Pads", "Mixer", "Chain" };
+ private static readonly string[] BankNames = { "C1", "C2", "C3", "C4" };
+ private static readonly string[] ChokeNames = { "Off", "1", "2", "3", "4" };
+ private const double DrumPadW = 186, DrumTabH = 20, DrumStripH = 22, DrumStatusH = 18, MixRowH = 13;
+
+ private static int BankBase => 36 + _drumBank * 16;
+ private static bool InBank(int note) => note >= BankBase && note < BankBase + 16;
+
+ // ---- entry point --------------------------------------------------------
+
+ /// <summary>The Drum Rack card's body, for the shared shell. <paramref name="padCount"/>
+ /// is the number of loaded pads, for the header badge.</summary>
+ public Control BuildDrumRackBody(out int padCount)
+ {
+ var a = new InstrumentRackAccess(E, T);
+ E.SetAuditionTrack(T); // so clicking a pad plays it without arming the track
+ _irTick.Clear();
+ var pads = LoadedPads(a);
+ padCount = pads.Count;
+ if (!IsPad(a, Sel)) Sel = FirstPad(a, pads);
+
+ var readout = DrumMono("", TextTertiary, NotaType.Axis);
+ readout.Margin = new Thickness(0, 0, 8, 0);
+ readout.HorizontalAlignment = HorizontalAlignment.Right;
+ Control view = _drumView switch
+ {
+ 1 => DrumMixer(a, readout),
+ 2 => DrumChain(a),
+ _ => DrumGrid(a),
+ };
+ if (_drumView != 1)
+ {
+ int inBank = pads.Count(c => InBank(a.ChainTriggerNote(c)));
+ readout.Text = $"{BankNames[_drumBank]} · {inBank}/16 loaded";
+ }
+
+ var left = new Grid { RowDefinitions = new RowDefinitions("Auto,Auto,*") };
+ left.Children.Add(DrumTabs(readout));
+ var strip = DrumStrip(a);
+ Grid.SetRow(strip, 1); left.Children.Add(strip);
+ Grid.SetRow(view, 2); left.Children.Add(view);
+
+ var panel = DrumBox(DrumPadPanel(a));
+ panel.Width = DrumPadW;
+
+ var body = new Grid
+ {
+ ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = NotaSpace.DeviceGap,
+ Margin = new Thickness(NotaSpace.DeviceGap),
+ };
+ body.Children.Add(DrumBox(left));
+ Grid.SetColumn(panel, 1); body.Children.Add(panel);
+
+ var statusHost = DrumStatus(a, pads);
+ DockPanel.SetDock(statusHost, Dock.Bottom);
+ var root = new DockPanel { LastChildFill = true, Background = NotaPalette.Gutter, Children = { statusHost, body } };
+
+ if (_irTick.Count > 0) _ctx.AddDeviceRefresher(() => { for (int i = 0; i < _irTick.Count; i++) _irTick[i](); });
+ return root;
+ }
+
+ // ---- tab strip (20): Pads · Mixer · Chain, and what the view shows ----------------
+
+ private Control DrumTabs(TextBlock readout)
+ {
+ var row = new StackPanel { Orientation = Orientation.Horizontal };
+ for (int i = 0; i < DrumViews.Length; i++)
+ {
+ int iv = i; bool on = i == _drumView;
+ var tb = new TextBlock
+ {
+ Text = DrumViews[i], FontSize = NotaType.DeviceSection, VerticalAlignment = VerticalAlignment.Center,
+ Foreground = on ? AccentBright : TextTertiary, FontWeight = on ? FontWeight.SemiBold : FontWeight.Normal,
+ };
+ var cell = new Border
+ {
+ Padding = new Thickness(8, 0), BorderThickness = new Thickness(0, 0, 0, 2),
+ BorderBrush = on ? Brass : Brushes.Transparent, Background = on ? NotaPalette.SurfaceRaised : Brushes.Transparent,
+ Cursor = new Cursor(StandardCursorType.Hand), Child = tb,
+ };
+ cell.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(cell).Properties.IsLeftButtonPressed) return;
+ e.Handled = true;
+ if (_drumView != iv) { _drumView = iv; DeferRebuild(); }
+ };
+ row.Children.Add(cell);
+ }
+ var g = new Grid { Height = DrumTabH, ColumnDefinitions = new ColumnDefinitions("Auto,*") };
+ g.Children.Add(row);
+ Grid.SetColumn(readout, 1); g.Children.Add(readout);
+ return new Border { BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Child = g };
+ }
+
+ // ---- strip (22): bank · swing · humanize · fold ------------------------------------
+
+ private Control DrumStrip(IRackAccess a)
+ {
+ var bank = Segments(BankNames, () => _drumBank, i =>
+ {
+ if (i == _drumBank) return;
+ _drumBank = i;
+ // Follow the bank with the selection, so the pad panel shows a pad you can see.
+ int first = FirstPadInBank(a);
+ if (first >= 0) Sel = first;
+ DeferRebuild();
+ }, out _, padX: 5);
+ ToolTip.SetTip(bank, "Pad bank: sixteen notes from C1, C2, C3 or C4");
+
+ var swing = SliderRow("SWING", () => E.RackSwing(T), v => E.RackSetSwing(T, (float)v),
+ () => NotaNum.Pct(E.RackSwing(T)), out var swingSync, reset: () => E.RackSetSwing(T, 0f), valueWidth: 28);
+ ToolTip.SetTip(swing, "Push the off-beat sixteenths late");
+ var humanize = SliderRow("HUMANIZE", () => E.RackHumanize(T), v => E.RackSetHumanize(T, (float)v),
+ () => NotaNum.Pct(E.RackHumanize(T)), out var humSync, reset: () => E.RackSetHumanize(T, 0f), valueWidth: 28);
+ ToolTip.SetTip(humanize, "Nudge every hit's timing at random");
+ _irTick.Add(swingSync); _irTick.Add(humSync);
+
+ var fold = DrumButton("Fold", _drumFold, () => { _drumFold = !_drumFold; DeferRebuild(); });
+ ToolTip.SetTip(fold, _drumFold ? "Show every pad of the bank" : "Hide the empty pads");
+ if (_drumView != 0) fold.AttachedToVisualTree += (_, _) => Inactive.Set(fold, true); // Fold is a Pads view setting
+
+ var g = new Grid
+ {
+ Height = DrumStripH, ColumnDefinitions = new ColumnDefinitions("Auto,Auto,*,*,Auto"), ColumnSpacing = 8,
+ Margin = new Thickness(7, 0),
+ };
+ g.Children.Add(DrumCap("BANK"));
+ Grid.SetColumn(bank, 1); g.Children.Add(bank);
+ Grid.SetColumn(swing, 2); g.Children.Add(swing);
+ Grid.SetColumn(humanize, 3); g.Children.Add(humanize);
+ Grid.SetColumn(fold, 4); g.Children.Add(fold);
+ return new Border { BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(0, 0, 0, 1), Child = g };
+ }
+
+ // ==================== Pads view ====================
+
+ private Control DrumGrid(IRackAccess a)
+ {
+ // Hardware order: the bank's first note bottom-left, rising left → right, bottom → top.
+ // Folded, the loaded pads close up in the same order.
+ var notes = new List<int>();
+ for (int n = BankBase; n < BankBase + 16; n++)
+ if (!_drumFold || ChainForNote(a, n) >= 0) notes.Add(n);
+
+ var grid = new Grid
+ {
+ RowDefinitions = new RowDefinitions("*,*,*,*"), ColumnDefinitions = new ColumnDefinitions("*,*,*,*"),
+ RowSpacing = 4, ColumnSpacing = 4, Margin = new Thickness(5),
+ };
+ for (int k = 0; k < notes.Count; k++)
+ {
+ var pad = DrumPad(a, notes[k]);
+ Grid.SetRow(pad, 3 - k / 4); Grid.SetColumn(pad, k % 4);
+ grid.Children.Add(pad);
+ }
+ if (notes.Count == 0)
+ {
+ var empty = DrumHint($"No pads in bank {BankNames[_drumBank]}.");
+ Grid.SetRowSpan(empty, 4); Grid.SetColumnSpan(empty, 4);
+ grid.Children.Add(empty);
+ }
+ return grid;
+ }
+
+ private Control DrumPad(IRackAccess a, int note)
+ {
+ int chain = ChainForNote(a, note);
+ bool filled = chain >= 0, selected = filled && chain == Sel;
+ int choke = filled ? E.RackChainChoke(T, chain) : 0;
+ string name = filled ? PadName(a, chain) : "";
+
+ var nameTb = new TextBlock
+ {
+ Text = name, FontSize = 8, FontWeight = FontWeight.SemiBold, VerticalAlignment = VerticalAlignment.Center,
+ Foreground = selected ? AccentBright : TextPrimary, TextTrimming = TextTrimming.CharacterEllipsis,
+ };
+ var top = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 4 };
+ if (filled) top.Children.Add(new Border { Width = 3, Height = 9, CornerRadius = NotaRadius.Bar, Background = PadHue(chain), VerticalAlignment = VerticalAlignment.Center });
+ Grid.SetColumn(nameTb, 1); top.Children.Add(nameTb);
+
+ var noteTb = DrumMono(NoteName(note), selected ? AccentBright : filled ? TextTertiary : TextDisabled, 7);
+ var chokeTb = DrumMono(choke > 0 ? $"CH {choke}" : "", NotaPalette.TealBright, 7);
+ var bottom = new Grid { ColumnDefinitions = new ColumnDefinitions("*,Auto"), VerticalAlignment = VerticalAlignment.Bottom };
+ bottom.Children.Add(noteTb);
+ Grid.SetColumn(chokeTb, 1); bottom.Children.Add(chokeTb);
+
+ var cell = new Grid { RowDefinitions = new RowDefinitions("Auto,*,Auto"), Margin = new Thickness(5, 3) };
+ cell.Children.Add(top);
+ Grid.SetRow(bottom, 2); cell.Children.Add(bottom);
+
+ IBrush restBg = selected ? NotaPalette.AccentSubtle : filled ? NotaPalette.BgSunken : NotaPalette.SurfaceCard;
+ IBrush restBorder = selected ? Brass : NotaPalette.GraphBorder;
+ var pad = new Border
+ {
+ Background = restBg, BorderBrush = restBorder, BorderThickness = new Thickness(1),
+ CornerRadius = NotaRadius.Badge, Cursor = new Cursor(StandardCursorType.Hand), ClipToBounds = true, Child = cell,
+ };
+ ToolTip.SetTip(pad, filled
+ ? $"{name} · {NoteName(note)} — click to play, right-click for more"
+ : $"{NoteName(note)} — click to add an instrument, or drop a sample here");
+
+ if (filled)
+ {
+ // A sounding pad lights in its own hue; brass stays the selection.
+ var hot = PadFill(PadHue(chain), 0.22);
+ _irTick.Add(() => pad.Background = E.RackChainMeter(T, chain) > 0.02f ? hot : restBg);
+ pad.PointerPressed += (_, e) =>
+ {
+ var pt = e.GetCurrentPoint(pad).Properties;
+ if (pt.IsRightButtonPressed) { e.Handled = true; ShowPadMenu(a, pad, chain); return; }
+ if (!pt.IsLeftButtonPressed) return;
+ e.Handled = true; e.Pointer.Capture(pad); E.NoteOn(note, 1.0f);
+ };
+ pad.PointerReleased += (_, e) =>
+ {
+ if (e.InitialPressMouseButton != MouseButton.Left) return;
+ E.NoteOff(note); e.Pointer.Capture(null); SelectPad(chain);
+ };
+ }
+ else
+ {
+ pad.PointerEntered += (_, _) => pad.BorderBrush = NotaPalette.BorderStrong;
+ pad.PointerExited += (_, _) => pad.BorderBrush = restBorder;
+ pad.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(pad).Properties.IsLeftButtonPressed) return;
+ e.Handled = true; ShowAddPadMenu(a, pad, note);
+ };
+ }
+
+ DragDrop.SetAllowDrop(pad, true);
+ DragDrop.AddDragOverHandler(pad, (_, e) =>
+ {
+ if (!BrowserView.IsAcceptableDrag(e)) { e.DragEffects = DragDropEffects.None; return; }
+ e.DragEffects = DragDropEffects.Copy; e.Handled = true; _ctx.HideDropGlow();
+ pad.BorderBrush = AccentBright; // the drop target: colour only, never a thicker edge
+ });
+ DragDrop.AddDragLeaveHandler(pad, (_, _) => pad.BorderBrush = restBorder);
+ DragDrop.AddDropHandler(pad, (_, e) =>
+ {
+ pad.BorderBrush = restBorder;
+ var items = BrowserView.DroppedItems(e);
+ if (items.Count == 0) return;
+ // Several samples fill this pad and the ones after it, up to the bank's last.
+ for (int i = 0; i < items.Count && note + i < BankBase + 16; i++) DropOnPad(a, note + i, items[i]);
+ e.Handled = true;
+ });
+ return pad;
+ }
+
+ // Right-click on a loaded pad: rename, choke group, its chain, remove. The pad is
+ // selected too; the card rebuilds once the menu closes.
+ private void ShowPadMenu(IRackAccess a, Control anchor, int chain)
+ {
+ Sel = chain;
+ var f = new MenuFlyout();
+ var rename = new MenuItem { Header = "Rename…" };
+ rename.Click += (_, _) => Avalonia.Threading.Dispatcher.UIThread.Post(() => PromptRenamePad(a, anchor, chain));
+ f.Items.Add(rename);
+
+ var chokeMenu = new MenuItem { Header = "Choke group" };
+ int cur = E.RackChainChoke(T, chain);
+ for (int g = 0; g < ChokeNames.Length; g++)
+ {
+ int gv = g;
+ var mi = new MenuItem { Header = g == 0 ? "None" : $"Group {g}", ToggleType = MenuItemToggleType.Radio, IsChecked = g == cur };
+ mi.Click += (_, _) => E.RackSetChainChoke(T, chain, gv);
+ chokeMenu.Items.Add(mi);
+ }
+ f.Items.Add(chokeMenu);
+
+ var open = new MenuItem { Header = "Open chain" };
+ open.Click += (_, _) => _drumView = 2;
+ f.Items.Add(open);
+ f.Items.Add(new Separator());
+ var remove = new MenuItem { Header = "Remove pad" };
+ remove.Click += (_, _) => { a.RemoveChain(chain); _ctx.NotifyChanged(); };
+ f.Items.Add(remove);
+
+ bool renaming = false;
+ rename.Click += (_, _) => renaming = true;
+ f.Closed += (_, _) => { if (!renaming) DeferRebuild(); };
+ f.ShowAt(anchor, showAtPointer: true);
+ }
+
+ private void PromptRenamePad(IRackAccess a, Control anchor, int chain)
+ {
+ var box = new TextBox { Text = PadName(a, chain), FontSize = 9, Width = 120, Height = 20, Padding = new Thickness(4, 0) };
+ var fly = new Flyout { Content = box };
+ void Commit()
+ {
+ string n = (box.Text ?? "").Trim();
+ E.RackSetChainName(T, chain, n); // empty falls back to the instrument's name
+ _ctx.NotifyChanged();
+ }
+ box.KeyDown += (_, e) =>
+ {
+ if (e.Key == Key.Enter) { Commit(); fly.Hide(); }
+ else if (e.Key == Key.Escape) fly.Hide();
+ };
+ fly.Closed += (_, _) => DeferRebuild();
+ fly.ShowAt(anchor);
+ box.SelectAll();
+ box.Focus();
+ }
+
+ // ==================== Mixer view ====================
+
+ private Control DrumMixer(IRackAccess a, TextBlock readout)
+ {
+ var pads = LoadedPads(a).Where(c => InBank(a.ChainTriggerNote(c))).ToList();
+ const string Cols = "86,26,*,26,48";
+
+ var head = new Grid { ColumnDefinitions = new ColumnDefinitions(Cols), ColumnSpacing = 6, Height = MixRowH };
+ void H(string t, int col, bool right = false)
+ {
+ var x = DrumCap(t); if (right) x.HorizontalAlignment = HorizontalAlignment.Right;
+ Grid.SetColumn(x, col); head.Children.Add(x);
+ }
+ H("PAD", 0); H("NOTE", 1); H("VOLUME", 2); H("PAN", 3); H("M S CH", 4, right: true);
+ var headBar = new Border { BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(0, 0, 0, 1), Child = head };
+
+ var rows = new StackPanel { Spacing = 1, Margin = new Thickness(0, 2, 0, 0) };
+ foreach (int c in pads) rows.Children.Add(DrumMixerRow(a, c, Cols));
+ Control list;
+ if (pads.Count == 0)
+ {
+ list = DrumHint($"No pads in bank {BankNames[_drumBank]} — drop samples on the Pads view.");
+ readout.Text = $"{BankNames[_drumBank]} · empty";
+ }
+ else
+ {
+ var scroll = new ScrollViewer { Content = rows, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled };
+ // The rows in view, e.g. "C1 · 1–12 of 16".
+ void Visible()
+ {
+ double rowH = MixRowH + 1;
+ int first = (int)Math.Floor(scroll.Offset.Y / rowH);
+ int shown = Math.Max(1, (int)Math.Floor((scroll.Viewport.Height - 2) / rowH));
+ int last = Math.Min(pads.Count, first + shown);
+ readout.Text = last - first >= pads.Count
+ ? $"{BankNames[_drumBank]} · {pads.Count} pad{(pads.Count == 1 ? "" : "s")}"
+ : $"{BankNames[_drumBank]} · {first + 1}–{last} of {pads.Count}";
+ }
+ scroll.ScrollChanged += (_, _) => Visible();
+ readout.Text = $"{BankNames[_drumBank]} · {pads.Count} pad{(pads.Count == 1 ? "" : "s")}";
+ list = scroll;
+ }
+ DockPanel.SetDock(headBar, Dock.Top);
+ return new DockPanel { LastChildFill = true, Margin = new Thickness(7, 0, 7, 4), Children = { headBar, list } };
+ }
+
+ private Control DrumMixerRow(IRackAccess a, int c, string cols)
+ {
+ int note = a.ChainTriggerNote(c);
+ bool sel = c == Sel;
+ var g = new Grid { ColumnDefinitions = new ColumnDefinitions(cols), ColumnSpacing = 6, Height = MixRowH, Background = sel ? NotaPalette.AccentSubtle : Brushes.Transparent };
+
+ var name = new TextBlock
+ {
+ Text = PadName(a, c), FontSize = 8, FontWeight = sel ? FontWeight.SemiBold : FontWeight.Medium,
+ Foreground = sel ? AccentBright : TextPrimary, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Center,
+ };
+ var nameCell = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 4, Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand) };
+ nameCell.Children.Add(new Border { Width = 3, Height = 8, CornerRadius = NotaRadius.Bar, Background = PadHue(c), VerticalAlignment = VerticalAlignment.Center });
+ Grid.SetColumn(name, 1); nameCell.Children.Add(name);
+ nameCell.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(nameCell).Properties.IsLeftButtonPressed) return;
+ e.Handled = true; SelectPad(c);
+ };
+ ToolTip.SetTip(nameCell, "Select the pad");
+ g.Children.Add(nameCell);
+
+ var noteTb = DrumMono(NoteName(note), sel ? AccentBright : TextTertiary, 7);
+ Grid.SetColumn(noteTb, 1); g.Children.Add(noteTb);
+
+ var vol = new SliderTrack { Norm = VolNorm(a.ChainGain(c)), Reset = () => a.SetChainGain(c, 1f) };
+ vol.Changed += v => a.SetChainGain(c, NormVol(v));
+ _irTick.Add(() => { if (!vol.Dragging) vol.Norm = VolNorm(a.ChainGain(c)); });
+ ToolTip.SetTip(vol, "Pad volume · drag up or down, double-click for 0\u2009dB");
+ MidiLearn.Bind(vol, MidiTarget.RackChainGain(T, a.AutomationDeviceIndex, c), "Pad Volume");
+ Grid.SetColumn(vol, 2); g.Children.Add(vol);
+
+ var pan = PanDrag(a, c);
+ Grid.SetColumn(pan, 3); g.Children.Add(pan);
+
+ int choke = E.RackChainChoke(T, c);
+ var mute = MixBtn("M", () => a.ChainMute(c), NotaPalette.AccentHover, () => a.SetChainMute(c, !a.ChainMute(c)));
+ var solo = MixBtn("S", () => a.ChainSolo(c), Brass, () => a.SetChainSolo(c, !a.ChainSolo(c)));
+ var chk = MixBtn(choke > 0 ? choke.ToString() : "·", () => E.RackChainChoke(T, c) > 0, NotaPalette.Teal,
+ () => { E.RackSetChainChoke(T, c, (E.RackChainChoke(T, c) + 1) % ChokeNames.Length); DeferRebuild(); }, choke: true);
+ ToolTip.SetTip(mute, "Mute the pad"); ToolTip.SetTip(solo, "Solo the pad"); ToolTip.SetTip(chk, "Choke group: click for the next");
+ MidiLearn.Bind(mute, MidiTarget.RackChainMute(T, a.AutomationDeviceIndex, c), "Pad Mute");
+ MidiLearn.Bind(solo, MidiTarget.RackChainSolo(T, a.AutomationDeviceIndex, c), "Pad Solo");
+ var msc = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Center, Children = { mute, solo, chk } };
+ Grid.SetColumn(msc, 4); g.Children.Add(msc);
+ return g;
+ }
+
+ // Pan as a mono readout you drag: up is right, as on every value control; double-click centres.
+ private Control PanDrag(IRackAccess a, int c)
+ {
+ var tb = DrumMono(PanText(a.ChainPan(c)), TextSecondary, 7);
+ tb.HorizontalAlignment = HorizontalAlignment.Center;
+ var host = new Border { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.SizeNorthSouth), Child = tb };
+ ToolTip.SetTip(host, "Pad pan · drag up or down, double-click to centre");
+ bool drag = false; double lastY = 0;
+ host.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(host).Properties.IsLeftButtonPressed) return;
+ e.Handled = true;
+ if (e.ClickCount == 2) { a.SetChainPan(c, 0f); tb.Text = PanText(0f); return; }
+ drag = true; lastY = e.GetPosition(host).Y; e.Pointer.Capture(host);
+ };
+ host.PointerMoved += (_, e) =>
+ {
+ if (!drag) return;
+ double y = e.GetPosition(host).Y, dy = lastY - y; lastY = y;
+ bool fine = (e.KeyModifiers & (KeyModifiers.Shift | KeyModifiers.Control | KeyModifiers.Meta)) != 0;
+ float v = (float)Math.Clamp(a.ChainPan(c) + dy / (fine ? 700.0 : 70.0), -1, 1);
+ a.SetChainPan(c, v); tb.Text = PanText(v);
+ };
+ host.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); } };
+ host.PointerCaptureLost += (_, _) => drag = false;
+ _irTick.Add(() => { if (!drag) tb.Text = PanText(a.ChainPan(c)); });
+ return host;
+ }
+
+ // A mixer switch, 13 × 11: raised when off; when on, filled with its colour (mute, solo)
+ // or washed in teal (the choke group, which is a number, not a state).
+ private Border MixBtn(string text, Func<bool> on, IBrush accent, Action toggle, bool choke = false)
+ {
+ var tb = new TextBlock { Text = text, FontSize = 7, FontWeight = FontWeight.Bold, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
+ if (choke) tb.FontFamily = NotaFonts.MonoFamily;
+ var b = new Border { Width = 13, Height = 11, CornerRadius = NotaRadius.Clip, BorderThickness = new Thickness(1), Cursor = new Cursor(StandardCursorType.Hand), Child = tb };
+ void Paint()
+ {
+ bool v = on();
+ if (choke)
+ {
+ b.Background = v ? NotaPalette.Wash(NotaPalette.Teal, 0x33) : NotaPalette.BgSunken;
+ b.BorderBrush = v ? accent : NotaPalette.GraphBorder;
+ tb.Foreground = v ? NotaPalette.TealBright : TextDisabled;
+ }
+ else
+ {
+ b.Background = v ? accent : NotaPalette.SurfaceRaised;
+ b.BorderBrush = v ? accent : BorderDef;
+ tb.Foreground = v ? OnAccent : TextSecondary;
+ }
+ }
+ b.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return;
+ e.Handled = true; toggle(); Paint();
+ };
+ _irTick.Add(Paint);
+ Paint();
+ return b;
+ }
+
+ // ==================== Chain view ====================
+
+ private Control DrumChain(IRackAccess a)
+ {
+ if (!IsPad(a, Sel)) return DrumHint("Select a pad to see its device chain.");
+ int sc = Sel, note = a.ChainTriggerNote(sc);
+ var head = new StackPanel
+ {
+ Orientation = Orientation.Horizontal, Spacing = 6, Margin = new Thickness(0, 0, 0, 6),
+ Children =
+ {
+ new Border { Width = 6, Height = 6, CornerRadius = NotaRadius.Clip, Background = PadHue(sc), VerticalAlignment = VerticalAlignment.Center },
+ new TextBlock { Text = PadName(a, sc), FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center },
+ DrumMono(NoteName(note), TextTertiary, 7),
+ new TextBlock { Text = "instrument, then its effects · signal left → right", FontSize = 8, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center },
+ },
+ };
+ var slots = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5 };
+ slots.Children.Add(IrInstrumentSlot(a, sc));
+ for (int d = 0; d < a.ChainDeviceCount(sc); d++) slots.Children.Add(IrDeviceSlot(a, sc, d));
+ slots.Children.Add(IrAddDeviceSlot(a, sc));
+ var row = new ScrollViewer { Content = slots, HorizontalScrollBarVisibility = ScrollBarVisibility.Auto, VerticalScrollBarVisibility = ScrollBarVisibility.Disabled };
+ DockPanel.SetDock(head, Dock.Top);
+ return new DockPanel { LastChildFill = true, Margin = new Thickness(8, 6), Children = { head, row } };
+ }
+
+ // ==================== the selected pad (186) ====================
+
+ private Control DrumPadPanel(IRackAccess a)
+ {
+ if (!IsPad(a, Sel))
+ {
+ var g0 = new Grid { RowDefinitions = new RowDefinitions("Auto,*") };
+ g0.Children.Add(new Border
+ {
+ Height = DrumTabH, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Padding = new Thickness(8, 0),
+ Child = new TextBlock { Text = "No pad", FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center },
+ });
+ var hint = DrumHint("Drop a sample on a pad, or pick a kit above.");
+ Grid.SetRow(hint, 1); g0.Children.Add(hint);
+ return g0;
+ }
+ int c = Sel, note = a.ChainTriggerNote(c);
+ var hue = PadHue(c);
+
+ // header (20): dot · name · note · Open chain
+ var link = new TextBlock { Text = _drumView == 2 ? "Back to pads" : "Open chain", FontSize = 7, Foreground = NotaPalette.TextMuted, VerticalAlignment = VerticalAlignment.Center };
+ var linkHost = new Border { Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Child = link };
+ ToolTip.SetTip(linkHost, _drumView == 2 ? "Show the pads" : "Show the pad's instrument and effects");
+ linkHost.PointerEntered += (_, _) => link.Foreground = TextPrimary;
+ linkHost.PointerExited += (_, _) => link.Foreground = NotaPalette.TextMuted;
+ linkHost.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(linkHost).Properties.IsLeftButtonPressed) return;
+ e.Handled = true; _drumView = _drumView == 2 ? 0 : 2; DeferRebuild();
+ };
+ var head = new Grid { Height = DrumTabH, ColumnDefinitions = new ColumnDefinitions("Auto,Auto,Auto,*"), ColumnSpacing = 5, Margin = new Thickness(8, 0) };
+ head.Children.Add(new Border { Width = 6, Height = 6, CornerRadius = NotaRadius.Clip, Background = hue, VerticalAlignment = VerticalAlignment.Center });
+ var nameTb = new TextBlock { Text = PadName(a, c), FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = TextPrimary, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis, MaxWidth = 92 };
+ Grid.SetColumn(nameTb, 1); head.Children.Add(nameTb);
+ var noteTb = DrumMono(NoteName(note), TextTertiary, 7);
+ Grid.SetColumn(noteTb, 2); head.Children.Add(noteTb);
+ linkHost.HorizontalAlignment = HorizontalAlignment.Right;
+ Grid.SetColumn(linkHost, 3); head.Children.Add(linkHost);
+ var headBar = new Border { BorderBrush = BorderDef, BorderThickness = new Thickness(0, 0, 0, 1), Child = head };
+
+ // the one-shot (46)
+ var wave = new PadWave { Hue = hue, TopInset = 12 };
+ var srcTb = new TextBlock { FontSize = 7, FontWeight = FontWeight.SemiBold, Foreground = TextStrongInk, Margin = new Thickness(6, 3), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top };
+ var durTb = DrumMono("", TextTertiary, 7);
+ durTb.Margin = new Thickness(6, 3); durTb.HorizontalAlignment = HorizontalAlignment.Right; durTb.VerticalAlignment = VerticalAlignment.Top;
+ var waveBox = new Panel { Height = 46, Children = { wave, srcTb, durTb } };
+ srcTb.Text = a.ChainInstrumentName(c);
+ if (E.RackChainSamplerInfo(T, c, out var si) && si.SampleId != 0 && E.TryGetSampleInfo(si.SampleId, out var sinfo))
+ {
+ wave.Peaks = MiniPeaks(E.ReadSample(si.SampleId), Math.Max(1, sinfo.Channels), sinfo.Frames, 96);
+ durTb.Text = sinfo.SampleRate > 0 ? NotaNum.Time(sinfo.Frames / sinfo.SampleRate) : "";
+ _irTick.Add(() => { float p = E.RackChainSamplerPlayPosition(T, c); wave.Play = p < 0 ? -1 : p; });
+ }
+ else
+ {
+ durTb.Text = a.ChainInstrumentKind(c) == 1 ? "empty" : "synth";
+ var none = new TextBlock
+ {
+ Text = a.ChainInstrumentKind(c) == 1 ? "No sample — drop one on the pad" : "A synth voice, no sample",
+ FontSize = 7, Foreground = TextTertiary, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0, 12, 0, 0),
+ };
+ waveBox.Children.Add(none);
+ }
+
+ // volume · pan · tune · decay
+ Grid Row(string label, Func<double> get, Action<double> set, Func<string> text, Action reset, bool bipolar = false)
+ {
+ var r = SliderRow(label, get, set, text, out var sync, reset: reset, bipolar: bipolar, labelWidth: 40, valueWidth: 38);
+ _irTick.Add(sync);
+ return r;
+ }
+ var volRow = Row("VOLUME", () => VolNorm(a.ChainGain(c)), v => a.SetChainGain(c, NormVol(v)), () => VolText(a.ChainGain(c)), () => a.SetChainGain(c, 1f));
+ MidiLearn.Bind(volRow, MidiTarget.RackChainGain(T, a.AutomationDeviceIndex, c), "Pad Volume");
+ var panRow = Row("PAN", () => (a.ChainPan(c) + 1) / 2, v => a.SetChainPan(c, (float)(v * 2 - 1)), () => PanText(a.ChainPan(c)), () => a.SetChainPan(c, 0f), bipolar: true);
+ var tuneRow = Row("TUNE", () => (E.RackChainTune(T, c) + 48) / 96.0, v => E.RackSetChainTune(T, c, (int)Math.Round(v * 96 - 48)),
+ () => NotaNum.Unit(E.RackChainTune(T, c), "+0;−0;0", "st"), () => E.RackSetChainTune(T, c, 0), bipolar: true);
+ var decayRow = Row("DECAY", () => E.RackChainDecay(T, c), v => E.RackSetChainDecay(T, c, (float)v), () => DecayText(E.RackChainDecay(T, c)), () => E.RackSetChainDecay(T, c, 1f));
+ ToolTip.SetTip(tuneRow, "Transpose the note the pad plays, in semitones");
+ ToolTip.SetTip(decayRow, "Shorten the pad's tail; hold lets it ring");
+ var sliders = new StackPanel { Spacing = 6, Children = { volRow, panRow, tuneRow, decayRow } };
+
+ // choke · instrument
+ var chokeSeg = Segments(ChokeNames, () => { int g = E.RackChainChoke(T, c); return g < ChokeNames.Length ? g : -1; },
+ i => { E.RackSetChainChoke(T, c, i); DeferRebuild(); }, out var chokeSync, padX: 5);
+ _irTick.Add(chokeSync);
+ ToolTip.SetTip(chokeSeg, "Pads in the same group cut each other off");
+ var chokeRow = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*"), ColumnSpacing = 6 };
+ chokeRow.Children.Add(DrumCap("CHOKE"));
+ Grid.SetColumn(chokeSeg, 1); chokeRow.Children.Add(chokeSeg);
+
+ Border inst = null!;
+ inst = DrumWideButton(InstrumentWord(a, c), () => OpenChainInstrumentGui(a, c, inst));
+ ToolTip.SetTip(inst, "Open the pad's instrument");
+ var foot = new StackPanel { Spacing = 5, Children = { chokeRow, inst } };
+ var footer = new Border { BorderBrush = NotaPalette.GraphBorder, BorderThickness = new Thickness(0, 1, 0, 0), Padding = new Thickness(0, 5, 0, 0), VerticalAlignment = VerticalAlignment.Bottom, Child = foot };
+
+ var col = new Grid { RowDefinitions = new RowDefinitions("Auto,Auto,*"), RowSpacing = 6, Margin = new Thickness(8, 6) };
+ col.Children.Add(waveBox);
+ Grid.SetRow(sliders, 1); col.Children.Add(sliders);
+ Grid.SetRow(footer, 2); col.Children.Add(footer);
+
+ DockPanel.SetDock(headBar, Dock.Top);
+ return new DockPanel { LastChildFill = true, Children = { headBar, col } };
+ }
+
+ // The instrument button's word: what the pad plays, without the maker's prefix.
+ private static string InstrumentWord(IRackAccess a, int c)
+ {
+ string n = a.ChainInstrumentName(c);
+ if (string.IsNullOrEmpty(n)) return "Instrument";
+ return n.StartsWith("Nota ", StringComparison.Ordinal) ? n[5..] : n;
+ }
+
+ // ---- status strip (18) -----------------------------------------------------------
+
+ private Control DrumStatus(IRackAccess a, List<int> pads)
+ {
+ var status = new TextBlock { FontSize = 8, Foreground = TextSecondary, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };
+ var meta = DrumMono("", TextSecondary, 8);
+ int groups = pads.Select(c => E.RackChainChoke(T, c)).Where(g => g > 0).Distinct().Count();
+ meta.Text = $"{pads.Count} PAD{(pads.Count == 1 ? "" : "S")} · {groups} CHOKE GROUP{(groups == 1 ? "" : "S")}"
+ + (E.SampleRate > 0 ? " · " + NotaNum.Unit(E.SampleRate / 1000.0, "0.#", "kHz") : "");
+
+ string Timing() => $"swing {NotaNum.Pct(E.RackSwing(T))} · humanize {NotaNum.Pct(E.RackHumanize(T))}";
+ string PadWords(int c)
+ {
+ string src = E.RackChainSamplerInfo(T, c, out var si) && si.SampleId != 0 && E.TryGetSampleInfo(si.SampleId, out var inf) && inf.SampleRate > 0
+ ? $"sampler {NotaNum.Time(inf.Frames / inf.SampleRate)}"
+ : InstrumentWord(a, c).ToLowerInvariant();
+ int g = E.RackChainChoke(T, c);
+ return $"{PadName(a, c)} {NoteName(a.ChainTriggerNote(c))} selected · {src} · choke {(g > 0 ? g.ToString() : "off")}";
+ }
+ string Summary()
+ {
+ string bank = $"Bank {BankNames[_drumBank]}";
+ if (_drumView == 1)
+ {
+ var inBank = pads.Where(c => InBank(a.ChainTriggerNote(c))).ToList();
+ var chokes = inBank.GroupBy(c => E.RackChainChoke(T, c)).Where(gr => gr.Key > 0).OrderBy(gr => gr.Key)
+ .Select(gr => $"choke group {gr.Key}: {string.Join(", ", gr.Select(c => PadName(a, c)))}").ToList();
+ return $"{bank} · {inBank.Count} pad{(inBank.Count == 1 ? "" : "s")}" + (chokes.Count > 0 ? " · " + string.Join(" · ", chokes) : " · no choke groups");
+ }
+ if (!IsPad(a, Sel)) return $"{bank} · no pad selected · {Timing()}";
+ if (_drumView == 2)
+ {
+ int d = a.ChainDeviceCount(Sel);
+ return $"{PadName(a, Sel)} {NoteName(a.ChainTriggerNote(Sel))} · {a.ChainInstrumentName(Sel)} → {d} effect{(d == 1 ? "" : "s")} → pad volume, pan";
+ }
+ return $"{bank} · {PadWords(Sel)} · {Timing()}";
+ }
+ status.Text = Summary();
+ _irTick.Add(() => status.Text = Summary());
+
+ var g = new Grid { Height = DrumStatusH, ColumnDefinitions = new ColumnDefinitions("*,Auto"), ColumnSpacing = 10 };
+ g.Children.Add(status);
+ Grid.SetColumn(meta, 1); g.Children.Add(meta);
+ return new Border
+ {
+ Height = DrumStatusH, BorderBrush = BorderDef, BorderThickness = new Thickness(0, 1, 0, 0),
+ Background = NotaPalette.SurfaceAbyss, Padding = new Thickness(8, 0), Child = g,
+ };
+ }
+
+ // ---- pads: lookup, selection, loading ----------------------------------------------
+
+ private static int ChainForNote(IRackAccess a, int note)
+ {
+ for (int c = 0; c < a.ChainCount(); c++) if (a.ChainTriggerNote(c) == note) return c;
+ return -1;
+ }
+
+ private static bool IsPad(IRackAccess a, int c) => c >= 0 && c < a.ChainCount() && a.ChainTriggerNote(c) >= 0;
+
+ // Loaded pads, lowest note first.
+ private static List<int> LoadedPads(IRackAccess a)
+ {
+ var list = new List<int>();
+ for (int c = 0; c < a.ChainCount(); c++) if (a.ChainTriggerNote(c) >= 0) list.Add(c);
+ list.Sort((x, y) => a.ChainTriggerNote(x).CompareTo(a.ChainTriggerNote(y)));
+ return list;
+ }
+
+ private static int FirstPadInBank(IRackAccess a)
+ {
+ foreach (int c in LoadedPads(a)) if (InBank(a.ChainTriggerNote(c))) return c;
+ return -1;
+ }
+
+ private static int FirstPad(IRackAccess a, List<int> pads)
+ {
+ int inBank = FirstPadInBank(a);
+ return inBank >= 0 ? inBank : pads.Count > 0 ? pads[0] : -1;
+ }
+
+ // A pad's display name: the chain name if set, else the chain instrument's.
+ private string PadName(IRackAccess a, int chain)
+ {
+ string n = E.RackChainName(T, chain);
+ return n.Length > 0 ? n : a.ChainInstrumentName(chain);
+ }
+
+ // Select a pad and show it (rebuilds only when the selection changes).
+ private void SelectPad(int chain)
+ {
+ if (chain < 0 || chain == Sel) return;
+ Sel = chain;
+ DeferRebuild();
+ }
+
+ // A browser item dropped on a specific pad: sample → a Sampler on this note; instrument
+ // → that instrument on this note. Either replaces what the pad held.
+ private void DropOnPad(IRackAccess a, int note, Nota.Presentation.BrowserItem item)
+ {
+ int existing = ChainForNote(a, note);
+ int added;
+ switch (item.Kind)
+ {
+ case Nota.Presentation.BrowserItemKind.Sample:
+ if (existing >= 0) a.RemoveChain(existing);
+ added = E.RackAddSamplerChain(T, item.Path, note, false);
+ if (added >= 0)
+ {
+ E.RackSetChainTriggerNote(T, added, note);
+ // Name the pad after the sample — sixteen pads reading "Nota Sampler" say nothing.
+ E.RackSetChainName(T, added, System.IO.Path.GetFileNameWithoutExtension(item.Path));
+ }
+ break;
+ case Nota.Presentation.BrowserItemKind.BuiltinInstrument:
+ if (existing >= 0) a.RemoveChain(existing);
+ added = a.AddChain(item.BuiltinKind);
+ if (added >= 0) a.SetChainTriggerNote(added, note);
+ break;
+ case Nota.Presentation.BrowserItemKind.PluginInstrument:
+ if (existing >= 0) a.RemoveChain(existing);
+ added = E.RackAddPluginInstrumentChain(T, item.CatalogIndex);
+ if (added >= 0) E.RackSetChainTriggerNote(T, added, note);
+ break;
+ default:
+ return; // effects and presets aren't pad content
+ }
+ if (added >= 0) Sel = added;
+ _ctx.NotifyChanged();
+ DeferRebuild();
+ }
+
+ private void ShowAddPadMenu(IRackAccess a, Control anchor, int note)
+ {
+ var f = new MenuFlyout();
+ void Add(string header, int kind)
+ {
+ var mi = new MenuItem { Header = header };
+ mi.Click += (_, _) =>
+ {
+ int c = a.AddChain(kind);
+ if (c >= 0) { a.SetChainTriggerNote(c, note); Sel = c; }
+ _ctx.NotifyChanged();
+ DeferRebuild();
+ };
+ f.Items.Add(mi);
+ }
+ Add("Nota Sampler", 1);
+ f.Items.Add(new Separator());
+ Add("Nota Synth", 0);
+ Add("Nota Physical", 2);
+ Add("Nota Aurora", 5);
+ Add("Nota Volt", 6);
+ Add("Nota Bass", 7);
+ Add("Nota Pendulum", 8);
+ Add("Nota Operator", 9);
+ Add("Nota Grain", 10);
+ Add("Nota Flux", 11);
+ Add("Nota Monolith", 13);
+ Add("Nota Pentad", 14);
+ Add("Nota Consort", 15);
+ f.ShowAt(anchor, showAtPointer: true);
+ }
+
+ // ---- value mapping ---------------------------------------------------------------
+
+ // Pad hues are the track palette slots themselves, so a pad re-tints with the theme.
+ private static SolidColorBrush PadHue(int chain) => NotaPalette.TrackBrushes[((chain % 8) + 8) % 8];
+ private static IBrush PadFill(SolidColorBrush c, double alpha) => NotaPalette.Wash(c, (byte)(Math.Clamp(alpha, 0, 1) * 255));
+ // Volume: −60 … +6 dB over the slider, silence at the bottom.
+ private static double VolNorm(float gain) { double db = gain <= 0.001 ? -60 : 20 * Math.Log10(gain); return Math.Clamp((db + 60) / 66.0, 0, 1); }
+ private static float NormVol(double v) { double db = -60 + v * 66; return v <= 0 ? 0f : (float)Math.Pow(10, db / 20); }
+ private static string VolText(float gain) => NotaNum.Db(gain <= 0.001 ? double.NegativeInfinity : 20 * Math.Log10(gain), signed: true, floor: -59.5);
+ private static string PanText(float pan) { int p = (int)Math.Round(pan * 50); return p == 0 ? "C" : (p < 0 ? $"{-p}L" : $"{p}R"); }
+ // The engine's pad decay: 20 ms … 2 s, and "hold" (no shaping) at the top.
+ private static string DecayText(float d) => d >= 0.999f ? "hold" : NotaNum.Time(0.02 * Math.Pow(100, d));
+
+ private static float[] MiniPeaks(float[] raw, int ch, long frames, int buckets)
+ {
+ var o = new float[buckets];
+ if (frames <= 0 || raw.Length == 0) return o;
+ long per = Math.Max(1, frames / buckets);
+ for (int b = 0; b < buckets; b++)
+ {
+ long s = (long)b * per; float mx = 0;
+ for (long i = 0; i < per; i++)
+ {
+ long f = s + i; if (f >= frames || (f + 1) * ch > raw.Length) break;
+ float v = 0; for (int cc = 0; cc < ch; cc++) v += Math.Abs(raw[f * ch + cc]);
+ v /= ch; if (v > mx) mx = v;
+ }
+ o[b] = mx;
+ }
+ float peak = 0; foreach (float v in o) peak = Math.Max(peak, v);
+ if (peak > 0) for (int b = 0; b < buckets; b++) o[b] /= peak;
+ return o;
+ }
+
+ // ---- small builders --------------------------------------------------------------
+
+ private static readonly IBrush TextStrongInk = NotaPalette.TextStrong;
+
+ // A device section: card ground, hairline, radius 6.
+ private static Border DrumBox(Control child) => new()
+ {
+ Background = NotaPalette.SurfaceCard, BorderBrush = BorderDef, BorderThickness = new Thickness(1),
+ CornerRadius = NotaRadius.Tile, ClipToBounds = true, Child = child,
+ };
+
+ private static TextBlock DrumCap(string t) => new()
+ {
+ Text = t, FontSize = NotaType.KnobLabel, FontWeight = FontWeight.Bold, LetterSpacing = NotaType.KnobLabelTracking,
+ Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center,
+ };
+
+ private static TextBlock DrumMono(string t, IBrush ink, double fs) => new()
+ {
+ Text = t, FontSize = fs, Foreground = ink, FontFamily = NotaFonts.MonoFamily, VerticalAlignment = VerticalAlignment.Center,
+ };
+
+ // An empty state: one Ink 5 line, centred.
+ private static TextBlock DrumHint(string t) => new()
+ {
+ Text = t, FontSize = 8, Foreground = TextTertiary, TextWrapping = TextWrapping.Wrap, TextAlignment = TextAlignment.Center,
+ HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(8, 0),
+ };
+
+ // A small raised toggle (Fold): brass edge and Brass Light text when on.
+ private static Border DrumButton(string text, bool on, Action click)
+ {
+ var tb = new TextBlock { Text = text, FontSize = 7, FontWeight = FontWeight.SemiBold, Foreground = on ? AccentBright : TextStrongInk, VerticalAlignment = VerticalAlignment.Center };
+ var b = new Border
+ {
+ Height = 14, Padding = new Thickness(6, 0), CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1),
+ Background = on ? NotaPalette.AccentSubtle : NotaPalette.SurfaceRaised, BorderBrush = on ? Brass : BorderDef,
+ Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center, Child = tb,
+ };
+ b.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return;
+ e.Handled = true; click();
+ };
+ return b;
+ }
+
+ // A full-width raised button (the pad's instrument).
+ private static Border DrumWideButton(string text, Action click)
+ {
+ var tb = new TextBlock { Text = text, FontSize = 7, FontWeight = FontWeight.SemiBold, Foreground = TextStrongInk, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };
+ var b = new Border
+ {
+ Height = 16, CornerRadius = NotaRadius.Badge, BorderThickness = new Thickness(1),
+ Background = NotaPalette.SurfaceRaised, BorderBrush = BorderDef, Cursor = new Cursor(StandardCursorType.Hand), Child = tb,
+ };
+ b.PointerEntered += (_, _) => b.Background = NotaPalette.SurfaceHover;
+ b.PointerExited += (_, _) => b.Background = NotaPalette.SurfaceRaised;
+ b.PointerPressed += (_, e) =>
+ {
+ if (!e.GetCurrentPoint(b).Properties.IsLeftButtonPressed) return;
+ e.Handled = true; click();
+ };
+ return b;
+ }
+}
diff --git a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs
index 0071a270..e7ab0f1a 100644
--- a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs
+++ b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.cs
@@ -7,7 +7,8 @@
// 4×4 pad grid for the drum rack) in the middle, and the selected chain's device chain
// on the right. The two rack addressings differ only via IRackAccess. Built per-rebuild
// with a DeviceCardContext; all mutable state (selected chain, refreshers, drop glow,
-// rebuild) lives in the view behind the context.
+// rebuild) lives in the view behind the context. The Drum Rack body is in
+// RackCardView.Drum.cs.
using System;
using Avalonia;
@@ -23,7 +24,7 @@ using static Nota.App.DeviceCardKit;
namespace Nota.App;
-internal sealed class RackCardView(DeviceCardContext ctx)
+internal sealed partial class RackCardView(DeviceCardContext ctx)
{
private static readonly string[] RackDeviceNames = { "Nota EQ-3", "Nota EQ-8", "Nota Dynamic EQ-8", "Nota Compressor", "Nota Prism", "Nota Reverb", "Nota Chamber", "Nota Delay", "Nota Utility", "Nota Level", "Nota Ceiling", "Nota Shutter", "Nota Valve", "Nota Auto Filter", "Nota Vintage", "Nota Forge", "Nota Crush", "Nota Orbit", "Nota Auto Shift", "Nota Beat Repeat", "Nota Strata" };
private static readonly int[] RackDeviceKinds = { 16, 0, 13, 1, 21, 2, 20, 3, 4, 18, 14, 19, 6, 7, 8, 17, 12, 9, 10, 11, 15 };
@@ -49,9 +50,6 @@ internal sealed class RackCardView(DeviceCardContext ctx)
private static readonly IBrush IrRed = NotaPalette.AccentHover; // a state, not an alert: red is kept for recording and overload
private static bool _macroMapMode; // Instrument Rack: second (Macro-map) view
private static int _splitAxis; // 0 = Key zone, 1 = Velocity
- private static bool _drumMixer; // Drum Rack: false = Pads view, true = Mixer view
- private static int _drumBank; // Drum Rack: current pad bank 0..3 (C1..C4 → notes 36+bank*16)
- private static bool _drumFold; // Drum Rack: hide empty pads in the grid
private static bool _aeMacroMap; // Audio Effect Rack: macro-map view
private static bool _aeFold; // Audio Effect Rack: fold device cards to titles
private readonly System.Collections.Generic.List<Action> _irTick = new();
@@ -940,345 +938,6 @@ internal sealed class RackCardView(DeviceCardContext ctx)
return row;
}
- // Drum Rack card, rebuilt to mockup 2q (700×260): a 4×4 hue-coded pad grid with a
- // selected-pad detail panel, or a Mixer view (every loaded pad as a row). A LIVE strip
- // carries bank / swing / humanize / fold. Pads still audition on click and accept drops.
- public Control BuildDrumRackCard()
- {
- var a = new InstrumentRackAccess(E, T);
- E.SetAuditionTrack(T); // so clicking a pad plays it without arming
- int chains = a.ChainCount();
- Sel = chains > 0 ? Math.Clamp(Sel, 0, chains - 1) : 0;
- _irTick.Clear();
-
- var header = DrumHeader(a);
- var strip = DrumLiveStrip(a);
- Control bodyView = _drumMixer ? DrumMixerView(a) : DrumPadsView(a);
- DockPanel.SetDock(header, Dock.Top); DockPanel.SetDock(strip, Dock.Top);
- var content = new DockPanel { LastChildFill = true, Children = { header, strip, bodyView } };
- if (_irTick.Count > 0) _ctx.AddDeviceRefresher(() => { for (int i = 0; i < _irTick.Count; i++) _irTick[i](); });
- return new Border { Width = 700, Height = 260, Background = NotaPalette.BgApp, BorderBrush = IrBorder, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Body, ClipToBounds = true, Child = content };
- }
-
- // ---- header (22): name · pad count ----
- private Control DrumHeader(IRackAccess a)
- {
- int pads = 0;
- for (int c = 0; c < a.ChainCount(); c++) if (a.ChainTriggerNote(c) >= 0) pads++;
- return RackHeader("Nota Drum Rack", $"DRUMS · {pads} PAD{(pads == 1 ? "" : "S")}");
- }
-
- // ---- LIVE strip (34): bank · swing · humanize · fold ----
- private Control DrumLiveStrip(IRackAccess a)
- {
- var row = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 10, VerticalAlignment = VerticalAlignment.Center };
- row.Children.Add(IrCap("BANK"));
- row.Children.Add(IrSeg(new[] { "C1", "C2", "C3", "C4" }, _drumBank, i => { _drumBank = i; _ctx.RequestRebuild(); }));
- row.Children.Add(DrumKitKnob("SWING", 52, IrAmber, () => E.RackSwing(T), v => E.RackSetSwing(T, v)));
- row.Children.Add(DrumKitKnob("HUMANIZE", 46, IrTeal, () => E.RackHumanize(T), v => E.RackSetHumanize(T, v)));
- var fold = DrumChip("Fold", _drumFold, () => { _drumFold = !_drumFold; _ctx.RequestRebuild(); });
- // Pads / Mixer view switch: moved here from the header (almanac header carries name and badge only).
- var view = IrSeg(new[] { "Pads", "Mixer" }, _drumMixer ? 1 : 0, i => { _drumMixer = i == 1; _ctx.RequestRebuild(); });
- var right = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 8, VerticalAlignment = VerticalAlignment.Center, [DockPanel.DockProperty] = Dock.Right, Children = { view, fold } };
- var dp = new DockPanel { LastChildFill = false, Margin = new Thickness(9, 0), Children = { row, right } };
- return new Border { Height = 34, Background = IrHdr, BorderBrush = IrBorder, BorderThickness = new Thickness(0, 0, 0, 1), Child = dp };
- }
-
- // A labelled kit slider (swing / humanize) with a fixed-width groove + live % readout.
- private Control DrumKitKnob(string label, double width, IBrush accent, Func<float> get, Action<float> set)
- {
- var val = IrMono("0\u2009%", IrTxt, 9); val.MinWidth = 30;
- var slot = HSlider(width, accent, () => get(), v => { set((float)v); val.Text = $"{v * 100:0}\u2009%"; });
- val.Text = $"{get() * 100:0}\u2009%";
- return new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = { IrCap(label), slot, val } };
- }
-
- private static Border DrumChip(string text, bool on, Action onClick)
- {
- var b = new Border { BorderThickness = new Thickness(1), BorderBrush = on ? IrTeal : NotaPalette.BorderStrong, Background = on ? NotaPalette.Wash(NotaPalette.Teal, 0x24) : IrCard, CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,
- Child = new TextBlock { Text = text, FontSize = 9, Foreground = on ? IrTeal : NotaPalette.TextSecondary } };
- b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };
- return b;
- }
-
- // A fixed-width horizontal groove+fill+handle bound to a 0..1 getter/setter.
- private static Control HSlider(double width, IBrush accent, Func<double> get, Action<double> set)
- {
- var slider = new SliderTrack { Width = width, Norm = Math.Clamp(get(), 0, 1) };
- slider.Changed += set;
- return slider;
- }
-
- // ==================== Pads view ====================
- private Control DrumPadsView(IRackAccess a)
- {
- var grid = DrumPadGrid(a);
- var panel = DrumSelectedPanel(a);
- DockPanel.SetDock(grid, Dock.Left);
- return new DockPanel { LastChildFill = true, Children = { grid, panel } };
- }
-
- private Control DrumPadGrid(IRackAccess a)
- {
- int bankBase = 36 + _drumBank * 16;
- var notes = new System.Collections.Generic.List<int>();
- // Hardware order: pad 1 bottom-left, ascending left→right, bottom→top.
- foreach (int rowBase in new[] { bankBase + 12, bankBase + 8, bankBase + 4, bankBase })
- for (int col = 0; col < 4; col++) notes.Add(rowBase + col);
- if (_drumFold) notes = notes.FindAll(nn => ChainForNote(a, nn) >= 0);
-
- var uni = new UniformGrid { Columns = 4, Rows = _drumFold ? Math.Max(1, (notes.Count + 3) / 4) : 4 };
- foreach (int nn in notes) uni.Children.Add(DrumPad(a, nn));
- return new Border { Width = 314, Padding = new Thickness(8, 7), Child = uni };
- }
-
- // A pad's display name: the chain name if set, else the chain instrument's.
- private string PadName(IRackAccess a, int chain)
- {
- string n = E.RackChainName(T, chain);
- return n.Length > 0 ? n : a.ChainInstrumentName(chain);
- }
-
- private Control DrumPad(IRackAccess a, int note)
- {
- int chain = ChainForNote(a, note);
- bool filled = chain >= 0;
- bool selected = filled && chain == Sel;
- var hue = filled ? PadHue(chain) : NotaPalette.SurfaceAbyss;
- int choke = filled ? E.RackChainChoke(T, chain) : 0;
- // The pad's own name when it has one (kit voice, dropped sample); otherwise the
- // instrument's — which for a Sampler is the same word on every pad.
- string name = filled ? PadName(a, chain) : NoteName(note);
-
- var nameTb = new TextBlock { Text = name, FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = filled ? IrTxt : IrMuted, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Top };
- var noteTb = IrMono(NoteName(note), filled ? NotaPalette.TextSecondary : IrMuted, 7);
- var chokeTb = IrMono(choke > 0 ? $"CH {choke}" : "", IrTeal, 7);
- var bottom = new DockPanel { LastChildFill = false, VerticalAlignment = VerticalAlignment.Bottom, Children = { noteTb, WithRight(chokeTb) } };
- var cell = new Grid { RowDefinitions = new RowDefinitions("Auto,*,Auto"), Margin = new Thickness(5, 4) };
- cell.Children.Add(nameTb);
- Grid.SetRow(bottom, 2); cell.Children.Add(bottom);
-
- IBrush LoadedBg() => filled ? PadFill(hue, 0.16) : IrCard;
- IBrush SelBg() => PadFill(hue, 0.28);
- IBrush idleBorder = selected ? AccentBright : (filled ? PadFill(hue, 0.5) : IrBorder);
- double idleThick = 1; // selection shows in colour (SelBg), not a thicker edge
- var pad = new Border { Margin = new Thickness(2), Background = selected ? SelBg() : LoadedBg(), BorderBrush = idleBorder, BorderThickness = new Thickness(idleThick), CornerRadius = NotaRadius.Tile, Cursor = new Cursor(StandardCursorType.Hand), Child = cell };
- ToolTip.SetTip(pad, filled ? $"{name} · {NoteName(note)} — click to play + edit" : $"{NoteName(note)} — click to add · drop a sample here");
-
- if (filled)
- {
- // Live: brighten the pad while it's sounding (meter > floor).
- _irTick.Add(() => {
- bool hot = E.RackChainMeter(T, chain) > 0.02f;
- pad.Background = hot ? PadFill(hue, 0.42) : (chain == Sel ? SelBg() : LoadedBg());
- pad.BorderBrush = hot ? AccentBright : (chain == Sel ? AccentBright : PadFill(hue, 0.5));
- });
- pad.PointerPressed += (_, e) => {
- var pt = e.GetCurrentPoint(pad).Properties;
- if (pt.IsRightButtonPressed) { e.Handled = true; SelectPad(chain); return; }
- if (pt.IsLeftButtonPressed) { e.Handled = true; e.Pointer.Capture(pad); E.NoteOn(note, 1.0f); }
- };
- pad.PointerReleased += (_, e) => { E.NoteOff(note); e.Pointer.Capture(null); SelectPad(chain); };
- }
- else
- {
- pad.PointerPressed += (_, e) => { e.Handled = true; ShowAddPadMenu(a, pad, note); };
- }
-
- DragDrop.SetAllowDrop(pad, true);
- DragDrop.AddDragOverHandler(pad, (_, e) => {
- if (!BrowserView.IsAcceptableDrag(e)) { e.DragEffects = DragDropEffects.None; return; }
- e.DragEffects = DragDropEffects.Copy; e.Handled = true; _ctx.HideDropGlow();
- pad.BorderBrush = AccentBright; // drop target: colour only, no thicker border
- });
- DragDrop.AddDragLeaveHandler(pad, (_, _) => { pad.BorderBrush = idleBorder; });
- DragDrop.AddDropHandler(pad, (_, e) => {
- pad.BorderBrush = idleBorder; pad.BorderThickness = new Thickness(idleThick);
- var items = BrowserView.DroppedItems(e);
- if (items.Count == 0) return;
- int bankTop = (36 + _drumBank * 16) + 16;
- for (int i = 0; i < items.Count && note + i < bankTop; i++) DropOnPad(a, note + i, items[i]);
- e.Handled = true;
- });
- return pad;
- }
-
- // ---- selected-pad detail panel ----
- private Control DrumSelectedPanel(IRackAccess a)
- {
- var panel = new Border { Background = NotaPalette.SurfaceInset, BorderBrush = IrBorder, BorderThickness = new Thickness(1, 0, 0, 0), Padding = new Thickness(9, 6) };
- int chains = a.ChainCount();
- if (chains == 0 || Sel < 0 || Sel >= chains || a.ChainTriggerNote(Sel) < 0)
- {
- panel.Child = new TextBlock { Text = "Select a pad to edit it.", FontSize = 9, Foreground = IrMuted, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
- return panel;
- }
- int c = Sel, note = a.ChainTriggerNote(c);
- int devs = a.ChainDeviceCount(c);
- int choke = E.RackChainChoke(T, c);
- var hue = PadHue(c);
-
- var head = new DockPanel { LastChildFill = false, Children = {
- new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = {
- new Border { Width = 7, Height = 7, CornerRadius = NotaRadius.Clip, Background = hue, VerticalAlignment = VerticalAlignment.Center },
- new TextBlock { Text = PadName(a, c), FontSize = 9, FontWeight = FontWeight.SemiBold, Foreground = IrTxt, VerticalAlignment = VerticalAlignment.Center },
- IrMono($"{NoteName(note)} · {(choke > 0 ? $"choke CH {choke}" : "no choke")} · {devs} dev", IrMuted) } },
- WithRight(DrumOpenChip(a, c)) } };
-
- var col = new StackPanel { Spacing = 5 };
- col.Children.Add(head);
- col.Children.Add(DrumSampleBox(a, c, hue));
- col.Children.Add(DrumParamRow("VOLUME", () => VolNorm(a.ChainGain(c)), v => a.SetChainGain(c, NormVol(v)), () => VolText(a.ChainGain(c))));
- col.Children.Add(DrumParamRow("PAN", () => (a.ChainPan(c) + 1) / 2, v => a.SetChainPan(c, (float)(v * 2 - 1)), () => PanText(a.ChainPan(c))));
- col.Children.Add(DrumParamRow("TUNE", () => (E.RackChainTune(T, c) + 48) / 96.0, v => E.RackSetChainTune(T, c, (int)Math.Round(v * 96 - 48)), () => $"{E.RackChainTune(T, c):+0;−0;0}\u2009st"));
- col.Children.Add(DrumParamRow("DECAY", () => E.RackChainDecay(T, c), v => E.RackSetChainDecay(T, c, (float)v), () => DecayText(E.RackChainDecay(T, c))));
-
- var chokeLeft = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, VerticalAlignment = VerticalAlignment.Center, Children = {
- IrCap("CHOKE"),
- IrSeg(new[] { "Off", "1", "2", "3", "4" }, choke, i => { E.RackSetChainChoke(T, c, i); _ctx.RequestRebuild(); }) } };
- var samplerChip = DrumChip("Sampler", false, () => OpenChainInstrumentGui(a, c, panel));
- var chokeRow = new DockPanel { LastChildFill = false, Margin = new Thickness(0, 3, 0, 0), Children = { chokeLeft, WithRight(samplerChip) } };
- DockPanel.SetDock(chokeRow, Dock.Bottom);
- panel.Child = new DockPanel { LastChildFill = true, Children = { chokeRow, col } };
- return panel;
- }
-
- private Border DrumOpenChip(IRackAccess a, int c)
- {
- Border b = null!;
- b = new Border { Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,
- Child = new TextBlock { Text = "Open chain", FontSize = 8, Foreground = IrMuted } };
- b.PointerPressed += (_, e) => { e.Handled = true; OpenChainInstrumentGui(a, c, b); };
- return b;
- }
-
- private Control DrumSampleBox(IRackAccess a, int c, SolidColorBrush hue)
- {
- var title = IrMono("", IrTxt, 8);
- var dur = IrMono("", IrMuted, 8);
- var bars = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 1, VerticalAlignment = VerticalAlignment.Center };
- float[] peaks = Array.Empty<float>();
- if (E.RackChainSamplerInfo(T, c, out var si) && si.SampleId != 0 && E.TryGetSampleInfo(si.SampleId, out var sinfo))
- {
- float[] raw = E.ReadSample(si.SampleId);
- int ch = Math.Max(1, sinfo.Channels); long frames = sinfo.Frames; double sr = sinfo.SampleRate;
- peaks = MiniPeaks(raw, ch, frames, 40);
- title.Text = a.ChainInstrumentName(c);
- dur.Text = sr > 0 ? $"{frames / sr:0.00}\u2009s" : "";
- }
- else { title.Text = a.ChainInstrumentName(c); dur.Text = "synth"; }
-
- if (peaks.Length > 0)
- foreach (float p in peaks)
- bars.Children.Add(new Border { Width = 3, Height = Math.Max(1, p * 30), Background = hue, CornerRadius = NotaRadius.Bar, VerticalAlignment = VerticalAlignment.Center });
- else
- bars.Children.Add(new TextBlock { Text = "— no sample —", FontSize = 8, Foreground = IrMuted, VerticalAlignment = VerticalAlignment.Center });
-
- var top = new DockPanel { LastChildFill = false, Children = { title, WithRight(dur) } };
- var inner = new DockPanel { LastChildFill = true, Children = { top } };
- DockPanel.SetDock(top, Dock.Top);
- inner.Children.Add(new Border { Child = new ScrollViewer { HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden, VerticalScrollBarVisibility = ScrollBarVisibility.Disabled, Content = bars }, VerticalAlignment = VerticalAlignment.Center });
- return new Border { Height = 56, Background = IrInset, BorderBrush = IrField, BorderThickness = new Thickness(1), CornerRadius = NotaRadius.Panel, Padding = new Thickness(7, 4), Child = inner };
- }
-
- // A param row: label (44) · flexible groove · value (48). Synced via the 60 Hz tick.
- private Control DrumParamRow(string label, Func<double> get, Action<double> set, Func<string> disp)
- {
- var lbl = new TextBlock { Text = label, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = IrMuted, Width = 44, VerticalAlignment = VerticalAlignment.Center };
- var val = IrMono(disp(), IrTxt, 9); val.Width = 48; val.TextAlignment = TextAlignment.Right;
- var fill = new Border { Height = 3, Background = IrAmber, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };
- var handle = new Border { Width = 8, Height = 9, Background = NotaPalette.TextSecondary, CornerRadius = NotaRadius.Clip, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center };
- var slot = new Panel { Height = 9, Cursor = new Cursor(StandardCursorType.Hand), Background = Brushes.Transparent, Children = { new Border { Height = 3, Background = IrInset, CornerRadius = NotaRadius.Clip, VerticalAlignment = VerticalAlignment.Center }, fill, handle } };
- void Vis(double v) { double W = slot.Bounds.Width; fill.Width = v * W; handle.Margin = new Thickness(Math.Clamp(v * W - 4, 0, Math.Max(0, W - 8)), 0, 0, 0); }
- bool drag = false;
- void SetX(double x) { double v = Math.Clamp(x / Math.Max(1, slot.Bounds.Width), 0, 1); set(v); Vis(v); val.Text = disp(); }
- slot.PointerPressed += (_, e) => { drag = true; e.Pointer.Capture(slot); SetX(e.GetPosition(slot).X); };
- slot.PointerMoved += (_, e) => { if (drag) SetX(e.GetPosition(slot).X); };
- slot.PointerReleased += (_, e) => { if (drag) { drag = false; e.Pointer.Capture(null); } };
- _irTick.Add(() => { if (!drag) { Vis(Math.Clamp(get(), 0, 1)); val.Text = disp(); } });
- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("Auto,*,Auto"), ColumnSpacing = 6, VerticalAlignment = VerticalAlignment.Center };
- Grid.SetColumn(slot, 1); Grid.SetColumn(val, 2);
- g.Children.Add(lbl); g.Children.Add(slot); g.Children.Add(val);
- return g;
- }
-
- // ==================== Mixer view ====================
- private Control DrumMixerView(IRackAccess a)
- {
- var pads = new System.Collections.Generic.List<int>();
- for (int c = 0; c < a.ChainCount(); c++) if (a.ChainTriggerNote(c) >= 0) pads.Add(c);
- pads.Sort((x, y) => a.ChainTriggerNote(x).CompareTo(a.ChainTriggerNote(y)));
-
- var head = new Grid { ColumnDefinitions = new ColumnDefinitions("96,26,*,40,44"), ColumnSpacing = 6, Height = 22, Margin = new Thickness(9, 0) };
- void H(string t, int col, IBrush? cc = null) { var x = new TextBlock { Text = t, FontSize = 8, FontWeight = FontWeight.Bold, Foreground = cc ?? IrMuted, VerticalAlignment = VerticalAlignment.Center }; Grid.SetColumn(x, col); head.Children.Add(x); }
- H("PAD", 0); H("NOTE", 1); H("VOLUME", 2); H("PAN", 3); H("M S CHK", 4);
- var headBar = new Border { Height = 22, Background = NotaPalette.SurfaceInset, BorderBrush = IrBorder, BorderThickness = new Thickness(0, 0, 0, 1), Child = head };
-
- var rows = new StackPanel { Spacing = 2 };
- foreach (int c in pads) rows.Children.Add(DrumMixerRow(a, c));
- if (pads.Count == 0) rows.Children.Add(new TextBlock { Text = "No pads loaded — drop samples on the Pads view.", FontSize = 9, Foreground = IrMuted, Margin = new Thickness(0, 8, 0, 0), HorizontalAlignment = HorizontalAlignment.Center });
- var scroll = new ScrollViewer { Content = rows, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled, Padding = new Thickness(9, 4, 9, 4) };
- DockPanel.SetDock(headBar, Dock.Top);
- return new DockPanel { LastChildFill = true, Children = { headBar, scroll } };
- }
-
- private Control DrumMixerRow(IRackAccess a, int c)
- {
- int note = a.ChainTriggerNote(c);
- var hue = PadHue(c);
- var g = new Grid { ColumnDefinitions = new ColumnDefinitions("96,26,*,40,44"), ColumnSpacing = 6, Height = 13 };
- var nameCell = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 5, VerticalAlignment = VerticalAlignment.Center, Children = {
- new Border { Width = 4, Height = 10, CornerRadius = NotaRadius.Bar, Background = hue, VerticalAlignment = VerticalAlignment.Center },
- new TextBlock { Text = PadName(a, c), FontSize = 9, Foreground = c == Sel ? IrAmberLit : IrTxt, TextTrimming = TextTrimming.CharacterEllipsis, VerticalAlignment = VerticalAlignment.Center } } };
- nameCell.PointerPressed += (_, _) => SelectPad(c);
- Grid.SetColumn(nameCell, 0); g.Children.Add(nameCell);
- var noteTb = IrMono(NoteName(note), IrMuted); Grid.SetColumn(noteTb, 1); g.Children.Add(noteTb);
-
- var vslot = new SliderTrack { Norm = VolNorm(a.ChainGain(c)) };
- vslot.Changed += v => a.SetChainGain(c, NormVol(v));
- _irTick.Add(() => { if (!vslot.Dragging) vslot.Norm = VolNorm(a.ChainGain(c)); });
- MidiLearn.Bind(vslot, MidiTarget.RackChainGain(T, a.AutomationDeviceIndex, c), "Pad Volume");
- Grid.SetColumn(vslot, 2); g.Children.Add(vslot);
-
- var panTb = IrMono(PanText(a.ChainPan(c)), NotaPalette.TextSecondary); panTb.TextAlignment = TextAlignment.Center; Grid.SetColumn(panTb, 3); g.Children.Add(panTb);
-
- int choke = E.RackChainChoke(T, c);
- var padMute = IrMsBtn("M", a.ChainMute(c), IrRed, () => { a.SetChainMute(c, !a.ChainMute(c)); _ctx.RequestRebuild(); });
- var padSolo = IrMsBtn("S", a.ChainSolo(c), IrAmber, () => { a.SetChainSolo(c, !a.ChainSolo(c)); _ctx.RequestRebuild(); });
- MidiLearn.Bind(padMute, MidiTarget.RackChainMute(T, a.AutomationDeviceIndex, c), "Pad Mute");
- MidiLearn.Bind(padSolo, MidiTarget.RackChainSolo(T, a.AutomationDeviceIndex, c), "Pad Solo");
- var msc = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2, VerticalAlignment = VerticalAlignment.Center, Children = {
- padMute, padSolo,
- IrMsBtn(choke > 0 ? choke.ToString() : "·", choke > 0, IrTeal, () => { E.RackSetChainChoke(T, c, (choke + 1) % 5); _ctx.RequestRebuild(); }) } };
- Grid.SetColumn(msc, 4); g.Children.Add(msc);
- return g;
- }
-
- // ---- drum helpers: pad hue + value mapping + mini peaks ----
- // Pad hues are the track palette slots themselves, so a pad re-tints with the theme.
- private static SolidColorBrush PadHue(int chain) => NotaPalette.TrackBrushes[((chain % 8) + 8) % 8];
- private static IBrush PadFill(SolidColorBrush c, double alpha) => NotaPalette.Wash(c, (byte)(Math.Clamp(alpha, 0, 1) * 255));
- private static double VolNorm(float gain) { double db = gain <= 0.001 ? -60 : 20 * Math.Log10(gain); return Math.Clamp((db + 60) / 66.0, 0, 1); }
- private static float NormVol(double v) { double db = -60 + v * 66; return (float)Math.Pow(10, db / 20); }
- private static string VolText(float gain) { double db = gain <= 0.001 ? -60 : 20 * Math.Log10(gain); return db <= -59 ? "−∞" : $"{db:+0.0;−0.0;0.0}\u2009dB"; }
- private static string PanText(float pan) { int p = (int)Math.Round(pan * 50); return p == 0 ? "C" : (p < 0 ? $"{-p}L" : $"{p}R"); }
- private static string DecayText(float d) => d >= 0.999f ? "hold" : $"{20 * Math.Pow(100, d):0}\u2009ms";
- private static float[] MiniPeaks(float[] raw, int ch, long frames, int buckets)
- {
- var o = new float[buckets];
- if (frames <= 0 || raw.Length == 0) return o;
- long per = Math.Max(1, frames / buckets);
- for (int b = 0; b < buckets; b++)
- {
- long s = (long)b * per; float mx = 0;
- for (long i = 0; i < per; i++) { long f = s + i; if (f >= frames) break; float v = 0; for (int cc = 0; cc < ch; cc++) v += Math.Abs(raw[f * ch + cc]); v /= ch; if (v > mx) mx = v; }
- o[b] = mx;
- }
- float peak = 0; foreach (float v in o) peak = Math.Max(peak, v);
- if (peak > 0) for (int b = 0; b < buckets; b++) o[b] /= peak;
- return o;
- }
-
// ---- rack body (macros + chains), reused by both rack types ------------
// The 4×2 macro grid column, shared by the rack card and the drum-rack card.
private Control MacroColumn(IRackAccess a)
@@ -1823,88 +1482,19 @@ internal sealed class RackCardView(DeviceCardContext ctx)
if (a.TryGetMapping(i, out var m) && m.Chain == chain && m.DeviceIndex == dev && m.ParamIndex == param) a.RemoveMapping(i);
}
- // ---- drum-rack pads ---------------------------------------------------
- private static int ChainForNote(IRackAccess a, int note)
- {
- for (int c = 0; c < a.ChainCount(); c++) if (a.ChainTriggerNote(c) == note) return c;
- return -1;
- }
-
- // Show a pad's chain in the device area (only rebuilds when the selection changes).
- private void SelectPad(int chain)
- {
- if (chain < 0 || chain == Sel) return;
- Sel = chain;
- _ctx.RequestRebuild();
- }
-
- // A browser item dropped on a specific pad: sample → Sampler on this note;
- // instrument → that built-in on this note (replacing any existing chain).
- private void DropOnPad(IRackAccess a, int note, Nota.Presentation.BrowserItem item)
- {
- int existing = ChainForNote(a, note);
- switch (item.Kind)
- {
- case Nota.Presentation.BrowserItemKind.Sample:
- if (existing >= 0) a.RemoveChain(existing);
- int cs = E.RackAddSamplerChain(T, item.Path, note, false);
- if (cs >= 0)
- {
- E.RackSetChainTriggerNote(T, cs, note);
- // Label the pad with the sample's name — 16 pads all reading
- // "Nota Sampler" tell the user nothing.
- E.RackSetChainName(T, cs, System.IO.Path.GetFileNameWithoutExtension(item.Path));
- }
- break;
- case Nota.Presentation.BrowserItemKind.BuiltinInstrument:
- if (existing >= 0) a.RemoveChain(existing);
- int ci = a.AddChain(item.BuiltinKind);
- if (ci >= 0) a.SetChainTriggerNote(ci, note);
- break;
- case Nota.Presentation.BrowserItemKind.PluginInstrument:
- if (existing >= 0) a.RemoveChain(existing);
- int cp = E.RackAddPluginInstrumentChain(T, item.CatalogIndex);
- if (cp >= 0) E.RackSetChainTriggerNote(T, cp, note);
- break;
- default:
- return; // effects / presets aren't pad content
- }
- _ctx.RequestRebuild();
- }
-
- private void ShowAddPadMenu(IRackAccess a, Control anchor, int note)
- {
- var f = new MenuFlyout();
- void Add(string header, int kind)
- {
- var mi = new MenuItem { Header = header };
- mi.Click += (_, _) =>
- {
- int c = a.AddChain(kind);
- if (c >= 0) a.SetChainTriggerNote(c, note);
- _ctx.RequestRebuild();
- };
- f.Items.Add(mi);
- }
- Add("Nota Synth", 0);
- Add("Nota Physical", 2);
- Add("Nota Aurora", 5);
- Add("Nota Volt", 6);
- Add("Nota Bass", 7);
- Add("Nota Pendulum", 8);
- Add("Nota Operator", 9);
- Add("Nota Grain", 10);
- Add("Nota Flux", 11);
- Add("Nota Monolith", 13);
- Add("Nota Pentad", 14);
- Add("Nota Consort", 15);
- f.ShowAt(anchor, showAtPointer: true);
- }
-
// ---- small shared bits ------------------------------------------------
private static Control SectionLabel(string text) => new TextBlock
{ Text = text, FontSize = 9, FontWeight = FontWeight.Bold, Foreground = NotaPalette.TextTertiary };
+ // A teal on/off chip (the Effect Rack's Follow / Manual selector).
+ private static Border DrumChip(string text, bool on, Action onClick)
+ {
+ var b = new Border { BorderThickness = new Thickness(1), BorderBrush = on ? IrTeal : NotaPalette.BorderStrong, Background = on ? NotaPalette.Wash(NotaPalette.Teal, 0x24) : IrCard, CornerRadius = NotaRadius.Control, Padding = new Thickness(8, 2), Cursor = new Cursor(StandardCursorType.Hand), VerticalAlignment = VerticalAlignment.Center,
+ Child = new TextBlock { Text = text, FontSize = 9, Foreground = on ? IrTeal : NotaPalette.TextSecondary } };
+ b.PointerPressed += (_, e) => { e.Handled = true; onClick(); };
+ return b;
+ }
+
// A small clickable chip (GUI / Save preset on the chain instrument card).
private static Border ActionChip(string text, Action onClick)
{
diff --git a/src/managed/Nota.App/DeviceChainView.Instruments.cs b/src/managed/Nota.App/DeviceChainView.Instruments.cs
index 460608a8..64b9ef50 100644
--- a/src/managed/Nota.App/DeviceChainView.Instruments.cs
+++ b/src/managed/Nota.App/DeviceChainView.Instruments.cs
@@ -17,7 +17,7 @@ public sealed partial class DeviceChainView
{
int kind = _engine.TrackInstrumentKind(_trackId);
if (kind == 3) return new RackCardView(NewCardContext()).BuildInstrumentRackCard(); // Instrument Rack
- if (kind == 4) return new RackCardView(NewCardContext()).BuildDrumRackCard(); // Drum Rack
+ if (kind == 4) return DrumRackCard();
// Built-in Sampler + synths (Synth/Physical/Aurora/Volt) → their strategy; anything
// else (or a synth reporting no params) → the generic Open-GUI card.
bool hasParams = _engine.PluginParamCount(_trackId, -1) > 0;
@@ -32,6 +32,31 @@ public sealed partial class DeviceChainView
return BuildCardShell(spec, body);
}
+ // The Drum Rack in the shared shell: its presets are the factory kits, which replace the
+ // rack's pads, and the badge counts the loaded pads.
+ private Control DrumRackCard()
+ {
+ var body = new RackCardView(NewCardContext()).BuildDrumRackBody(out int pads);
+ CardPresets? kits = null;
+ if (_kits is { } k)
+ {
+ int t = _trackId;
+ var items = new System.Collections.Generic.List<(string, string)>();
+ foreach (var kit in k.All()) items.Add((kit.Id, kit.Name));
+ kits = new CardPresets(items, () => k.Identify(_engine, t), id =>
+ {
+ k.LoadInto(_engine, t, id, out string warn);
+ _rackSelChain = 0;
+ return warn;
+ });
+ }
+ var spec = new ShellSpec(
+ Name: _engine.DeviceName(_trackId, -1), Subtitle: $"DRUMS · {pads} PAD{(pads == 1 ? "" : "S")}", DeviceIndex: -1, Count: 1,
+ Bypassed: false, Bypassable: false, CanMove: false, CanDelete: false,
+ PresetKind: 4, IsInstrument: true, Width: 700, Kind: ChainKind.Instrument, Presets: kits);
+ return BuildCardShell(spec, body);
+ }
+
/// <summary>Re-reads the built-in instrument params and updates faders + graphs
/// (so automation moves show live). Drives both the Synth and Physical editors.</summary>
public void RefreshSynthLive()
diff --git a/src/managed/Nota.App/DeviceChainView.Shell.cs b/src/managed/Nota.App/DeviceChainView.Shell.cs
index bb913b86..e1bbd072 100644
--- a/src/managed/Nota.App/DeviceChainView.Shell.cs
+++ b/src/managed/Nota.App/DeviceChainView.Shell.cs
@@ -90,7 +90,15 @@ public sealed partial class DeviceChainView
internal readonly record struct ShellSpec(
string Name, string Subtitle, int DeviceIndex, int Count, bool Bypassed, bool Bypassable,
bool CanMove, bool CanDelete, int PresetKind, bool IsInstrument, double Width, ChainKind Kind,
- Func<Nota.Application.IAudioEngine, int, int, string?>? VoiceLabel = null);
+ Func<Nota.Application.IAudioEngine, int, int, string?>? VoiceLabel = null,
+ CardPresets? Presets = null);
+
+ /// <summary>A card's own preset list, in place of the factory presets for its kind — the
+ /// Drum Rack's kits, which load pads rather than set parameters. <paramref name="Current"/>
+ /// names the one the device holds now ("" when none fits); <paramref name="Apply"/> loads
+ /// one by id and returns a warning, or "".</summary>
+ internal sealed record CardPresets(
+ IReadOnlyList<(string Id, string Name)> Items, Func<string> Current, Func<string, string> Apply);
// Small tertiary caption / mono readout helpers.
private static TextBlock Caps(string t, double fs = 9) => new() { Text = t, FontSize = fs, FontWeight = FontWeight.Bold, Foreground = TextTertiary, VerticalAlignment = VerticalAlignment.Center };
@@ -100,8 +108,8 @@ public sealed partial class DeviceChainView
// name opens the factory presets for this kind with the current one checked; ‹ › step to
// the previous / next preset, wrapping (from Init, › is the first and ‹ the last).
// Clicks are handled so they neither select nor start dragging the card.
- private Control PresetPicker(List<FactoryPresetInfo> presets, int cur, string current,
- Action<FactoryPresetInfo> apply, Action<int> step)
+ private Control PresetPicker(IReadOnlyList<string> presets, int cur, string current,
+ Action<int> apply, Action<int> step)
{
const double H = 18;
var label = new TextBlock
@@ -123,9 +131,9 @@ public sealed partial class DeviceChainView
var flyout = new MenuFlyout();
for (int i = 0; i < presets.Count; i++)
{
- var info = presets[i];
- var mi = new MenuItem { Header = info.DisplayName, ToggleType = MenuItemToggleType.Radio, IsChecked = i == cur };
- mi.Click += (_, _) => apply(info);
+ int iv = i;
+ var mi = new MenuItem { Header = presets[i], ToggleType = MenuItemToggleType.Radio, IsChecked = i == cur };
+ mi.Click += (_, _) => apply(iv);
flyout.Items.Add(mi);
}
flyout.ShowAt(name);
@@ -222,19 +230,40 @@ public sealed partial class DeviceChainView
};
ToolTip.SetTip(headerBar, s.CanMove ? "Drag to reorder · right-click for A/B, move and delete" : "Right-click for more");
- // Factory presets for this device, and applying one in place.
- var presets = s.PresetKind >= 0 || s.IsInstrument || s.Kind == ChainKind.Midi
- ? _factory.All().Where(p => p.BuiltinKind == s.PresetKind
- && (s.Kind == ChainKind.Midi ? p.IsMidiEffect : (p.IsInstrument == s.IsInstrument && !p.IsMidiEffect))).ToList()
- : new List<FactoryPresetInfo>();
+ // Factory presets for this device (or the card's own list), and applying one in place.
+ List<(string Id, string Name)> presets;
+ Action<string> applyById;
+ if (s.Presets is { } own)
+ {
+ presets = own.Items.ToList();
+ // What the device holds now wins over what this card last applied: a kit loaded
+ // from the browser, or a project reopened, still names its kit.
+ string now = own.Current();
+ if (now.Length > 0 && presets.FindIndex(p => p.Id == now) is var ni and >= 0) { extra.PresetId = now; extra.Preset = presets[ni].Name; }
+ applyById = id =>
+ {
+ string warn = own.Apply(id);
+ if (warn.Length > 0) StatusMessage?.Invoke(warn);
+ Changed?.Invoke();
+ };
+ }
+ else
+ {
+ presets = s.PresetKind >= 0 || s.IsInstrument || s.Kind == ChainKind.Midi
+ ? _factory.All().Where(p => p.BuiltinKind == s.PresetKind
+ && (s.Kind == ChainKind.Midi ? p.IsMidiEffect : (p.IsInstrument == s.IsInstrument && !p.IsMidiEffect)))
+ .Select(p => (p.Id, p.DisplayName)).ToList()
+ : new List<(string Id, string Name)>();
+ applyById = id => _factory.ApplyInPlace(_engine, id, _trackId, di);
+ }
int curPreset = presets.FindIndex(p => p.Id == extra.PresetId);
- void ApplyPreset(FactoryPresetInfo p) { _factory.ApplyInPlace(_engine, p.Id, _trackId, di); extra.PresetId = p.Id; extra.Preset = p.DisplayName; Rebuild(); }
+ void ApplyPreset(int i) { var p = presets[i]; applyById(p.Id); extra.PresetId = p.Id; extra.Preset = p.Name; Rebuild(); }
void StepPreset(int dir)
{
int n = presets.Count; if (n == 0) return;
- ApplyPreset(presets[curPreset < 0 ? (dir > 0 ? 0 : n - 1) : ((curPreset + dir) % n + n) % n]);
+ ApplyPreset(curPreset < 0 ? (dir > 0 ? 0 : n - 1) : ((curPreset + dir) % n + n) % n);
}
- if (presets.Count > 0) right.Children.Insert(0, PresetPicker(presets, curPreset, extra.Preset, ApplyPreset, StepPreset));
+ if (presets.Count > 0) right.Children.Insert(0, PresetPicker(presets.Select(p => p.Name).ToList(), curPreset, extra.Preset, ApplyPreset, StepPreset));
void Move(int to) { if (s.Kind == ChainKind.Midi) _engine.MoveMidiEffect(_trackId, di, to); else _engine.MoveDevice(_trackId, di, to); ExtrasMoved(s.Kind, di, to); Rebuild(); Changed?.Invoke(); }
@@ -249,9 +278,9 @@ public sealed partial class DeviceChainView
menu.Items.Add(prev); menu.Items.Add(next); menu.Items.Add(new Separator());
for (int i = 0; i < presets.Count; i++)
{
- var info = presets[i];
- var mi = new MenuItem { Header = info.DisplayName, ToggleType = MenuItemToggleType.Radio, IsChecked = i == curPreset };
- mi.Click += (_, _) => ApplyPreset(info);
+ int iv = i;
+ var mi = new MenuItem { Header = presets[i].Name, ToggleType = MenuItemToggleType.Radio, IsChecked = i == curPreset };
+ mi.Click += (_, _) => ApplyPreset(iv);
menu.Items.Add(mi);
}
flyout.Items.Add(menu);
diff --git a/src/managed/Nota.App/DeviceChainView.cs b/src/managed/Nota.App/DeviceChainView.cs
index 3e08d709..1d53ac5b 100644
--- a/src/managed/Nota.App/DeviceChainView.cs
+++ b/src/managed/Nota.App/DeviceChainView.cs
@@ -43,6 +43,7 @@ public sealed partial class DeviceChainView : UserControl
private readonly IAudioEngine _engine;
private readonly IFactoryPresets _factory;
private readonly IPluginCatalog? _catalog; // maps a copied plugin's id → catalog index for paste
+ private readonly IDrumKits? _kits; // the Drum Rack card's preset list
private readonly DeviceCardFactory _cardFactory = new();
private readonly InstrumentCardFactory _instrumentFactory = new();
private readonly MidiDeviceCardFactory _midiFactory = new();
@@ -60,6 +61,9 @@ public sealed partial class DeviceChainView : UserControl
/// routes it (effect → the shown track; instrument → a rack chain / drum pad).</summary>
public event Action<BrowserItem>? ItemDropped;
+ /// <summary>A one-line message for the status bar (e.g. a kit that loaded incompletely).</summary>
+ public event Action<string>? StatusMessage;
+
// Accent overlay shown while a browser item is dragged over the panel.
private readonly Border _dropGlow = new()
{
@@ -70,11 +74,12 @@ public sealed partial class DeviceChainView : UserControl
Margin = new Thickness(2),
};
- public DeviceChainView(IAudioEngine engine, IFactoryPresets factory, IPluginCatalog? catalog = null)
+ public DeviceChainView(IAudioEngine engine, IFactoryPresets factory, IPluginCatalog? catalog = null, IDrumKits? kits = null)
{
_engine = engine;
_factory = factory;
_catalog = catalog;
+ _kits = kits;
Focusable = true; // so Ctrl+C/X/V + Delete on a selected device reach OnKeyDown
var scroller = new ScrollViewer
{
diff --git a/src/managed/Nota.App/MainWindow.axaml.cs b/src/managed/Nota.App/MainWindow.axaml.cs
index 419b2cd2..56ce930d 100644
--- a/src/managed/Nota.App/MainWindow.axaml.cs
+++ b/src/managed/Nota.App/MainWindow.axaml.cs
@@ -284,12 +284,13 @@ public partial class MainWindow : Window
Browser.DeleteProjectRequested += OnBrowserDeleteProject;
Browser.EditTagsRequested += OnBrowserEditTags;
- _deviceChain = new DeviceChainView(vm.Engine, _factory, App.Services.GetService<IPluginCatalog>());
+ _deviceChain = new DeviceChainView(vm.Engine, _factory, App.Services.GetService<IPluginCatalog>(), _kits);
// A pad added / removed / renamed in the Drum Rack card changes the pattern grid's rows.
_deviceChain.Changed += () => { Timeline.Refresh(); _patternView?.Reload(); if (_modular?.IsVisible == true) _modular.Refresh(); };
_deviceChain.PresetSaveRequested += OnSavePreset;
_deviceChain.RackPresetSaveRequested += OnSaveRackChainPreset;
_deviceChain.ItemDropped += OnDevicePanelDrop; // browser drag onto the device panel
+ _deviceChain.StatusMessage += msg => { if (_vm is not null) _vm.StatusText = msg; };
Timeline.TrackSelected += OnTrackSelected;
Timeline.ClipGeometryChanged += OnClipGeometryChanged; // clip trimmed/moved → follow it in the open editor
Timeline.StatusMessage += msg => { if (_vm is not null) _vm.StatusText = msg; }; // automation-follow hints etc.
diff --git a/src/managed/Nota.Application/Ports/IDrumKits.cs b/src/managed/Nota.Application/Ports/IDrumKits.cs
index d99907a6..4bc3694f 100644
--- a/src/managed/Nota.Application/Ports/IDrumKits.cs
+++ b/src/managed/Nota.Application/Ports/IDrumKits.cs
@@ -37,4 +37,9 @@ public interface IDrumKits
/// <summary>Replaces the pads of an existing Drum Rack track with the kit.</summary>
bool LoadInto(IAudioEngine engine, int trackId, string id, out string warning);
+
+ /// <summary>The kit a Drum Rack track was loaded from, recognised by its pads (the
+ /// note and name of each), or "" when no kit fits. A rack stays recognised after a
+ /// pad or two is swapped or renamed, so a saved project reopens with its kit name.</summary>
+ string Identify(IAudioEngine engine, int trackId);
}
diff --git a/src/managed/Nota.Infrastructure/Kits/DrumKitService.cs b/src/managed/Nota.Infrastructure/Kits/DrumKitService.cs
index 654f2ab1..e12145c7 100644
--- a/src/managed/Nota.Infrastructure/Kits/DrumKitService.cs
+++ b/src/managed/Nota.Infrastructure/Kits/DrumKitService.cs
@@ -66,6 +66,33 @@ public sealed class DrumKitService : IDrumKits
return true;
}
+ public string Identify(IAudioEngine engine, int trackId)
+ {
+ int chains = engine.RackChainCount(trackId);
+ if (chains <= 0) return "";
+ var pads = new HashSet<(int Note, string Name)>();
+ for (int c = 0; c < chains; c++)
+ {
+ int note = engine.RackChainTriggerNote(trackId, c);
+ if (note >= 0) pads.Add((note, engine.RackChainName(trackId, c)));
+ }
+
+ // The kit sharing the most pads wins, if it shares at least three quarters of its
+ // own and no other kit ties it — most kits have a Kick on 36 and a Snare on 38, so
+ // a near-empty rack must not read as whichever kit happens to come first.
+ string best = "";
+ int bestScore = 0, runnerUp = 0;
+ foreach (var kit in KitCatalog.All)
+ {
+ int score = 0;
+ foreach (var p in kit.Pads) if (pads.Contains((p.Note, p.Name))) score++;
+ if (score > bestScore) { runnerUp = bestScore; bestScore = score; best = kit.Id; }
+ else if (score > runnerUp) runnerUp = score;
+ }
+ var winner = KitCatalog.ById(best);
+ return winner is not null && bestScore * 4 >= winner.Pads.Count * 3 && bestScore > runnerUp ? best : "";
+ }
+
private static void Fill(IAudioEngine engine, int track, KitDefinition kit, out string warning)
{
KitLibrary.Ensure(kit);
diff --git a/src/managed/Nota.Infrastructure/Kits/KitCatalog.Genres.cs b/src/managed/Nota.Infrastructure/Kits/KitCatalog.Genres.cs
new file mode 100644
index 00000000..5e1dd346
--- /dev/null
+++ b/src/managed/Nota.Infrastructure/Kits/KitCatalog.Genres.cs
@@ -0,0 +1,503 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// The genre kits, 11-25: the second shelf of the factory library. Same rules as the
+// first ten (KitCatalog.cs) — the General MIDI map on notes 36-51, the three hats in
+// choke group 1 — and each kit keeps at least one pad name no other kit uses, so a
+// loaded kit can be recognised from its pads (DrumKitService.Identify).
+//
+// Where a kit has a second pair that should cut each other (an open and a muted
+// conga, a long and a short shaker), that pair shares choke group 2. A kit with no
+// hats puts its own cut pair on the hat pads instead (Pit's triangles).
+
+using System.Collections.Generic;
+
+namespace Nota.Infrastructure.Kits;
+
+public static partial class KitCatalog
+{
+ // ======================================================================
+ // 11. Brass Room — a live rock kit in a big, bright tracking room. The
+ // room is on every pad, toms and cymbals are panned as the drummer
+ // sits, and the china is there for the last chorus.
+ // ======================================================================
+ private static KitDefinition BrassRoom() => new()
+ {
+ Id = "brass-room",
+ Name = "Brass Room",
+ Blurb = "live rock kit · big bright room, panned toms, china",
+ Humanize = 0.1f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickAcoustic, Note = 36, Freq = 56, Decay = 0.55, PitchAmt = 0.8, PitchDecay = 0.022, Tone = 0.55, Body = 0.7, Click = 0.55, Drive = 0.3, Warmth = 0.55, Room = 0.3, RoomSize = 0.7, RoomDecay = 0.35, RoomDamp = 0.35, Width = 0.8, Drift = 0.2, Length = 1.4, PeakDb = -1.5 },
+ new() { Name = "Side Stick", Model = DrumModel.Rim, Note = 37, Freq = 510, Decay = 0.05, Tone = 0.55, Body = 0.5, Drive = 0.2, Warmth = 0.5, HpHz = 240, Room = 0.35, RoomSize = 0.7, RoomDecay = 0.35, Width = 0.8, Drift = 0.3, Length = 0.9, PeakDb = -9 },
+ new() { Name = "Snare", Model = DrumModel.SnareAcoustic,Note = 38, Freq = 194, Decay = 0.42, Tone = 0.62, Body = 0.62, Noise = 0.9, NoiseDecay = 0.22, Click = 0.55, Drive = 0.3, Warmth = 0.5, Room = 0.42, RoomSize = 0.75, RoomDecay = 0.4, RoomDamp = 0.3, Width = 0.85, Drift = 0.25, Length = 1.6, PeakDb = -2.5 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1100,Decay = 0.22, Tone = 0.55, Body = 0.6, Drive = 0.2, Warmth = 0.5, Room = 0.4, RoomSize = 0.7, RoomDecay = 0.35, Width = 0.9, Drift = 0.5, Length = 1.2, PeakDb = -4.5 },
+ new() { Name = "Snare Rim", Model = DrumModel.SnareAcoustic,Note = 40, Freq = 228, Decay = 0.3, Tone = 0.7, Body = 0.55, Noise = 0.95, NoiseDecay = 0.15, Click = 0.7, Drive = 0.35, Warmth = 0.45, Room = 0.4, RoomSize = 0.75, RoomDecay = 0.4, Width = 0.85, Drift = 0.25, Length = 1.3, PeakDb = -3.5 },
+ new() { Name = "Floor Tom", Model = DrumModel.Tom, Note = 41, Freq = 70, Decay = 0.85, PitchAmt = 0.25, PitchDecay = 0.06, Tone = 0.45, Body = 0.7, Noise = 0.35, NoiseDecay = 0.08, Drive = 0.22, Warmth = 0.55, Room = 0.35, RoomSize = 0.75, RoomDecay = 0.4, Width = 0.85, Pan = -0.3f, Drift = 0.25, Length = 2.0, PeakDb = -4.5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 1300, Decay = 0.05, Tone = 0.68, Body = 0.55, Click = 0.45, Drive = 0.15, Warmth = 0.35, Room = 0.2, RoomSize = 0.6, Width = 0.7, Pan = 0.2f, Drift = 0.4, Length = 0.5, PeakDb = -10 },
+ new() { Name = "Rack Tom Low",Model = DrumModel.Tom, Note = 43, Freq = 98, Decay = 0.7, PitchAmt = 0.25, PitchDecay = 0.055, Tone = 0.47, Body = 0.7, Noise = 0.35, NoiseDecay = 0.08, Drive = 0.22, Warmth = 0.55, Room = 0.35, RoomSize = 0.75, RoomDecay = 0.4, Width = 0.85, Pan = -0.1f, Drift = 0.25, Length = 1.8, PeakDb = -4.5 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 1250, Decay = 0.035, Tone = 0.6, Body = 0.5, Click = 0.4, Drive = 0.12, Warmth = 0.35, Room = 0.18, RoomSize = 0.6, Width = 0.7, Pan = 0.2f, Drift = 0.4, Length = 0.4, PeakDb = -13 },
+ new() { Name = "Rack Tom Hi",Model = DrumModel.Tom, Note = 45, Freq = 136, Decay = 0.6, PitchAmt = 0.25, PitchDecay = 0.05, Tone = 0.5, Body = 0.7, Noise = 0.35, NoiseDecay = 0.08, Drive = 0.22, Warmth = 0.55, Room = 0.35, RoomSize = 0.75, RoomDecay = 0.4, Width = 0.85, Pan = 0.15f, Drift = 0.25, Length = 1.6, PeakDb = -4.5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 1300, Decay = 0.45, Tone = 0.72, Body = 0.55, Click = 0.4, Drive = 0.15, Warmth = 0.35, Room = 0.25, RoomSize = 0.6, Width = 0.7, Pan = 0.2f, Drift = 0.4, Length = 1.3, PeakDb = -9 },
+ new() { Name = "Cowbell", Model = DrumModel.Cowbell, Note = 47, Freq = 560, Decay = 0.28, Tone = 0.5, Body = 0.5, Click = 0.35, Drive = 0.2, Warmth = 0.45, Room = 0.3, RoomSize = 0.7, Width = 0.8, Drift = 0.3, Length = 0.9, PeakDb = -9 },
+ new() { Name = "Tambourine", Model = DrumModel.Shaker, Note = 48, Freq = 7400,Decay = 0.2, Tone = 0.72, Body = 0.9, Click = 0.85, Drive = 0.1, Warmth = 0.35, Room = 0.3, RoomSize = 0.7, Width = 0.85, Pan = -0.25f, Drift = 0.6, Length = 0.8, PeakDb = -10 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 300, Decay = 3.0, Tone = 0.5, Body = 0.62, Noise = 0.55, Drive = 0.1, Warmth = 0.3, Room = 0.3, RoomSize = 0.75, RoomDecay = 0.4, Width = 0.9, Pan = -0.35f, Drift = 0.4, Length = 4.0, PeakDb = -7 },
+ new() { Name = "China", Model = DrumModel.Cymbal, Note = 50, Freq = 380, Decay = 1.8, Tone = 0.35, Body = 0.75, Noise = 0.6, Drive = 0.3, Warmth = 0.3, Room = 0.28, RoomSize = 0.7, Width = 0.9, Pan = 0.4f, Drift = 0.4, Length = 2.6, PeakDb = -8 },
+ new() { Name = "Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 410, Decay = 1.7, Tone = 0.82, Body = 0.45, Noise = 0.3, Drive = 0.08, Warmth = 0.3, Room = 0.22, RoomSize = 0.7, Width = 0.8, Pan = 0.35f, Drift = 0.4, Length = 2.4, PeakDb = -10 },
+ },
+ };
+
+ // ======================================================================
+ // 12. Breakline — the chopped break of jungle and drum & bass: a small,
+ // bright, tuned-up acoustic kit through a 12-bit sampler, with ghost
+ // notes and flams on their own pads so a roll can be played.
+ // ======================================================================
+ private static KitDefinition Breakline() => new()
+ {
+ Id = "breakline",
+ Name = "Breakline",
+ Blurb = "jungle & breakbeat · tuned-up 12-bit break, ghosts and flams",
+ Humanize = 0.08f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickAcoustic, Note = 36, Freq = 62, Decay = 0.32, PitchAmt = 0.9, PitchDecay = 0.018, Tone = 0.6, Body = 0.5, Click = 0.6, Drive = 0.4, Warmth = 0.55, Bits = 12, CrushHz = 32000, HpHz = 35, Room = 0.15, RoomSize = 0.35, RoomDecay = 0.12, Width = 0.6, Drift = 0.2, Length = 0.7, PeakDb = -1.5 },
+ new() { Name = "Ghost Snare",Model = DrumModel.SnareAcoustic,Note = 37, Freq = 250, Decay = 0.12, Tone = 0.6, Body = 0.4, Noise = 0.8, NoiseDecay = 0.06, Click = 0.3, Drive = 0.35, Warmth = 0.5, Bits = 12, CrushHz = 32000, HpHz = 120, Drift = 0.4, Length = 0.35, PeakDb = -9 },
+ new() { Name = "Snare", Model = DrumModel.SnareAcoustic,Note = 38, Freq = 238, Decay = 0.26, Tone = 0.72, Body = 0.55, Noise = 0.95, NoiseDecay = 0.13, Click = 0.7, Drive = 0.45, Warmth = 0.5, Bits = 12, CrushHz = 32000, Room = 0.22, RoomSize = 0.4, RoomDecay = 0.15, Width = 0.7, Drift = 0.25, Length = 0.7, PeakDb = -2 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1250,Decay = 0.16, Tone = 0.62, Body = 0.45, Drive = 0.3, Warmth = 0.45, Bits = 12, CrushHz = 32000, Room = 0.18, Width = 0.7, Drift = 0.5, Length = 0.5, PeakDb = -5 },
+ new() { Name = "Snare Crack",Model = DrumModel.SnarePunch, Note = 40, Freq = 290, Decay = 0.14, Tone = 0.8, Body = 0.35, Noise = 1.0, NoiseDecay = 0.07, Drive = 0.5, Warmth = 0.4, Bits = 12, CrushHz = 32000, HpHz = 160, Drift = 0.3, Length = 0.4, PeakDb = -4 },
+ new() { Name = "Tom Low", Model = DrumModel.Tom, Note = 41, Freq = 104, Decay = 0.36, PitchAmt = 0.35, PitchDecay = 0.035, Tone = 0.5, Body = 0.5, Noise = 0.3, NoiseDecay = 0.05, Drive = 0.3, Warmth = 0.5, Bits = 12, CrushHz = 32000, Room = 0.18, Width = 0.6, Drift = 0.3, Length = 0.8, PeakDb = -5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 1500, Decay = 0.035, Tone = 0.7, Body = 0.5, Click = 0.5, Drive = 0.25, Warmth = 0.35, Bits = 12, CrushHz = 32000, Drift = 0.5, Length = 0.2, PeakDb = -10 },
+ new() { Name = "Tom Mid", Model = DrumModel.Tom, Note = 43, Freq = 140, Decay = 0.3, PitchAmt = 0.35, PitchDecay = 0.032, Tone = 0.5, Body = 0.5, Noise = 0.3, NoiseDecay = 0.05, Drive = 0.3, Warmth = 0.5, Bits = 12, CrushHz = 32000, Room = 0.18, Width = 0.6, Drift = 0.3, Length = 0.7, PeakDb = -5 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 1450, Decay = 0.025, Tone = 0.65, Body = 0.45, Click = 0.45, Drive = 0.22, Warmth = 0.35, Bits = 12, CrushHz = 32000, Drift = 0.5, Length = 0.15, PeakDb = -13 },
+ new() { Name = "Tom Hi", Model = DrumModel.Tom, Note = 45, Freq = 186, Decay = 0.26, PitchAmt = 0.35, PitchDecay = 0.03, Tone = 0.5, Body = 0.5, Noise = 0.3, NoiseDecay = 0.05, Drive = 0.3, Warmth = 0.5, Bits = 12, CrushHz = 32000, Room = 0.18, Width = 0.6, Drift = 0.3, Length = 0.6, PeakDb = -5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 1500, Decay = 0.28, Tone = 0.72, Body = 0.5, Click = 0.45, Drive = 0.25, Warmth = 0.35, Bits = 12, CrushHz = 32000, Drift = 0.5, Length = 0.7, PeakDb = -9 },
+ new() { Name = "Rim", Model = DrumModel.Rim, Note = 47, Freq = 560, Decay = 0.035, Tone = 0.65, Body = 0.5, Drive = 0.35, Warmth = 0.45, Bits = 12, CrushHz = 32000, HpHz = 300, Drift = 0.3, Length = 0.2, PeakDb = -9 },
+ new() { Name = "Shaker", Model = DrumModel.Shaker, Note = 48, Freq = 5800,Decay = 0.07, Tone = 0.55, Body = 0.85, Click = 0.6, Drive = 0.15, Warmth = 0.4, Bits = 12, CrushHz = 32000, Drift = 0.6, Length = 0.25, PeakDb = -12 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 330, Decay = 1.6, Tone = 0.55, Body = 0.55, Noise = 0.5, Drive = 0.25, Warmth = 0.35, Bits = 12, CrushHz = 32000, Drift = 0.4, Length = 2.2, PeakDb = -8 },
+ new() { Name = "Snare Flam", Model = DrumModel.SnareAcoustic,Note = 50, Freq = 262, Decay = 0.2, Tone = 0.7, Body = 0.5, Noise = 0.9, NoiseDecay = 0.1, Click = 0.8, Drive = 0.4, Warmth = 0.45, Bits = 12, CrushHz = 32000, Room = 0.18, Width = 0.7, Drift = 0.4, Length = 0.5, PeakDb = -5 },
+ new() { Name = "Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 440, Decay = 0.9, Tone = 0.8, Body = 0.4, Noise = 0.25, Drive = 0.15, Warmth = 0.3, Bits = 12, CrushHz = 32000, Drift = 0.4, Length = 1.3, PeakDb = -11 },
+ },
+ };
+
+ // ======================================================================
+ // 13. Bunker — warehouse techno. A driven kick with a rumble pad beside it
+ // (a low, dark, reverberant kick to layer under the main one), claps
+ // and snares with a concrete room, and hats cut high enough to tick.
+ // ======================================================================
+ private static KitDefinition Bunker() => new()
+ {
+ Id = "bunker",
+ Name = "Bunker",
+ Blurb = "warehouse techno · driven kick, rumble, concrete clap",
+ Humanize = 0.02f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickAnalog, Note = 36, Freq = 48, Decay = 0.75, PitchAmt = 2.0, PitchDecay = 0.025, Tone = 0.3, Body = 0.8, Click = 0.4, Drive = 0.55, Warmth = 0.55, HpHz = 28, Drift = 0.15, Length = 1.2, PeakDb = -1.5 },
+ new() { Name = "Rumble", Model = DrumModel.KickAnalog, Note = 37, Freq = 44, Decay = 1.6, PitchAmt = 0.6, PitchDecay = 0.05, Tone = 0.1, Body = 0.95, Click = 0.05, Drive = 0.5, Warmth = 0.7, LpHz = 900, Room = 0.45, RoomSize = 0.8, RoomDecay = 0.6, RoomDamp = 0.85, Width = 0.6, Drift = 0.2, Length = 2.6, PeakDb = -4 },
+ new() { Name = "Snare", Model = DrumModel.SnarePunch, Note = 38, Freq = 185, Decay = 0.22, Tone = 0.5, Body = 0.5, Noise = 0.9, NoiseDecay = 0.12, Drive = 0.55, Warmth = 0.45, Room = 0.25, RoomSize = 0.6, RoomDecay = 0.3, RoomDamp = 0.6, Width = 0.7, Drift = 0.2, Length = 0.9, PeakDb = -3 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1050,Decay = 0.3, Tone = 0.55, Body = 0.7, Drive = 0.6, Warmth = 0.45, Room = 0.35, RoomSize = 0.7, RoomDecay = 0.45, RoomDamp = 0.5, Width = 0.85, Drift = 0.5, Length = 1.3, PeakDb = -4 },
+ new() { Name = "Snare Noise",Model = DrumModel.SnarePunch, Note = 40, Freq = 240, Decay = 0.12, Tone = 0.85, Body = 0.2, Noise = 1.0, NoiseDecay = 0.08, Drive = 0.5, Warmth = 0.35, HpHz = 400, Drift = 0.2, Length = 0.4, PeakDb = -6 },
+ new() { Name = "Tom Low", Model = DrumModel.Tom, Note = 41, Freq = 82, Decay = 0.45, PitchAmt = 0.9, PitchDecay = 0.03, Tone = 0.3, Body = 0.35, Noise = 0.08, NoiseDecay = 0.03, Drive = 0.45, Warmth = 0.5, Drift = 0.2, Length = 0.9, PeakDb = -5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatMetal, Note = 42, Choke = 1, Freq = 360, Decay = 0.04, Tone = 0.55, Body = 0.7, Noise = 0.45, Drive = 0.35, Warmth = 0.25, HpHz = 5000, Drift = 0.3, Length = 0.25, PeakDb = -10 },
+ new() { Name = "Tom Mid", Model = DrumModel.Tom, Note = 43, Freq = 116, Decay = 0.38, PitchAmt = 0.9, PitchDecay = 0.028, Tone = 0.3, Body = 0.35, Noise = 0.08, NoiseDecay = 0.03, Drive = 0.45, Warmth = 0.5, Drift = 0.2, Length = 0.8, PeakDb = -5 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatMetal, Note = 44, Choke = 1, Freq = 360, Decay = 0.025, Tone = 0.5, Body = 0.65, Noise = 0.4, Drive = 0.3, Warmth = 0.25, HpHz = 5000, Drift = 0.3, Length = 0.18, PeakDb = -13 },
+ new() { Name = "Tom Hi", Model = DrumModel.Tom, Note = 45, Freq = 158, Decay = 0.32, PitchAmt = 0.9, PitchDecay = 0.025, Tone = 0.3, Body = 0.35, Noise = 0.08, NoiseDecay = 0.03, Drive = 0.45, Warmth = 0.5, Drift = 0.2, Length = 0.7, PeakDb = -5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatMetal, Note = 46, Choke = 1, Freq = 360, Decay = 0.36, Tone = 0.6, Body = 0.75, Noise = 0.5, Drive = 0.35, Warmth = 0.25, HpHz = 4000, Drift = 0.3, Length = 0.9, PeakDb = -9 },
+ new() { Name = "Rim Echo", Model = DrumModel.Rim, Note = 47, Freq = 620, Decay = 0.035, Tone = 0.7, Body = 0.55, Drive = 0.5, Warmth = 0.35, HpHz = 350, Room = 0.3, RoomSize = 0.7, RoomDecay = 0.4, Width = 0.8, Drift = 0.3, Length = 0.8, PeakDb = -8 },
+ new() { Name = "Metal Hit", Model = DrumModel.PercMetal, Note = 48, Freq = 410, Decay = 0.4, Tone = 0.62, Body = 0.7, Drive = 0.45, Warmth = 0.35, HpHz = 300, Room = 0.2, Width = 0.7, Drift = 0.3, Length = 0.9, PeakDb = -9 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 330, Decay = 2.0, Tone = 0.45, Body = 0.65, Noise = 0.6, Drive = 0.4, Warmth = 0.3, HpHz = 600, Drift = 0.3, Length = 2.6, PeakDb = -8 },
+ new() { Name = "Blip Low", Model = DrumModel.Zap, Note = 50, Freq = 95, Decay = 0.18, PitchAmt = 6, PitchDecay = 0.03, Tone = 0.5, Body = 0.6, Drive = 0.55, Warmth = 0.4, Length = 0.45, PeakDb = -6 },
+ new() { Name = "Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 470, Decay = 0.8, Tone = 0.85, Body = 0.45, Noise = 0.3, Drive = 0.25, Warmth = 0.25, HpHz = 800, Drift = 0.3, Length = 1.2, PeakDb = -11 },
+ },
+ };
+
+ // ======================================================================
+ // 14. Pixel — minimal and micro-house: everything short, small and dry.
+ // Clicks instead of rims, three tuned blips instead of toms, and a
+ // few glassy ticks panned out wide for the offbeats.
+ // ======================================================================
+ private static KitDefinition Pixel() => new()
+ {
+ Id = "pixel",
+ Name = "Pixel",
+ Blurb = "minimal & micro-house · short clicks, blips and ticks",
+ Swing = 0.08f,
+ Humanize = 0.03f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickPunch, Note = 36, Freq = 60, Decay = 0.22, PitchAmt = 2.4, PitchDecay = 0.008, Tone = 0.7, Body = 0.3, Click = 0.75, Drive = 0.2, Warmth = 0.4, HpHz = 32, Length = 0.45, PeakDb = -1.5 },
+ new() { Name = "Click", Model = DrumModel.Block, Note = 37, Freq = 3200,Decay = 0.012, Tone = 0.6, Body = 0.3, Drive = 0.1, Warmth = 0.3, HpHz = 800, Length = 0.08, PeakDb = -10 },
+ new() { Name = "Snare", Model = DrumModel.SnarePunch, Note = 38, Freq = 230, Decay = 0.12, Tone = 0.72, Body = 0.3, Noise = 0.9, NoiseDecay = 0.06, Drive = 0.2, Warmth = 0.35, HpHz = 180, Length = 0.3, PeakDb = -3 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1400,Decay = 0.12, Tone = 0.72, Body = 0.3, Drive = 0.15, Warmth = 0.35, HpHz = 400, Room = 0.2, RoomSize = 0.3, RoomDecay = 0.1, Width = 0.9, Drift = 0.4, Length = 0.4, PeakDb = -5 },
+ new() { Name = "Tick Snare", Model = DrumModel.Rim, Note = 40, Freq = 820, Decay = 0.025, Tone = 0.8, Body = 0.6, Drive = 0.2, Warmth = 0.3, HpHz = 500, Length = 0.15, PeakDb = -7 },
+ new() { Name = "Blip Low", Model = DrumModel.Zap, Note = 41, Freq = 160, Decay = 0.06, PitchAmt = 3, PitchDecay = 0.01, Tone = 0.3, Body = 0.4, Drive = 0.1, Warmth = 0.35, Length = 0.2, PeakDb = -6 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 2000, Decay = 0.02, Tone = 0.75, Body = 0.4, Click = 0.5, Drive = 0.1, Warmth = 0.25, HpHz = 6000, Length = 0.12, PeakDb = -11 },
+ new() { Name = "Blip Mid", Model = DrumModel.Zap, Note = 43, Freq = 260, Decay = 0.05, PitchAmt = 3, PitchDecay = 0.008, Tone = 0.3, Body = 0.4, Drive = 0.1, Warmth = 0.35, Length = 0.18, PeakDb = -7 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 1900, Decay = 0.014, Tone = 0.7, Body = 0.4, Click = 0.45, Drive = 0.1, Warmth = 0.25, HpHz = 6000, Length = 0.1, PeakDb = -14 },
+ new() { Name = "Blip Hi", Model = DrumModel.Zap, Note = 45, Freq = 420, Decay = 0.04, PitchAmt = 3, PitchDecay = 0.006, Tone = 0.3, Body = 0.4, Drive = 0.1, Warmth = 0.35, Length = 0.15, PeakDb = -8 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 2000, Decay = 0.16, Tone = 0.78, Body = 0.45, Click = 0.4, Drive = 0.1, Warmth = 0.25, HpHz = 5000, Length = 0.4, PeakDb = -10 },
+ new() { Name = "Wood", Model = DrumModel.Block, Note = 47, Freq = 1900,Decay = 0.03, Tone = 0.5, Body = 0.4, Drive = 0.1, Warmth = 0.4, Room = 0.2, RoomSize = 0.3, Width = 0.9, Pan = -0.4f, Drift = 0.4, Length = 0.3, PeakDb = -9 },
+ new() { Name = "Glass Tick", Model = DrumModel.PercMetal, Note = 48, Freq = 1850,Decay = 0.12, Tone = 0.75, Body = 0.5, Drive = 0.08, Warmth = 0.3, HpHz = 600, Pan = 0.4f, Drift = 0.4, Length = 0.35, PeakDb = -11 },
+ new() { Name = "Noise Burst",Model = DrumModel.Cymbal, Note = 49, Freq = 400, Decay = 0.6, Tone = 0.6, Body = 0.4, Noise = 0.7, Drive = 0.1, Warmth = 0.25, HpHz = 2000, Length = 0.9, PeakDb = -10 },
+ new() { Name = "Dot Bell", Model = DrumModel.PercMetal, Note = 50, Freq = 880, Decay = 0.35, Tone = 0.6, Body = 0.55, Drive = 0.08, Warmth = 0.3, HpHz = 400, Room = 0.25, RoomSize = 0.4, Width = 0.9, Drift = 0.3, Length = 0.9, PeakDb = -10 },
+ new() { Name = "Ping", Model = DrumModel.Cymbal, Note = 51, Freq = 560, Decay = 0.5, Tone = 0.9, Body = 0.35, Noise = 0.15, Drive = 0.05, Warmth = 0.25, HpHz = 1200, Length = 0.8, PeakDb = -12 },
+ },
+ };
+
+ // ======================================================================
+ // 15. Velvet — a jazz kit played with brushes. The snare is all wire and
+ // sweep, the kick is felt rather than heard, and the ride carries the
+ // time. Heavily swung out of the box.
+ // ======================================================================
+ private static KitDefinition Velvet() => new()
+ {
+ Id = "velvet",
+ Name = "Velvet",
+ Blurb = "jazz brushes · sweeps and taps, soft kick, singing ride",
+ Swing = 0.33f,
+ Humanize = 0.18f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickAcoustic, Note = 36, Freq = 60, Decay = 0.4, PitchAmt = 0.4, PitchDecay = 0.03, Tone = 0.3, Body = 0.7, Click = 0.2, Drive = 0.1, Warmth = 0.65, LpHz = 7000, Room = 0.25, RoomSize = 0.45, RoomDecay = 0.25, RoomDamp = 0.6, Width = 0.6, Drift = 0.25, Length = 1.2, PeakDb = -3 },
+ new() { Name = "Cross Stick",Model = DrumModel.Rim, Note = 37, Freq = 480, Decay = 0.06, Tone = 0.45, Body = 0.55, Drive = 0.1, Warmth = 0.55, HpHz = 220, Room = 0.25, RoomSize = 0.45, Width = 0.7, Drift = 0.3, Length = 0.6, PeakDb = -8 },
+ new() { Name = "Brush Snare",Model = DrumModel.SnareAcoustic,Note = 38, Freq = 200, Decay = 0.3, Tone = 0.3, Body = 0.35, Noise = 0.95, NoiseDecay = 0.28, Click = 0.1, Drive = 0.08, Warmth = 0.6, LpHz = 9000, Room = 0.3, RoomSize = 0.45, RoomDecay = 0.25, Width = 0.7, Drift = 0.4, Length = 1.0, PeakDb = -4 },
+ new() { Name = "Brush Sweep",Model = DrumModel.Shaker, Note = 39, Freq = 3800,Decay = 0.22, Tone = 0.35, Body = 0.6, Click = 0.1, Drive = 0.05, Warmth = 0.5, LpHz = 8000, Room = 0.3, RoomSize = 0.45, Width = 0.8, Drift = 0.6, Length = 0.9, PeakDb = -9 },
+ new() { Name = "Brush Slap", Model = DrumModel.SnareAcoustic,Note = 40, Freq = 220, Decay = 0.2, Tone = 0.4, Body = 0.45, Noise = 0.9, NoiseDecay = 0.12, Click = 0.35, Drive = 0.1, Warmth = 0.55, LpHz = 10000, Room = 0.3, RoomSize = 0.45, Width = 0.7, Drift = 0.35, Length = 0.8, PeakDb = -5 },
+ new() { Name = "Floor Tom", Model = DrumModel.Tom, Note = 41, Freq = 82, Decay = 0.8, PitchAmt = 0.15, PitchDecay = 0.06, Tone = 0.3, Body = 0.65, Noise = 0.4, NoiseDecay = 0.1, Drive = 0.08, Warmth = 0.6, LpHz = 6000, Room = 0.3, RoomSize = 0.45, Width = 0.7, Pan = -0.25f, Drift = 0.3, Length = 1.8, PeakDb = -6 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 1150, Decay = 0.06, Tone = 0.5, Body = 0.55, Click = 0.25, Drive = 0.05, Warmth = 0.45, Room = 0.2, RoomSize = 0.45, Width = 0.6, Pan = 0.25f, Drift = 0.5, Length = 0.5, PeakDb = -11 },
+ new() { Name = "Rack Tom", Model = DrumModel.Tom, Note = 43, Freq = 124, Decay = 0.6, PitchAmt = 0.15, PitchDecay = 0.05, Tone = 0.32, Body = 0.65, Noise = 0.4, NoiseDecay = 0.1, Drive = 0.08, Warmth = 0.6, LpHz = 6500, Room = 0.3, RoomSize = 0.45, Width = 0.7, Pan = 0.1f, Drift = 0.3, Length = 1.5, PeakDb = -6 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 1100, Decay = 0.04, Tone = 0.45, Body = 0.5, Click = 0.2, Drive = 0.05, Warmth = 0.45, Room = 0.18, RoomSize = 0.45, Width = 0.6, Pan = 0.25f, Drift = 0.5, Length = 0.4, PeakDb = -13 },
+ new() { Name = "Tom Hi", Model = DrumModel.Tom, Note = 45, Freq = 168, Decay = 0.5, PitchAmt = 0.15, PitchDecay = 0.045, Tone = 0.34, Body = 0.65, Noise = 0.4, NoiseDecay = 0.1, Drive = 0.08, Warmth = 0.6, LpHz = 7000, Room = 0.3, RoomSize = 0.45, Width = 0.7, Pan = 0.2f, Drift = 0.3, Length = 1.3, PeakDb = -6 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 1150, Decay = 0.4, Tone = 0.55, Body = 0.55, Click = 0.2, Drive = 0.05, Warmth = 0.45, Room = 0.22, RoomSize = 0.45, Width = 0.6, Pan = 0.25f, Drift = 0.5, Length = 1.1, PeakDb = -10 },
+ new() { Name = "Brush Tap", Model = DrumModel.SnareAcoustic,Note = 47, Freq = 205, Decay = 0.1, Tone = 0.3, Body = 0.3, Noise = 0.9, NoiseDecay = 0.06, Click = 0.15, Drive = 0.05, Warmth = 0.6, LpHz = 9000, Room = 0.25, RoomSize = 0.45, Width = 0.7, Drift = 0.5, Length = 0.5, PeakDb = -10 },
+ new() { Name = "Ride Bell", Model = DrumModel.PercMetal, Note = 48, Freq = 700, Decay = 0.9, Tone = 0.62, Body = 0.55, Drive = 0.05, Warmth = 0.35, HpHz = 300, Room = 0.25, RoomSize = 0.45, Width = 0.7, Pan = 0.35f, Drift = 0.3, Length = 1.6, PeakDb = -11 },
+ new() { Name = "Sizzle", Model = DrumModel.Cymbal, Note = 49, Freq = 300, Decay = 3.2, Tone = 0.62, Body = 0.5, Noise = 0.6, Drive = 0.05, Warmth = 0.35, Room = 0.28, RoomSize = 0.5, Width = 0.85, Pan = -0.35f, Drift = 0.4, Length = 4.0, PeakDb = -9 },
+ new() { Name = "Splash", Model = DrumModel.Cymbal, Note = 50, Freq = 520, Decay = 0.8, Tone = 0.6, Body = 0.45, Noise = 0.5, Drive = 0.05, Warmth = 0.35, Room = 0.25, RoomSize = 0.45, Width = 0.8, Pan = -0.2f, Drift = 0.4, Length = 1.3, PeakDb = -10 },
+ new() { Name = "Jazz Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 380, Decay = 2.4, Tone = 0.85, Body = 0.45, Noise = 0.3, Drive = 0.05, Warmth = 0.35, Room = 0.25, RoomSize = 0.5, Width = 0.8, Pan = 0.35f, Drift = 0.4, Length = 3.2, PeakDb = -9 },
+ },
+ };
+
+ // ======================================================================
+ // 16. Circuit — the thin, snappy analog box of early electro: a short
+ // round kick, a snare that is mostly noise, toms that are nearly
+ // sine, and a laser for the breaks.
+ // ======================================================================
+ private static KitDefinition Circuit() => new()
+ {
+ Id = "circuit",
+ Name = "Circuit",
+ Blurb = "electro box · snappy snare, sine toms, laser and clave",
+ Humanize = 0.03f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickAnalog, Note = 36, Freq = 58, Decay = 0.4, PitchAmt = 1.6, PitchDecay = 0.018, Tone = 0.3, Body = 0.5, Click = 0.35, Drive = 0.3, Warmth = 0.5, Drift = 0.35, Length = 0.8, PeakDb = -1.5 },
+ new() { Name = "Rim", Model = DrumModel.Rim, Note = 37, Freq = 610, Decay = 0.035, Tone = 0.65, Body = 0.5, Drive = 0.3, Warmth = 0.45, HpHz = 300, Drift = 0.35, Length = 0.2, PeakDb = -9 },
+ new() { Name = "Snare", Model = DrumModel.SnareAnalog,Note = 38, Freq = 260, Decay = 0.16, Tone = 0.72, Body = 0.35, Noise = 0.95, NoiseDecay = 0.08, Click = 0.45, Drive = 0.3, Warmth = 0.45, HpHz = 150, Drift = 0.35, Length = 0.4, PeakDb = -2.5 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1300,Decay = 0.16, Tone = 0.65, Body = 0.45, Drive = 0.25, Warmth = 0.45, Drift = 0.5, Length = 0.5, PeakDb = -4 },
+ new() { Name = "Snare Snap", Model = DrumModel.SnareAnalog,Note = 40, Freq = 330, Decay = 0.1, Tone = 0.85, Body = 0.25, Noise = 1.0, NoiseDecay = 0.05, Click = 0.55, Drive = 0.3, Warmth = 0.4, HpHz = 200, Drift = 0.35, Length = 0.3, PeakDb = -4 },
+ new() { Name = "Tom Low", Model = DrumModel.Tom, Note = 41, Freq = 110, Decay = 0.3, PitchAmt = 0.7, PitchDecay = 0.025, Tone = 0.3, Body = 0.2, Noise = 0.05, NoiseDecay = 0.02, Drive = 0.3, Warmth = 0.5, Drift = 0.35, Length = 0.6, PeakDb = -5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatMetal, Note = 42, Choke = 1, Freq = 470, Decay = 0.025, Tone = 0.3, Body = 0.8, Noise = 0.15, Drive = 0.25, Warmth = 0.3, HpHz = 6000, Drift = 0.35, Length = 0.15, PeakDb = -10 },
+ new() { Name = "Tom Mid", Model = DrumModel.Tom, Note = 43, Freq = 150, Decay = 0.26, PitchAmt = 0.7, PitchDecay = 0.022, Tone = 0.3, Body = 0.2, Noise = 0.05, NoiseDecay = 0.02, Drive = 0.3, Warmth = 0.5, Drift = 0.35, Length = 0.55, PeakDb = -5 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatMetal, Note = 44, Choke = 1, Freq = 470, Decay = 0.018, Tone = 0.28, Body = 0.75, Noise = 0.12, Drive = 0.22, Warmth = 0.3, HpHz = 6000, Drift = 0.35, Length = 0.12, PeakDb = -13 },
+ new() { Name = "Tom Hi", Model = DrumModel.Tom, Note = 45, Freq = 205, Decay = 0.22, PitchAmt = 0.7, PitchDecay = 0.02, Tone = 0.3, Body = 0.2, Noise = 0.05, NoiseDecay = 0.02, Drive = 0.3, Warmth = 0.5, Drift = 0.35, Length = 0.5, PeakDb = -5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatMetal, Note = 46, Choke = 1, Freq = 470, Decay = 0.22, Tone = 0.35, Body = 0.8, Noise = 0.2, Drive = 0.25, Warmth = 0.3, HpHz = 5000, Drift = 0.35, Length = 0.6, PeakDb = -9 },
+ new() { Name = "Laser", Model = DrumModel.Zap, Note = 47, Freq = 140, Decay = 0.09, PitchAmt = 8, PitchDecay = 0.012, Tone = 0.2, Body = 0.5, Drive = 0.3, Warmth = 0.4, Length = 0.3, PeakDb = -7 },
+ new() { Name = "Cowbell", Model = DrumModel.Cowbell, Note = 48, Freq = 590, Decay = 0.24, Tone = 0.5, Body = 0.45, Click = 0.3, Drive = 0.28, Warmth = 0.45, Drift = 0.35, Length = 0.5, PeakDb = -9 },
+ new() { Name = "Cymbal", Model = DrumModel.Cymbal, Note = 49, Freq = 360, Decay = 1.2, Tone = 0.5, Body = 0.6, Noise = 0.5, Drive = 0.2, Warmth = 0.3, HpHz = 1500, Drift = 0.35, Length = 1.8, PeakDb = -9 },
+ new() { Name = "Clave", Model = DrumModel.Block, Note = 50, Freq = 2500,Decay = 0.045, Tone = 0.35, Body = 0.4, Drive = 0.2, Warmth = 0.45, Drift = 0.35, Length = 0.25, PeakDb = -9 },
+ new() { Name = "Metal Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 520, Decay = 0.7, Tone = 0.3, Body = 0.85, Noise = 0.1, Drive = 0.2, Warmth = 0.3, HpHz = 1500, Drift = 0.35, Length = 1.1, PeakDb = -11 },
+ },
+ };
+
+ // ======================================================================
+ // 17. Yard — dub and roots reggae. A warm, dark kick; rimshot and snare
+ // thrown into a long spring-ish room; toms that drop like a syndrum;
+ // an open and a muted conga that cut each other; and a dub siren.
+ // ======================================================================
+ private static KitDefinition Yard() => new()
+ {
+ Id = "yard",
+ Name = "Yard",
+ Blurb = "dub & reggae · rimshot in a long room, dropping toms, siren",
+ Swing = 0.1f,
+ Humanize = 0.12f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickAcoustic, Note = 36, Freq = 50, Decay = 0.6, PitchAmt = 0.5, PitchDecay = 0.03, Tone = 0.25, Body = 0.8, Click = 0.3, Drive = 0.3, Warmth = 0.75, LpHz = 4500, Room = 0.18, RoomSize = 0.4, RoomDamp = 0.8, Width = 0.5, Drift = 0.25, Length = 1.4, PeakDb = -1.5 },
+ new() { Name = "Rimshot", Model = DrumModel.Rim, Note = 37, Freq = 540, Decay = 0.06, Tone = 0.6, Body = 0.6, Drive = 0.3, Warmth = 0.6, HpHz = 250, Room = 0.45, RoomSize = 0.75, RoomDecay = 0.6, RoomDamp = 0.45, Width = 0.9, Drift = 0.3, Length = 1.8, PeakDb = -5 },
+ new() { Name = "Snare", Model = DrumModel.SnareAcoustic,Note = 38, Freq = 225, Decay = 0.26, Tone = 0.6, Body = 0.65, Noise = 0.7, NoiseDecay = 0.12, Click = 0.6, Drive = 0.35, Warmth = 0.65, Room = 0.4, RoomSize = 0.75, RoomDecay = 0.55, RoomDamp = 0.45, Width = 0.9, Drift = 0.3, Length = 1.8, PeakDb = -2.5 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1000,Decay = 0.2, Tone = 0.45, Body = 0.55, Drive = 0.25, Warmth = 0.6, Room = 0.4, RoomSize = 0.75, RoomDecay = 0.55, Width = 0.9, Drift = 0.5, Length = 1.5, PeakDb = -5 },
+ new() { Name = "Snare Dub", Model = DrumModel.SnareAcoustic,Note = 40, Freq = 250, Decay = 0.2, Tone = 0.65, Body = 0.6, Noise = 0.8, NoiseDecay = 0.1, Click = 0.7, Drive = 0.4, Warmth = 0.6, HpHz = 200, Room = 0.6, RoomSize = 0.85, RoomDecay = 0.8, RoomDamp = 0.35, Width = 1.0, Drift = 0.3, Length = 3.0, PeakDb = -4 },
+ new() { Name = "Tom Low", Model = DrumModel.Tom, Note = 41, Freq = 90, Decay = 0.5, PitchAmt = 1.0, PitchDecay = 0.05, Tone = 0.35, Body = 0.6, Noise = 0.2, NoiseDecay = 0.05, Drive = 0.3, Warmth = 0.65, Room = 0.35, RoomSize = 0.7, RoomDecay = 0.5, Width = 0.85, Pan = -0.3f, Drift = 0.3, Length = 1.6, PeakDb = -5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 950, Decay = 0.05, Tone = 0.45, Body = 0.55, Click = 0.35, Drive = 0.2, Warmth = 0.55, LpHz = 9000, Drift = 0.5, Length = 0.3, PeakDb = -11 },
+ new() { Name = "Tom Mid", Model = DrumModel.Tom, Note = 43, Freq = 128, Decay = 0.44, PitchAmt = 1.0, PitchDecay = 0.045, Tone = 0.35, Body = 0.6, Noise = 0.2, NoiseDecay = 0.05, Drive = 0.3, Warmth = 0.65, Room = 0.35, RoomSize = 0.7, RoomDecay = 0.5, Width = 0.85, Drift = 0.3, Length = 1.5, PeakDb = -5 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 900, Decay = 0.03, Tone = 0.4, Body = 0.5, Click = 0.3, Drive = 0.2, Warmth = 0.55, LpHz = 8500, Drift = 0.5, Length = 0.2, PeakDb = -14 },
+ new() { Name = "Tom Hi", Model = DrumModel.Tom, Note = 45, Freq = 172, Decay = 0.38, PitchAmt = 1.0, PitchDecay = 0.04, Tone = 0.35, Body = 0.6, Noise = 0.2, NoiseDecay = 0.05, Drive = 0.3, Warmth = 0.65, Room = 0.35, RoomSize = 0.7, RoomDecay = 0.5, Width = 0.85, Pan = 0.3f, Drift = 0.3, Length = 1.4, PeakDb = -5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 950, Decay = 0.34, Tone = 0.5, Body = 0.55, Click = 0.3, Drive = 0.2, Warmth = 0.55, LpHz = 9000, Drift = 0.5, Length = 0.9, PeakDb = -10 },
+ new() { Name = "Conga Open", Model = DrumModel.Conga, Note = 47, Choke = 2, Freq = 250, Decay = 0.34, Tone = 0.4, Body = 0.5, Click = 0.35, Drive = 0.2, Warmth = 0.6, Room = 0.25, RoomSize = 0.6, Width = 0.8, Pan = -0.25f, Drift = 0.3, Length = 0.9, PeakDb = -5 },
+ new() { Name = "Conga Mute", Model = DrumModel.Conga, Note = 48, Choke = 2, Freq = 260, Decay = 0.08, Tone = 0.55, Body = 0.25, Click = 0.55, Drive = 0.2, Warmth = 0.6, Room = 0.2, RoomSize = 0.6, Width = 0.8, Pan = -0.25f, Drift = 0.3, Length = 0.3, PeakDb = -7 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 290, Decay = 2.4, Tone = 0.45, Body = 0.6, Noise = 0.5, Drive = 0.15, Warmth = 0.5, LpHz = 11000, Room = 0.3, RoomSize = 0.75, Width = 0.9, Drift = 0.4, Length = 3.2, PeakDb = -8 },
+ new() { Name = "Dub Siren", Model = DrumModel.Zap, Note = 50, Freq = 220, Decay = 0.45, PitchAmt = 4, PitchDecay = 0.12, Tone = 0.6, Body = 0.7, Drive = 0.3, Warmth = 0.5, Room = 0.5, RoomSize = 0.85, RoomDecay = 0.8, Width = 1.0, Length = 2.4, PeakDb = -7 },
+ new() { Name = "Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 400, Decay = 1.2, Tone = 0.75, Body = 0.45, Noise = 0.3, Drive = 0.12, Warmth = 0.5, LpHz = 11000, Room = 0.2, RoomSize = 0.6, Width = 0.8, Drift = 0.4, Length = 1.8, PeakDb = -11 },
+ },
+ };
+
+ // ======================================================================
+ // 18. Byte — a game console's sound chip: everything through a 5-bit,
+ // 11 kHz crusher, noise-channel hats, pitch-drop toms, a coin, a
+ // laser and a square bass to play the riff on.
+ // ======================================================================
+ private static KitDefinition Byte() => new()
+ {
+ Id = "byte",
+ Name = "Byte",
+ Blurb = "8-bit chip · crushed noise hats, pitch drops, coin, square bass",
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickPunch, Note = 36, Freq = 70, Decay = 0.18, PitchAmt = 5, PitchDecay = 0.012, Tone = 0.6, Body = 0.3, Click = 0.5, Drive = 0.6, Warmth = 0.2, Bits = 5, CrushHz = 11025, HpHz = 30, Length = 0.35, PeakDb = -2 },
+ new() { Name = "Blip", Model = DrumModel.Zap, Note = 37, Freq = 520, Decay = 0.05, PitchAmt = 1, PitchDecay = 0.01, Tone = 0.2, Body = 0.4, Drive = 0.5, Warmth = 0.2, Bits = 5, CrushHz = 11025, Length = 0.12, PeakDb = -8 },
+ new() { Name = "Snare", Model = DrumModel.SnarePunch, Note = 38, Freq = 240, Decay = 0.14, Tone = 0.6, Body = 0.3, Noise = 1.0, NoiseDecay = 0.1, Drive = 0.5, Warmth = 0.2, Bits = 5, CrushHz = 11025, Length = 0.3, PeakDb = -3 },
+ new() { Name = "Noise Clap", Model = DrumModel.Clap, Note = 39, Freq = 1200,Decay = 0.12, Tone = 0.6, Body = 0.35, Drive = 0.4, Warmth = 0.2, Bits = 5, CrushHz = 11025, Length = 0.3, PeakDb = -5 },
+ new() { Name = "Snare Hi", Model = DrumModel.SnarePunch, Note = 40, Freq = 360, Decay = 0.08, Tone = 0.8, Body = 0.2, Noise = 1.0, NoiseDecay = 0.05, Drive = 0.5, Warmth = 0.2, Bits = 5, CrushHz = 11025, Length = 0.2, PeakDb = -5 },
+ new() { Name = "Drop Low", Model = DrumModel.Tom, Note = 41, Freq = 110, Decay = 0.25, PitchAmt = 1.5, PitchDecay = 0.05, Tone = 0.2, Body = 0.2, Drive = 0.5, Warmth = 0.2, Bits = 5, CrushHz = 11025, Length = 0.4, PeakDb = -5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 3000, Decay = 0.02, Tone = 0.8, Body = 0.3, Click = 0.5, Drive = 0.3, Warmth = 0.1, Bits = 5, CrushHz = 11025, Length = 0.1, PeakDb = -11 },
+ new() { Name = "Drop Mid", Model = DrumModel.Tom, Note = 43, Freq = 160, Decay = 0.2, PitchAmt = 1.5, PitchDecay = 0.045, Tone = 0.2, Body = 0.2, Drive = 0.5, Warmth = 0.2, Bits = 5, CrushHz = 11025, Length = 0.35, PeakDb = -5 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 2800, Decay = 0.012, Tone = 0.75, Body = 0.3, Click = 0.45, Drive = 0.3, Warmth = 0.1, Bits = 5, CrushHz = 11025, Length = 0.08, PeakDb = -14 },
+ new() { Name = "Drop Hi", Model = DrumModel.Tom, Note = 45, Freq = 230, Decay = 0.16, PitchAmt = 1.5, PitchDecay = 0.04, Tone = 0.2, Body = 0.2, Drive = 0.5, Warmth = 0.2, Bits = 5, CrushHz = 11025, Length = 0.3, PeakDb = -5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 3000, Decay = 0.14, Tone = 0.8, Body = 0.3, Click = 0.4, Drive = 0.3, Warmth = 0.1, Bits = 5, CrushHz = 11025, Length = 0.35, PeakDb = -10 },
+ new() { Name = "Coin", Model = DrumModel.PercMetal, Note = 47, Freq = 1320,Decay = 0.25, Tone = 0.5, Body = 0.3, Drive = 0.4, Warmth = 0.15, Bits = 5, CrushHz = 11025, HpHz = 500, Length = 0.4, PeakDb = -9 },
+ new() { Name = "Laser", Model = DrumModel.Zap, Note = 48, Freq = 110, Decay = 0.25, PitchAmt = 9, PitchDecay = 0.06, Tone = 0.4, Body = 0.5, Drive = 0.5, Warmth = 0.2, Bits = 5, CrushHz = 11025, Length = 0.5, PeakDb = -7 },
+ new() { Name = "Noise Crash",Model = DrumModel.Cymbal, Note = 49, Freq = 400, Decay = 0.9, Tone = 0.3, Body = 0.5, Noise = 0.8, Drive = 0.4, Warmth = 0.1, Bits = 5, CrushHz = 11025, Length = 1.2, PeakDb = -9 },
+ new() { Name = "Square Bass",Model = DrumModel.SubHit, Note = 50, Freq = 55, Decay = 0.6, PitchAmt = 0.3, PitchDecay = 0.02, Tone = 0.7, Drive = 0.6, Warmth = 0.3, Bits = 5, CrushHz = 11025, Length = 0.9, PeakDb = -3 },
+ new() { Name = "Chip Bell", Model = DrumModel.Cowbell, Note = 51, Freq = 880, Decay = 0.25, Tone = 0.5, Body = 0.4, Click = 0.2, Drive = 0.3, Warmth = 0.15, Bits = 5, CrushHz = 11025, Length = 0.5, PeakDb = -10 },
+ },
+ };
+
+ // ======================================================================
+ // 19. Lagoon — amapiano and afro-house. Three log drums (the pitched,
+ // woody bass hit the style is built on), a warm roomy clap, and a
+ // short and a long shaker that cut each other.
+ // ======================================================================
+ private static KitDefinition Lagoon() => new()
+ {
+ Id = "lagoon",
+ Name = "Lagoon",
+ Blurb = "amapiano & afro-house · log drums, shakers, wood and bongo",
+ Swing = 0.12f,
+ Humanize = 0.1f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickPunch, Note = 36, Freq = 52, Decay = 0.4, PitchAmt = 2.2, PitchDecay = 0.016, Tone = 0.45, Body = 0.6, Click = 0.45, Drive = 0.25, Warmth = 0.55, Drift = 0.2, Length = 0.9, PeakDb = -1.5 },
+ new() { Name = "Log Drum", Model = DrumModel.Tom, Note = 37, Freq = 62, Decay = 0.55, PitchAmt = 1.2, PitchDecay = 0.03, Tone = 0.2, Body = 0.35, Noise = 0.05, NoiseDecay = 0.02, Drive = 0.45, Warmth = 0.65, LpHz = 3500, Drift = 0.2, Length = 1.2, PeakDb = -1.5 },
+ new() { Name = "Snare", Model = DrumModel.SnareAcoustic,Note = 38, Freq = 240, Decay = 0.18, Tone = 0.6, Body = 0.45, Noise = 0.8, NoiseDecay = 0.09, Click = 0.5, Drive = 0.25, Warmth = 0.5, Room = 0.2, RoomSize = 0.5, Width = 0.8, Drift = 0.3, Length = 0.7, PeakDb = -3 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1150,Decay = 0.22, Tone = 0.5, Body = 0.6, Drive = 0.2, Warmth = 0.5, Room = 0.3, RoomSize = 0.6, RoomDecay = 0.35, Width = 0.9, Drift = 0.5, Length = 1.1, PeakDb = -4 },
+ new() { Name = "Log Drum Hi",Model = DrumModel.Tom, Note = 40, Freq = 94, Decay = 0.45, PitchAmt = 1.0, PitchDecay = 0.028, Tone = 0.22, Body = 0.35, Noise = 0.05, NoiseDecay = 0.02, Drive = 0.45, Warmth = 0.65, LpHz = 4000, Drift = 0.2, Length = 1.0, PeakDb = -2 },
+ new() { Name = "Log Drum Low",Model = DrumModel.Tom, Note = 41, Freq = 47, Decay = 0.7, PitchAmt = 1.4, PitchDecay = 0.035, Tone = 0.18, Body = 0.35, Noise = 0.05, NoiseDecay = 0.02, Drive = 0.45, Warmth = 0.65, LpHz = 3000, Drift = 0.2, Length = 1.4, PeakDb = -1.5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 1400, Decay = 0.04, Tone = 0.62, Body = 0.5, Click = 0.4, Drive = 0.1, Warmth = 0.4, Drift = 0.5, Length = 0.25, PeakDb = -11 },
+ new() { Name = "Shaker", Model = DrumModel.Shaker, Note = 43, Choke = 2, Freq = 5600, Decay = 0.07, Tone = 0.55, Body = 0.85, Click = 0.55, Drive = 0.1, Warmth = 0.4, Pan = 0.3f, Drift = 0.6, Length = 0.25, PeakDb = -11 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 1350, Decay = 0.025, Tone = 0.58, Body = 0.45, Click = 0.35, Drive = 0.1, Warmth = 0.4, Drift = 0.5, Length = 0.18, PeakDb = -14 },
+ new() { Name = "Shaker Long",Model = DrumModel.Shaker, Note = 45, Choke = 2, Freq = 5200, Decay = 0.2, Tone = 0.5, Body = 0.8, Click = 0.3, Drive = 0.1, Warmth = 0.4, Pan = 0.3f, Drift = 0.6, Length = 0.5, PeakDb = -11 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 1400, Decay = 0.3, Tone = 0.65, Body = 0.5, Click = 0.35, Drive = 0.1, Warmth = 0.4, Drift = 0.5, Length = 0.8, PeakDb = -10 },
+ new() { Name = "Woodblock", Model = DrumModel.Block, Note = 47, Freq = 1650,Decay = 0.05, Tone = 0.45, Body = 0.5, Drive = 0.15, Warmth = 0.5, Room = 0.2, RoomSize = 0.5, Width = 0.8, Pan = -0.3f, Drift = 0.4, Length = 0.4, PeakDb = -8 },
+ new() { Name = "Bongo", Model = DrumModel.Conga, Note = 48, Freq = 420, Decay = 0.18, Tone = 0.55, Body = 0.45, Click = 0.5, Drive = 0.2, Warmth = 0.55, Room = 0.18, Width = 0.7, Pan = 0.25f, Drift = 0.35, Length = 0.5, PeakDb = -6 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 320, Decay = 1.8, Tone = 0.5, Body = 0.55, Noise = 0.5, Drive = 0.1, Warmth = 0.35, Room = 0.2, RoomSize = 0.6, Width = 0.85, Drift = 0.4, Length = 2.4, PeakDb = -9 },
+ new() { Name = "Thumb Bell", Model = DrumModel.PercMetal, Note = 50, Freq = 740, Decay = 0.6, Tone = 0.45, Body = 0.6, Drive = 0.1, Warmth = 0.4, HpHz = 250, Room = 0.25, RoomSize = 0.6, Width = 0.85, Pan = -0.2f, Drift = 0.35, Length = 1.2, PeakDb = -9 },
+ new() { Name = "Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 430, Decay = 0.9, Tone = 0.78, Body = 0.45, Noise = 0.25, Drive = 0.08, Warmth = 0.35, Room = 0.15, Width = 0.8, Drift = 0.4, Length = 1.4, PeakDb = -11 },
+ },
+ };
+
+ // ======================================================================
+ // 20. Titan — trailer percussion. Everything is big: a booming low hit,
+ // three taiko, a war snare, steel and a braam in a hall, cymbal swells
+ // and a gong. Loud on purpose; the room is the instrument.
+ // ======================================================================
+ private static KitDefinition Titan() => new()
+ {
+ Id = "titan",
+ Name = "Titan",
+ Blurb = "cinematic trailer · boom, taiko, war snare, braam, gong",
+ Humanize = 0.08f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Boom", Model = DrumModel.KickAnalog, Note = 36, Freq = 38, Decay = 2.2, PitchAmt = 1.5, PitchDecay = 0.08, Tone = 0.2, Body = 0.95, Click = 0.3, Drive = 0.45, Warmth = 0.7, Room = 0.4, RoomSize = 0.9, RoomDecay = 0.8, RoomDamp = 0.6, Width = 1.0, Drift = 0.2, Length = 4.5, PeakDb = -1 },
+ new() { Name = "Impact", Model = DrumModel.Zap, Note = 37, Freq = 58, Decay = 0.8, PitchAmt = 4, PitchDecay = 0.08, Tone = 0.7, Body = 0.8, Drive = 0.7, Warmth = 0.55, Room = 0.45, RoomSize = 0.9, RoomDecay = 0.8, Width = 1.0, Length = 3.5, PeakDb = -2 },
+ new() { Name = "War Snare", Model = DrumModel.SnareAcoustic,Note = 38, Freq = 180, Decay = 0.5, Tone = 0.55, Body = 0.7, Noise = 0.9, NoiseDecay = 0.25, Click = 0.65, Drive = 0.4, Warmth = 0.55, Room = 0.55, RoomSize = 0.9, RoomDecay = 0.75, RoomDamp = 0.4, Width = 1.0, Drift = 0.25, Length = 3.0, PeakDb = -2.5 },
+ new() { Name = "Stomp Clap", Model = DrumModel.Clap, Note = 39, Freq = 700, Decay = 0.35, Tone = 0.3, Body = 0.8, Drive = 0.3, Warmth = 0.6, Room = 0.5, RoomSize = 0.85, RoomDecay = 0.7, Width = 1.0, Drift = 0.5, Length = 2.5, PeakDb = -4 },
+ new() { Name = "Snare Crack",Model = DrumModel.SnareAcoustic,Note = 40, Freq = 220, Decay = 0.35, Tone = 0.7, Body = 0.6, Noise = 0.95, NoiseDecay = 0.18, Click = 0.85, Drive = 0.5, Warmth = 0.5, Room = 0.55, RoomSize = 0.9, RoomDecay = 0.75, Width = 1.0, Drift = 0.25, Length = 2.6, PeakDb = -3 },
+ new() { Name = "Taiko Low", Model = DrumModel.Tom, Note = 41, Freq = 58, Decay = 1.2, PitchAmt = 0.35, PitchDecay = 0.06, Tone = 0.35, Body = 0.85, Noise = 0.4, NoiseDecay = 0.08, Drive = 0.35, Warmth = 0.65, Room = 0.5, RoomSize = 0.9, RoomDecay = 0.8, Width = 1.0, Pan = -0.3f, Drift = 0.25, Length = 4.0, PeakDb = -2 },
+ new() { Name = "Ticker", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 1600, Decay = 0.05, Tone = 0.6, Body = 0.5, Click = 0.5, Drive = 0.15, Warmth = 0.4, Room = 0.4, RoomSize = 0.8, RoomDecay = 0.6, Width = 1.0, Drift = 0.4, Length = 1.4, PeakDb = -10 },
+ new() { Name = "Taiko Mid", Model = DrumModel.Tom, Note = 43, Freq = 82, Decay = 1.0, PitchAmt = 0.35, PitchDecay = 0.055, Tone = 0.38, Body = 0.85, Noise = 0.4, NoiseDecay = 0.08, Drive = 0.35, Warmth = 0.65, Room = 0.5, RoomSize = 0.9, RoomDecay = 0.8, Width = 1.0, Drift = 0.25, Length = 3.6, PeakDb = -2 },
+ new() { Name = "Ticker Soft",Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 1500, Decay = 0.035, Tone = 0.55, Body = 0.45, Click = 0.4, Drive = 0.12, Warmth = 0.4, Room = 0.35, RoomSize = 0.8, RoomDecay = 0.6, Width = 1.0, Drift = 0.4, Length = 1.2, PeakDb = -13 },
+ new() { Name = "Taiko Hi", Model = DrumModel.Tom, Note = 45, Freq = 118, Decay = 0.8, PitchAmt = 0.35, PitchDecay = 0.05, Tone = 0.4, Body = 0.85, Noise = 0.4, NoiseDecay = 0.08, Drive = 0.35, Warmth = 0.65, Room = 0.5, RoomSize = 0.9, RoomDecay = 0.8, Width = 1.0, Pan = 0.3f, Drift = 0.25, Length = 3.2, PeakDb = -2 },
+ new() { Name = "Hiss", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 1400, Decay = 0.6, Tone = 0.6, Body = 0.5, Click = 0.2, Drive = 0.12, Warmth = 0.4, Room = 0.45, RoomSize = 0.85, RoomDecay = 0.7, Width = 1.0, Drift = 0.4, Length = 2.4, PeakDb = -9 },
+ new() { Name = "Steel Hit", Model = DrumModel.PercMetal, Note = 47, Freq = 470, Decay = 1.2, Tone = 0.7, Body = 0.8, Drive = 0.4, Warmth = 0.45, HpHz = 150, Room = 0.45, RoomSize = 0.9, RoomDecay = 0.8, Width = 1.0, Drift = 0.3, Length = 3.0, PeakDb = -5 },
+ new() { Name = "Low Braam", Model = DrumModel.Zap, Note = 48, Freq = 45, Decay = 1.8, PitchAmt = 0.5, PitchDecay = 0.3, Tone = 0.8, Body = 0.9, Drive = 0.8, Warmth = 0.6, Room = 0.4, RoomSize = 0.9, RoomDecay = 0.8, Width = 1.0, Length = 3.6, PeakDb = -3 },
+ new() { Name = "Cymbal Swell",Model = DrumModel.Cymbal, Note = 49, Freq = 270, Decay = 4.0, Tone = 0.4, Body = 0.7, Noise = 0.6, Drive = 0.15, Warmth = 0.4, Room = 0.5, RoomSize = 0.9, RoomDecay = 0.8, Width = 1.0, Drift = 0.4, Length = 5.0, PeakDb = -6 },
+ new() { Name = "Sub Boom", Model = DrumModel.SubHit, Note = 50, Freq = 34, Decay = 3.0, PitchAmt = 1.0, PitchDecay = 0.25, Tone = 0.3, Drive = 0.3, Warmth = 0.6, Length = 4.0, PeakDb = -2 },
+ new() { Name = "Gong", Model = DrumModel.Cymbal, Note = 51, Freq = 180, Decay = 4.5, Tone = 0.25, Body = 0.9, Noise = 0.2, Drive = 0.15, Warmth = 0.5, Room = 0.45, RoomSize = 0.9, RoomDecay = 0.8, Width = 1.0, Drift = 0.3, Length = 5.5, PeakDb = -5 },
+ },
+ };
+
+ // ======================================================================
+ // 21. Shuffle — UK garage and 2-step: a clicky kick, a crisp snare and
+ // clap, bright tight hats, a sub hit for the bassline, and swing set
+ // where the genre sits.
+ // ======================================================================
+ private static KitDefinition Shuffle() => new()
+ {
+ Id = "shuffle",
+ Name = "Shuffle",
+ Blurb = "UK garage & 2-step · crisp snare, bright hats, sub, heavy swing",
+ Swing = 0.28f,
+ Humanize = 0.05f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickPunch, Note = 36, Freq = 54, Decay = 0.3, PitchAmt = 3.2, PitchDecay = 0.011, Tone = 0.6, Body = 0.45, Click = 0.6, Drive = 0.3, Warmth = 0.45, Length = 0.7, PeakDb = -1.5 },
+ new() { Name = "Rim", Model = DrumModel.Rim, Note = 37, Freq = 700, Decay = 0.03, Tone = 0.75, Body = 0.55, Drive = 0.3, Warmth = 0.4, HpHz = 400, Room = 0.2, RoomSize = 0.4, Width = 0.8, Drift = 0.3, Length = 0.4, PeakDb = -8 },
+ new() { Name = "Snare", Model = DrumModel.SnarePunch, Note = 38, Freq = 215, Decay = 0.2, Tone = 0.68, Body = 0.4, Noise = 0.95, NoiseDecay = 0.1, Drive = 0.3, Warmth = 0.4, HpHz = 160, Room = 0.2, RoomSize = 0.4, RoomDecay = 0.2, Width = 0.8, Drift = 0.2, Length = 0.6, PeakDb = -2.5 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1350,Decay = 0.2, Tone = 0.68, Body = 0.5, Drive = 0.25, Warmth = 0.4, HpHz = 300, Room = 0.25, RoomSize = 0.45, Width = 0.9, Drift = 0.5, Length = 0.7, PeakDb = -3.5 },
+ new() { Name = "Snare Skip", Model = DrumModel.SnarePunch, Note = 40, Freq = 260, Decay = 0.1, Tone = 0.78, Body = 0.3, Noise = 1.0, NoiseDecay = 0.05, Drive = 0.3, Warmth = 0.4, HpHz = 200, Drift = 0.2, Length = 0.3, PeakDb = -7 },
+ new() { Name = "Sub Bass", Model = DrumModel.SubHit, Note = 41, Freq = 49, Decay = 1.2, PitchAmt = 0.3, PitchDecay = 0.02, Tone = 0.45, Drive = 0.35, Warmth = 0.5, Length = 1.8, PeakDb = -2 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatMetal, Note = 42, Choke = 1, Freq = 400, Decay = 0.03, Tone = 0.62, Body = 0.65, Noise = 0.5, Drive = 0.2, Warmth = 0.25, HpHz = 5000, Drift = 0.3, Length = 0.2, PeakDb = -10 },
+ new() { Name = "Shaker", Model = DrumModel.Shaker, Note = 43, Freq = 6000,Decay = 0.06, Tone = 0.6, Body = 0.85, Click = 0.6, Drive = 0.1, Warmth = 0.35, Pan = 0.3f, Drift = 0.6, Length = 0.25, PeakDb = -11 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatMetal, Note = 44, Choke = 1, Freq = 400, Decay = 0.02, Tone = 0.58, Body = 0.6, Noise = 0.45, Drive = 0.18, Warmth = 0.25, HpHz = 5000, Drift = 0.3, Length = 0.15, PeakDb = -13 },
+ new() { Name = "Tambourine", Model = DrumModel.Shaker, Note = 45, Freq = 7200,Decay = 0.16, Tone = 0.7, Body = 0.9, Click = 0.8, Drive = 0.1, Warmth = 0.35, Pan = -0.3f, Drift = 0.6, Length = 0.45, PeakDb = -10 },
+ new() { Name = "Open Hat", Model = DrumModel.HatMetal, Note = 46, Choke = 1, Freq = 400, Decay = 0.26, Tone = 0.65, Body = 0.65, Noise = 0.55, Drive = 0.2, Warmth = 0.25, HpHz = 4000, Drift = 0.3, Length = 0.7, PeakDb = -9 },
+ new() { Name = "Clave", Model = DrumModel.Block, Note = 47, Freq = 2200,Decay = 0.045, Tone = 0.4, Body = 0.45, Drive = 0.15, Warmth = 0.4, Room = 0.15, Width = 0.8, Pan = -0.35f, Drift = 0.4, Length = 0.3, PeakDb = -9 },
+ new() { Name = "Chime", Model = DrumModel.PercMetal, Note = 48, Freq = 620, Decay = 0.25, Tone = 0.55, Body = 0.5, Drive = 0.2, Warmth = 0.35, HpHz = 300, Room = 0.25, RoomSize = 0.5, Width = 0.9, Pan = 0.3f, Drift = 0.3, Length = 0.7, PeakDb = -9 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 340, Decay = 1.8, Tone = 0.55, Body = 0.55, Noise = 0.55, Drive = 0.15, Warmth = 0.3, Drift = 0.4, Length = 2.4, PeakDb = -8 },
+ new() { Name = "Finger Snap",Model = DrumModel.Clap, Note = 50, Freq = 1800,Decay = 0.06, Tone = 0.8, Body = 0.2, Drive = 0.2, Warmth = 0.35, HpHz = 600, Room = 0.2, RoomSize = 0.4, Width = 0.8, Drift = 0.4, Length = 0.35, PeakDb = -7 },
+ new() { Name = "Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 460, Decay = 0.8, Tone = 0.8, Body = 0.4, Noise = 0.25, Drive = 0.1, Warmth = 0.3, Drift = 0.4, Length = 1.2, PeakDb = -11 },
+ },
+ };
+
+ // ======================================================================
+ // 22. Mirrorball — the 70s disco kit: dry and damped (a towel in the
+ // kick), a sizzling open hat, tambourine and conga on the side, and
+ // three syndrums for the fills.
+ // ======================================================================
+ private static KitDefinition Mirrorball() => new()
+ {
+ Id = "mirrorball",
+ Name = "Mirrorball",
+ Blurb = "70s disco · damped dry kit, sizzling open hat, syndrums",
+ Humanize = 0.1f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickAcoustic, Note = 36, Freq = 60, Decay = 0.3, PitchAmt = 0.7, PitchDecay = 0.018, Tone = 0.5, Body = 0.5, Click = 0.55, Drive = 0.2, Warmth = 0.6, LpHz = 9000, Room = 0.1, RoomSize = 0.25, RoomDamp = 0.8, Width = 0.4, Drift = 0.2, Length = 0.7, PeakDb = -1.5 },
+ new() { Name = "Side Stick", Model = DrumModel.Rim, Note = 37, Freq = 500, Decay = 0.045, Tone = 0.5, Body = 0.5, Drive = 0.15, Warmth = 0.55, HpHz = 240, Room = 0.12, RoomSize = 0.25, Width = 0.5, Drift = 0.3, Length = 0.3, PeakDb = -9 },
+ new() { Name = "Snare", Model = DrumModel.SnareAcoustic,Note = 38, Freq = 205, Decay = 0.28, Tone = 0.55, Body = 0.5, Noise = 0.85, NoiseDecay = 0.14, Click = 0.45, Drive = 0.2, Warmth = 0.55, LpHz = 11000, Room = 0.14, RoomSize = 0.3, RoomDamp = 0.7, Width = 0.6, Drift = 0.25, Length = 0.7, PeakDb = -2.5 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1080,Decay = 0.2, Tone = 0.5, Body = 0.5, Drive = 0.15, Warmth = 0.5, Room = 0.2, RoomSize = 0.35, Width = 0.8, Drift = 0.5, Length = 0.7, PeakDb = -4 },
+ new() { Name = "Snare Tight",Model = DrumModel.SnareAcoustic,Note = 40, Freq = 240, Decay = 0.16, Tone = 0.62, Body = 0.4, Noise = 0.9, NoiseDecay = 0.08, Click = 0.55, Drive = 0.2, Warmth = 0.5, LpHz = 11000, Room = 0.12, RoomSize = 0.3, Width = 0.6, Drift = 0.25, Length = 0.45, PeakDb = -4 },
+ new() { Name = "Syndrum Low",Model = DrumModel.Tom, Note = 41, Freq = 92, Decay = 0.5, PitchAmt = 1.4, PitchDecay = 0.12, Tone = 0.35, Body = 0.3, Noise = 0.1, NoiseDecay = 0.03, Drive = 0.2, Warmth = 0.5, Room = 0.15, RoomSize = 0.35, Width = 0.7, Pan = -0.3f, Drift = 0.3, Length = 1.0, PeakDb = -5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 1350, Decay = 0.045, Tone = 0.68, Body = 0.55, Click = 0.4, Drive = 0.1, Warmth = 0.4, Drift = 0.4, Length = 0.3, PeakDb = -10 },
+ new() { Name = "Syndrum Mid",Model = DrumModel.Tom, Note = 43, Freq = 130, Decay = 0.44, PitchAmt = 1.4, PitchDecay = 0.11, Tone = 0.35, Body = 0.3, Noise = 0.1, NoiseDecay = 0.03, Drive = 0.2, Warmth = 0.5, Room = 0.15, RoomSize = 0.35, Width = 0.7, Drift = 0.3, Length = 0.9, PeakDb = -5 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 1300, Decay = 0.03, Tone = 0.62, Body = 0.5, Click = 0.35, Drive = 0.1, Warmth = 0.4, Drift = 0.4, Length = 0.2, PeakDb = -13 },
+ new() { Name = "Syndrum Hi", Model = DrumModel.Tom, Note = 45, Freq = 180, Decay = 0.38, PitchAmt = 1.4, PitchDecay = 0.1, Tone = 0.35, Body = 0.3, Noise = 0.1, NoiseDecay = 0.03, Drive = 0.2, Warmth = 0.5, Room = 0.15, RoomSize = 0.35, Width = 0.7, Pan = 0.3f, Drift = 0.3, Length = 0.8, PeakDb = -5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 1350, Decay = 0.5, Tone = 0.72, Body = 0.55, Click = 0.35, Drive = 0.1, Warmth = 0.4, Drift = 0.4, Length = 1.3, PeakDb = -9 },
+ new() { Name = "Tambourine", Model = DrumModel.Shaker, Note = 47, Freq = 7500,Decay = 0.2, Tone = 0.72, Body = 0.9, Click = 0.85, Drive = 0.1, Warmth = 0.35, Room = 0.12, Width = 0.8, Pan = 0.3f, Drift = 0.6, Length = 0.5, PeakDb = -10 },
+ new() { Name = "Conga", Model = DrumModel.Conga, Note = 48, Freq = 240, Decay = 0.3, Tone = 0.4, Body = 0.45, Click = 0.35, Drive = 0.15, Warmth = 0.55, Room = 0.12, Width = 0.7, Pan = -0.3f, Drift = 0.35, Length = 0.7, PeakDb = -6 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 300, Decay = 2.4, Tone = 0.5, Body = 0.55, Noise = 0.55, Drive = 0.08, Warmth = 0.35, Room = 0.12, RoomSize = 0.35, Width = 0.8, Drift = 0.4, Length = 3.0, PeakDb = -8 },
+ new() { Name = "Cowbell", Model = DrumModel.Cowbell, Note = 50, Freq = 560, Decay = 0.26, Tone = 0.5, Body = 0.5, Click = 0.35, Drive = 0.2, Warmth = 0.45, Room = 0.1, Width = 0.6, Drift = 0.35, Length = 0.6, PeakDb = -9 },
+ new() { Name = "Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 420, Decay = 1.4, Tone = 0.8, Body = 0.45, Noise = 0.3, Drive = 0.08, Warmth = 0.35, Room = 0.1, RoomSize = 0.35, Width = 0.7, Drift = 0.4, Length = 2.0, PeakDb = -10 },
+ },
+ };
+
+ // ======================================================================
+ // 23. Pit — the orchestra's percussion section in a hall: gran cassa,
+ // three timpani (D, G, C), concert snare, slapstick, castanets,
+ // glockenspiel, tubular bell and clash cymbals. The open and the
+ // muted triangle share a choke group, so a mute stops the ring.
+ // ======================================================================
+ private static KitDefinition Pit() => new()
+ {
+ Id = "pit",
+ Name = "Pit",
+ Blurb = "orchestral percussion · timpani, gran cassa, triangle, clash cymbals",
+ Humanize = 0.15f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Gran Cassa", Model = DrumModel.KickAcoustic, Note = 36, Freq = 44, Decay = 1.4, PitchAmt = 0.2, PitchDecay = 0.05, Tone = 0.2, Body = 0.9, Click = 0.15, Drive = 0.05, Warmth = 0.6, LpHz = 5000, Room = 0.45, RoomSize = 0.85, RoomDecay = 0.7, RoomDamp = 0.5, Width = 0.9, Drift = 0.2, Length = 3.5, PeakDb = -1.5 },
+ new() { Name = "Rimshot", Model = DrumModel.Rim, Note = 37, Freq = 520, Decay = 0.05, Tone = 0.55, Body = 0.55, Drive = 0.05, Warmth = 0.5, HpHz = 220, Room = 0.4, RoomSize = 0.85, RoomDecay = 0.6, Width = 0.9, Drift = 0.3, Length = 1.8, PeakDb = -8 },
+ new() { Name = "Concert Snare",Model = DrumModel.SnareAcoustic,Note = 38, Freq = 220, Decay = 0.3, Tone = 0.72, Body = 0.5, Noise = 0.95, NoiseDecay = 0.2, Click = 0.4, Drive = 0.05, Warmth = 0.45, Room = 0.42, RoomSize = 0.85, RoomDecay = 0.65, RoomDamp = 0.45, Width = 0.9, Drift = 0.3, Length = 2.2, PeakDb = -3 },
+ new() { Name = "Slapstick", Model = DrumModel.Clap, Note = 39, Freq = 1600,Decay = 0.05, Tone = 0.8, Body = 0.2, Drive = 0.05, Warmth = 0.4, Room = 0.45, RoomSize = 0.85, RoomDecay = 0.6, Width = 0.9, Drift = 0.3, Length = 1.5, PeakDb = -5 },
+ new() { Name = "Snare Soft", Model = DrumModel.SnareAcoustic,Note = 40, Freq = 210, Decay = 0.25, Tone = 0.5, Body = 0.45, Noise = 0.9, NoiseDecay = 0.18, Click = 0.15, Drive = 0.05, Warmth = 0.5, Room = 0.42, RoomSize = 0.85, RoomDecay = 0.65, Width = 0.9, Drift = 0.35, Length = 2.0, PeakDb = -7 },
+ new() { Name = "Timpani D", Model = DrumModel.Tom, Note = 41, Freq = 73, Decay = 2.2, PitchAmt = 0.05, PitchDecay = 0.05, Tone = 0.25, Body = 0.85, Noise = 0.15, NoiseDecay = 0.05, Drive = 0.05, Warmth = 0.55, Room = 0.45, RoomSize = 0.85, RoomDecay = 0.7, Width = 0.9, Pan = -0.3f, Drift = 0.1, Length = 4.0, PeakDb = -2 },
+ new() { Name = "Triangle Mute",Model = DrumModel.PercMetal, Note = 42, Choke = 1, Freq = 2100, Decay = 0.12, Tone = 0.8, Body = 0.55, Drive = 0.05, Warmth = 0.3, Room = 0.35, RoomSize = 0.85, RoomDecay = 0.5, Width = 0.9, Pan = 0.4f, Drift = 0.4, Length = 1.0, PeakDb = -12 },
+ new() { Name = "Timpani G", Model = DrumModel.Tom, Note = 43, Freq = 98, Decay = 2.0, PitchAmt = 0.05, PitchDecay = 0.05, Tone = 0.27, Body = 0.85, Noise = 0.15, NoiseDecay = 0.05, Drive = 0.05, Warmth = 0.55, Room = 0.45, RoomSize = 0.85, RoomDecay = 0.7, Width = 0.9, Drift = 0.1, Length = 3.8, PeakDb = -2 },
+ new() { Name = "Castanets", Model = DrumModel.Block, Note = 44, Freq = 2900,Decay = 0.025, Tone = 0.5, Body = 0.4, Drive = 0.05, Warmth = 0.4, Room = 0.3, RoomSize = 0.8, RoomDecay = 0.5, Width = 0.9, Pan = 0.3f, Drift = 0.5, Length = 0.8, PeakDb = -9 },
+ new() { Name = "Timpani C", Model = DrumModel.Tom, Note = 45, Freq = 131, Decay = 1.8, PitchAmt = 0.05, PitchDecay = 0.045, Tone = 0.3, Body = 0.85, Noise = 0.15, NoiseDecay = 0.05, Drive = 0.05, Warmth = 0.55, Room = 0.45, RoomSize = 0.85, RoomDecay = 0.7, Width = 0.9, Pan = 0.3f, Drift = 0.1, Length = 3.5, PeakDb = -2 },
+ new() { Name = "Triangle", Model = DrumModel.PercMetal, Note = 46, Choke = 1, Freq = 2100, Decay = 2.0, Tone = 0.8, Body = 0.55, Drive = 0.05, Warmth = 0.3, Room = 0.35, RoomSize = 0.85, RoomDecay = 0.6, Width = 0.9, Pan = 0.4f, Drift = 0.4, Length = 3.0, PeakDb = -11 },
+ new() { Name = "Tambourine", Model = DrumModel.Shaker, Note = 47, Freq = 7200,Decay = 0.22, Tone = 0.7, Body = 0.9, Click = 0.8, Drive = 0.05, Warmth = 0.35, Room = 0.35, RoomSize = 0.85, RoomDecay = 0.5, Width = 0.9, Pan = -0.3f, Drift = 0.6, Length = 1.2, PeakDb = -10 },
+ new() { Name = "Glock", Model = DrumModel.PercMetal, Note = 48, Freq = 1570,Decay = 1.4, Tone = 0.5, Body = 0.45, Drive = 0.05, Warmth = 0.3, HpHz = 400, Room = 0.35, RoomSize = 0.85, RoomDecay = 0.6, Width = 0.9, Pan = 0.2f, Drift = 0.2, Length = 2.4, PeakDb = -10 },
+ new() { Name = "Clash Cymbals",Model = DrumModel.Cymbal, Note = 49, Freq = 280, Decay = 3.5, Tone = 0.45, Body = 0.65, Noise = 0.6, Drive = 0.05, Warmth = 0.35, Room = 0.45, RoomSize = 0.85, RoomDecay = 0.7, Width = 1.0, Drift = 0.4, Length = 4.5, PeakDb = -6 },
+ new() { Name = "Tubular Bell", Model = DrumModel.PercMetal, Note = 50, Freq = 523, Decay = 3.0, Tone = 0.35, Body = 0.8, Drive = 0.05, Warmth = 0.4, HpHz = 150, Room = 0.4, RoomSize = 0.85, RoomDecay = 0.7, Width = 0.9, Pan = -0.2f, Drift = 0.2, Length = 4.5, PeakDb = -8 },
+ new() { Name = "Suspended", Model = DrumModel.Cymbal, Note = 51, Freq = 360, Decay = 3.0, Tone = 0.7, Body = 0.5, Noise = 0.5, Drive = 0.05, Warmth = 0.35, Room = 0.4, RoomSize = 0.85, RoomDecay = 0.7, Width = 0.95, Drift = 0.4, Length = 4.0, PeakDb = -9 },
+ },
+ };
+
+ // ======================================================================
+ // 24. Hyper — hyperpop and festival EDM: everything clipped and bright.
+ // A kick that is mostly attack, a distorted 808, stacked clap, glitch
+ // and dive effects, and a crushed snare for the fills.
+ // ======================================================================
+ private static KitDefinition Hyper() => new()
+ {
+ Id = "hyper",
+ Name = "Hyper",
+ Blurb = "hyperpop & EDM · clipped kick, distorted 808, glitch and dive",
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickPunch, Note = 36, Freq = 56, Decay = 0.35, PitchAmt = 4.5, PitchDecay = 0.01, Tone = 0.75, Body = 0.55, Click = 0.8, Drive = 0.8, Warmth = 0.3, HpHz = 30, Length = 0.7, PeakDb = -1 },
+ new() { Name = "Zip", Model = DrumModel.Zap, Note = 37, Freq = 300, Decay = 0.06, PitchAmt = 6, PitchDecay = 0.008, Tone = 0.4, Body = 0.5, Drive = 0.6, Warmth = 0.2, HpHz = 300, Length = 0.2, PeakDb = -7 },
+ new() { Name = "Snare", Model = DrumModel.SnarePunch, Note = 38, Freq = 225, Decay = 0.22, Tone = 0.8, Body = 0.45, Noise = 1.0, NoiseDecay = 0.12, Drive = 0.75, Warmth = 0.3, HpHz = 180, Room = 0.25, RoomSize = 0.5, RoomDecay = 0.3, Width = 1.0, Length = 0.8, PeakDb = -2 },
+ new() { Name = "Clap Stack", Model = DrumModel.Clap, Note = 39, Freq = 1500,Decay = 0.25, Tone = 0.8, Body = 0.6, Drive = 0.7, Warmth = 0.3, HpHz = 400, Room = 0.35, RoomSize = 0.6, RoomDecay = 0.4, Width = 1.0, Drift = 0.5, Length = 1.1, PeakDb = -2.5 },
+ new() { Name = "Snare Up", Model = DrumModel.SnarePunch, Note = 40, Freq = 320, Decay = 0.16, Tone = 0.85, Body = 0.4, Noise = 1.0, NoiseDecay = 0.08, Drive = 0.7, Warmth = 0.3, HpHz = 220, Room = 0.2, RoomSize = 0.5, Width = 1.0, Length = 0.6, PeakDb = -3.5 },
+ new() { Name = "808 Distort",Model = DrumModel.SubHit, Note = 41, Freq = 44, Decay = 2.0, PitchAmt = 0.8, PitchDecay = 0.03, Tone = 0.75, Drive = 0.8, Warmth = 0.4, Length = 2.8, PeakDb = -1.5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatMetal, Note = 42, Choke = 1, Freq = 520, Decay = 0.025, Tone = 0.7, Body = 0.7, Noise = 0.6, Drive = 0.5, Warmth = 0.15, HpHz = 6000, Length = 0.15, PeakDb = -10 },
+ new() { Name = "Glitch", Model = DrumModel.Zap, Note = 43, Freq = 700, Decay = 0.03, PitchAmt = 2, PitchDecay = 0.004, Tone = 0.8, Body = 0.3, Drive = 0.6, Warmth = 0.2, Bits = 6, CrushHz = 8000, Length = 0.1, PeakDb = -8 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatMetal, Note = 44, Choke = 1, Freq = 520, Decay = 0.015, Tone = 0.65, Body = 0.65, Noise = 0.55, Drive = 0.45, Warmth = 0.15, HpHz = 6000, Length = 0.1, PeakDb = -13 },
+ new() { Name = "Dive", Model = DrumModel.Zap, Note = 45, Freq = 80, Decay = 0.6, PitchAmt = 9, PitchDecay = 0.2, Tone = 0.6, Body = 0.7, Drive = 0.6, Warmth = 0.3, Room = 0.3, RoomSize = 0.6, Width = 1.0, Length = 1.2, PeakDb = -5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatMetal, Note = 46, Choke = 1, Freq = 520, Decay = 0.3, Tone = 0.72, Body = 0.7, Noise = 0.65, Drive = 0.5, Warmth = 0.15, HpHz = 5000, Length = 0.8, PeakDb = -9 },
+ new() { Name = "Star Bell", Model = DrumModel.PercMetal, Note = 47, Freq = 1040,Decay = 0.4, Tone = 0.55, Body = 0.5, Drive = 0.3, Warmth = 0.2, HpHz = 400, Room = 0.3, RoomSize = 0.6, Width = 1.0, Length = 0.9, PeakDb = -8 },
+ new() { Name = "Crush Snare",Model = DrumModel.SnarePunch, Note = 48, Freq = 280, Decay = 0.16, Tone = 0.8, Body = 0.4, Noise = 1.0, NoiseDecay = 0.08, Drive = 0.7, Warmth = 0.2, Bits = 6, CrushHz = 12000, Length = 0.4, PeakDb = -4 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 360, Decay = 2.0, Tone = 0.65, Body = 0.5, Noise = 0.7, Drive = 0.4, Warmth = 0.2, HpHz = 800, Room = 0.3, RoomSize = 0.6, Width = 1.0, Length = 2.6, PeakDb = -7 },
+ new() { Name = "Sub Kick", Model = DrumModel.KickAnalog, Note = 50, Freq = 42, Decay = 0.9, PitchAmt = 1.2, PitchDecay = 0.03, Tone = 0.15, Body = 0.9, Click = 0.1, Drive = 0.6, Warmth = 0.5, Length = 1.4, PeakDb = -2 },
+ new() { Name = "Ride Bright",Model = DrumModel.Cymbal, Note = 51, Freq = 480, Decay = 0.9, Tone = 0.85, Body = 0.4, Noise = 0.35, Drive = 0.3, Warmth = 0.2, HpHz = 1000, Length = 1.3, PeakDb = -11 },
+ },
+ };
+
+ // ======================================================================
+ // 25. Crate — 90s boom bap, dug out of a record crate: a thumping kick
+ // and a cracking snare through a 12-bit sampler with a little hiss,
+ // swung the way the MPC swung it, and a scratch for the turnaround.
+ // ======================================================================
+ private static KitDefinition Crate() => new()
+ {
+ Id = "crate",
+ Name = "Crate",
+ Blurb = "90s boom bap · 12-bit thump and crack, swung, with a scratch",
+ Swing = 0.2f,
+ Humanize = 0.1f,
+ Pads = new List<KitPad>
+ {
+ new() { Name = "Kick", Model = DrumModel.KickAcoustic, Note = 36, Freq = 55, Decay = 0.45, PitchAmt = 0.9, PitchDecay = 0.02, Tone = 0.5, Body = 0.6, Click = 0.6, Drive = 0.5, Warmth = 0.7, Bits = 12, CrushHz = 26040, HpHz = 35, LpHz = 9000, Hiss = 0.2, Drift = 0.2, Length = 0.9, PeakDb = -1.5 },
+ new() { Name = "Rim", Model = DrumModel.Rim, Note = 37, Freq = 500, Decay = 0.045, Tone = 0.5, Body = 0.5, Drive = 0.4, Warmth = 0.6, Bits = 12, CrushHz = 26040, HpHz = 220, LpHz = 9000, Hiss = 0.2, Drift = 0.3, Length = 0.3, PeakDb = -9 },
+ new() { Name = "Snare", Model = DrumModel.SnareAcoustic,Note = 38, Freq = 200, Decay = 0.32, Tone = 0.62, Body = 0.6, Noise = 0.9, NoiseDecay = 0.16, Click = 0.65, Drive = 0.55, Warmth = 0.65, Bits = 12, CrushHz = 26040, LpHz = 10000, Hiss = 0.2, Room = 0.2, RoomSize = 0.35, RoomDecay = 0.18, RoomDamp = 0.6, Width = 0.6, Drift = 0.25, Length = 0.8, PeakDb = -2 },
+ new() { Name = "Clap", Model = DrumModel.Clap, Note = 39, Freq = 1000,Decay = 0.2, Tone = 0.45, Body = 0.55, Drive = 0.45, Warmth = 0.6, Bits = 12, CrushHz = 26040, LpHz = 9000, Hiss = 0.2, Room = 0.15, Width = 0.6, Drift = 0.5, Length = 0.6, PeakDb = -4 },
+ new() { Name = "Snare Crack",Model = DrumModel.SnarePunch, Note = 40, Freq = 235, Decay = 0.2, Tone = 0.7, Body = 0.5, Noise = 1.0, NoiseDecay = 0.1, Drive = 0.6, Warmth = 0.6, Bits = 12, CrushHz = 26040, LpHz = 10000, Hiss = 0.2, Drift = 0.25, Length = 0.5, PeakDb = -3 },
+ new() { Name = "Tom Low", Model = DrumModel.Tom, Note = 41, Freq = 86, Decay = 0.5, PitchAmt = 0.3, PitchDecay = 0.05, Tone = 0.4, Body = 0.55, Noise = 0.3, NoiseDecay = 0.06, Drive = 0.45, Warmth = 0.65, Bits = 12, CrushHz = 26040, LpHz = 7000, Hiss = 0.2, Drift = 0.3, Length = 1.1, PeakDb = -5 },
+ new() { Name = "Closed Hat", Model = DrumModel.HatNoise, Note = 42, Choke = 1, Freq = 1100, Decay = 0.045, Tone = 0.55, Body = 0.5, Click = 0.45, Drive = 0.4, Warmth = 0.6, Bits = 12, CrushHz = 26040, LpHz = 10000, Hiss = 0.2, Drift = 0.5, Length = 0.25, PeakDb = -10 },
+ new() { Name = "Tom Mid", Model = DrumModel.Tom, Note = 43, Freq = 114, Decay = 0.44, PitchAmt = 0.3, PitchDecay = 0.045, Tone = 0.42, Body = 0.55, Noise = 0.3, NoiseDecay = 0.06, Drive = 0.45, Warmth = 0.65, Bits = 12, CrushHz = 26040, LpHz = 7500, Hiss = 0.2, Drift = 0.3, Length = 1.0, PeakDb = -5 },
+ new() { Name = "Pedal Hat", Model = DrumModel.HatNoise, Note = 44, Choke = 1, Freq = 1050, Decay = 0.03, Tone = 0.5, Body = 0.45, Click = 0.4, Drive = 0.4, Warmth = 0.6, Bits = 12, CrushHz = 26040, LpHz = 9500, Hiss = 0.2, Drift = 0.5, Length = 0.2, PeakDb = -13 },
+ new() { Name = "Tom Hi", Model = DrumModel.Tom, Note = 45, Freq = 150, Decay = 0.38, PitchAmt = 0.3, PitchDecay = 0.04, Tone = 0.44, Body = 0.55, Noise = 0.3, NoiseDecay = 0.06, Drive = 0.45, Warmth = 0.65, Bits = 12, CrushHz = 26040, LpHz = 8000, Hiss = 0.2, Drift = 0.3, Length = 0.9, PeakDb = -5 },
+ new() { Name = "Open Hat", Model = DrumModel.HatNoise, Note = 46, Choke = 1, Freq = 1100, Decay = 0.3, Tone = 0.58, Body = 0.5, Click = 0.4, Drive = 0.4, Warmth = 0.6, Bits = 12, CrushHz = 26040, LpHz = 10000, Hiss = 0.2, Drift = 0.5, Length = 0.8, PeakDb = -9 },
+ new() { Name = "Shaker", Model = DrumModel.Shaker, Note = 47, Freq = 5000,Decay = 0.08, Tone = 0.45, Body = 0.8, Click = 0.5, Drive = 0.3, Warmth = 0.55, Bits = 12, CrushHz = 26040, LpHz = 9000, Hiss = 0.2, Drift = 0.6, Length = 0.3, PeakDb = -12 },
+ new() { Name = "Scratch", Model = DrumModel.Zap, Note = 48, Freq = 180, Decay = 0.25, PitchAmt = 2, PitchDecay = 0.12, Tone = 0.3, Body = 0.5, Drive = 0.4, Warmth = 0.55, Bits = 12, CrushHz = 26040, LpHz = 6000, Hiss = 0.25, Drift = 0.4, Length = 0.4, PeakDb = -8 },
+ new() { Name = "Crash", Model = DrumModel.Cymbal, Note = 49, Freq = 280, Decay = 1.9, Tone = 0.45, Body = 0.55, Noise = 0.5, Drive = 0.35, Warmth = 0.6, Bits = 12, CrushHz = 26040, LpHz = 9000, Hiss = 0.2, Drift = 0.4, Length = 2.4, PeakDb = -8 },
+ new() { Name = "Cowbell", Model = DrumModel.Cowbell, Note = 50, Freq = 540, Decay = 0.26, Tone = 0.45, Body = 0.5, Click = 0.3, Drive = 0.35, Warmth = 0.55, Bits = 12, CrushHz = 26040, LpHz = 9000, Hiss = 0.2, Drift = 0.35, Length = 0.6, PeakDb = -9 },
+ new() { Name = "Ride", Model = DrumModel.Cymbal, Note = 51, Freq = 390, Decay = 1.0, Tone = 0.72, Body = 0.4, Noise = 0.3, Drive = 0.3, Warmth = 0.55, Bits = 12, CrushHz = 26040, LpHz = 9500, Hiss = 0.2, Drift = 0.4, Length = 1.5, PeakDb = -10 },
+ },
+ };
+}
diff --git a/src/managed/Nota.Infrastructure/Kits/KitCatalog.cs b/src/managed/Nota.Infrastructure/Kits/KitCatalog.cs
index 6dbcfdea..b6e24286 100644
--- a/src/managed/Nota.Infrastructure/Kits/KitCatalog.cs
+++ b/src/managed/Nota.Infrastructure/Kits/KitCatalog.cs
@@ -1,10 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
//
-// The shipped factory kits, as recipes. Ten kits x 16 pads, defined here rather than
+// The shipped factory kits, as recipes. 25 kits x 16 pads, defined here rather than
// bundled as audio: the installer carries a few kilobytes of parameters and the WAVs
// are rendered on the user's machine the first time Nota runs (KitLibrary).
//
+// The first ten kits live here; the fifteen genre kits that followed are in
+// KitCatalog.Genres.cs. Browser order is the Build() list below.
+//
// Pad layout follows the General MIDI drum map for notes 36-51, so a pattern written
// for any other drum instrument lands on the right pads here:
//
@@ -25,7 +28,7 @@ using System.Collections.Generic;
namespace Nota.Infrastructure.Kits;
-public static class KitCatalog
+public static partial class KitCatalog
{
private static IReadOnlyList<KitDefinition>? _all;
@@ -42,6 +45,9 @@ public static class KitCatalog
{
Volta(), Kompakt(), Micron(), Linnwood(), Atelier(),
Cellar(), Neon(), Foundry(), Terra(), Aether(),
+ BrassRoom(), Breakline(), Bunker(), Pixel(), Velvet(),
+ Circuit(), Yard(), Byte(), Lagoon(), Titan(),
+ Shuffle(), Mirrorball(), Pit(), Hyper(), Crate(),
};
// ======================================================================
diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.cs
index 79774c73..eabafd88 100644
--- a/tests/Nota.SmokeTest/Program.cs
+++ b/tests/Nota.SmokeTest/Program.cs
@@ -5541,24 +5541,42 @@ Console.WriteLine("-- Drum Rack: engine + C ABI + persistence --");
Console.WriteLine("-- Factory drum kits --");
{
var kits = Nota.Infrastructure.Kits.KitCatalog.All;
- Check(kits.Count == 10, $"ten factory kits ({kits.Count})");
+ Check(kits.Count == 25, $"25 factory kits ({kits.Count})");
var kitIds = new System.Collections.Generic.HashSet<string>();
- bool padsOk = true, notesOk = true, namesOk = true;
+ var kitNames = new System.Collections.Generic.HashSet<string>();
+ bool padsOk = true, notesOk = true, namesOk = true, hatsOk = true;
foreach (var k in kits)
{
- if (!kitIds.Add(k.Id)) padsOk = false;
+ if (!kitIds.Add(k.Id) || !kitNames.Add(k.Name)) padsOk = false;
if (k.Pads.Count != 16) padsOk = false;
var padNotes = new System.Collections.Generic.HashSet<int>();
+ var padNames = new System.Collections.Generic.HashSet<string>();
foreach (var pad in k.Pads)
{
if (pad.Note < 36 || pad.Note > 51 || !padNotes.Add(pad.Note)) notesOk = false;
- if (string.IsNullOrWhiteSpace(pad.Name)) namesOk = false;
+ if (string.IsNullOrWhiteSpace(pad.Name) || !padNames.Add(pad.Name)) namesOk = false;
+ if (pad.Choke < 0 || pad.Choke > 4) hatsOk = false; // the card offers groups 1..4
+ if (pad.Name.EndsWith(" Hat") && pad.Choke != 1) hatsOk = false; // closed cuts open
}
+ // A choke group of one pad cuts nothing — a recipe typo.
+ if (k.Pads.Where(p => p.Choke > 0).GroupBy(p => p.Choke).Any(g => g.Count() < 2)) hatsOk = false;
}
- Check(padsOk, "every kit has a unique id and 16 pads");
+ Check(padsOk, "every kit has a unique id and name and 16 pads");
Check(notesOk, "pad notes are unique and inside the GM bank (36..51)");
- Check(namesOk, "every pad is named");
+ Check(namesOk, "every pad is named, uniquely within its kit");
+ Check(hatsOk, "hats share choke group 1; every choke group (1..4) pairs at least two pads");
+
+ // A loaded kit is recognised by its pads, so no two kits may share more than 12 of them:
+ // then a kit stays recognisable with up to three pads swapped or renamed.
+ int worstOverlap = 0; string worstPair = "";
+ for (int i = 0; i < kits.Count; i++)
+ for (int j = i + 1; j < kits.Count; j++)
+ {
+ int n = kits[i].Pads.Count(p => kits[j].Pads.Any(q => q.Note == p.Note && q.Name == p.Name));
+ if (n > worstOverlap) { worstOverlap = n; worstPair = $"{kits[i].Name}/{kits[j].Name}"; }
+ }
+ Check(worstOverlap <= 12, $"kits are told apart by their pads (most shared: {worstOverlap}, {worstPair})");
// Rendering: deterministic, on target level, finite, and long enough to be a drum.
var kick = kits[0].Pads[0];
@@ -5576,6 +5594,19 @@ Console.WriteLine("-- Factory drum kits --");
$"rendered peak hits the recipe's target ({20 * Math.Log10(peak):0.0} dBFS, want {kick.PeakDb:0.0})");
Check(r1.Frames > r1.SampleRate / 50, $"one-shot is longer than 20 ms ({r1.Frames * 1000 / r1.SampleRate} ms)");
+ // Every recipe of every kit renders: finite, on its level, not silent.
+ var badPads = new System.Collections.Generic.List<string>();
+ var sw = System.Diagnostics.Stopwatch.StartNew();
+ System.Threading.Tasks.Parallel.ForEach(kits.SelectMany(k => k.Pads.Select(p => (k, p))), kp =>
+ {
+ var r = Nota.Infrastructure.Kits.KitRenderer.Render(kp.p, 1);
+ double pk = 0; bool fin = r.Frames > 0;
+ foreach (var v in r.Interleaved) { if (!float.IsFinite(v)) { fin = false; break; } pk = Math.Max(pk, Math.Abs(v)); }
+ if (!fin || pk > 1.0 || pk <= 0 || Math.Abs(20 * Math.Log10(pk) - kp.p.PeakDb) > 1.0)
+ lock (badPads) badPads.Add($"{kp.k.Name}/{kp.p.Name}");
+ });
+ Check(badPads.Count == 0, $"all {kits.Sum(k => k.Pads.Count)} kit pads render finite and on level in {sw.ElapsedMilliseconds} ms{(badPads.Count > 0 ? ": " + string.Join(", ", badPads) : "")}");
+
// Building a rack from a kit: every pad loaded, named, choked and audible.
var svc = new DrumKitService();
Check(svc.All().Count == kits.Count, "the kit service lists the catalog");
@@ -5601,6 +5632,16 @@ Console.WriteLine("-- Factory drum kits --");
// Loading a second kit into the same rack replaces its pads rather than stacking.
Check(svc.LoadInto(ke, kt, kits[1].Id, out _) && ke.RackChainCount(kt) == 16, "loading another kit replaces the pads");
Check(ke.RackChainName(kt, 0) == kits[1].Pads[0].Name, "the replaced pads carry the new kit's names");
+
+ // The card's kit picker names the kit a rack holds, and keeps naming it through a pad
+ // swap — but a rack stripped to a few pads is no longer that kit.
+ Check(svc.Identify(ke, kt) == kits[1].Id, $"the loaded kit is recognised ('{svc.Identify(ke, kt)}')");
+ ke.RackSetChainName(kt, 0, "My Kick");
+ Check(svc.Identify(ke, kt) == kits[1].Id, "a renamed pad keeps the kit recognised");
+ while (ke.RackChainCount(kt) > 3) ke.RackRemoveChain(kt, ke.RackChainCount(kt) - 1);
+ Check(svc.Identify(ke, kt) == "", "a rack stripped to three pads is no kit");
+ Check(svc.LoadInto(ke, kt, kits[24].Id, out string lastWarn) && svc.Identify(ke, kt) == kits[24].Id,
+ $"the last kit loads and is recognised ({(lastWarn.Length == 0 ? "no warnings" : lastWarn)})");
}
// ===================== M9-D: automation segment curves =====================