AudioBits is currently tested in Chromium-based browsers. Other browsers are not yet verified.
Picked bass
A rounded picked electric bass with decaying string harmonics.
Control position · Frequency (Hz) 31%
Picked bass: ready
Audio: idle
Sound controls
Add to project
npx shadcn@latest add joacod/audiobits/picked-bassAdds 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 { pickedBass } from "./sounds/recipes/picked-bass/recipe";
const audio = createAudio();
const sound = audio.sound(pickedBass);
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":82.41,"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 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.
{
"duration": 0.28,
"kind": "one-shot",
"layers": [
{
"effects": [
{
"filter": "lowpass",
"frequency": {
"curve": "exponential",
"points": [
[
0,
{
"control": "frequency",
"range": [
700,
3200
],
"scale": "linear"
}
],
[
0.14,
{
"control": "frequency",
"range": [
220,
1100
],
"scale": "linear"
}
]
]
},
"q": 0.65,
"type": "filter"
}
],
"envelope": {
"attack": 0.004,
"decay": 0.16,
"release": 0.09,
"sustain": 0.22
},
"gainDb": {
"control": "velocity",
"range": [
-20,
-10
],
"scale": "linear"
},
"id": "string",
"source": {
"frequency": {
"control": "frequency",
"range": [
30,
200
],
"scale": "linear"
},
"type": "oscillator",
"waveform": "triangle"
}
},
{
"envelope": {
"attack": 0.003,
"decay": 0.05,
"release": 0.05,
"sustain": 0.35
},
"gainDb": {
"control": "velocity",
"range": [
-20,
-11
],
"scale": "linear"
},
"id": "sub",
"source": {
"frequency": {
"control": "frequency",
"range": [
30,
200
],
"scale": "linear"
},
"type": "oscillator",
"waveform": "sine"
}
},
{
"effects": [
{
"filter": "lowpass",
"frequency": 1500,
"q": 0.7,
"type": "filter"
}
],
"envelope": {
"attack": 0.003,
"decay": 0.06,
"release": 0.04,
"sustain": 0.08
},
"gainDb": {
"control": "velocity",
"range": [
-31,
-18
],
"scale": "linear"
},
"id": "upper-string",
"source": {
"frequency": {
"control": "frequency",
"range": [
60.18,
401.2
],
"scale": "linear"
},
"type": "oscillator",
"waveform": "sine"
}
},
{
"effects": [
{
"filter": "bandpass",
"frequency": 1700,
"q": 0.7,
"type": "filter"
}
],
"envelope": {
"attack": 0.001,
"decay": 0.018,
"release": 0.012,
"sustain": 0
},
"gainDb": {
"control": "velocity",
"range": [
-44,
-30
],
"scale": "linear"
},
"id": "finger",
"source": {
"color": "white",
"type": "noise"
}
}
],
"parameters": {
"frequency": {
"default": 82.41,
"max": 200,
"min": 30,
"mode": "play"
},
"velocity": {
"default": 0.8,
"max": 1,
"min": 0,
"mode": "play"
}
},
"schemaVersion": 1
}