Last active
October 22, 2019 13:50
-
-
Save walmik/f3d2a0557810c68fa2e40ecff9f32343 to your computer and use it in GitHub Desktop.
Create a commonly used dance music riff using just Scribbletune
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scribble = require('scribbletune'); | |
const getRandomPattern = function(count = 8) { | |
let str = '[x-]R'; | |
for (let i = 1; i < count; i++) { | |
str += Math.round(Math.random()) ? '[x-]R' : 'R[x-]'; | |
} | |
return str; | |
}; | |
const pattern = getRandomPattern(); | |
const clipA = scribble.clip({ | |
notes: 'D2', | |
randomNotes: scribble.arp( | |
scribble.getChordsByProgression('D2 minor', 'ii iii') | |
), | |
pattern, | |
subdiv: '16n', | |
}); | |
const clipB = scribble.clip({ | |
notes: 'D2', | |
randomNotes: scribble.arp( | |
scribble.getChordsByProgression('D2 minor', 'iii v') | |
), | |
pattern, | |
subdiv: '16n', | |
}); | |
scribble.midi([].concat(clipA, clipA, clipA, clipB), 'riff.mid'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment