midiviz-prepare
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -84,10 +84,9 @@ #!/usr/bin/env node | ||
// Do the processing | ||
if (music.length !== 1) { | ||
console.error("Sorry, but I can only handle single-track MIDI files!"); | ||
return; | ||
} | ||
var tempo = music.ppqn; | ||
var allEvents = []; | ||
music.forEach(function (track) { return track.forEach(function (event) { return allEvents.push(event); }); }); | ||
var sortedEvents = allEvents.sort(function (a, b) { return a.tt - b.tt; }); | ||
// Filter the notes | ||
var majors = music[0].filter(function (event) { return isMajorNote(event); }); | ||
var minors = music[0].filter(function (event) { return isMinorNote(event); }); | ||
var majors = sortedEvents.filter(function (event) { return isMajorNote(event); }); | ||
var minors = sortedEvents.filter(function (event) { return isMinorNote(event); }); | ||
// Calculating required time adjustment | ||
@@ -94,0 +93,0 @@ var timeOffset = 0; |
{ | ||
"name": "midiviz-prepare", | ||
"author": "Kristof Csillag <csillag.kristof@gmail.com>", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "A preprocessor for MIDIVisualizer", | ||
@@ -11,3 +11,2 @@ "main": "build/main.js", | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
@@ -14,0 +13,0 @@ "repository": "github:csillag/midiviz-prepare", |
@@ -100,12 +100,12 @@ #!/usr/bin/env node | ||
// Do the processing | ||
if (music.length !== 1) { | ||
console.error("Sorry, but I can only handle single-track MIDI files!"); | ||
return; | ||
} | ||
const tempo = music.ppqn; | ||
const allEvents: MIDI[] = []; | ||
music.forEach((track) => track.forEach((event) => allEvents.push(event))); | ||
const sortedEvents = allEvents.sort((a, b) => a.tt - b.tt); | ||
// Filter the notes | ||
const majors = music[0].filter((event) => isMajorNote(event)); | ||
const minors = music[0].filter((event) => isMinorNote(event)); | ||
const majors = sortedEvents.filter((event) => isMajorNote(event)); | ||
const minors = sortedEvents.filter((event) => isMinorNote(event)); | ||
@@ -112,0 +112,0 @@ // Calculating required time adjustment |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
59874
18
1
548