Vagibond

Follow Vagibond

Stay connected with us on social media for updates on new ventures.

Thanks for subscribing!
Visit Vagibeats Site

Vagibeats API

AI-powered procedural music generation for the web. Create terrible, wonderful 8-bit background music with consistent seed-based generation. Perfect for adding ambiance to any Vagibond application.

🎵
Beta Release
Vagibeats is currently in beta. The API may change as we add more features and music styles.

What you can build

Quickstart

Get up and running with Vagibeats in under a minute.

1. Include the script

html
<script src="https://vagibeats.vagibond.com/vagibeats-core.js"></script>

2. Start playing music

javascript
// Play music with a seed and style
Vagibeats.play({
  seed: 'my-page',      // Consistent music per seed
  style: 'cheesy'       // cheesy | spooky | epic | sad | lofi | circus
});

// Stop playing
Vagibeats.stop();

// Toggle on/off
Vagibeats.toggle({ seed: 'my-page', style: 'epic' });

Music Styles

Vagibeats offers 6 distinct musical styles, each with its own scale and chord progression:

Style Description Tempo Best For
cheesy Happy elevator music (C major) 800ms Default, corporate parody
spooky Haunted house vibes (C minor/dim) 1000ms Horror, magic shows
epic Action movie intensity (pentatonic) 600ms Dramatic moments
sad Melodramatic despair (natural minor) 1200ms Tragic content
lofi Chill beats to code to (jazz scale) 900ms Relaxed browsing
circus Whimsical chaos (whole tone) 500ms Comedy, absurdist

play(options)

Start playing procedurally generated music.

Parameters

ParameterTypeDefaultDescription
seedstring'vagibeats'Seed for consistent random music
stylestring'cheesy'Music style (see table above)

Returns

boolean - true if music started successfully, false if already playing or audio not supported.

stop()

Stop playing music and clean up audio resources.

toggle(options)

Toggle music on or off. If stopped, starts with the provided options. If playing, stops.

Returns

boolean - The new playing state (true if now playing, false if stopped).

playJingle(type)

Play a short sound effect jingle.

Available Jingles

TypeDescription
'success'Ascending happy notes (form submitted, action complete)
'error'Descending sad notes (error occurred)
'notification'Two-note ping (new message)
'levelup'Triumphant fanfare (achievement unlocked)
javascript
// Play success jingle when form is submitted
form.addEventListener('submit', () => {
  Vagibeats.playJingle('success');
});

// Play error jingle on validation failure
if (!isValid) {
  Vagibeats.playJingle('error');
}

playNote(freq, options)

Play a single note at a specific frequency.

Parameters

ParameterTypeDefaultDescription
freqnumber-Frequency in Hz (e.g., 440 for A4)
options.waveformstring'square'Oscillator type: square, sine, triangle, sawtooth
options.volumenumber0.15Volume level (0-1)
options.durationnumber0.3Duration in seconds

Examples

Vagipage with Background Music

html
<button id="music-btn">🎵</button>
<script src="https://vagibeats.vagibond.com/vagibeats-core.js"></script>
<script>
  // Autoplay on first interaction (required by browsers)
  document.addEventListener('click', () => {
    Vagibeats.play({ seed: 'tarbaj-magician', style: 'spooky' });
  }, { once: true });

  // Toggle button
  document.getElementById('music-btn').onclick = () => Vagibeats.toggle();
</script>

Create a Music Button Automatically

javascript
// Creates a styled button with autoplay behavior
const btn = Vagibeats.createMusicButton({
  seed: 'my-page',
  style: 'epic',
  autoplay: true
});
document.body.appendChild(btn);

Changelog

v1.0.0 January 2026 Initial Release