remove edit and pipe function (duplicate of layer and apply)

This commit is contained in:
Lars Kobbe 2022-07-25 22:20:06 +02:00
parent bebfa23cc9
commit 82728be44b
3 changed files with 8 additions and 15 deletions

View File

@ -1014,13 +1014,6 @@ export class Pattern {
return this._chunk(n, func, true); return this._chunk(n, func, true);
} }
edit(...funcs) {
return stack(...funcs.map((func) => func(this)));
}
pipe(func) {
return func(this);
}
_bypass(on) { _bypass(on) {
on = Boolean(parseInt(on)); on = Boolean(parseInt(on));
return on ? silence : this; return on ? silence : this;

View File

@ -306,7 +306,7 @@ const drums = stack(
const thru = (x) => x.transpose("<0 1>/8").transpose(-1); const thru = (x) => x.transpose("<0 1>/8").transpose(-1);
const synths = stack( const synths = stack(
"<eb4 d4 c4 b3>/2".scale(timeCat([3,'C minor'],[1,'C melodic minor']).slow(8)).struct("[~ x]*2") "<eb4 d4 c4 b3>/2".scale(timeCat([3,'C minor'],[1,'C melodic minor']).slow(8)).struct("[~ x]*2")
.edit( .layer(
scaleTranspose(0).early(0), scaleTranspose(0).early(0),
scaleTranspose(2).early(1/8), scaleTranspose(2).early(1/8),
scaleTranspose(7).early(1/4), scaleTranspose(7).early(1/4),
@ -517,7 +517,7 @@ const snare = noise({type:'white',...adsr(0,0.2,0)}).chain(lowpass(5000),vol(1.8
const s = polysynth().set({...osc('sawtooth4'),...adsr(0.01,.2,.6,0.2)}).chain(vol(.23).connect(delay),out()); const s = polysynth().set({...osc('sawtooth4'),...adsr(0.01,.2,.6,0.2)}).chain(vol(.23).connect(delay),out());
stack( stack(
stack( stack(
"0 1 4 [3!2 5]".edit( "0 1 4 [3!2 5]".layer(
// chords // chords
x=>x.add("0,3").duration("0.05!3 0.02"), x=>x.add("0,3").duration("0.05!3 0.02"),
// bass // bass

View File

@ -32,14 +32,14 @@ const drums = stack(
const thru = (x) => x.transpose("<0 1>/8").transpose(-1); const thru = (x) => x.transpose("<0 1>/8").transpose(-1);
const synths = stack( const synths = stack(
"<eb4 d4 c4 b3>/2".scale(timeCat([3,'C minor'],[1,'C melodic minor']).slow(8)).struct("[~ x]\*2") "<eb4 d4 c4 b3>/2".scale(timeCat([3,'C minor'],[1,'C melodic minor']).slow(8)).struct("[~ x]\*2")
.edit( .layer(
scaleTranspose(0).early(0), scaleTranspose(0).early(0),
scaleTranspose(2).early(1/8), scaleTranspose(2).early(1/8),
scaleTranspose(7).early(1/4), scaleTranspose(7).early(1/4),
scaleTranspose(8).early(3/8) scaleTranspose(8).early(3/8)
).edit(thru).tone(keys).bypass("<1 0>/16"), ).layer(thru).tone(keys).bypass("<1 0>/16"),
"<C2 Bb1 Ab1 [G1 [G2 G1]]>/2".struct("[x [~ x] <[~ [~ x]]!3 [x x]>@2]/2".fast(2)).edit(thru).tone(bass), "<C2 Bb1 Ab1 [G1 [G2 G1]]>/2".struct("[x [~ x] <[~ [~ x]]!3 [x x]>@2]/2".fast(2)).layer(thru).tone(bass),
"<Cm7 Bb7 Fm7 G7b13>/2".struct("~ [x@0.1 ~]".fast(2)).voicings().edit(thru).every(2, early(1/8)).tone(keys).bypass("<0@7 1>/8".early(1/4)) "<Cm7 Bb7 Fm7 G7b13>/2".struct("~ [x@0.1 ~]".fast(2)).voicings().layer(thru).every(2, early(1/8)).tone(keys).bypass("<0@7 1>/8".early(1/4))
) )
stack( stack(
drums.fast(2), drums.fast(2),
@ -647,10 +647,10 @@ Turns chord symbols into root notes of chords in given octave.
<MiniRepl tune={`"<C^7 A7b13 Dm7 G7>".rootNotes(3)`} /> <MiniRepl tune={`"<C^7 A7b13 Dm7 G7>".rootNotes(3)`} />
Together with edit, struct and voicings, this can be used to create a basic backing track: Together with layer, struct and voicings, this can be used to create a basic backing track:
<MiniRepl <MiniRepl
tune={`"<C^7 A7b13 Dm7 G7>".edit( tune={`"<C^7 A7b13 Dm7 G7>".layer(
x => x.voicings(['d3','g4']).struct("~ x"), x => x.voicings(['d3','g4']).struct("~ x"),
x => x.rootNotes(2).tone(synth(osc('sawtooth4')).chain(out())) x => x.rootNotes(2).tone(synth(osc('sawtooth4')).chain(out()))
)`} )`}