Strudelify

Instant Karma

John Lennon

KeyD majorTempo120 bpm
0:00/0:00
// Instant Karma — John Lennon
// 120 bpm, 4/4, key D major. Source: midi.
// Generated by strudelify. One cycle = one bar.
// note: sustain pedal (CC 64) lengthens the held notes
// note: duplicate parts dropped: ch 7 "echo" piano (copy of ch 5 piano, 0.25 beats late); ch 8 "echo" piano (copy of ch 6 piano, 0.25 beats late)
// note: Full arrangement: all 86 bars on a 24-step grid, each part at one level; ghost notes are separate "_soft" parts. Source detail keeps the original performance.
setcpm(120/4)

// Notation: c3@3 lasts 3 steps · ~ is a rest · [c3,e3] is a chord · "a, b" plays two voices at once · [...]/2 spreads a riff over 2 bars.
// A part's distinct bars are riffs (A, B, C...) played in order: edit a riff to change every repeat.

// bass · electric bass finger · "BASS"
const bass = note(`<
  ~@3 A B C D E F G H I J I K L M N O A B C D E F G H I P I K L M N O Q R S T Q U V W A B C D E F G H I P I K L M N O Q
  R S T Q U V W Q R S T Q U V W Q X ~@9
>`.pickRestart({
  A: "a1@10 ~@2 a1@7 ~ a1 ~ a1@2", B: "f#1@8 ~@2 f#2@2 f#1@7 ~ f#1@2 g#1 ~", C: "a1@7 ~@3 e1@2 a1@11 ~",
  D: "f#1@5 ~ f#1@3 ~ f#1 g#1", E: "a1@9 ~ e1@2 a1@11 ~", F: "f#1@5 ~ f#1@4 ~@2", G: "f1@7 ~@3 f1 ~ g1@9 ~@3",
  H: "a1@5 ~ a1@5 ~", I: "d2@11 ~ c#2@11 ~", J: "b1@11 ~ a1@11 ~", K: "b1@12 a1@11 ~", L: "c2 b1", M: "a1@12 g1@11 ~",
  N: "d2@11 ~ d2@8 a1 ~ d2@2", O: "e2@11 ~ e2@5 ~ e2@2 b1@2 ~@2", P: "b1@11 ~", Q: "g1@7 ~@3 g1@2 b1@8 ~@2 b1@2",
  R: "e2@7 ~@3 e2@2 d2@8 e2@2 d2@2", S: "g1@4 ~ g1 b1@4 ~ b1", T: "e2@8 ~@2 e2@2 d2@7 ~ e2@2 d2@2",
  U: "e2@7 ~@3 e2@2 d2@11 ~", V: "d2@7 ~@3 d2@10 a1@2 d2@2", W: "e2@7 ~ e2@2 b1@2 e1@7 ~ e2@2 e1@2",
  X: "e2@7 ~@3 e2@2 ~@12",
})).s("gm_electric_bass_finger").gain(0.78).pan(0.6)

// bass · electric bass finger · "BASS" · soft notes
const bass_soft = note("<~@76 A B C D E B C D ~@2>".pickRestart({
  A: "~@6 d2@4 e2 d2", B: "g1@4 ~ g1 b1@4 ~ b1", C: "e2@8 ~@2 e2@2 d2@7 ~ e2@2 d2@2", D: "g1@7 ~@3 g1@2 b1@8 ~@2 b1@2",
  E: "e2@7 ~@3 e2@2 d2@8 e2@2 d2@2",
})).s("gm_electric_bass_finger").gain(0.23).pan(0.6)

// chords · piano
const piano = note(`<
  ~ A B C D C D E D F G H I H J K L M N C D C D E D F G H I H J K L M N O P Q R S T U V C D C D E D F G H I H J K L M N
  O P Q R S T U V O P Q R S T U V W X Y ~@8
>`.pickRestart({
  A: "[e2,e3]", B: "[g2,g3]@19 ~@5", C: "[a3,c#4,e4] ~@2 [a3,c#4,e4], [a2,e3]@5 [a2,e3]@3 [a2,e3]@4, ~ [a3,c#4,e4]!2 ~",
  D: "[f#3,a3,c#4] ~@2 [f#3,a3,c#4], f#2@5 f#2@3 f#2@4, ~ [f#3,a3,c#4]!2 ~", // F#m
  E: "[a3,c#4,e4] ~ [a3,c#4,e4]!2, [a2,e3]@5 [a2,e3]@7, ~ [a3,c#4,e4] ~@2", F: "[f3,a3,c4]!2 [g3,b3,d4]!2, [f2,c3] g2",
  G: "[a3,c#4,e4]@6 ~@12 [a3,c#4,e4]@5 ~, [a2,e3]@10 [a2,e3]@6 [a2,e3]@7 ~, ~ [a3,c#4,e4]!2 ~", // A A5 A
  H: "[d4,f#4,a4]!2 [c#4,f#4,a4]!2, [d3,a3] c#3", I: "[b3,d4,f#4]!2 [a3,d4,f#4]!2, b2@13 ~@11",
  J: "[b3,d4,f#4]@3 [b3,d4,f#4]@3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 ~@4", // G Bm
  X: "[e3,g3,b3,e4]@4 ~@2 e4@3 ~ [e3,g3,b3] ~ e4@3 ~ [e3,g3,b3] ~ e4 ~@5", Y: "[g3,b3,d4]@4 ~@2 [g3,b3,d4] ~@17",
})).s("gm_piano").gain(0.36).pan(0.8)

// chords · piano · soft notes
const piano_soft = note("<~@77 A B C D E B F@3>".pickRestart({
  A: "~@6 [b3,d4,f#4]@2 ~ [b3,f#4] ~@2, ~@18 d4 ~@5", // Bm B5
  B: "[e3,g3,b3,e4]@4 ~@2 [e3,g3,b3,e4]@2 ~@4 [g3,b3,e4] ~@5 [e3,g3,b3,e4] ~@5, ~@6 e3 ~@5", // Em
  C: "[g2,d3,g3,b3,d4,g4]@4 ~@2 [b3,d4]@2 ~@4 [b3,d4,f#4]@4 ~@2 [b3,d4] ~@5, ~@6 g4 ~@11 f#4@2 ~@4", // G Bm
  D: "[e3,g3,b3,e4]@4 ~@2 e4@3 ~ [e3,g3,b3] ~ e4@3 ~ [e3,g3,b3] ~ e4 ~@5", // Em
  E: "[g3,b3,d4]@4 ~@2 [g3,b3,d4] ~@5 [b3,d4,f#4]@4 ~@2 [b3,f#4]@2 ~@4, ~@18 d4 ~@5", // G Bm B5
  F: "[[b3,d4,g4]!2 [b3,d4,f#4] [b3,d4,f#4]@8 ~, [g2,d3,g3] ~@5]/3", // G Bm G5
})).s("gm_piano").gain(0.12).pan(0.8)

// chords · acoustic guitar steel · "GUITAR"
const acoustic_guitar_steel = note(`<
  ~@3 A B C B D B E A F G F G H@2 F I A B C B D B E A F ~ F G H@2 F I J K L M N K O P A B C B D B E A F ~ F G H@2 F I J
  K L M N K O P J K L M N K O P Q R S ~@8
>`.pickRestart({
  A: "~@6 [a3,c#4,e4] ~@11 [a3,c#4,e4] ~@5", B: "~@6 [c#4,f#4,a4] ~@11 [c#4,f#4,a4] ~@5",
  C: "~@6 [a3,c#4,e4] ~@11 [a3,c#4,e4]@2 ~@4", D: "~@6 [a3,c#4,e4]@2 ~@10 [a3,c#4,e4] ~@5",
  E: "~@6 [f3,a3,c4]@2 ~@10 [g3,b3,d4] ~@5", F: "~@6 [a3,d4,f#4] ~@11 [a3,d4,f#4] ~@5",
  G: "~@6 [b3,d4,f#4] ~@11 [b3,d4,f#4] ~@5", H: "~@6 [g3,c4,e4] ~@11 [g3,c4,e4] ~@5",
  I: "~@3 [g#3,b3,e4] ~@5 [g#3,b3,e4] ~@2", J: "[g3,b3,d4]!2 [b3,d4,f#4]!2, g2 ~",
  K: "[e3,g3,b3,e4]@3 [e3,g3,b3]@2 ~@4 e4@3, ~ e4!2 ~, ~@5 [e3,g3,b3]@3 [e3,g3,b3]@4", L: "[g3,b3,d4]!2 [b3,d4,f#4]!2",
  M: "[g3,b3,d4] ~@2 [g3,b3,e4], ~ d4@3, ~ [g3,b3] [g3,b3,e4] ~, ~@5 e3@3 e3@4", // G Em G Em
  N: "[g3,b3,d4]!2 [b3,d4,f#4]!2, [g2,d3] ~", O: "d4@3 ~@8 d4, f#4, [d3,a3]@2 [d3,a3]!4, ~@3 d4@2 d4@2 d4@2 d4@2 ~",
  P: "[e3,b3]@2 [e3,b3]@2 [e3,b3]@2 ~@4 e4 ~, ~@6 [e3,b3]@3 [e3,b3]@2 ~, ~@4 e4 ~", // E5
  Q: "[g2,g3,b3,d4] ~@5 [b3,d4]@6 [b3,d4,f#4]@6 [b3,d4,f#4]@5 ~, ~@6 g3@17 ~", // G Bm
  R: "[e3,g3,b3,e4]@3 [e3,g3,b3]@2 ~@4 e4@2 ~, ~ e4!2 ~, ~@5 [e3,g3,b3]@3 [e3,g3,b3]@3 ~", // Em
  S: "[g3,b3,d4] [b3,d4] ~@2, ~@6 g3@17 ~", // G Bm
})).s("gm_acoustic_guitar_steel").gain(0.45).pan(0.3)

// chords · acoustic guitar steel · "GUITAR" · soft notes
const acoustic_guitar_steel_2 = note("<~@77 A B C D E B F@3>".pickRestart({
  A: "~@12 [b3,d4,f#4]@6 [b3,d4,f#4]@5 ~", // Bm
  B: "[g3,b3,d4]@6 ~@12 [g3,b3,e4]@5 ~, ~@6 d4@17 ~, ~ [g3,b3] [g3,b3,e4] ~, ~@10 e3@6 e3@7 ~", // G Em G Em
  C: "[g2,g3,b3,d4] ~@5 [b3,d4]@6 [b3,d4,f#4]@6 [b3,d4,f#4]@5 ~, ~@6 g3@17 ~", // G Bm
  D: "[e3,g3,b3,e4]@3 [e3,g3,b3]@2 ~@4 e4@2 ~, ~ e4!2 ~, ~@5 [e3,g3,b3]@3 [e3,g3,b3]@3 ~", // Em
  E: "[g3,b3,d4]@6 [b3,d4]@6 [b3,d4,f#4]@6 [b3,d4,f#4]@5 ~, ~@6 g3@17 ~", // G Bm
  F: "[[g3,b3,d4]!2 [b3,d4,f#4] [b3,d4,f#4]@8 ~, g2 ~@5]/3", // G Bm
})).s("gm_acoustic_guitar_steel").gain(0.15).pan(0.3)

// other · piano
const piano_2 = note("<~@3 A@2 B C B D E@2 ~@8 A@2 B C B D E@2 ~@16 A@2 B C B D E@2 ~@35>".pickRestart({
  A: "[~@6 e3 ~ e3@2 ~ a3@2 ~ e3@2 ~ a3@2 ~ e3@2 ~ b3@4 ~@2 f#3@4 ~@15]/2",
  B: "~@9 e3 ~ e3 a3@2 ~ e3@2 ~ a3@2 ~ e3@2 ~", C: "b3 ~@5", D: "b3@2 ~ f#3@4 ~@17",
  E: "[~@6 a3@2 ~ a3@2 ~ b3@4 ~ b3@4 ~@2 c#4@8 ~@17]/2",
})).s("gm_piano").gain(0.8).pan(0.3)

// drums · kick
const kick = s("bd").struct("<~@2 A B C@24 D C@6 E C@3 E C@12 D C@6 E C@3 E C@3 E C@3 E C@3 E F ~@9>".pickRestart({
  A: "~@11 x", B: "x ~ x ~@2 x!2 ~@4 x", C: "x ~ x ~@2 x!2 ~ x ~@2 x", D: "x", E: "x!3 ~@2 x!2 ~ x ~@2 x",
  F: "x ~ x ~@2 x ~@6",
})).gain(0.55)

// drums · kick · soft notes
const kick_soft = s("bd").struct(`<
  ~@76
  [~@6 x ~ x ~@2 x]
  [x ~ x ~@2 x!2 ~ x ~@2 x]!2
  [x!3 ~@2 x!2 ~ x ~@2 x]
  [x ~ x ~@2 x!2 ~ x ~@2 x]!3
  [x!3 ~@2 x!2 ~ x ~@2 x]
  ~@2
>`).gain(0.16)

// drums · snare
const snare = s("sd").struct(`<
  ~@2 A B@7 C B@7 D B@7 C B E B@5 C B@7 F B@7 C B G B@5 C B@7 F B@7 H B I ~@9
>`.pickRestart({
  A: "~@17 x!2 ~@5", B: "~ x ~ x", C: "~@2 x!2 ~@5 x!3", D: "~@3 x ~@2 x ~@2 x!3", E: "x ~@7 x!2 ~ x ~@6 x ~ x!2 ~ x",
  F: "~@2 x!2 ~ x ~@3 x!3", G: "~@3 x ~ x ~@6 x ~@5 x ~ x!2 ~ x", H: "~ x!3 ~ x ~ x!5", I: "~ x ~@2",
})).gain(0.55)

// drums · snare · soft notes
const snare_soft = s("sd").struct(`<
  ~@2 A ~@7 B ~@7 C ~@7 B ~ D ~@5 B ~@7 B ~@7 B ~ E ~@5 B ~@7 B ~@9 F G@5 H G ~@2
>`.pickRestart({
  A: "~@2 x", B: "~ x ~@5 x!2 ~@3", C: "~@4 x!2 ~@2 x ~@3", D: "~@2 x ~@2 x ~@8 x ~@2 x ~@6",
  E: "x ~ x ~@5 x!2 ~ x ~@2 x ~@2 x ~@6", F: "~@3 x", G: "~ x ~ x", H: "~ x!3 ~ x ~ x!5",
})).gain(0.22)

// drums · clap
const clap = s("cp").struct("<~@35 [~ x ~ x]!8 ~@16 [~ x ~ x]!17 [~ x ~@2] ~@9>").gain(0.55)

// drums · clap · soft notes
const clap_soft = s("cp").struct("<~@76 [~@3 x] [~ x ~ x]!7 ~@2>").gain(0.16)

// drums · low tom
const low_tom = s("lt").struct("<~@10 A ~@15 A ~@7 A ~@15 A ~@7 A ~@27>".pickRestart({
  A: "~@11 x",
})).gain(0.55)

// drums · hihat
const hihat = s("hh").struct("<A B C D@6 E D@15 E D@2 A D@4 E D@15 E D@2 A D@4 E D@21 F ~@6>".pickRestart({
  A: "x!4", B: "~ x ~ x", C: "~ x ~@2", D: "x ~ x!2 ~ x!2 ~ x!2 ~ x", E: "x ~ x!2 ~ x!2 ~ x!2 ~@2",
  F: "x ~ x!2 ~ x!2 ~@5",
})).gain(0.33)

// drums · hihat · soft notes
const hihat_soft = s("hh").struct("<~@79 [~@8 x!2 ~ x] [x ~ x!2 ~ x!2 ~ x!2 ~ x]!4 ~@2>").gain(0.11)

// drums · mid tom
const mid_tom = s("mt").struct("<~@3 A ~@6 B ~@15 B ~@7 B ~@15 B ~@7 B ~@27>".pickRestart({
  A: "~@2 x", B: "~@9 x!2 ~",
})).gain(0.55)

// drums · open hat
const open_hat = s("oh").struct("<~@9 A ~@15 A ~@7 A ~@15 A ~@7 A ~@28>".pickRestart({
  A: "~@11 x",
})).gain(0.55)

// drums · high tom
const high_tom = s("ht").struct("<~@10 A ~@15 A ~@7 A ~@15 A ~@7 A ~@27>".pickRestart({
  A: "~@7 x ~@4",
})).gain(0.55)

// drums · crash
const crash = s("cr").struct(`<
  ~@3 A ~@7 A ~@7 A ~@7 A ~ A ~ A ~@3 B ~@3 B ~@3 A ~@7 A ~@3 A ~@3 B ~@3 B ~@3 B ~@3 B ~@3 B ~@3 B ~@3 B ~@2
>`.pickRestart({
  A: "x", B: "~ x ~@2",
})).gain(0.55)

// drums · ride
const ride = s("rd").struct("<~@35 [x!4]!8 ~@16 [x!4]!17 [x!2 ~@2] ~@9>").gain(0.55)

// drums · ride · soft notes
const ride_soft = s("rd").struct("<~@76 [~@2 x!2] [x!4]!7 ~@2>").gain(0.16)

stack(
  bass, bass_soft, piano, piano_soft, acoustic_guitar_steel, acoustic_guitar_steel_2, piano_2, kick, kick_soft, snare,
  snare_soft, clap, clap_soft, low_tom, hihat, hihat_soft, mid_tom, open_hat, high_tom, crash, ride, ride_soft
)

More by John Lennon