{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "example-grain-console",
  "type": "registry:block",
  "title": "Grain Console",
  "description": "A silent brushed charcoal granular interface with editable sample scan, spectrum, ADSR and modulation banks.",
  "dependencies": [
    "@base-ui/react",
    "@webgpu/types",
    "maruaudio@>=0.0.3 <0.1.0"
  ],
  "registryDependencies": [
    "https://pluginui.com/r/core-envelope-display.json",
    "https://pluginui.com/r/core-fader.json",
    "https://pluginui.com/r/gallery-grain-fader.json",
    "https://pluginui.com/r/gallery-grain-knob.json",
    "https://pluginui.com/r/core-knob.json",
    "https://pluginui.com/r/core-sample-view.json"
  ],
  "files": [
    {
      "path": "components/blocks/grain-console.tsx",
      "content": "/**\n * Source: https://pluginui.com/examples/grain-console\n * Copyright © [Maru](https://maru.audio)\n *\n * Maru UI Kit — https://maru.audio/ui-kit\n *\n * Installed from the Maru UI registry. This file is yours now: edit it\n * freely, it will not be overwritten unless you re-run the add command.\n *\n * Keep this item’s companion files and CSS imports together. Dependencies\n * declared by the registry are installed with the source.\n */\nimport { percent } from \"maruaudio/ui/shared/format\"\nimport { Fader } from \"@/components/ui/fader\"\nimport { Knob } from \"@/components/ui/knob\"\nimport { useState, type CSSProperties, type ReactNode } from \"react\"\nimport { GrainKnobDesign } from \"@/components/ui/grain-knob\"\nimport { GrainFaderDesign } from \"@/components/ui/grain-fader\"\nimport {\n  EnvelopeDisplay,\n  type ADSR,\n} from \"@/components/ui/envelope-display\"\nimport { SampleView } from \"@/components/ui/sample-view\"\nimport { UI_KIT_TEXT_SELECTION_STYLES } from \"maruaudio/ui/shared/portable-styles\"\nimport \"@/components/blocks/grain-console.css\"\nconst INITIAL = {\n  amplitude: 0.7,\n  scan: 0.2,\n  feedback: 0.7,\n  coarse: 1,\n  fine: 1,\n  spread: 0.3,\n  space: 0.2,\n  highpass: 0.2,\n  chorusmix: 0.1,\n  chorusrate: 0.2,\n  chorusfeedback: 0.2,\n  fmcoarse: 0.5,\n  fmfine: 0,\n  fmgain: 0.3,\n  delaymix: 0.35,\n  delaytime: 0.18,\n  delayfine: 0,\n  driveamount: 0.25,\n  drivetone: 0.15,\n  subgain: 0.6,\n  output: 0.7,\n  glidetime: 30,\n}\ntype Parameters = typeof INITIAL\ntype Snapshot = {\n  parameters: Parameters\n  effects: boolean[]\n  bars: number[]\n  envelopes: ADSR[]\n  lfos: { amount: number; rate: number; type: string; shape: string }[]\n  envTab: number\n  lfoTab: number\n  preset: number\n  comp: boolean\n  glide: boolean\n  subShape: string\n  fmShape: string\n  windowShape: string\n  driveMode: string\n  sample: number\n  destinations: string[]\n  envDestinations: string[]\n}\nconst PEAKS = Array.from({ length: 130 }, (_, i) => {\n  const p =\n    (0.8 * Math.exp(-i / 12) +\n      0.5 * Math.exp(-(((i - 40) / 10) ** 2)) +\n      0.65 * Math.exp(-(((i - 86) / 12) ** 2)) +\n      0.25 * Math.exp(-(((i - 110) / 7) ** 2)) +\n      0.03) *\n    (0.55 + 0.45 * Math.abs(Math.sin(i * 0.74)))\n  return { min: -p, max: p }\n})\nconst PREPARED_PEAKS = {\n  min: Float32Array.from(PEAKS.map((p) => p.min)),\n  max: Float32Array.from(PEAKS.map((p) => p.max)),\n  columns: PEAKS.length,\n}\nconst REVERSE_PEAKS = {\n  min: Float32Array.from([...PREPARED_PEAKS.min].reverse()),\n  max: Float32Array.from([...PREPARED_PEAKS.max].reverse()),\n  columns: PEAKS.length,\n}\nconst DEFAULT_ENVELOPE: ADSR = {\n  attack: 1.1,\n  decay: 1.4,\n  sustain: 0.5,\n  release: 3,\n}\nexport interface GrainConsoleProps {\n  branding?: ReactNode\n}\n/** Interactive source-only interface: prepared peaks and local EQ bars are illustrative, without audio. */\nexport function GrainConsole({ branding }: GrainConsoleProps) {\n  const [parameters, setParameters] = useState(INITIAL),\n    [effects, setEffects] = useState([true, false, true, true, false]),\n    [bars, setBars] = useState([\n      0.48, 0.7, 0.8, 0.5, 0.22, 0.18, 0.22, 0.25, 0.39, 0.5, 0.62, 0.67, 0.57,\n      0.45, 0.63, 0.67,\n    ]),\n    [envelopes, setEnvelopes] = useState<ADSR[]>([\n      DEFAULT_ENVELOPE,\n      { ...DEFAULT_ENVELOPE, attack: 0.6 },\n      { ...DEFAULT_ENVELOPE, sustain: 0.8 },\n    ]),\n    [envTab, setEnvTab] = useState(0),\n    [lfoTab, setLfoTab] = useState(0),\n    [lfos, setLfos] = useState([\n      { amount: 0.7, rate: 0.65, type: \"Free\", shape: \"Sine\" },\n      { amount: 0.3, rate: 0.4, type: \"Sync\", shape: \"Triangle\" },\n      { amount: 0.5, rate: 0.2, type: \"Free\", shape: \"Square\" },\n    ]),\n    [saved, setSaved] = useState<Snapshot | null>(null),\n    [preset, setPreset] = useState(0),\n    [comp, setComp] = useState(true),\n    [glide, setGlide] = useState(true),\n    [subShape, setSubShape] = useState(\"Sine\"),\n    [fmShape, setFmShape] = useState(\"Sine\"),\n    [windowShape, setWindowShape] = useState(\"Triangle\"),\n    [driveMode, setDriveMode] = useState(\"Tube\"),\n    [popup, setPopup] = useState<string | null>(null),\n    [destinations, setDestinations] = useState([\"Scan\", \"Amplitude\", \"Spread\"]),\n    [sample, setSample] = useState(0),\n    [envDestinations, setEnvDestinations] = useState([\n      \"Amplitude\",\n      \"Pitch\",\n      \"Mix\",\n    ])\n  const patch = (key: keyof Parameters, value: number) =>\n    setParameters((p) => ({ ...p, [key]: value }))\n  const dial = (\n    key: keyof Parameters,\n    label: string,\n    accent = \"#1ccbe2\",\n    disabled = false\n  ) => (\n    <div className=\"grain-console__dial\">\n      <Knob\n        value={parameters[key]}\n        onChange={(v) => patch(key, v)}\n        label={label}\n        disabled={disabled}\n        valueDisplay=\"percent\"\n        size={48}\n        defaultValue={INITIAL[key]}\n        hideLabel\n        hideValue\n        renderDesign={(state) => <GrainKnobDesign {...state} accent={accent} />}\n      />\n      <span className=\"grain-console__caption\">\n        {label.replace(/^(FM |Delay |Sub )/, \"\")}\n      </span>\n    </div>\n  )\n  const numeric = (key: keyof Parameters, label: string, color = \"#1ccbe2\") => (\n    <label className=\"grain-console__number\" style={{ color }}>\n      <input\n        aria-label={label}\n        type=\"number\"\n        step={key === \"fmcoarse\" ? 0.1 : 1}\n        value={parameters[key]}\n        onChange={(e) => patch(key, Number(e.target.value))}\n      />\n      <span className=\"grain-console__caption\">\n        {label.replace(/^(FM |Delay |Sub )/, \"\")}\n      </span>\n    </label>\n  )\n  const shape = (\n    label: string,\n    value: string,\n    onChange: (v: string) => void\n  ) => (\n    <label className=\"grain-console__shape\">\n      <div className=\"grain-console__shape-art\">\n        <svg viewBox=\"0 0 40 18\" aria-hidden=\"true\">\n          <path\n            d={\n              value === \"Sine\"\n                ? \"M 2 9 Q 7 -4 13 9 T 25 9 T 38 9\"\n                : value === \"Triangle\"\n                  ? \"M 2 14 L 11 3 L 25 14 L 38 3\"\n                  : value === \"Square\"\n                    ? \"M 2 14 V 3 H 15 V 14 H 28 V 3 H 38\"\n                    : \"M 2 14 L 18 3 V 14 L 36 3 V 14\"\n            }\n          />\n        </svg>\n        <select\n          aria-label={label}\n          value={value}\n          onChange={(e) => onChange(e.target.value)}\n        >\n          <option>Sine</option>\n          <option>Triangle</option>\n          <option>Square</option>\n          <option>Saw</option>\n        </select>\n      </div>\n      <span className=\"grain-console__caption\">\n        {label.replace(/^(FM |Delay |Sub |LFO )/, \"\")}\n      </span>\n    </label>\n  )\n  const miniToggle = (\n    label: string,\n    value: boolean,\n    change: (v: boolean) => void\n  ) => (\n    <button\n      type=\"button\"\n      className=\"grain-console__switch\"\n      aria-label={label}\n      aria-pressed={value}\n      onClick={() => change(!value)}\n    >\n      <i />\n      <span className=\"grain-console__caption\">\n        {label.replace(/^(FM |Delay |Sub )/, \"\")}\n      </span>\n    </button>\n  )\n  const recall = (index: number) => {\n    setPreset(index)\n    setParameters({\n      ...INITIAL,\n      scan: index ? 0.65 : 0.2,\n      spread: index ? 0.65 : 0.3,\n    })\n    setBars(\n      bars.map((_, i) => 0.18 + Math.abs(Math.sin(i * 0.67 + index)) * 0.62)\n    )\n  }\n  const env = envelopes[envTab]!,\n    lfo = lfos[lfoTab]!\n  const updateEnv = (next: ADSR) =>\n    setEnvelopes((items) =>\n      items.map((item, i) => (i === envTab ? next : item))\n    )\n  const updateLfo = (next: Partial<typeof lfo>) =>\n    setLfos((items) =>\n      items.map((item, i) => (i === lfoTab ? { ...item, ...next } : item))\n    )\n  return (\n    <section\n      className=\"grain-console\"\n      aria-label=\"Grain Console, silent interface\"\n      data-text-selection=\"editable-only\"\n      onKeyDown={(e) => {\n        if (e.key === \"Escape\") setPopup(null)\n      }}\n    >\n      <style>{UI_KIT_TEXT_SELECTION_STYLES}</style>\n      <header className=\"grain-console__header\">\n        <div className=\"grain-console__brand\">\n          {branding ?? (\n            <>\n              <svg viewBox=\"0 0 70 24\" aria-hidden=\"true\">\n                {[3, 6, 12, 20, 24, 18, 12, 7, 3].map((h, i) => (\n                  <rect\n                    key={i}\n                    x={i * 7}\n                    y={(24 - h) / 2}\n                    width=\"4\"\n                    height={h}\n                  />\n                ))}\n              </svg>\n              <span>GRAIN CONSOLE</span>\n            </>\n          )}\n        </div>\n        <nav aria-label=\"Preset actions\">\n          <select\n            aria-label=\"Preset\"\n            value={preset}\n            onChange={(e) => recall(Number(e.target.value))}\n          >\n            <option value={0}>Preset: Crystal Dust</option>\n            <option value={1}>Preset: Wide Drift</option>\n          </select>\n          <button\n            onClick={() => {\n              if (saved) {\n                setParameters({ ...saved.parameters })\n                setEffects([...saved.effects])\n                setBars([...saved.bars])\n                setEnvelopes(saved.envelopes.map((e) => ({ ...e })))\n                setLfos(saved.lfos.map((v) => ({ ...v })))\n                setEnvTab(saved.envTab)\n                setLfoTab(saved.lfoTab)\n                setPreset(saved.preset)\n                setComp(saved.comp)\n                setGlide(saved.glide)\n                setSubShape(saved.subShape)\n                setFmShape(saved.fmShape)\n                setWindowShape(saved.windowShape)\n                setDriveMode(saved.driveMode)\n                setSample(saved.sample)\n                setDestinations([...saved.destinations])\n                setEnvDestinations([...saved.envDestinations])\n              }\n            }}\n            disabled={!saved}\n          >\n            Load\n          </button>\n          <button\n            onClick={() =>\n              setSaved({\n                parameters: { ...parameters },\n                effects: [...effects],\n                bars: [...bars],\n                envelopes: envelopes.map((e) => ({ ...e })),\n                lfos: lfos.map((v) => ({ ...v })),\n                envTab,\n                lfoTab,\n                preset,\n                comp,\n                glide,\n                subShape,\n                fmShape,\n                windowShape,\n                driveMode,\n                sample,\n                destinations: [...destinations],\n                envDestinations: [...envDestinations],\n              })\n            }\n          >\n            {saved ? \"Saved\" : \"Save\"}\n          </button>\n          <button\n            aria-expanded={popup === \"Settings\"}\n            onClick={() => setPopup(popup === \"Settings\" ? null : \"Settings\")}\n          >\n            Settings\n          </button>\n          <output>Delay Dry/Wet: {percent()(parameters.delaymix)}</output>\n        </nav>\n      </header>\n      <div className=\"grain-console__top\">\n        <div className=\"grain-console__sample grain-console__panel\">\n          <h3>SAMPLE</h3>\n          <div className=\"grain-console__sample-screen\">\n            <div className=\"grain-console__sample-caption\">\n              <span>\n                ⊞　{sample ? \"cloud-study\" : \"glass-study\"}.wav · 2428ms\n              </span>\n              <button\n                aria-label=\"Previous illustrative sample\"\n                onClick={() => setSample(1 - sample)}\n              >\n                ←\n              </button>\n              <button\n                aria-label=\"Next illustrative sample\"\n                onClick={() => setSample(1 - sample)}\n              >\n                →\n              </button>\n            </div>\n            <SampleView\n              peaks={sample ? REVERSE_PEAKS : PREPARED_PEAKS}\n              durationSeconds={2.428}\n              showModeToggle={false}\n              showRuler={false}\n              height={73}\n              waveformColor=\"#1ccbe2\"\n              playheads={[\n                { id: \"scan\", position: parameters.scan, color: \"#1ccbe2\" },\n              ]}\n              label=\"Illustrative sample waveform, no audio\"\n            />\n            <Fader\n              orientation=\"horizontal\"\n              length={488}\n              value={parameters.scan}\n              onChange={(v) => patch(\"scan\", v)}\n              label=\"Sample scan\"\n              format={percent()}\n              thickness={15}\n              capInset={0}\n              hideLabel\n              hideValue\n              renderDesign={GrainFaderDesign}\n            />\n          </div>\n          <div className=\"grain-console__sample-controls\">\n            {dial(\"amplitude\", \"Amplitude\")}\n            {dial(\"scan\", \"Scan\")}\n            {dial(\"feedback\", \"Grain Fdbck\")}\n            {numeric(\"coarse\", \"Coarse\")}\n            {numeric(\"fine\", \"Fine\")}\n            {shape(\"Window Shape\", windowShape, setWindowShape)}\n            {miniToggle(\"Comp\", comp, setComp)}\n          </div>\n        </div>\n        {([\"Spread\", \"Chorus\", \"FM\", \"Delay\", \"Drive\"] as const).map(\n          (name, i) => (\n            <div\n              key={name}\n              className=\"grain-console__effect grain-console__panel\"\n              data-enabled={effects[i]}\n              style={\n                {\n                  \"--grain-section\": [\n                    \"#26e381\",\n                    \"#1ccbe2\",\n                    \"#ffe478\",\n                    \"#ff9b32\",\n                    \"#1ccbe2\",\n                  ][i],\n                } as CSSProperties\n              }\n            >\n              <h3>\n                <button\n                  aria-label={`${name} enabled`}\n                  aria-pressed={effects[i]}\n                  onClick={() =>\n                    setEffects((items) =>\n                      items.map((v, j) => (j === i ? !v : v))\n                    )\n                  }\n                >\n                  <i />\n                  {name}\n                </button>\n              </h3>\n              <div className=\"grain-console__effect-controls\">\n                {i === 0 ? (\n                  <>\n                    {dial(\"spread\", \"Amount\", \"#26e381\", !effects[i])}\n                    {dial(\"space\", \"Space\", \"#26e381\", !effects[i])}\n                    {dial(\"highpass\", \"Hi Pass\", \"#26e381\", !effects[i])}\n                  </>\n                ) : i === 1 ? (\n                  <>\n                    {dial(\"chorusmix\", \"Dry/Wet\", undefined, !effects[i])}\n                    {dial(\"chorusrate\", \"Rate\", undefined, !effects[i])}\n                    {dial(\"chorusfeedback\", \"Fdbck\", undefined, !effects[i])}\n                  </>\n                ) : i === 2 ? (\n                  <>\n                    {shape(\"FM Shape\", fmShape, setFmShape)}\n                    {numeric(\"fmcoarse\", \"FM Coarse\", \"#ffe478\")}\n                    {numeric(\"fmfine\", \"FM Fine\", \"#ffe478\")}\n                    {dial(\"fmgain\", \"Gain\", \"#ffe478\", !effects[i])}\n                  </>\n                ) : i === 3 ? (\n                  <>\n                    {dial(\"delaymix\", \"Dry/Wet\", \"#ff9b32\", !effects[i])}\n                    {dial(\"delaytime\", \"Time\", \"#ff9b32\", !effects[i])}\n                    {numeric(\"delayfine\", \"Delay Fine\", \"#ff9b32\")}\n                  </>\n                ) : (\n                  <>\n                    <select\n                      aria-label=\"Drive mode\"\n                      value={driveMode}\n                      disabled={!effects[i]}\n                      onChange={(e) => setDriveMode(e.target.value)}\n                    >\n                      <option>Tube</option>\n                      <option>Tape</option>\n                      <option>Fold</option>\n                    </select>\n                    {dial(\"driveamount\", \"Amount\", undefined, !effects[i])}\n                    {dial(\"drivetone\", \"Tone\", undefined, !effects[i])}\n                  </>\n                )}\n              </div>\n            </div>\n          )\n        )}\n      </div>\n      <div className=\"grain-console__bottom\">\n        <div className=\"grain-console__sub grain-console__panel\">\n          <h3>● SUB OSC</h3>\n          {shape(\"Sub Shape\", subShape, setSubShape)}\n          {dial(\"subgain\", \"Gain\")}\n        </div>\n        <div className=\"grain-console__eq grain-console__panel\">\n          <h3>● SPECTRAL EQ</h3>\n          <div\n            className=\"grain-console__bars\"\n            aria-label=\"Editable illustrative spectral levels\"\n          >\n            {bars.map((value, i) => (\n              <div key={i}>\n                <Fader\n                  value={value}\n                  onChange={(v) =>\n                    setBars((items) => items.map((x, j) => (j === i ? v : x)))\n                  }\n                  label={`Spectral band ${i + 1}`}\n                  length={160}\n                  format={percent()}\n                  orientation={\"vertical\"}\n                  thickness={15}\n                  capInset={0}\n                  hideLabel\n                  hideValue\n                  renderDesign={GrainFaderDesign}\n                />\n                <span>{[1, 3, 5, 7][i % 4]}</span>\n              </div>\n            ))}\n          </div>\n        </div>\n        <div className=\"grain-console__lfo grain-console__panel\">\n          <h3>\n            LFO{\" \"}\n            <span role=\"group\" aria-label=\"LFO bank\">\n              {[0, 1, 2].map((i) => (\n                <button\n                  aria-pressed={lfoTab === i}\n                  onClick={() => setLfoTab(i)}\n                  key={i}\n                >\n                  {i + 1}\n                </button>\n              ))}\n            </span>\n          </h3>\n          <button\n            className=\"grain-console__destination\"\n            onClick={() =>\n              setPopup(popup === \"LFO Destinations\" ? null : \"LFO Destinations\")\n            }\n          >\n            Destinations\n          </button>\n          <div className=\"grain-console__lfo-options\">\n            <select\n              aria-label=\"LFO type\"\n              value={lfo.type}\n              onChange={(e) => updateLfo({ type: e.target.value })}\n            >\n              <option>Free</option>\n              <option>Sync</option>\n            </select>\n            {shape(\"LFO Shape\", lfo.shape, (v) => updateLfo({ shape: v }))}\n          </div>\n          <div className=\"grain-console__pair\">\n            {([\"amount\", \"rate\"] as const).map((key) => (\n              <div className=\"grain-console__dial\" key={key}>\n                <Knob\n                  value={lfo[key]}\n                  onChange={(v) => updateLfo({ [key]: v })}\n                  label={`LFO ${key}`}\n                  valueDisplay=\"percent\"\n                  size={48}\n                  defaultValue={0.5}\n                  hideLabel\n                  hideValue\n                  renderDesign={GrainKnobDesign}\n                />\n                <span>{key}</span>\n              </div>\n            ))}\n          </div>\n        </div>\n        <div className=\"grain-console__envelope grain-console__panel\">\n          <h3>\n            ENVELOPE{\" \"}\n            <span role=\"group\" aria-label=\"Envelope bank\">\n              {[0, 1, 2].map((i) => (\n                <button\n                  aria-pressed={envTab === i}\n                  onClick={() => setEnvTab(i)}\n                  key={i}\n                >\n                  {i + 1}\n                </button>\n              ))}\n            </span>\n          </h3>\n          <button\n            className=\"grain-console__destination\"\n            onClick={() =>\n              setPopup(\n                popup === \"Envelope Destinations\"\n                  ? null\n                  : \"Envelope Destinations\"\n              )\n            }\n          >\n            Destinations\n          </button>\n          <EnvelopeDisplay\n            value={env}\n            onChange={updateEnv}\n            height={74}\n            showGrid={false}\n            showSegmentLabels={false}\n            curve=\"exponential\"\n            aria-label=\"Envelope curve\"\n          />\n          <div className=\"grain-console__pair\">\n            {([\"attack\", \"decay\", \"sustain\", \"release\"] as const).map((key) => (\n              <div className=\"grain-console__dial\" key={key}>\n                <Knob\n                  value={\n                    key === \"sustain\"\n                      ? env[key]\n                      : env[key] / (key === \"release\" ? 8 : 4)\n                  }\n                  onChange={(v) =>\n                    updateEnv({\n                      ...env,\n                      [key]:\n                        key === \"sustain\"\n                          ? v\n                          : Math.max(0.001, v * (key === \"release\" ? 8 : 4)),\n                    })\n                  }\n                  label={`Envelope ${key}`}\n                  size={44}\n                  valueDisplay=\"percent\"\n                  defaultValue={0.5}\n                  hideLabel\n                  hideValue\n                  renderDesign={GrainKnobDesign}\n                />\n                <span>{key}</span>\n              </div>\n            ))}\n          </div>\n        </div>\n        <div className=\"grain-console__master grain-console__panel\">\n          <h3>MASTER</h3>\n          <div className=\"grain-console__master-options\">\n            {miniToggle(\"Glide\", glide, setGlide)}\n            {numeric(\"glidetime\", \"Time\")}\n          </div>\n          {dial(\"output\", \"Output\")}\n        </div>\n      </div>\n      {popup && (\n        <div className=\"grain-console__popup\" role=\"dialog\" aria-label={popup}>\n          <strong>{popup}</strong>\n          <button aria-label=\"Close options\" onClick={() => setPopup(null)}>\n            ×\n          </button>\n          {popup === \"Settings\" ? (\n            <label>\n              <input\n                type=\"checkbox\"\n                checked={comp}\n                onChange={(e) => setComp(e.target.checked)}\n              />\n              Compensate level\n            </label>\n          ) : (\n            (popup === \"LFO Destinations\" ? destinations : envDestinations).map(\n              (destination, i) => (\n                <label key={i}>\n                  Slot {i + 1}\n                  <select\n                    value={destination}\n                    onChange={(e) =>\n                      (popup === \"LFO Destinations\"\n                        ? setDestinations\n                        : setEnvDestinations)((items) =>\n                        items.map((v, j) => (j === i ? e.target.value : v))\n                      )\n                    }\n                  >\n                    <option>Scan</option>\n                    <option>Amplitude</option>\n                    <option>Spread</option>\n                    <option>Mix</option>\n                    <option>Pitch</option>\n                  </select>\n                </label>\n              )\n            )\n          )}\n        </div>\n      )}\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "@components/blocks/grain-console.tsx"
    },
    {
      "path": "components/blocks/grain-console.css",
      "content": "/**\n * Source: https://pluginui.com/examples/grain-console\n * Copyright © [Maru](https://maru.audio)\n *\n * Maru UI Kit — https://maru.audio/ui-kit\n *\n * Installed from the Maru UI registry. This file is yours now: edit it\n * freely, it will not be overwritten unless you re-run the add command.\n *\n * Keep this item’s companion files and CSS imports together. Dependencies\n * declared by the registry are installed with the source.\n */\n.grain-console {\n  position: relative;\n  width: 1024px;\n  height: 566px;\n  box-sizing: border-box;\n  color: #c5d6dd;\n  font-family: \"Arial Narrow\", \"Roboto Condensed\", Arial, sans-serif;\n  font-stretch: condensed;\n  font-size: 13px;\n  --uikit-accent: #1ccbe2;\n  --uikit-surface: #191d1e;\n  --uikit-text: #c5d6dd;\n  --uikit-border: #363d40;\n  --uikit-text-muted: #94a5ab;\n  background: repeating-linear-gradient(\n    0deg,\n    #2c3032 0,\n    #2c3032 1px,\n    #303436 1px,\n    #303436 3px\n  );\n  box-shadow: 0 2px 8px #0008;\n  border: 1px solid #151819;\n  overflow: hidden;\n}\n.grain-console * {\n  box-sizing: border-box;\n}\n.grain-console button,\n.grain-console select,\n.grain-console input {\n  font: inherit;\n  color: inherit;\n}\n.grain-console button {\n  cursor: pointer;\n  border: 0;\n  background: none;\n  padding: 0;\n}\n.grain-console button:disabled {\n  cursor: default;\n  opacity: 0.35;\n}\n.grain-console select,\n.grain-console input[type=\"number\"] {\n  border: 0;\n  border-radius: 3px;\n  background: #111516;\n  color: #1ccbe2;\n  max-width: 100%;\n  text-align: center;\n  outline: none;\n}\n.grain-console select {\n  appearance: auto;\n  font-size: 11px;\n  padding: 2px 3px;\n}\n.grain-console select:focus-visible,\n.grain-console input:focus-visible,\n.grain-console button:focus-visible {\n  outline: 1px solid #4fe1f4;\n  outline-offset: 2px;\n}\n.grain-console__header {\n  height: 35px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 3px 9px 3px 15px;\n  background: linear-gradient(#4b5052, #323637);\n  border-bottom: 3px solid #151819;\n  box-shadow: 0 3px 5px #0006;\n}\n.grain-console__brand {\n  display: flex;\n  gap: 8px;\n  align-items: center;\n  color: #1fd3e8;\n  font-size: 16px;\n  text-shadow: 0 1px 2px #000;\n}\n.grain-console__brand svg {\n  width: 68px;\n  height: 24px;\n  fill: currentColor;\n}\n.grain-console__header nav {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  background: linear-gradient(#262b2d, #15191a);\n  border: 1px solid #181c1e;\n  padding: 2px 10px;\n  border-radius: 2px;\n  color: #159db3;\n  height: 24px;\n  font-size: 12px;\n  box-shadow: inset 0 1px 2px #0005;\n}\n.grain-console__header select {\n  background: none;\n  padding: 0;\n  color: #24d2e8;\n  font-size: 12px;\n  max-width: 150px;\n}\n.grain-console__header output {\n  margin-left: 48px;\n  color: #1ccbe2;\n  font-size: 12px;\n}\n.grain-console__top {\n  display: grid;\n  grid-template-columns: 526px repeat(5, 1fr);\n  height: 294px;\n  gap: 4px;\n  background: #141819;\n}\n.grain-console__bottom {\n  display: grid;\n  grid-template-columns: 108px 332px 160px 310px 1fr;\n  gap: 4px;\n  height: 234px;\n  background: #141819;\n}\n.grain-console__panel {\n  min-width: 0;\n  background: repeating-linear-gradient(\n    0deg,\n    #2b2e30 0,\n    #2b2e30 1px,\n    #2d3032 1px,\n    #2d3032 3px\n  );\n  border-radius: 3px;\n  padding: 0 8px;\n  box-shadow: inset 0 1px 1px #474b4d;\n}\n.grain-console h3 {\n  height: 36px;\n  padding: 9px 0 5px;\n  margin: 0;\n  border-bottom: 1px solid #181c1d;\n  box-shadow: 0 1px 0 #414648;\n  font-size: 14px;\n  font-weight: 500;\n  white-space: nowrap;\n}\n.grain-console h3 button {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  text-transform: uppercase;\n  font-size: 14px;\n}\n.grain-console h3 i {\n  width: 10px;\n  height: 10px;\n  border-radius: 50%;\n  background: var(--grain-section);\n}\n.grain-console__sample-screen {\n  margin: 15px 7px 0;\n  background: repeating-linear-gradient(\n    90deg,\n    #161b1d 0,\n    #161b1d 2px,\n    #1b2022 2px,\n    #1b2022 4px\n  );\n  border-radius: 3px;\n  border-bottom: 2px solid #43494b;\n  padding: 4px 0 0;\n  height: 114px;\n  overflow: hidden;\n}\n.grain-console__sample-caption {\n  display: flex;\n  align-items: center;\n  color: #1ccbe2;\n  padding: 1px 7px;\n  font-size: 12px;\n  height: 22px;\n}\n.grain-console__sample-caption span {\n  flex: 1;\n}\n.grain-console__sample-caption button {\n  font-size: 20px;\n  margin-left: 10px;\n}\n.grain-console__sample-controls {\n  display: flex;\n  justify-content: space-around;\n  align-items: flex-start;\n  margin-top: 30px;\n  gap: 10px;\n}\n.grain-console__dial {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 8px;\n  min-width: 45px;\n}\n.grain-console__dial > .grain-console__caption,\n.grain-console__shape > .grain-console__caption,\n.grain-console__number > .grain-console__caption {\n  text-transform: uppercase;\n  text-align: center;\n  font-size: 10px;\n  line-height: 12px;\n}\n.grain-console__sample-controls > .grain-console__dial {\n  width: 65px;\n}\n.grain-console__sample-controls > .grain-console__number,\n.grain-console__sample-controls > .grain-console__shape,\n.grain-console__sample-controls > .grain-console__switch {\n  margin-top: 10px;\n}\n.grain-console__sample-controls .grain-console__dial > .grain-console__caption {\n  max-width: 60px;\n}\n.grain-console__number {\n  display: flex;\n  align-items: center;\n  flex-direction: column;\n  gap: 8px;\n  width: 46px;\n}\n.grain-console__number input {\n  width: 46px;\n  height: 20px;\n  color: inherit;\n  appearance: textfield;\n}\n.grain-console__number input::-webkit-inner-spin-button {\n  appearance: none;\n}\n.grain-console__shape {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 6px;\n}\n.grain-console__shape select {\n  width: 45px;\n  color: var(--grain-section, #1ccbe2);\n  font-size: 11px;\n}\n.grain-console__effect-controls {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 18px;\n  margin-top: 15px;\n}\n.grain-console__effect[data-enabled=\"false\"] h3 {\n  color: #7d878c;\n}\n.grain-console__effect[data-enabled=\"false\"] h3 i {\n  background: #53595d;\n}\n.grain-console__effect[data-enabled=\"false\"] .grain-console__effect-controls {\n  opacity: 0.55;\n}\n.grain-console__effect .grain-console__dial {\n  gap: 8px;\n}\n.grain-console__effect .grain-console__number {\n  gap: 3px;\n}\n.grain-console__effect:nth-child(4) .grain-console__effect-controls {\n  gap: 14px;\n}\n.grain-console__effect:nth-child(6) .grain-console__effect-controls {\n  gap: 34px;\n}\n.grain-console__switch {\n  display: flex;\n  align-items: center;\n  flex-direction: column;\n  gap: 9px;\n  font-size: 10px;\n  text-transform: uppercase;\n}\n.grain-console__switch i {\n  width: 30px;\n  height: 14px;\n  border-radius: 3px;\n  background: #275d66;\n  position: relative;\n}\n.grain-console__switch i:after {\n  content: \"\";\n  position: absolute;\n  left: 2px;\n  top: 0;\n  width: 14px;\n  height: 14px;\n  border-radius: 3px;\n  background: #50676b;\n}\n.grain-console__switch[aria-pressed=\"true\"] i:after {\n  left: 15px;\n  background: #1ccbe2;\n}\n.grain-console__sub h3,\n.grain-console__eq h3 {\n  color: #c5d6dd;\n}\n.grain-console__sub h3::first-letter,\n.grain-console__eq h3::first-letter {\n  color: #1ccbe2;\n}\n.grain-console__sub > .grain-console__shape {\n  margin-top: 18px;\n}\n.grain-console__sub > .grain-console__dial {\n  margin-top: 44px;\n}\n.grain-console__bars {\n  display: flex;\n  align-items: flex-end;\n  gap: 4px;\n  height: 184px;\n  background: #171b1c;\n  padding: 0 6px;\n  margin: 8px 4px 0;\n  border-top: 1px solid #0c1011;\n}\n.grain-console__bars > div {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 1px;\n  flex: 1;\n  min-width: 0;\n}\n.grain-console__bars .grain-rail {\n  width: 15px;\n}\n.grain-console__bars span {\n  font-size: 10px;\n  color: #1ccbe2;\n}\n.grain-console h3 > span {\n  display: inline-flex;\n  gap: 9px;\n  margin-left: 12px;\n}\n.grain-console h3 > span button {\n  color: #687074;\n  font-size: 13px;\n}\n.grain-console h3 > span button[aria-pressed=\"true\"] {\n  color: #c5d6dd;\n}\n.grain-console__destination {\n  background: #1ccbe2 !important;\n  border-radius: 2px;\n  color: #102b31 !important;\n  text-transform: uppercase;\n  font-size: 10px !important;\n  padding: 4px 6px !important;\n  margin: 12px 7px 9px;\n}\n.grain-console__lfo-options {\n  display: flex;\n  justify-content: space-between;\n  align-items: start;\n  margin: 18px 8px;\n}\n.grain-console__lfo-options .grain-console__shape > .grain-console__caption {\n  display: none;\n}\n.grain-console__lfo .grain-console__pair {\n  margin-top: 43px;\n}\n.grain-console__pair {\n  display: flex;\n  justify-content: space-around;\n}\n.grain-console__envelope > div[role=\"group\"] {\n  background: #171b1c !important;\n  margin: 1px 5px 11px;\n}\n.grain-console__master-options {\n  display: flex;\n  gap: 9px;\n  margin: 20px 4px 40px;\n}\n.grain-console__master-options .grain-console__number {\n  width: 35px;\n}\n.grain-console__master-options input {\n  width: 35px;\n}\n.grain-console__master-options .grain-console__switch {\n  justify-content: center;\n}\n.grain-console__master h3 {\n  text-align: center;\n}\n.grain-console__popup {\n  position: absolute;\n  z-index: 10;\n  top: 40px;\n  right: 12px;\n  width: 230px;\n  background: #1a2022;\n  border: 1px solid #546067;\n  border-radius: 4px;\n  padding: 14px;\n  box-shadow: 0 5px 20px #0009;\n  display: grid;\n  gap: 13px;\n}\n.grain-console__popup > button {\n  position: absolute;\n  right: 10px;\n  top: 7px;\n  font-size: 18px;\n}\n.grain-console__popup label {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  gap: 8px;\n}\n.grain-console__popup select {\n  width: 110px;\n}\n\n.grain-console__sample-screen canvas {\n  mask-image: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 5px);\n}\n.grain-console__sample-screen > div[role=\"group\"] {\n  border: 0 !important;\n  border-radius: 0 !important;\n  background: transparent !important;\n}\n.grain-console__envelope svg {\n  border-radius: 2px !important;\n  border: 0 !important;\n}\n\n.grain-console {\n  font-family: Arial, sans-serif;\n}\n.grain-console h3,\n.grain-console h3 button {\n  font-size: 15px;\n}\n.grain-console__dial > .grain-console__caption,\n.grain-console__shape > .grain-console__caption,\n.grain-console__number > .grain-console__caption {\n  font-size: 11px;\n  line-height: 13px;\n}\n.grain-console__shape-art {\n  position: relative;\n  width: 45px;\n  height: 20px;\n  border-radius: 3px;\n  background: #111516;\n  color: var(--grain-section, #1ccbe2);\n}\n.grain-console__shape-art svg {\n  position: absolute;\n  inset: 1px 4px;\n  width: 37px;\n  height: 18px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 2;\n}\n.grain-console__shape-art select {\n  position: absolute;\n  inset: 0;\n  width: 100%;\n  height: 100%;\n  opacity: 0;\n  cursor: pointer;\n}\n.grain-console__shape-art:focus-within {\n  outline: 1px solid #1ccbe2;\n}\n.grain-console__effect[data-enabled=\"false\"] .grain-console__effect-controls {\n  opacity: 0.85;\n}\n.grain-console__effect[data-enabled=\"false\"] .grain-knob {\n  opacity: 0.5;\n}\n",
      "type": "registry:file",
      "target": "@components/blocks/grain-console.css"
    }
  ]
}
