mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-30 16:33:19 -04:00
always stringify fraction param
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { Pattern, timeCat } from '../../strudel.mjs';
|
||||
import bjork from 'bjork';
|
||||
import { rotate } from '../../util.mjs';
|
||||
import Fraction from 'fraction.js';
|
||||
import Fraction from '../../fraction.js';
|
||||
|
||||
const euclid = (pulses, steps, rotation = 0) => {
|
||||
const b = bjork(steps, pulses);
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ const applyOptions = (parent: any) => (pat: any, i: number) => {
|
||||
if (operator) {
|
||||
switch (operator.type_) {
|
||||
case 'stretch':
|
||||
const speed = new Fraction(operator.arguments_.amount).inverse();
|
||||
const speed = Fraction(operator.arguments_.amount).inverse();
|
||||
return reify(pat).fast(speed);
|
||||
case 'bjorklund':
|
||||
return pat.euclid(operator.arguments_.pulse, operator.arguments_.step, operator.arguments_.rotation);
|
||||
@@ -56,7 +56,7 @@ function resolveReplications(ast) {
|
||||
options_: {
|
||||
operator: {
|
||||
type_: 'stretch',
|
||||
arguments_: { amount: new Fraction(replicate).inverse().toString() },
|
||||
arguments_: { amount: Fraction(replicate).inverse().toString() },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user