Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/crotwell/teoria into pres…
Browse files Browse the repository at this point in the history
…erve_duration
  • Loading branch information
saebekassebil committed Jul 2, 2017
2 parents 99877da + a532047 commit 5b8c2b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/note.js
Expand Up @@ -80,7 +80,7 @@ Note.prototype = {
if (typeof interval === 'string') interval = Interval.toCoord(interval);

if (interval instanceof Interval)
return new Note(vector.add(this.coord, interval.coord));
return new Note(vector.add(this.coord, interval.coord), this.duration);
else if (interval instanceof Note)
return new Interval(vector.sub(interval.coord, this.coord));
},
Expand Down
7 changes: 7 additions & 0 deletions test/notes.js
Expand Up @@ -296,5 +296,12 @@ vows.describe('TeoriaNote class').addBatch({
assert.deepEqual(teoria.note('cb4').enharmonics(true),
['b3'].map(teoria.note));
}
},

'copy duration on interval': {
'stay whole note on call interval': function() {
var note = teoria.note('a#', { duration: 1 });
assert.equal(note.duration.value, note.interval('P5').duration.value);
}
}
}).export(module);

0 comments on commit 5b8c2b2

Please sign in to comment.