From c4a8180592e20634ab4c6741c92e4c6b02cd3e1d Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 8 Feb 2022 09:27:18 +0000 Subject: [PATCH] another test for fast --- test/pattern.test.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pattern.test.mjs b/test/pattern.test.mjs index 6740af38..959727f4 100644 --- a/test/pattern.test.mjs +++ b/test/pattern.test.mjs @@ -2,7 +2,7 @@ import Fraction from 'fraction.js' 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 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 () { assert.equal(pure("a").fast(sequence(1,4)).firstCycle.length, 3) - // not working.. - // assert.deepStrictEqual(pure("a").fast(sequence(1,4)).firstCycle, sequence("a",sequence("a","a")).firstCycle) + // .fast(sequence(1,silence) is a quick hack to cut an event in two.. + assert.deepStrictEqual(pure("a").fast(sequence(1,4)).firstCycle, stack(pure("a").fast(sequence(1,silence)), sequence(silence, ["a","a"])).firstCycle) }) }) describe('_slow()', function () {