add .tone + helpers
This commit is contained in:
parent
71023fc09c
commit
70f858361f
2 changed files with 93 additions and 4 deletions
|
|
@ -62,7 +62,8 @@ function scaleTranspose(scale: string, offset: number, note: string) {
|
|||
Pattern.prototype._mapNotes = function (func: (note: NoteEvent) => NoteEvent) {
|
||||
return this.fmap((event: string | NoteEvent) => {
|
||||
const noteEvent = toNoteEvent(event);
|
||||
return func(noteEvent);
|
||||
// TODO: generalize? this is practical for any event that is expected to be an object with
|
||||
return { ...noteEvent, ...func(noteEvent) };
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue