Create Music with Code

Scribbletune is a JavaScript library that helps you create music with code using simple and intuitive patterns.

Simple API

Create musical clips with a minimal and intuitive API. Scribbletune makes it easy to generate melodies, chord progressions, and rhythms.

Learn more

Browser & Node.js

Works in both Node.js for generating MIDI files and in the browser for real-time audio playback using Web Audio API.

Learn more

Music Theory

Leverage built-in music theory concepts like scales, chords, and progressions without needing to be a music theory expert.

Learn more

Get Started with a Few Lines of Code

const scribble = require('scribbletune');
 
// Create a clip that plays the middle C
const clip = scribble.clip({
notes: scribble.scale('C4 major'),
pattern: 'xxxxxxx'
});
 
// Render a MIDI file of this clip
scribble.midi(clip, 'c.mid');