diff --git a/repl/src/voicings.ts b/repl/src/voicings.ts index a5f55dc7..2b641c93 100644 --- a/repl/src/voicings.ts +++ b/repl/src/voicings.ts @@ -32,17 +32,16 @@ Pattern.prototype.voicings = function (range) { range = ['F3', 'A4']; } return this.fmapNested((event) => { - lastVoicing = getVoicing(event.value?.value || event.value, lastVoicing, range); + lastVoicing = getVoicing(event.value, lastVoicing, range); return stack(...lastVoicing); }); }; Pattern.prototype.rootNotes = function (octave = 2) { // range = ['G1', 'C3'] - return this._mapNotes((value) => { - const [_, root] = value.value.match(/^([a-gA-G])[b#]?.*$/); - const bassNote = root + octave; - return { ...value, value: bassNote }; + return this.fmap((value) => { + const [_, root] = value.match(/^([a-gA-G])[b#]?.*$/); + return root + octave; }); }; diff --git a/strudel.mjs b/strudel.mjs index f0c1d6af..aa0d7d8d 100644 --- a/strudel.mjs +++ b/strudel.mjs @@ -214,7 +214,7 @@ class Hap { } show() { - return "(" + (this.whole == undefined ? "~" : this.whole.show()) + ", " + this.part.show() + ", " + JSON.stringify(this.value?.value ?? this.value) + ")" + return "(" + (this.whole == undefined ? "~" : this.whole.show()) + ", " + this.part.show() + ", " + this.value + ")" } setContext(context) {