bugfix: transpose now has default octave of 3

This commit is contained in:
tyow
2026-04-01 18:51:29 -04:00
parent 4a801ab668
commit 1723125099
+4 -1
View File
@@ -137,7 +137,10 @@ export const { transpose, trans } = register(['transpose', 'trans'], function tr
const interval = !isNaN(Number(intervalOrSemitones))
? Interval.fromSemitones(intervalOrSemitones)
: String(intervalOrSemitones);
const targetNote = Note.transpose(note, interval);
let n = Note.get(note);
n.oct = Interval.num(interval) < 8 ? n.oct : (n.oct ?? 3);
const targetNote = Note.transpose(n, interval);
if (typeof hap.value === 'object') {
return hap.withValue(() => ({ ...hap.value, note: targetNote }));
}