summaryrefslogtreecommitdiff
path: root/bundle.js
diff options
context:
space:
mode:
Diffstat (limited to 'bundle.js')
-rw-r--r--bundle.js87
1 files changed, 51 insertions, 36 deletions
diff --git a/bundle.js b/bundle.js
index 7de142c..7469d6b 100644
--- a/bundle.js
+++ b/bundle.js
@@ -40322,7 +40322,7 @@ data.load().then(function (lists) {
});
});
datasets['Media'].onPick = function () {
- _ui.nx.offset.value = -6;
+ _ui.nx.offset.value = -13;
_ui.nx.multiply.value = 20;
document.querySelector('#scale').value = '0';
_scales2.default.pick(0);
@@ -40371,10 +40371,17 @@ data.load().then(function (lists) {
});
var schools = lists.school_shootings;
- datasets['School Shootings 2016-18'] = {};
- datasets['School Shootings 2016-18'].name = 'School Shootings (2016-18)';
- datasets['School Shootings 2016-18'].pedal = true;
- datasets['School Shootings 2016-18'].play_fn = play_mass_shootings;
+ datasets['School Shootings 2015-18'] = {};
+ datasets['School Shootings 2015-18'].name = 'School Shootings (2015-18)';
+ datasets['School Shootings 2015-18'].pedal = true;
+ datasets['School Shootings 2015-18'].play_fn = play_mass_shootings;
+ datasets['School Shootings 2015-18'].onPick = function () {
+ _ui.nx.offset.value = -2;
+ _ui.nx.multiply.value = 11;
+ _ui.nx.pedal_tone.value = -8;
+ document.querySelector('#scale').value = '0';
+ _scales2.default.pick(0);
+ };
var school_lines = schools.lines.map(function (l) {
if (l[gv_fields.incident_characteristics].match('Shots Fired - No Injuries')) {
return null;
@@ -40387,28 +40394,29 @@ data.load().then(function (lists) {
m = _l$gv_fields$date$spl4[1],
d = _l$gv_fields$date$spl4[2];
- if (parseInt(y) > 2017) return null;
- var yy = (parseInt(y) - 2016) * 365;
+ if (parseInt(y) > 2018) return null;
+ if (parseInt(y) < 2015) return null;
+ var yy = (parseInt(y) - 2015) * 365;
var mm = year_days_by_month[parseInt(m)];
var dd = Math.floor(parseInt(d)) + 14;
var date = Math.floor((yy + mm + dd) / 7);
// console.log(date, y, m, d)
var total = l[gv_fields.n_killed] + l[gv_fields.n_injured];
if (l[gv_fields.n_killed] === 0) {
- total = -l[gv_fields.n_injured];
+ total = l[gv_fields.n_injured] - 4;
}
return [date, Math.log(Math.log(total + 10) + 1), "** !!, $$, {} killed, [] injured".replace('**', l[gv_fields.date]).replace('!!', l[gv_fields.city_or_county]).replace('$$', l[gv_fields.state]).replace('{}', l[gv_fields.n_killed]).replace('[]', l[gv_fields.n_injured]), l[gv_fields.n_killed], l[gv_fields.n_injured]];
}).filter(function (n) {
return !!n;
});
- datasets['School Shootings 2016-18'].dates = school_lines.map(function (a) {
+ datasets['School Shootings 2015-18'].dates = school_lines.map(function (a) {
return a[0];
});
- datasets['School Shootings 2016-18'].dates.push(school_lines.length);
- datasets['School Shootings 2016-18'].lines = [school_lines.map(function (a) {
+ datasets['School Shootings 2015-18'].dates.push(school_lines.length);
+ datasets['School Shootings 2015-18'].lines = [school_lines.map(function (a) {
return a[1];
})];
- datasets['School Shootings 2016-18'].labels = school_lines.map(function (a) {
+ datasets['School Shootings 2015-18'].labels = school_lines.map(function (a) {
return a[2];
});
@@ -40502,7 +40510,12 @@ function play_mass_shootings(i, bounds, diff, note_time) {
midi_notes = [];
var cases = [];
var timings = void 0;
- var week = Math.floor((i + 8) / 4) % 4;
+ var week = Math.floor(i / 4) % 4;
+ var year = Math.floor((i - 4 * 4 * 3) / 48); // + 2
+ console.log(year);
+ var yy = -year;
+ if (year > 0) year += 1;
+ var this_one = 0;
// console.log(i, mass_i, dataset.dates[mass_i], channel, exporting)
while (i >= dataset.dates[mass_i] && mass_i < total) {
// console.log(i, dataset.dates[mass_i])
@@ -40515,48 +40528,50 @@ function play_mass_shootings(i, bounds, diff, note_time) {
}
// console.log('push case', dataset.data[mass_i][mass_fields.date] + ' ' + dataset.data[mass_i][mass_fields.case])
mass_i += 1;
+ this_one += 1;
+ if (this_one >= 4) break;
}
switch (notes.length) {
default:
case 0:
break;
case 1:
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value, 128, channel, exporting, 0));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value + yy, 128, channel, exporting, 0));
timings = [128];
break;
case 2:
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value, 64, channel, exporting, 0));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value, 64, channel, exporting, 64));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value + yy, 64, channel, exporting, 0));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value + yy, 64, channel, exporting, 64));
timings = [64, 64];
break;
case 3:
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value, 43, channel, exporting, 0));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value, 43, channel, exporting, 43));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[2], min, max) * _ui.nx.multiply.value, 42, channel, exporting, 85));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value + yy, 43, channel, exporting, 0));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value + yy, 43, channel, exporting, 43));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[2], min, max) * _ui.nx.multiply.value + yy, 42, channel, exporting, 85));
timings = [43, 43, 42];
break;
case 4:
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value, 32, channel, exporting, 0));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value, 32, channel, exporting, 32));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[2], min, max) * _ui.nx.multiply.value, 32, channel, exporting, 64));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[3], min, max) * _ui.nx.multiply.value, 32, channel, exporting, 96));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value + yy, 32, channel, exporting, 0));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value + yy, 32, channel, exporting, 32));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[2], min, max) * _ui.nx.multiply.value + yy, 32, channel, exporting, 64));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[3], min, max) * _ui.nx.multiply.value + yy, 32, channel, exporting, 96));
timings = [32, 32, 32, 32];
break;
case 5:
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value, 22, channel, exporting, 0));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value, 21, channel, exporting, 22));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[2], min, max) * _ui.nx.multiply.value, 21, channel, exporting, 43));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[3], min, max) * _ui.nx.multiply.value, 32, channel, exporting, 64));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[4], min, max) * _ui.nx.multiply.value, 32, channel, exporting, 96));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value + yy, 22, channel, exporting, 0));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value + yy, 21, channel, exporting, 22));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[2], min, max) * _ui.nx.multiply.value + yy, 21, channel, exporting, 43));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[3], min, max) * _ui.nx.multiply.value + yy, 32, channel, exporting, 64));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[4], min, max) * _ui.nx.multiply.value + yy, 32, channel, exporting, 96));
timings = [22, 21, 21, 32, 32];
break;
case 6:
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value, 22, channel, exporting, 0));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value, 21, channel, exporting, 22));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[2], min, max) * _ui.nx.multiply.value, 21, channel, exporting, 43));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[3], min, max) * _ui.nx.multiply.value, 22, channel, exporting, 64));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[4], min, max) * _ui.nx.multiply.value, 21, channel, exporting, 86));
- midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[5], min, max) * _ui.nx.multiply.value, 21, channel, exporting, 107));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[0], min, max) * _ui.nx.multiply.value + yy, 22, channel, exporting, 0));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[1], min, max) * _ui.nx.multiply.value + yy, 21, channel, exporting, 22));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[2], min, max) * _ui.nx.multiply.value + yy, 21, channel, exporting, 43));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[3], min, max) * _ui.nx.multiply.value + yy, 22, channel, exporting, 64));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[4], min, max) * _ui.nx.multiply.value + yy, 21, channel, exporting, 86));
+ midi_notes.push((0, _midi.play_note)((0, _util.norm)(notes[5], min, max) * _ui.nx.multiply.value + yy, 21, channel, exporting, 107));
timings = [22, 21, 21, 22, 21, 21];
break;
case 7:
@@ -40635,7 +40650,7 @@ function play_mass_shootings(i, bounds, diff, note_time) {
timings = [11, 11, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10];
break;
}
- var pedal_freq = _scales2.default.current().index(_ui.nx.pedal_tone.value + week, _ui.nx.octave.value);
+ var pedal_freq = _scales2.default.current().index(_ui.nx.pedal_tone.value - week + 4 - year, _ui.nx.octave.value);
pedal_note = get_midi_note_for_frequency(pedal_freq);
if (!exporting) {
_kalimba2.default.play(pedal_freq, -12);
@@ -44264,7 +44279,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
var files = [
// "gun_violence",
-"mass_shootings_from_columbine", "gun_violence_by_month", "firearms_manufactured", "ar_15_2016_18", "media"];
+"mass_shootings_from_columbine", "gun_violence_by_month", "firearms_manufactured", "ar_15_2016_18", "media", "school_shootings"];
var parse = __webpack_require__(145);
var dataPromises = files.map(function (name) {