Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beat-oriented functionality #976

Merged
merged 24 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8cb352c
allow timecat lengths/weights to be inferred from mininotation
yaxu Mar 4, 2024
3323768
snapshot
yaxu Mar 4, 2024
65ce56d
format
yaxu Mar 4, 2024
03cfb1a
annotate pure values with their value
yaxu Mar 4, 2024
c67255e
allow single mininotation values to maintain their labels as pure
yaxu Mar 5, 2024
c304d94
format
yaxu Mar 5, 2024
86e28fc
beatCat
yaxu Mar 6, 2024
8708463
silence is weightless
yaxu Mar 6, 2024
ad31b57
silence has a weight of 1, add alternative nothing with a weight of 0
yaxu Mar 14, 2024
f2fe7b6
Merge branch 'main' of github.com:tidalcycles/strudel into guessing-t…
yaxu Mar 14, 2024
67eb162
Add missing lcm import
yaxu Mar 14, 2024
0f8c9fa
make timeCat add the weight property to its result
yaxu Mar 14, 2024
8b8601f
preserve weight of single patterns passed to fastcat
yaxu Mar 14, 2024
4ac0bc4
snapshot
yaxu Mar 14, 2024
b1b91fc
Don't use patternified params if they're all 'pure'
yaxu Mar 14, 2024
ab4419d
move to use weight for polymeter
yaxu Mar 15, 2024
a807b83
quick test
yaxu Mar 15, 2024
f075130
preserve weight across applicative operations (weight comes with the …
yaxu Mar 15, 2024
f951640
calculate lcm of weights as rationals
yaxu Mar 15, 2024
94479a9
some weight preservation, and use lcm for weight of a stack
yaxu Mar 15, 2024
e41a5ed
Merge branch 'main' of github.com:tidalcycles/strudel into guessing-t…
yaxu Mar 15, 2024
86f9dcd
more weight preservation
yaxu Mar 15, 2024
747b108
weight for jux, and add some simple stack alignments
yaxu Mar 16, 2024
34306a9
stackBy for patterning stack alignments
yaxu Mar 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/core/fraction.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ Fraction.prototype.max = function (other) {
return this.gt(other) ? this : other;
};

Fraction.prototype.maximum = function (...others) {
others = others.map((x) => new Fraction(x));
return others.reduce((max, other) => other.max(max), this);
};

Fraction.prototype.min = function (other) {
return this.lt(other) ? this : other;
};
Expand Down Expand Up @@ -83,6 +88,10 @@ export const gcd = (...fractions) => {
return fractions.reduce((gcd, fraction) => gcd.gcd(fraction), fraction(1));
};

export const lcm = (...fractions) => {
return fractions.reduce((lcm, fraction) => lcm.lcm(fraction), fraction(1));
};

fraction._original = Fraction;

export default fraction;
Expand Down
Loading
Loading