mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 12:38:35 +00:00
Merge branch 'main' into pattern-composers
This commit is contained in:
commit
c305e82f5c
14
index.html
14
index.html
@ -1,14 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<script>import("./strudel.js").then(m => strudel = m)
|
|
||||||
</script>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Bingo</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<button onclick="foo()">hello</button>
|
|
||||||
<button onclick="bar()">hello</button>
|
|
||||||
|
|
||||||
<script type="module" src="./strudel.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -463,7 +463,7 @@ export class Pattern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_compress(b, e) {
|
_compress(b, e) {
|
||||||
if (b > e || b > 1 || e > 1 || b < 0 || e < 0) {
|
if (b.gt(e) || b.gt(1) || e.gt(1) || b.lt(0) || e.lt(0)) {
|
||||||
return silence;
|
return silence;
|
||||||
}
|
}
|
||||||
return this._fastGap(Fraction(1).div(e.sub(b)))._late(b);
|
return this._fastGap(Fraction(1).div(e.sub(b)))._late(b);
|
||||||
@ -495,6 +495,13 @@ export class Pattern {
|
|||||||
return this._squeezeBind(func);
|
return this._squeezeBind(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_striate(n) {
|
||||||
|
const slices = Array.from({ length: n }, (x, i) => i);
|
||||||
|
const slice_objects = slices.map((i) => ({ begin: i / n, end: (i + 1) / n }));
|
||||||
|
const slicePat = slowcat(...slice_objects);
|
||||||
|
return this.union(slicePat)._fast(n);
|
||||||
|
}
|
||||||
|
|
||||||
// cpm = cycles per minute
|
// cpm = cycles per minute
|
||||||
_cpm(cpm) {
|
_cpm(cpm) {
|
||||||
return this._fast(cpm / 60);
|
return this._fast(cpm / 60);
|
||||||
@ -774,6 +781,7 @@ Pattern.prototype.patternified = [
|
|||||||
'linger',
|
'linger',
|
||||||
'ply',
|
'ply',
|
||||||
'segment',
|
'segment',
|
||||||
|
'striate',
|
||||||
'slow',
|
'slow',
|
||||||
'velocity',
|
'velocity',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -704,6 +704,10 @@ describe('Pattern', function () {
|
|||||||
sequence(pure('a').fast(3), [pure('b').fast(3), pure('c').fast(3)]).firstCycle(),
|
sequence(pure('a').fast(3), [pure('b').fast(3), pure('c').fast(3)]).firstCycle(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('Doesnt drop events in the 9th cycle', () => {
|
||||||
|
// fixed with https://github.com/tidalcycles/strudel/commit/72eeaf446e3d5e186d63cc0d2276f0723cde017a
|
||||||
|
assert.equal(sequence(1, 2, 3).ply(2).early(8).firstCycle().length, 6);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
describe('chop', () => {
|
describe('chop', () => {
|
||||||
it('Can _chop(2)', () => {
|
it('Can _chop(2)', () => {
|
||||||
|
|||||||
@ -33,7 +33,7 @@ export class TimeSpan {
|
|||||||
// (Note that the output timespan probably does not start *at* Time 0 --
|
// (Note that the output timespan probably does not start *at* Time 0 --
|
||||||
// that only happens when the input Arc starts at an integral Time.)
|
// that only happens when the input Arc starts at an integral Time.)
|
||||||
const b = this.begin.cyclePos();
|
const b = this.begin.cyclePos();
|
||||||
const e = b + (this.end - this.begin);
|
const e = b.add(this.end.sub(this.begin));
|
||||||
return new TimeSpan(b, e);
|
return new TimeSpan(b, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -734,8 +734,8 @@ const bass = await sampler({
|
|||||||
bell = bell.chain(vol(0.6).connect(delay),out());
|
bell = bell.chain(vol(0.6).connect(delay),out());
|
||||||
|
|
||||||
"0".euclidLegato(3,8)
|
"0".euclidLegato(3,8)
|
||||||
|
.echo(3, 1/16, .5)
|
||||||
.add(rand.range(0,12))
|
.add(rand.range(0,12))
|
||||||
.echo(3, 1/16, (x,n)=>x.add((n+1)*2).velocity(1/(n+1)))
|
|
||||||
.velocity(rand.range(.5,1))
|
.velocity(rand.range(.5,1))
|
||||||
.legato(rand.range(.4,3))
|
.legato(rand.range(.4,3))
|
||||||
.scale(slowcat('D minor pentatonic')).tone(bell)
|
.scale(slowcat('D minor pentatonic')).tone(bell)
|
||||||
@ -808,3 +808,19 @@ stack(
|
|||||||
|
|
||||||
//.pianoroll({minMidi:20, maxMidi:160})
|
//.pianoroll({minMidi:20, maxMidi:160})
|
||||||
// strudel disable-highlighting`;
|
// strudel disable-highlighting`;
|
||||||
|
|
||||||
|
export const festivalOfFingers3 = `"[-7*3],0,2,6,[8 7]"
|
||||||
|
.echoWith(4,1/4, (x,n)=>x
|
||||||
|
.add(n*7)
|
||||||
|
.velocity(1/(n+1))
|
||||||
|
.legato(1/(n+1)))
|
||||||
|
.velocity(perlin.range(.5,.9).slow(8))
|
||||||
|
.stack("[22 25]*3"
|
||||||
|
.legato(sine.range(.5,2).slow(8))
|
||||||
|
.velocity(sine.range(.4,.8).slow(5))
|
||||||
|
.echo(4,1/12,.5))
|
||||||
|
.scale(slowcat('D dorian','G mixolydian','C dorian','F mixolydian'))
|
||||||
|
.legato(1)
|
||||||
|
.slow(2)
|
||||||
|
.tone((await piano()).toDestination())
|
||||||
|
//.pianoroll({maxMidi:160})`;
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
// Snowpack Configuration File
|
|
||||||
// See all supported options: https://www.snowpack.dev/reference/configuration
|
|
||||||
|
|
||||||
/** @type {import("snowpack").SnowpackUserConfig } */
|
|
||||||
module.exports = {
|
|
||||||
mount: {
|
|
||||||
/* ... */
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
/* ... */
|
|
||||||
],
|
|
||||||
packageOptions: {
|
|
||||||
/* ... */
|
|
||||||
},
|
|
||||||
devOptions: {
|
|
||||||
/* ... */
|
|
||||||
},
|
|
||||||
buildOptions: {
|
|
||||||
/* ... */
|
|
||||||
},
|
|
||||||
};
|
|
||||||
Loading…
x
Reference in New Issue
Block a user