Last note in scale (8va) is calculated wrong (always using defaultOctave as a base)
Closed this issue · 2 comments
In https://github.com/jsrmath/sharp11-web-audio/blob/master/index.js#L79,
a scale doesn't have an "octave" property so the check for ensureOctave always returns the defaultOctave instead of the user selected octave when available. This causes the first 7 notes to be in "default octave" and the last (8va) to be in the correct octave.
This is also incorrect in "arpeggiate" (since I copied the same code) but the error is actually in ensureOctave that for scales should check something like obj.key.octave or obj.root.octave.
If you change ensureOctave to "return obj.root.octave ? obj : obj.inOctave(defaultOctave);", it should work for both chords and scales.
The best solution for this is to add an .octave
property to scales in sharp11, which I will do at some point when I have the time. I think it was an oversight that they don't have one in the first place.
Fixed in jsrmath/sharp11@1979920 which has been published in sharp11 v1.1.4