Rhythm guitar

A short picked string for chord strums and muted rhythm parts.

Measured outputPlay to measure this sound

Control position · Frequency (Hz) 18%

Rhythm guitar: ready

Audio: idle

Sound controls

Add to project

npx shadcn@latest add joacod/audiobits/rhythm-guitar

Adds editable source and the audiobits runtime dependency. Installation guide

Installs the catalog defaults. The usage below reflects your current settings and applied edits.

Use this sound

Use in src/integration.ts. Call play() from a user gesture and handle activation errors. Connect updates to application state; stop on cancellation or hiding, and dispose on removal.

import { createAudio } from "audiobits";
import { rhythmGuitar } from "./sounds/recipes/rhythm-guitar/recipe";

const audio = createAudio();
const sound = audio.sound(rhythmGuitar);
let request = 0;

// Use in src/integration.ts. Call play() from a user gesture; handle errors.
export async function play() {
  const token = ++request;
  await audio.start();
  if (token !== request) return;
  sound.play({ parameters: {"frequency":220,"velocity":0.8}, seed: 42 });
}

export function stop() {
  request++;
  audio.stopAll({ tails: "cut" });
}

// Call on navigation/unmount.
export async function dispose() {
  stop();
  sound.dispose();
  await audio.dispose();
}
Production lifecycle

Customize or inspect

Recipe

Apply valid JSON edits to hear and copy them. Copy Recipe returns the applied definition; the Add command installs catalog defaults.

{
  "duration": 0.32,
  "effects": [
    {
      "filter": "highpass",
      "frequency": 110,
      "q": 0.7,
      "type": "filter"
    },
    {
      "filter": "lowpass",
      "frequency": {
        "curve": "exponential",
        "points": [
          [
            0,
            {
              "control": "velocity",
              "range": [
                1600,
                4200
              ],
              "scale": "linear"
            }
          ],
          [
            0.2,
            900
          ]
        ]
      },
      "q": 0.7,
      "type": "filter"
    }
  ],
  "kind": "one-shot",
  "layers": [
    {
      "envelope": {
        "attack": 0.003,
        "decay": 0.18,
        "release": 0.06,
        "sustain": 0.08
      },
      "gainDb": {
        "control": "velocity",
        "range": [
          -38,
          -23
        ],
        "scale": "linear"
      },
      "id": "string",
      "source": {
        "frequency": {
          "control": "frequency",
          "range": [
            80,
            880
          ],
          "scale": "linear"
        },
        "type": "oscillator",
        "waveform": "sawtooth"
      }
    },
    {
      "envelope": {
        "attack": 0.003,
        "decay": 0.22,
        "release": 0.06,
        "sustain": 0.12
      },
      "gainDb": {
        "control": "velocity",
        "range": [
          -36,
          -22
        ],
        "scale": "linear"
      },
      "id": "body",
      "source": {
        "frequency": {
          "control": "frequency",
          "range": [
            80,
            880
          ],
          "scale": "linear"
        },
        "type": "oscillator",
        "waveform": "triangle"
      }
    },
    {
      "effects": [
        {
          "filter": "bandpass",
          "frequency": 2400,
          "q": 0.7,
          "type": "filter"
        }
      ],
      "envelope": {
        "attack": 0,
        "decay": 0.012,
        "release": 0.01,
        "sustain": 0
      },
      "gainDb": {
        "control": "velocity",
        "range": [
          -48,
          -34
        ],
        "scale": "linear"
      },
      "id": "pick",
      "source": {
        "color": "white",
        "type": "noise"
      }
    }
  ],
  "parameters": {
    "frequency": {
      "default": 220,
      "max": 880,
      "min": 80,
      "mode": "play"
    },
    "velocity": {
      "default": 0.8,
      "max": 1,
      "min": 0,
      "mode": "play"
    }
  },
  "schemaVersion": 1
}