refactor: voicings -> voicing in tunes

This commit is contained in:
Felix Roos 2023-07-13 01:09:29 +02:00
parent a639d9f49f
commit 70fe8f14e3

View File

@ -68,32 +68,35 @@ stack(
`;
export const giantSteps = `// John Coltrane - Giant Steps
setVoicingRange('lefthand', ['E3', 'G4']);
let melody = note(
"[F#5 D5] [B4 G4] Bb4 [B4 A4]",
"[D5 Bb4] [G4 Eb4] F#4 [G4 F4]",
"Bb4 [B4 A4] D5 [D#5 C#5]",
"F#5 [G5 F5] Bb5 [F#5 F#5]",
)
stack(
// melody
seq(
"[F#5 D5] [B4 G4] Bb4 [B4 A4]",
"[D5 Bb4] [G4 Eb4] F#4 [G4 F4]",
"Bb4 [B4 A4] D5 [D#5 C#5]",
"F#5 [G5 F5] Bb5 [F#5 F#5]",
).color('#F8E71C'),
melody.color('#F8E71C'),
// chords
seq(
chord(
"[B^7 D7] [G^7 Bb7] Eb^7 [Am7 D7]",
"[G^7 Bb7] [Eb^7 F#7] B^7 [Fm7 Bb7]",
"Eb^7 [Am7 D7] G^7 [C#m7 F#7]",
"B^7 [Fm7 Bb7] Eb^7 [C#m7 F#7]"
).voicings('lefthand').color('#7ED321'),
).dict('lefthand')
.anchor(melody).mode('under')
.voicing().color('#7ED321'),
// bass
seq(
note(
"[B2 D2] [G2 Bb2] [Eb2 Bb3] [A2 D2]",
"[G2 Bb2] [Eb2 F#2] [B2 F#2] [F2 Bb2]",
"[Eb2 Bb2] [A2 D2] [G2 D2] [C#2 F#2]",
"[B2 F#2] [F2 Bb2] [Eb2 Bb3] [C#2 F#2]"
).color('#00B8D4')
).slow(20).note()
//.pianoroll({fold:1})`;
).slow(20)
.pianoroll({fold:1})`;
export const zeldasRescue = `// Koji Kondo - Princess Zelda's Rescue
stack(
@ -134,28 +137,31 @@ const drums = stack(
s("[~ hh]*2").delay(.3).delayfeedback(.5).delaytime(.125).gain(.4)
);
const thru = (x) => x.transpose("<0 1>/8").transpose(-1);
const synths = stack(
"<eb4 d4 c4 b3>/2"
.scale(timeCat([3,'C minor'],[1,'C melodic minor'])
.slow(8)).struct("[~ x]*2")
.scale("<C:minor!3 C:melodic:minor>/2")
.struct("[~ x]*2")
.layer(
x=>x.scaleTranspose(0).early(0),
x=>x.scaleTranspose(2).early(1/8),
x=>x.scaleTranspose(7).early(1/4),
x=>x.scaleTranspose(8).early(3/8)
).apply(thru).note().apply(keys).mask("<~ x>/16")
).note().apply(keys).mask("<~ x>/16")
.color('darkseagreen'),
note("<C2 Bb1 Ab1 [G1 [G2 G1]]>/2".apply(thru))
note("<C2 Bb1 Ab1 [G1 [G2 G1]]>/2")
.struct("[x [~ x] <[~ [~ x]]!3 [x x]>@2]/2".fast(2))
.s('sawtooth').attack(0.001).decay(0.2).sustain(1).cutoff(500)
.color('brown'),
"<Cm7 Bb7 Fm7 G7b13>/2".struct("~ [x@0.2 ~]".fast(2))
.voicings('lefthand')
.apply(thru).every(2, early(1/8)).note().apply(keys).sustain(0)
chord("<Cm7 Bb7 Fm7 G7b13>/2")
.struct("~ [x@0.2 ~]".fast(2))
.dict('lefthand').voicing()
.every(2, early(1/8))
.apply(keys).sustain(0)
.delay(.4).delaytime(.12)
.mask("<x@7 ~>/8".early(1/4))
)
).add(note("<-1 0>/8"))
stack(
drums.fast(2).color('tomato'),
synths
@ -263,15 +269,20 @@ export const festivalOfFingers = `// "Festival of fingers"
const chords = "<Cm7 Fm7 G7 F#7>";
stack(
chords.voicings('lefthand').struct("x(3,8,-1)").velocity(.5).off(1/7,x=>x.transpose(12).velocity(.2)),
chords.rootNotes(2).struct("x(4,8,-2)"),
chord(chords).dict('lefthand').voicing().struct("x(3,8,-1)")
.velocity(.5).off(1/7,x=>x.add(note(12)).velocity(.2)),
chords.rootNotes(2).struct("x(4,8,-2)").note(),
chords.rootNotes(4)
.scale(cat('C minor','F dorian','G dorian','F# mixolydian'))
.struct("x(3,8,-2)".fast(2))
.scaleTranspose("0 4 0 6".early(".125 .5")).layer(scaleTranspose("0,<2 [4,6] [5,7]>/4"))
.note()
).slow(2)
.velocity(sine.struct("x*8").add(3/5).mul(2/5).fast(8))
.note().piano()`;
.piano()`;
// iter, echo, echoWith
export const undergroundPlumber = `// "Underground plumber"
@ -527,10 +538,10 @@ stack(
.gain(.4) // turn down
.cutoff(sine.slow(7).range(300,5000)) // automate cutoff
//.hush()
,"<Am7!3 <Em7 E7b13 Em7 Ebm7b5>>".voicings('lefthand') // chords
.superimpose(x=>x.add(.04)) // add second, slightly detuned voice
.add(perlin.range(0,.5)) // random pitch variation
.note() // wrap in "note"
,chord("<Am7!3 <Em7 E7b13 Em7 Ebm7b5>>")
.dict('lefthand').voicing() // chords
.add(note("0,.04")) // add second, slightly detuned voice
.add(note(perlin.range(0,.5))) // random pitch variation
.s('sawtooth') // waveform
.gain(.16) // turn down
.cutoff(500) // fixed cutoff
@ -559,14 +570,15 @@ samples({
perc: ['perc/002_perc2.wav'],
}, 'github:tidalcycles/Dirt-Samples/master/');
"C^7 Am7 Dm7 G7".slow(2).voicings('lefthand')
.stack("0@6 [<1 2> <2 0> 1]@2".scale('C5 major'))
.note().slow(4)
chord("<C^7 Am7 Dm7 G7>*2").dict('lefthand').anchor("G4").voicing()
.stack(n("0@6 [<1 2> <2 0> 1]@2").scale('C5 major'))
.slow(4)
.s("gm_epiano1:1")
.color('steelblue')
.stack(
"<-7 ~@2 [~@2 -7] -9 ~@2 [~@2 -9] -10!2 ~ [~@2 -10] -5 ~ [-3 -2 -10]@2>*2".scale('C3 major')
.note().s('sawtooth').color('brown')
n("<-7 ~@2 [~@2 -7] -9 ~@2 [~@2 -9] -10!2 ~ [~@2 -10] -5 ~ [-3 -2 -10]@2>*2")
.scale('C3 major')
.s('sawtooth').color('brown')
)
.attack(0.05).decay(.1).sustain(.7)
.cutoff(perlin.range(800,2000))
@ -664,8 +676,10 @@ stack(
s("mt lt ht").struct("x(3,8)").fast(2).gain(.5).room(.5).sometimes(x=>x.speed(".5")),
s("misc:2").speed(1).delay(.5).delaytime(1/3).gain(.4),
// chords
note("[~ Gm7] ~ [~ Dm7] ~".voicings('lefthand').superimpose(x=>x.add(.1)))
.s('sawtooth').gain(.5)
chord("[~ Gm7] ~ [~ Dm7] ~")
.dict('lefthand').voicing()
.add(note("0,.1"))
.s('sawtooth').gain(.8)
.cutoff(perlin.range(400,3000).slow(8))
.decay(perlin.range(0.05,.2)).sustain(0)
.delay(.9).room(1),
@ -695,7 +709,11 @@ setVoicingRange('lefthand', ['c3','a4'])
stack(
s('bass').loopAt(8).clip(1),
s("bd*2, ~ sd,hh*4"),
note("Abm7".voicings('lefthand').struct("x(3,8,1)".slow(2))),
chord("Abm7")
.mode("below:G4")
.dict('lefthand')
.voicing()
.struct("x(3,8,1)".slow(2)),
"0 1 2 3".scale('ab4 minor pentatonic')
.superimpose(x=>x.add(.1))
.sometimes(x=>x.add(12))
@ -859,7 +877,7 @@ export const loungeSponge = `// "Lounge sponge"
await loadOrc('github:kunstmusik/csound-live-code/master/livecode.orc')
stack(
note("<C^7 A7 Dm7 Fm7>/2".voicings('lefthand'))
chord("<C^7 A7 Dm7 Fm7>/2").dict('lefthand').voicing()
.cutoff(sine.range(500,2000).round().slow(16))
.euclidLegato(3,8).csound('FM1')
,
@ -878,9 +896,11 @@ export const arpoon = `// "Arpoon"
await samples('github:tidalcycles/Dirt-Samples/master')
note("<<Am7 C^7> C7 F^7 [Fm7 E7b9]>".voicings('lefthand'))
.arp("[0,3] 2 [1,3] 2".fast(3).lastOf(4, fast(2))).clip(2)
.add(perlin.range(0,0.2).add("<0 12>/8").note())
n("[0,3] 2 [1,3] 2".fast(3).lastOf(4, fast(2))).clip(2)
.offset("<<1 2> 2 1 1>")
.chord("<<Am7 C^7> C7 F^7 [Fm7 E7b9]>")
.dict('lefthand').voicing()
.add(perlin.range(0,0.2).add("<-12 0>/8").note())
.cutoff(perlin.range(500,4000)).resonance(12)
.gain("<.5 .8>*16")
.decay(.16).sustain(0.5)