Scribbletune

Scribbletune

Scribbletune is a Node.js module that helps you construct musical ideas with JavaScript String & Array functions and export them as MIDI files. You can also use Scribbletune in the browser!

npm install scribbletune

Let's put something together. Create a file called chords.js and paste the following in it,

const scribble = require('scribbletune');
  const clips = ['1032', '2032', '4021', '3052'].map(order =>
    scribble.clip({
      pattern: '[xx][xR]'.repeat(4),
      notes: scribble.arp({
        chords: 'Dm BbM Am FM BbM FM CM Gm',
        count: 8,
        order,
      }),
      accent: 'x-xx--xx',
    })
  );
  scribble.midi([].concat(...clips), 'chords.mid');

Now execute that file in the terminal at the same location as you saved it,

node chords.js

This will generate a MIDI file called chords.mid in the same location as you executed this script. You can import this file into any music production software like Ableton Live or even Garage Band! Here's how it sounded when I did that and rendered it with a couple of synths and the same chords on a pad sound:



Read the documentation or show your Star this project on Github!