saebekassebil / teoria

Javascript taught Music Theory
http://saebekassebil.github.io/teoria
MIT License
1.32k stars 114 forks source link

Settings direction of an interval to what it already is, fails #38

Closed saebekassebil closed 11 years ago

saebekassebil commented 11 years ago

When using the TeoriaInterval#direction(dir) is a setter, the direction is toggled no matter what you set the direction to. That is, it is not idempotent which it ought to be.

Example:

var m3 = teoria.note('a3').interval(teoria.note('c4'));
console.log(m3.direction()); // -> 'up'
m3.direction('up');
console.log(m3.direction()); // -> 'down' ?!