Piano Roll Visualizer
piano-roll-visualizerVisualizersFalling notes or a scrolling river, driven by your MIDI playhead.
$ pnpm dlx shadcn@latest add @pluginui/core-piano-roll-visualizerLoading interactive preview…
Install
Copies the source into your project. Anything it depends on comes with it. Run this in your React project with shadcn initialized; no registry configuration is needed.
Pulls in
piano-roll-geometrycontrol-theme
Install using the registry URL
$ pnpm dlx shadcn@latest add https://pluginui.com/r/core-piano-roll-visualizer.jsonUsage
Connect the documented props to your application or host.
import { PianoRollVisualizer } from "@/components/ui/piano-roll-visualizer"
<PianoRollVisualizer notes={notes} time={playheadSeconds} orientation="vertical" span={6} />About Piano Roll Visualizer
An immersive display of absolute-time MIDI notes. Vertical mode drops future notes toward a strike line; horizontal mode turns the same notes into a river. Held notes light up and released notes fade. The host supplies notes and time; this component opens no devices and owns no transport. A bounded indexed window keeps long scores practical, and seeking redraws deterministically.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| notes / time | Timed MIDI notes[] / number | — | Immutable notes in absolute seconds and the host playhead. Each note has midi, time, duration, velocity, and optional voice. |
| orientation | "vertical" | "horizontal" | "vertical" | Falling notes or a horizontal note river. |
| span / maxNotes | number / number | 4 / 512 | Visible time window in seconds and the maximum painted-note budget. Does not alter playback. |
| low / high | number | — | Optional MIDI pitch bounds. Omit both to fit the immutable score with a minimum two-octave window. |
| height / aria-label | number | string / string | — | Responsive canvas height and accessible description; no visible label is required. |
| background / ink / accent / muted | string | — | One shared palette for the entire composition. Omit to use UI-kit tokens. |
Interaction
- Drag with pointer capture, so the gesture keeps tracking past the edge of the control.
- Shift while dragging for a fine pass; release it mid-gesture and coarse tracking resumes.
- Double-click resets to
defaultValue. - Arrow keys step normally, Shift+arrow steps finely, PageUp/PageDown jump by ten, Home/End go to the extremes.
- Proper
sliderandswitchroles with livearia-valuetext, so a screen reader announces the formatted value rather than the raw number. - The scroll wheel adjusts the value while the pointer is over the control; stepped ranges move at least one declared step per notch by default.