> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gridshift.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Sample Editor

> A modal sheet for editing a sample — transient markers, slice settings, source BPM, and the beat-grid alignment.

The **Sample Editor** opens a large interactive waveform on top of the Timeline so the audio fills the screen while every editor control sits in a single bar at the bottom. It is the only place where transient markers and the source-level BPM grid are edited.

## Open the editor

| From            | Action                                               |
| --------------- | ---------------------------------------------------- |
| Inspector       | Click the waveform preview in the **Sample** section |
| Command Palette | Run **Edit Sample or Instrument** (`⌥X`)             |

The sheet locks input to the Timeline behind it. Press **Done**, `Esc`, or click outside the sheet to close it. `Return` does not close the editor — it drops a marker at the playhead.

The window can be resized from its minimum (1280 × 540) upward to any size your display allows.

## Layout

The waveform fills the body of the sheet. A single bar at the bottom holds the controls for the currently selected mode. Both the waveform and the controls are tinted with the color of the track that owns the sample.

A segment picker centered in the header switches between three modes:

| Mode       | Purpose                                                                     |
| ---------- | --------------------------------------------------------------------------- |
| **Slices** | Transient detection, and the per-slice envelope — Fade In, Fade Out, Length |
| **Tempo**  | Original BPM, beat-grid origin, and aligning clips to the downbeat          |
| **Stems**  | Generate per-stem layers from the sample and balance their volumes in place |

Press `⌘1`, `⌘2`, or `⌘3` to switch to Slices, Tempo, or Stems from the keyboard.

## Waveform interactions

The waveform reacts to the same gestures in Slices and Tempo modes — only the click target differs. Stems mode replaces the waveform with a lane stack and has none of them. Zoom reaches as deep as the Timeline's, down to individual samples.

| Gesture                   | Action                                                                                                  |
| ------------------------- | ------------------------------------------------------------------------------------------------------- |
| Drag empty area           | Pan horizontally and zoom (drag down = zoom in) around the click point                                  |
| Scroll wheel              | Zoom, anchored at the pointer                                                                           |
| Trackpad pinch            | Zoom, anchored at the pointer                                                                           |
| Trackpad horizontal swipe | Pan horizontally                                                                                        |
| `←` / `→`                 | Step the selection through slices; the view re-frames on every step (see below)                         |
| `⇧←` / `⇧→`               | Extend the selection by one slice — several slices loop as one region                                   |
| `↑` / `↓`                 | Clear the slice selection (playback falls back to the whole sample)                                     |
| `⌘←` / `⌘→`               | Nudge the selected marker (or the Tempo grid offset) by 1 ms                                            |
| `⌥⌘←` / `⌥⌘→`             | Fine-nudge the same target by a single sample                                                           |
| `⌥←` / `⌥→`               | Zoom out / in, keeping the selected slice framed (Slices mode) or anchored at the downbeat (Tempo mode) |
| `⌥↑`                      | Reset zoom to 1×                                                                                        |

The right hand never leaves the arrow cluster: step from marker to marker with the bare arrows, hold `⌘` to shove the selected marker, add `⌥` for sample-accurate alignment.

### Where the camera puts the selected slice

Arrow navigation and keyboard zoom always frame the selected slice the same way, so the marker under review never has to be re-found after a keypress:

* **While the slice fits on screen** it is **centered**.
* **Once it is wider than the viewport** — i.e. zoomed in past the point where the whole slice fits — its **start marker is pinned one third in from the left edge**, leaving room to judge the attack in context.

Zooming in with `⌥←` / `⌥→` walks a slice from the first state into the second, so the transient stays in view the whole way down to sample level.

Letter keys play the slices of the sample for audition (same layout as [Musical Typing for audio slices](/shortcuts/musical-typing#audio-slices)).

## Slices mode

### Transients

A picker selects how transient markers are produced:

| Mode       | Behavior                                                                                                                                                                                                      |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Auto**   | An on-device detector places markers automatically. A sensitivity slider in the bar filters the candidate set — turn it up for more markers, down for fewer. Switching back to Auto re-applies the detection. |
| **Manual** | The current marker positions are pinned. The bar shows a **Clear** button that removes every marker on the source. Auto-detection no longer overwrites the markers in this mode.                              |
| **Beat**   | Markers are evenly spaced on a beat grid derived from the source BPM. A division picker chooses the spacing (2 Bars, 1 Bar, 1/2, 1/4, 1/8, 1/16).                                                             |

### Editing markers (Slices mode)

| Action                      | Input                                                                             |
| --------------------------- | --------------------------------------------------------------------------------- |
| Add marker                  | Double-click on the waveform                                                      |
| Remove marker               | Double-click on a marker, or press `Backspace` with the marker selected           |
| Move marker                 | Drag a marker — the model updates on release                                      |
| Nudge selected marker       | `⌘←` / `⌘→` (1 ms), or `⌥⌘←` / `⌥⌘→` for a single-sample step                     |
| Drop marker at the playhead | `Return` while a slice is auditioning or Space-preview is running                 |
| Toggle looping preview      | `Space` — loops the selected slices, or the whole sample when nothing is selected |

The selected slice is the one whose start marker the `⌘`-arrow nudge moves. Selection is set with the bare `←` / `→` arrows, by clicking a marker, or by playing a slice with its letter key.

### Looping the slice you are editing

`Space` loops the selection rather than playing once through:

* **One slice selected** → that slice loops.
* **`⇧←` / `⇧→` extended the selection** → the whole range loops as one region.
* **Nothing selected** (`↑` / `↓` clears it) → the whole sample loops.

The loop follows the selection **while it plays**: step to the next slice with `→` and you immediately hear it, so a transient can be judged and corrected with `⌘←` / `⌘→` without stopping playback. Moving or deleting a marker moves the loop onto the corrected position too, and holding an arrow walks the loop continuously.

Every seam the loop cuts — the turn-around, a jump to another slice, and stopping — is de-clicked with the same shape the timeline and the keyboard audition use: the outgoing pass rings out over roughly 8 ms of the audio that actually follows the slice, while the incoming pass ramps in over 2 ms. The ramp is deliberately much shorter than the ring-out, so attacks stay sharp enough to judge.

### Sample operations (Slices mode)

Two chips in the top-right corner of the waveform hold non-destructive operations on the source sample, in Slices mode only. Both write back into the sample's parameters — the original audio file is not modified, and pressing the same button again removes the effect.

| Operation        | Description                                                                                                                                                                                                                                                       |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Normalize**    | Lifts the sample's peak to 0 dBFS. Off by default.                                                                                                                                                                                                                |
| **Trim Silence** | Detects leading and trailing silence and excludes it from playback. Available only while the sample plays raw — **Stretch** off and **Pitch** at 0 — since stretched and varispeed buffers don't share trim semantics. Clearing an existing trim stays available. |

### Shape the slices

The right of the bar holds the per-slice amplitude envelope. Option-click a slider to reset it, double-click to type a value.

| Control      | Description                                                                                                                          | Default |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| **Fade In**  | Linear fade at each slice's start, 0–250 ms                                                                                          | `0 ms`  |
| **Fade Out** | Linear fade back from each slice's effective end, 0–250 ms                                                                           | `0 ms`  |
| **Length**   | Played portion of each slice, 1–100 % of the slice body — below 100 % the slice gates to silence and the rest becomes a rhythmic gap | `100 %` |

These mirror the same controls in the Inspector.

## Tempo mode

Tempo mode shows a beat grid overlaid on the waveform. The grid is derived from the source's effective BPM and uses the bar/beat lines to give the user a visual reference for aligning the audio.

### Set the source BPM

The toolbar holds one control: **Original BPM**, the sample's own tempo — detected at import, or the project tempo when detection isn't possible. Drag the field to scrub it and the beat grid follows live, click to type a value, right-click to reset an edited value back to the detected one.

Warping — **Character**, **Stretch**, **Target BPM**, **Pitch**, **Formant** — lives in the track Inspector, not here: "what tempo is this sample" and "fit this clip to the project" are different jobs. See [Time Stretching](/features/time-stretching).

### Aligning the beat grid

When the first downbeat of the audio doesn't sit at the start of the file, the grid can be moved without changing the BPM:

| Action                       | Input                                                                                                              |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Drag the grid                | Click any beat line and drag — the offset updates live                                                             |
| Stretch the grid             | `⌘`-click a beat line and drag — the downbeat stays anchored, the BPM updates so the grid spacing matches the drag |
| Nudge offset                 | `⌘←` / `⌘→` (1 ms), or `⌥⌘←` / `⌥⌘→` for a single-sample step                                                      |
| Reset offset                 | The **Reset** button on the offset chip (bottom-right corner of the waveform)                                      |
| Move the clips onto the grid | The **Align Clips** button on the same chip                                                                        |

The current offset is shown in seconds in the chip. The offset is persisted on the source and re-applied the next time the editor is opened — and stored in the [Sample Library](/features/sample-library) against the audio itself, so the next project that loads the same file starts from your correction.

Moving the grid says how far the clips are off; it does not move them. **Align Clips** finishes the job for every clip using this sample, across all tracks — it counts them in its label (**Align 3 Clips**) and is disabled when there is nothing to correct. It slides the audio inside each clip rather than moving the clip, so clip positions, lengths, and neighbours stay exactly as they are.

## Stems mode

Stems mode replaces the single waveform with a stack of stem lanes — one row per stem (Vocals, Drums, Bass, Other for Source Stems; Kick, Snare, Cymbals, Toms for Drum Elements). Each lane carries a solo button and a volume slider — drag it to zero to mute, double-click to reset — so you can rebalance the parts inside one sample without splitting the clip across multiple tracks.

Three states the user can land in:

| State                         | What you see                                                                                |
| ----------------------------- | ------------------------------------------------------------------------------------------- |
| Model not installed           | A **Download Model** call to action that hands off to the model-download sheet              |
| Model installed, no stems yet | A **Generate Stems** call to action — uses the algorithm chosen in the **Algorithm** picker |
| Stems present                 | The lane stack                                                                              |

The **Algorithm** picker in the middle of the bar selects the model (Source Stems / Drum Elements), and is disabled while a bake runs. A source stores one bundle at a time, so switching to a kind that hasn't been baked drops back to **Generate Stems**. While a bake runs, the body of the editor swaps to a progress view; once the bundle lands on the source, the lanes appear automatically.

This is an in-place alternative to [splitting a clip into separate stem tracks](/features/stem-separation) — both flows use the same models, but stems mode keeps everything on one track and one sample. Use stems mode when you want to mix the layers as a single instrument; use the track-split flow when you want to arrange them independently.

## Shortcuts

These keys are specific to the Sample Editor sheet. The slice-audition letter keys follow the [Musical Typing](/shortcuts/musical-typing#audio-slices) layout.

| Action                                             | Shortcut           |
| -------------------------------------------------- | ------------------ |
| Switch to Slices / Tempo / Stems mode              | `⌘1` / `⌘2` / `⌘3` |
| Step through slices                                | `←` / `→`          |
| Extend the slice selection                         | `⇧←` / `⇧→`        |
| Clear the slice selection                          | `↑` / `↓`          |
| Nudge marker or grid offset 1 ms                   | `⌘←` / `⌘→`        |
| Fine-nudge by a single sample                      | `⌥⌘←` / `⌥⌘→`      |
| Zoom out / in                                      | `⌥←` / `⌥→`        |
| Reset zoom to 1×                                   | `⌥↑`               |
| Drop marker at playhead (while auditioning)        | `Return`           |
| Toggle looping preview (selection or whole sample) | `Space`            |
| Remove selected marker                             | `Backspace`        |
| Close the editor                                   | `Esc`              |
