mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-19 09:38:38 +00:00
fix: slow fractions
This commit is contained in:
parent
5c0d9f6f15
commit
682462ca07
@ -32,7 +32,7 @@ export function curry(func, overload) {
|
|||||||
|
|
||||||
// Returns the start of the cycle.
|
// Returns the start of the cycle.
|
||||||
Fraction.prototype.sam = function() {
|
Fraction.prototype.sam = function() {
|
||||||
return Fraction(Math.floor(this))
|
return this.floor()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the start of the next cycle.
|
// Returns the start of the next cycle.
|
||||||
@ -621,7 +621,7 @@ class Pattern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_slow(factor) {
|
_slow(factor) {
|
||||||
return this._fast(1/factor)
|
return this._fast(Fraction(1).div(factor))
|
||||||
}
|
}
|
||||||
|
|
||||||
_early(offset) {
|
_early(offset) {
|
||||||
@ -632,7 +632,8 @@ class Pattern {
|
|||||||
|
|
||||||
_late(offset) {
|
_late(offset) {
|
||||||
// Equivalent of Tidal's ~> operator
|
// Equivalent of Tidal's ~> operator
|
||||||
return this._early(0-offset)
|
offset = Fraction(offset)
|
||||||
|
return this._early(Fraction(0).sub(offset))
|
||||||
}
|
}
|
||||||
|
|
||||||
struct(...binary_pats) {
|
struct(...binary_pats) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user