mml-optimizer
Advanced tools
Comparing version 0.0.7 to 0.1.0
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
@@ -17,3 +17,4 @@ var core = require('./optimizer-core'); | ||
tracksShareState: false, | ||
octaveOffset: 0 | ||
octaveOffset: 0, | ||
noLiteralDottedRests: false | ||
}, | ||
@@ -32,3 +33,4 @@ 'aa': { | ||
tracksShareState: true, | ||
octaveOffset: -1 | ||
octaveOffset: -1, | ||
noLiteralDottedRests: true | ||
} | ||
@@ -69,3 +71,4 @@ } | ||
}; | ||
module.exports.getOptions = getOptions; | ||
module.exports.parse = parse; | ||
module.exports.generate = generate; |
var aStar = require('a-star'); | ||
var extend = require('extend'); | ||
var optionAliases = { | ||
'mabi': { | ||
tpqn: 96, | ||
minimumNoteDuration: 64, | ||
defaultState: { | ||
octave: 4, | ||
tempo: 120, | ||
volume: 8/15, | ||
duration: '4' | ||
}, | ||
maxVolume: 15, | ||
supportsNoteNumbers: true, | ||
tracksShareState: false, | ||
octaveOffset: 0 | ||
}, | ||
'aa': { | ||
tpqn: 500, | ||
minimumNoteDuration: 64, | ||
defaultState: { | ||
octave: 4, | ||
tempo: 120, | ||
volume: 100/127, | ||
duration: '4' | ||
}, | ||
maxVolume: 127, | ||
supportsNoteNumbers: false, | ||
tracksShareState: true, | ||
octaveOffset: -1 | ||
} | ||
} | ||
var defaultOptions = optionAliases['aa']; | ||
function noteDurationToTicks(duration, options) { | ||
@@ -309,4 +277,7 @@ return noteDurationAndDotsToTicks( | ||
case 'rest': | ||
neighbors.push(extend({}, state, { cursor: state.cursor + 1 })); | ||
if (token.ticks !== noteDurationToTicks(state.duration, options)) { | ||
var isSameAsCurrentDuration = token.ticks === noteDurationToTicks(state.duration, options); | ||
if (isSameAsCurrentDuration || !options.noLiteralDottedRests) { | ||
neighbors.push(extend({}, state, { cursor: state.cursor + 1 })); | ||
} | ||
if (!isSameAsCurrentDuration) { | ||
ticksToAllNoteDurations(token.ticks, options) | ||
@@ -321,2 +292,3 @@ .forEach(function (duration) { | ||
} | ||
break; | ||
case 'volume': | ||
@@ -326,2 +298,3 @@ case 'tempo': | ||
neighbors.push(extend({}, state, { cursor: state.cursor + 1 })); | ||
break; | ||
case 'nextVoice': | ||
@@ -328,0 +301,0 @@ if (options.tracksShareState) |
{ | ||
"name": "mml-optimizer", | ||
"version": "0.0.7", | ||
"version": "0.1.0", | ||
"description": "Optimizer for Music Macro Language (MML)", | ||
@@ -29,4 +29,4 @@ "main": "index.js", | ||
"concat-stream": "^1.4.6", | ||
"extend": "^1.3.0" | ||
"extend": "^2.0.0" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # mml-optimizer |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16041
5
483
+ Addedextend@2.0.2(transitive)
- Removedextend@1.3.0(transitive)
Updatedextend@^2.0.0