AudioBits is currently tested in Chromium-based browsers. Other browsers are not yet verified.
Electric guitar lead
A picked procedural electric lead with live brightness and pitch bend.
Control position · Bend 50%
Electric guitar lead: stopped
Audio: idle
Sound controls
Add to project
npx shadcn@latest add joacod/audiobits/electric-guitar-leadAdds 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 { electricGuitarLead } from "./sounds/recipes/electric-guitar-lead/recipe";
const audio = createAudio();
const sound = audio.sound(electricGuitarLead);
let request = 0;
let voice: ReturnType<typeof sound.play> | undefined;
// 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;
voice?.stop();
voice = sound.play({ parameters: {"bend":0,"brightness":0.55,"frequency":440,"velocity":0.8}, seed: 42 });
}
// Connect application state to these live parameters.
export function update(values: { "bend": number; "brightness": number }) {
voice?.set(values);
}
// Release with the recipe's natural tail.
export function release() {
request++;
voice?.stop();
voice = undefined;
}
export function stop() {
request++;
audio.stopAll({ tails: "cut" });
voice = undefined;
}
// Call on navigation/unmount.
export async function dispose() {
stop();
sound.dispose();
await audio.dispose();
}
Production lifecycleCustomize or inspect
Recipe
Apply valid JSON edits to hear and copy them. Copy Recipe returns the applied definition; the Add command installs catalog defaults.
{
"effects": [
{
"filter": "highpass",
"frequency": 100,
"q": 0.7,
"type": "filter"
},
{
"filter": "lowpass",
"frequency": {
"control": "brightness",
"range": [
1500,
6500
],
"scale": "exponential"
},
"q": 0.8,
"type": "filter"
},
{
"feedback": 0,
"mix": 0.07,
"time": 0.12,
"type": "delay"
}
],
"kind": "sustained",
"layers": [
{
"envelope": {
"attack": 0.003,
"decay": 0.22,
"release": 0.065,
"sustain": 0.4
},
"gainDb": {
"control": "velocity",
"range": [
-30,
-11
],
"scale": "linear"
},
"id": "string",
"source": {
"detune": {
"control": "bend",
"range": [
-200,
200
],
"scale": "linear"
},
"frequency": {
"control": "frequency",
"range": [
110,
1400
],
"scale": "linear"
},
"type": "oscillator",
"waveform": "triangle"
}
},
{
"envelope": {
"attack": 0.004,
"decay": 0.16,
"release": 0.06,
"sustain": 0.22
},
"gainDb": {
"control": "velocity",
"range": [
-38,
-23
],
"scale": "linear"
},
"id": "amp-edge",
"source": {
"detune": {
"control": "bend",
"range": [
-200,
200
],
"scale": "linear"
},
"frequency": {
"control": "frequency",
"range": [
110,
1400
],
"scale": "linear"
},
"type": "oscillator",
"waveform": "sawtooth"
}
},
{
"envelope": {
"attack": 0.002,
"decay": 0.12,
"release": 0.05,
"sustain": 0.06
},
"gainDb": {
"control": "velocity",
"range": [
-38,
-24
],
"scale": "linear"
},
"id": "ring",
"source": {
"detune": {
"control": "bend",
"range": [
-200,
200
],
"scale": "linear"
},
"frequency": {
"control": "frequency",
"range": [
220,
2800
],
"scale": "linear"
},
"type": "oscillator",
"waveform": "sine"
}
},
{
"effects": [
{
"filter": "bandpass",
"frequency": 2800,
"q": 0.7,
"type": "filter"
}
],
"envelope": {
"attack": 0,
"decay": 0.012,
"release": 0.01,
"sustain": 0
},
"gainDb": {
"control": "velocity",
"range": [
-48,
-33
],
"scale": "linear"
},
"id": "pick",
"source": {
"color": "white",
"type": "noise"
}
}
],
"parameters": {
"bend": {
"default": 0,
"max": 200,
"min": -200,
"mode": "live",
"smoothing": 0.04
},
"brightness": {
"default": 0.55,
"max": 1,
"min": 0,
"mode": "live",
"smoothing": 0.04
},
"frequency": {
"default": 440,
"max": 1400,
"min": 110,
"mode": "play"
},
"velocity": {
"default": 0.8,
"max": 1,
"min": 0,
"mode": "play"
}
},
"schemaVersion": 1
}