mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-14 07:08:34 +00:00
simplify
This commit is contained in:
parent
08ab06c9cc
commit
067c0bfe70
@ -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;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user