arp (arpeggiate)
Scribbletune can generate arpeggios from chords.
You can set the order of the notes in the arpeggiator and the count of notes in it.
const scribble = require('scribbletune');
const c = scribble.clip({
notes: scribble.arp('CM FM CM GM'),
pattern: 'x'.repeat(32)
});
scribble.midi(c, 'arp.mid');
This will create a MIDI clip with the notes of the chord progression in an arpeggiated format where each note is a quarter note. You can change this by setting a property called subdiv
.
subdiv: '16n'
Now it plays a bit faster as we set the default duration of each note to sixteenth notes. By default, the arp
method uses 4 notes per arpeggio and it plays those notes from 0 to 3. But you can change that, as the arp
method also accepts an object as its argument instead of a String
.
const scribble = require('scribbletune');
const notesArr = scribble.arp({
chords: 'Cm Fm Cm Fm Cm Gm Cm DM',
count: 3,
order: '102'
});
const c = scribble.clip({
notes: notesArr,
pattern: 'x-x_'.repeat(notesArr.length/2),
subdiv: '16n'
});
scribble.midi(c, 'arp.mid');
This will create a midi file called "arp.mid" at the same location as you run this script with `node` and it will arpeggiate the triads Cm, Fm, Cm, Fm, Cm, Gm, Cm and DM chords each with 3 notes in them ordered as 1 0 2. So if the first arpeggio (for Cm) was C4 D#4 G4 then the order of these notes would be 1 0 2, which is D#4 C4 G4
Here's how it sounded when I imported the MIDI file it produced into Ableton Live
You can use this in the browser as well. Just make sure to pull in Tone.js first however!