mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
Implement brak()
This commit is contained in:
parent
73b0a3a0ef
commit
4fd843f8cf
@ -822,6 +822,16 @@ export class Pattern {
|
||||
return slowcatPrime(...pats);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new pattern where every other cycle is played once, twice as
|
||||
* fast, and offset in time by one quarter of a cycle. Creates a kind of
|
||||
* breakbeat feel.
|
||||
* @returns Pattern
|
||||
*/
|
||||
brak() {
|
||||
return this.every(2, x => fastcat(x, silence)._late(0.25))
|
||||
}
|
||||
|
||||
rev() {
|
||||
const pat = this;
|
||||
const query = function (state) {
|
||||
|
||||
@ -277,10 +277,7 @@ describe('Pattern', function () {
|
||||
);
|
||||
});
|
||||
it('can SqueezeOut() structure', () => {
|
||||
sameFirst(
|
||||
sequence(1, [2, 3]).keepifSqueezeOut(true, true, false),
|
||||
sequence([1, [2, 3]], [1, [2, 3]], silence),
|
||||
);
|
||||
sameFirst(sequence(1, [2, 3]).keepifSqueezeOut(true, true, false), sequence([1, [2, 3]], [1, [2, 3]], silence));
|
||||
});
|
||||
});
|
||||
describe('sub()', function () {
|
||||
@ -589,6 +586,14 @@ describe('Pattern', function () {
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('brak()', () => {
|
||||
it('Can make something a bit breakbeaty', () => {
|
||||
sameFirst(
|
||||
sequence('a', 'b').brak()._fast(2),
|
||||
sequence('a', 'b', fastcat(silence, 'a'), fastcat('b', silence))
|
||||
)
|
||||
});
|
||||
});
|
||||
describe('timeCat()', function () {
|
||||
it('Can concatenate patterns with different relative durations', function () {
|
||||
assert.deepStrictEqual(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user