Skip to content

Commit

Permalink
Bump version to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
freakimkaefig committed Jul 9, 2016
1 parent 7ca953c commit da16236
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 2 deletions.
82 changes: 82 additions & 0 deletions dist/musicjsontoolbox
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env node

/* eslint-disable */
'use strict';

var program = require('commander');
var fs = require('fs');
program.version(require('../package.json').version);
program.parse(process.argv);

// ==============================
// ========== Toolbox =========
// ==============================
var MusicJsonToolbox = require('../musicjson-toolbox');
// var doc = require('../test/example.json');
var doc = require('../test/example.json');
var searchPitch = [1, 6, 1, 6];
var searchParsons = '*uuruddrdrr';
var searchIntervals = ['*', 5, -5, 5];
var searchIntervalsDuration = [
{value: 12, rest: false, duration: 4},
{value: 7, rest: false, duration: 4},
{value: 12, rest: false, duration: 2},
{value: 7, rest: false, duration: 1}
];

// var notes = MusicJsonToolbox.notes(doc, false, false);
// var parsons = MusicJsonToolbox.parsons(notes);
// var intervals = MusicJsonToolbox.intervals(MusicJsonToolbox.notes(doc, false), doc.attributes.key.fifths);
// var ngrams = MusicJsonToolbox.ngrams(notes, searchPitch.length);
// var pitchDurationValues = MusicJsonToolbox.pitchDurationValues(notes, -1, 4, 4);
// var value = MusicJsonToolbox.base12Pitch('C', 0, 4, 0, true);

// console.log(parsons);

// ==============================
// ========== DISTANCE ==========
// ==============================
// var distance = MusicJsonToolbox.distanceParsons(doc, searchParsons);
// var distance = MusicJsonToolbox.distanceParsonsNgrams(doc, searchParsons);

// var distance = MusicJsonToolbox.distancePitch(doc, searchPitch);
// var distance = MusicJsonToolbox.distancePitchNgrams(doc, searchPitch);

// var distance = MusicJsonToolbox.distanceIntervals(doc, searchIntervals);
// var distance = MusicJsonToolbox.distanceIntervalsNgrams(doc, searchIntervals);

// var distance = MusicJsonToolbox.distancePitchDuration(doc, searchIntervalsDuration);
// var distance = MusicJsonToolbox.distancePitchDurationNgrams(doc, searchIntervalsDuration);

var distance = MusicJsonToolbox.distanceIntervals(doc, ['*', 2, 2, 1, 2, 5, -11, 0, 10, -7, 5, -5, 5]);
// var distance = MusicJsonToolbox.distanceParsons(doc, '*uuuuudrududu');
console.log(distance);

// console.log(MusicJsonToolbox.notes(doc, false, true));
// console.log(MusicJsonToolbox.pitchDurationValues(MusicJsonToolbox.notes(doc, false, true), -1, 4, 4));

// console.log(MusicJsonToolbox.weightInterval(
// { value: 11, duration: 4},
// { value: 2, duration: 4}
// ));
// var output = MusicJsonToolbox.weightedEditDistance(
// [
// {value: 1, duration: 4},
// {value: 3, duration: 4},
// {value: 5, duration: 2},
// {value: 6, duration: 2}
// ],
// [
// {value: 1, duration: 4},
// {value: 6, duration: 4},
// {value: 5, duration: 2},
// {value: 6, duration: 1},
// {value: 6, duration: 1}
// ]);

// for (var i=0; i<distance.length; i++) {
// console.log(parsons.map(function(item) {
// return item.value;
// }).join(' '));
// }
// fs.writeFileSync('../data/output.json',JSON.stringify(ngrams));
1 change: 0 additions & 1 deletion musicjson-toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@
* @returns {Array} The resulting array with adjusted tempo
*/
tempoAdjust: function(notes, adjust) {
// TODO: unit test
var adjustedNotes = [];
for (var i = 0; i < notes.length; i++) {
var tempNote = notes[i];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "musicjson-toolbox",
"version": "0.0.8",
"version": "1.0.0",
"description": "A toolbox for comparing musicjson objects",
"main": "musicjson-toolbox.js",
"scripts": {
Expand Down

0 comments on commit da16236

Please sign in to comment.