Switch 'operators' from .whatHow to .what.how, and make sure there are toplevel curried functions for all of them. Rename util.mod to util._mod, to make room for toplevel 'operator' of that name. (#285)
This commit is contained in:
parent
485a96962a
commit
f827201ee0
6 changed files with 117 additions and 103 deletions
|
|
@ -5,7 +5,7 @@ This program is free software: you can redistribute it and/or modify it under th
|
|||
*/
|
||||
|
||||
import { Note, Interval, Scale } from '@tonaljs/tonal';
|
||||
import { Pattern, mod } from '@strudel.cycles/core';
|
||||
import { Pattern, _mod } from '@strudel.cycles/core';
|
||||
|
||||
// transpose note inside scale by offset steps
|
||||
// function scaleOffset(scale: string, offset: number, note: string) {
|
||||
|
|
@ -29,7 +29,7 @@ function scaleOffset(scale, offset, note) {
|
|||
// TODO: find way to do this smarter
|
||||
while (Math.abs(i - noteIndex) < Math.abs(offset)) {
|
||||
i += direction;
|
||||
const index = mod(i, notes.length);
|
||||
const index = _mod(i, notes.length);
|
||||
if (direction < 0 && n[0] === 'C') {
|
||||
o += direction;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue