mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-31 21:27:07 -04:00
Implement brak()
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user