fix: support numbers in piano / sampler
This commit is contained in:
parent
227dda921c
commit
42922a0d75
2 changed files with 5 additions and 5 deletions
|
|
@ -55,8 +55,9 @@ Pattern.prototype.piano = function () {
|
|||
return this.clip(1)
|
||||
.s('piano')
|
||||
.fmap((value) => {
|
||||
const midi = typeof value.note === 'string' ? toMidi(value.note) : value.note;
|
||||
// pan by pitch
|
||||
const pan = panwidth(Math.min(toMidi(value.note) / maxPan, 1), 0.5);
|
||||
const pan = panwidth(Math.min(midi / maxPan, 1), 0.5);
|
||||
return { ...value, pan: (value.pan || 1) * pan };
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue