mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 20:48:27 +00:00
Merge branch 'main' into docs
This commit is contained in:
commit
fd9ab987e6
@ -2028,6 +2028,16 @@ export const bypass = register('bypass', function (on, pat) {
|
|||||||
return on ? silence : pat;
|
return on ? silence : pat;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loops the pattern inside at `offset` for `cycles`.
|
||||||
|
* @param {number} offset start point of loop in cycles
|
||||||
|
* @param {number} cycles loop length in cycles
|
||||||
|
* @example
|
||||||
|
* // Looping a portion of randomness
|
||||||
|
* note(irand(8).segment(4).scale('C3 minor')).ribbon(1337, 2)
|
||||||
|
*/
|
||||||
|
export const ribbon = register('ribbon', (offset, cycles, pat) => pat.early(offset).restart(pure(1).slow(cycles)));
|
||||||
|
|
||||||
// sets absolute duration of haps
|
// sets absolute duration of haps
|
||||||
// TODO - fix
|
// TODO - fix
|
||||||
export const duration = register('duration', function (value, pat) {
|
export const duration = register('duration', function (value, pat) {
|
||||||
|
|||||||
@ -914,6 +914,13 @@ describe('Pattern', () => {
|
|||||||
expect(run(4).firstCycle()).toStrictEqual(sequence(0, 1, 2, 3).firstCycle());
|
expect(run(4).firstCycle()).toStrictEqual(sequence(0, 1, 2, 3).firstCycle());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
describe('ribbon', () => {
|
||||||
|
it('Can ribbon', () => {
|
||||||
|
expect(cat(0, 1, 2, 3, 4, 5, 6, 7).ribbon(2, 4).fast(4).firstCycle()).toStrictEqual(
|
||||||
|
sequence(2, 3, 4, 5).firstCycle(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
describe('linger', () => {
|
describe('linger', () => {
|
||||||
it('Can linger on the first quarter of a cycle', () => {
|
it('Can linger on the first quarter of a cycle', () => {
|
||||||
expect(sequence(0, 1, 2, 3, 4, 5, 6, 7).linger(0.25).firstCycle()).toStrictEqual(
|
expect(sequence(0, 1, 2, 3, 4, 5, 6, 7).linger(0.25).firstCycle()).toStrictEqual(
|
||||||
|
|||||||
@ -3066,6 +3066,27 @@ exports[`runs examples > example "rev" example index 0 1`] = `
|
|||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`runs examples > example "ribbon" example index 0 1`] = `
|
||||||
|
[
|
||||||
|
"[ 0/1 → 1/4 | note:C3 ]",
|
||||||
|
"[ 1/4 → 1/2 | note:G3 ]",
|
||||||
|
"[ 1/2 → 3/4 | note:Eb3 ]",
|
||||||
|
"[ 3/4 → 1/1 | note:Bb3 ]",
|
||||||
|
"[ 1/1 → 5/4 | note:C3 ]",
|
||||||
|
"[ 5/4 → 3/2 | note:D3 ]",
|
||||||
|
"[ 3/2 → 7/4 | note:G3 ]",
|
||||||
|
"[ 7/4 → 2/1 | note:Eb3 ]",
|
||||||
|
"[ 2/1 → 9/4 | note:C3 ]",
|
||||||
|
"[ 9/4 → 5/2 | note:G3 ]",
|
||||||
|
"[ 5/2 → 11/4 | note:Eb3 ]",
|
||||||
|
"[ 11/4 → 3/1 | note:Bb3 ]",
|
||||||
|
"[ 3/1 → 13/4 | note:C3 ]",
|
||||||
|
"[ 13/4 → 7/2 | note:D3 ]",
|
||||||
|
"[ 7/2 → 15/4 | note:G3 ]",
|
||||||
|
"[ 15/4 → 4/1 | note:Eb3 ]",
|
||||||
|
]
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`runs examples > example "room" example index 0 1`] = `
|
exports[`runs examples > example "room" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/2 | s:bd room:0 ]",
|
"[ 0/1 → 1/2 | s:bd room:0 ]",
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { JsDoc } from '../../docs/JsDoc';
|
|||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
|
|
||||||
Pitches are an essential building block for music.
|
Pitches are an important building block in many musical traditions.
|
||||||
In Strudel, pitches can be expressed as note names, note numbers or frequencies.
|
In Strudel, pitches can be expressed as note names, note numbers or frequencies.
|
||||||
Here's the same pattern written in three different ways:
|
Here's the same pattern written in three different ways:
|
||||||
|
|
||||||
|
|||||||
@ -101,3 +101,7 @@ Some of these have equivalent operators in the Mini Notation:
|
|||||||
## cpm
|
## cpm
|
||||||
|
|
||||||
<JsDoc client:idle name="cpm" h={0} />
|
<JsDoc client:idle name="cpm" h={0} />
|
||||||
|
|
||||||
|
## ribbon
|
||||||
|
|
||||||
|
<JsDoc client:idle name="ribbon" h={0} />
|
||||||
|
|||||||
5140
website/src/repl/drum_patterns.mjs
Normal file
5140
website/src/repl/drum_patterns.mjs
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user