mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 12:38:35 +00:00
simplify
This commit is contained in:
parent
08ab06c9cc
commit
067c0bfe70
@ -32,17 +32,16 @@ Pattern.prototype.voicings = function (range) {
|
|||||||
range = ['F3', 'A4'];
|
range = ['F3', 'A4'];
|
||||||
}
|
}
|
||||||
return this.fmapNested((event) => {
|
return this.fmapNested((event) => {
|
||||||
lastVoicing = getVoicing(event.value?.value || event.value, lastVoicing, range);
|
lastVoicing = getVoicing(event.value, lastVoicing, range);
|
||||||
return stack(...lastVoicing);
|
return stack(...lastVoicing);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Pattern.prototype.rootNotes = function (octave = 2) {
|
Pattern.prototype.rootNotes = function (octave = 2) {
|
||||||
// range = ['G1', 'C3']
|
// range = ['G1', 'C3']
|
||||||
return this._mapNotes((value) => {
|
return this.fmap((value) => {
|
||||||
const [_, root] = value.value.match(/^([a-gA-G])[b#]?.*$/);
|
const [_, root] = value.match(/^([a-gA-G])[b#]?.*$/);
|
||||||
const bassNote = root + octave;
|
return root + octave;
|
||||||
return { ...value, value: bassNote };
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -214,7 +214,7 @@ class Hap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
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) {
|
setContext(context) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user