Skip to content

Instantly share code, notes, and snippets.

@Andrew8xx8
Last active October 13, 2017 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andrew8xx8/158071159ed7b1e22092163f07962476 to your computer and use it in GitHub Desktop.
Save Andrew8xx8/158071159ed7b1e22092163f07962476 to your computer and use it in GitHub Desktop.
E.Letov — Everything goes according to plan for https://jackschaedler.github.io/jazzari/
// Program: "E.Letov — Everything goes according to plan"
var note_length = 1/8;
var notes = [9, 9, 9, 11,
5, 5, 5, 4,
12, 12, 12, 4,
4, 4, 4, 4]
for (i = 0; i < 2; i++) {
notes.forEach(function(note, note_index) {
NOTE({time: i * 10 + (note_index * note_length),
row: note,
length: note_length})
});
}
// Program: "E.Letov — Everything goes according to plan"
// Set BPM as 100
var kick_times = [0, 5/8, 8/8]
var snare_times = [1/4, 3/4]
var closed_hat_times = [0, 1/4, 2/4, 3/4]
var open_hat_times = [10/16]
var hat_volumes = [1/4, 2/4, 1, 3/4]
var shaker_volumes = [1/4, 3/4, 1/4, 2/4]
var measures = [0, 1, 2, 3]
measures.forEach(function(measure) {
if (measure % 2 == 0) {
NOTE({time: measure, row: 12, vol: 0.2});
NOTE({time: measure + 1.87, row: 7, vol: 0.5});
NOTE({time: measure + 1.93, row: 6, vol: 0.5});
}
kick_times.forEach(function(kick_time) {
NOTE({time: kick_time + measure,
row: 0});
})
snare_times.forEach(function(time) {
NOTE({time: time + measure,
row: 2});
})
closed_hat_times.forEach(function(time, index) {
NOTE({time: time + measure,
row: 3,
vol: index % 3 + 0.5});
})
open_hat_times.forEach(function(time, index) {
NOTE({time: time + measure,
row: 4,
vol: 0.5});
})
for (var i = 0; i < 16; i++) {
NOTE({time: i/16 + measure,
row: 5,
vol: shaker_volumes[i%4]});
}
});
// Program: "E.Letov — Everything goes according to plan"
var A = 9;
var F = 5;
var C = 12;
var E = 4;
var maj = [0,4,7];
var min = [0,3,7];
var chords = [
{ notes: min, root: A},
{ notes: maj, root: F},
{ notes: maj, root: C},
{ notes: maj, root: E},
]
var notes = [9, 5, 12, 4]
var chord_length = 1/2;
for (var i = 0; i < (4/chord_length); i++) {
var chord = chords[i % chords.length]
var chord_time = chord_length * i;
chord.notes.forEach(function(note) {
NOTE({ time: chord_time,
row: note + chord.root,
length: chord_length });
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment