GitHub
3.72k
Created 11 years ago, last commit 23 days ago
22 contributors
504 commits
Stars added on GitHub, month by month
0
4
5
6
7
8
9
10
11
12
1
2
3
2024
2025
Stars added on GitHub, per day, on average
Yesterday
+1
Last week
+0.1
/day
Last month
+0.1
/day
Last 12 months
+0.1
/day
npmPackage on NPM
Monthly downloads on NPM
4
5
6
7
8
9
10
11
12
1
2
3
2024
2025
README

SCRIBBLETUNE

Build Status Try scribbletune on RunKit

Use simple JavaScript Strings and Arrays to generate rhythms and musical patterns. Directly use the names of scales or chords in your code to get arrays which you can mash up using Array methods in ways you hadn't imagined before! Create clips of musical ideas and export MIDI files which you can import in Ableton Live, Reason, GarageBand or any music creation software that accepts MIDI files.

Install

npm install scribbletune

Use it to create a MIDI clip by running a JS file from your terminal using node.js

const scribble = require('scribbletune');
const clip = scribble.clip({
    notes: scribble.scale('C4 major'),
    pattern: 'x'.repeat(7) + '_'
});

scribble.midi(clip, 'c-major.mid');

You can use Scribbletune even in the browser with Tone.js!. There are a couple of ways to do this. A quick and dirty way is to make sure to pull in Tone.js followed by the latest browser version of Scribbletune.

<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/<LATEST-VERSION-FROM-CDNJS>/Tone.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/scribbletune/<LATEST-VERSION-FROM-CDNJS>/scribbletune.js"></script>

This will expose a global object called scribble which you can directly use to run the methods from Scribbletune in conjunction with Tone.js

The recommended way for the browser, however, is to import it like this

const scribble = require('scribbletune/browser');

This will provide the same API but augment it a bit to support browser based functionality.

Visit scribbletune.com for documentation, tutorials and examples! Listen to music generated with Scribbletune on Soundcloud.