mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 05:28:41 +00:00
another test for fast
This commit is contained in:
parent
9d809be775
commit
c4a8180592
@ -2,7 +2,7 @@ import Fraction from 'fraction.js'
|
|||||||
|
|
||||||
import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
|
|
||||||
import {TimeSpan, Hap, Pattern, pure, stack, fastcat, slowcat, cat, sequence, polyrhythm} from "../strudel.mjs";
|
import {TimeSpan, Hap, Pattern, pure, stack, fastcat, slowcat, cat, sequence, polyrhythm, silence} from "../strudel.mjs";
|
||||||
|
|
||||||
const ts = (begin, end) => new TimeSpan(Fraction(begin), Fraction(end));
|
const ts = (begin, end) => new TimeSpan(Fraction(begin), Fraction(end));
|
||||||
const hap = (whole, part, value) => new Hap(whole, part, value)
|
const hap = (whole, part, value) => new Hap(whole, part, value)
|
||||||
@ -95,8 +95,8 @@ describe('Pattern', function() {
|
|||||||
})
|
})
|
||||||
it('Makes things faster, with a pattern of factors', function () {
|
it('Makes things faster, with a pattern of factors', function () {
|
||||||
assert.equal(pure("a").fast(sequence(1,4)).firstCycle.length, 3)
|
assert.equal(pure("a").fast(sequence(1,4)).firstCycle.length, 3)
|
||||||
// not working..
|
// .fast(sequence(1,silence) is a quick hack to cut an event in two..
|
||||||
// assert.deepStrictEqual(pure("a").fast(sequence(1,4)).firstCycle, sequence("a",sequence("a","a")).firstCycle)
|
assert.deepStrictEqual(pure("a").fast(sequence(1,4)).firstCycle, stack(pure("a").fast(sequence(1,silence)), sequence(silence, ["a","a"])).firstCycle)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
describe('_slow()', function () {
|
describe('_slow()', function () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user