Strudelify

Instant Karma

John Lennon

KeyD majorTempo120 bpm
0:00/0:00
// Instant Karma — Lennon John
// 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: Full arrangement: all 101 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 · acoustic bass · "ACOU BASS"
const bass = note(`<
  ~@2 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 A B C D E F G H Q R S T Q U V W Q R S T Q R S T Q R S T Q U V W X@3
>`.pickRestart({
  A: "a2@10 ~@2 a2@7 ~ a2 ~ a2@2", B: "f#2@8 ~@2 f#3@2 f#2@7 ~ f#2@2 g#2 ~", C: "a2@7 ~@3 e2@2 a2@11 ~",
  D: "f#2@5 ~ f#2@3 ~ f#2 g#2", E: "a2@9 ~ e2@2 a2@11 ~", F: "f#2@5 ~ f#2@4 ~@2", G: "f2@7 ~@3 f2 ~ g2@9 ~@3",
  H: "a2@5 ~ a2@5 ~", I: "d3@11 ~ c#3@11 ~", J: "b2@11 ~ a2@11 ~", K: "b2@12 a2@11 ~", L: "c3 b2", M: "a2@12 g2@11 ~",
  N: "d3@11 ~ d3@8 a2 ~ d3@2", O: "e3@11 ~ e3@5 ~ e3@2 b2@2 ~@2", P: "b2@11 ~", Q: "g2@7 ~@3 g2@2 b2@8 ~@2 b2@2",
  R: "e3@7 ~@3 e3@2 d3@8 e3@2 d3@2", S: "g2@4 ~ g2 b2@4 ~ b2", T: "e3@8 ~@2 e3@2 d3@7 ~ e3@2 d3@2",
  U: "e3@7 ~@3 e3@2 d3@11 ~", V: "d3@7 ~@3 d3@10 a2@2 d3@2", W: "e3@7 ~ e3@2 b2@2 e2@7 ~ e3@2 e2@2",
  X: "[a2@49 ~@23]/3",
})).s("gm_acoustic_bass").gain(0.64)

// chords · piano · "A.PIANO 1"
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 C D C D E D F G O P Q R S T U V W X Y Z W X Y Z O P Q R S T U V AA@3
>`.pickRestart({
  A: "[e3,e4]", B: "[g3,g4]@19 ~@5", C: "[a4,c#5,e5] ~@2 [a4,c#5,e5], [a3,e4]@5 [a3,e4]@3 [a3,e4]@4, ~ [a4,c#5,e5]!2 ~",
  D: "[f#4,a4,c#5] ~@2 [f#4,a4,c#5], f#3@5 f#3@3 f#3@4, ~ [f#4,a4,c#5]!2 ~", // F#m
  E: "[a4,c#5,e5] ~ [a4,c#5,e5]!2, [a3,e4]@5 [a3,e4]@7, ~ [a4,c#5,e5] ~@2", F: "[f4,a4,c5]!2 [g4,b4,d5]!2, [f3,c4] g3",
  G: "[a4,c#5,e5]@6 ~@12 [a4,c#5,e5]@5 ~, [a3,e4]@10 [a3,e4]@6 [a3,e4]@7 ~, ~ [a4,c#5,e5]!2 ~", // A A5 A
  H: "[d5,f#5,a5]!2 [c#5,f#5,a5]!2, [d4,a4] c#4", I: "[b4,d5,f#5]!2 [a4,d5,f#5]!2, b3@13 ~@11",
  J: "[b4,d5,f#5]@3 [b4,d5,f#5]@3 [a4,d5,f#5]@3 [a4,d5,f#5]@2 ~, b3@13 ~@11", // Bm D
  K: "[c5,e5,g5]@5 ~@5 c4@2 [b4,e5,g5]@6 [b4,e5,g5]@6, g4@13 ~@11, c4@5 ~ b3@6, ~@6 [c5,e5,g5]@7 ~@11", // C Em C
  L: "[c5,e5,g5]@3 ~@2 a3 [b4,e5,g5]@3 [b4,e5,g5]@2 ~, a3@5 ~@7, ~ [c5,e5,g5] ~@2", // C Em C
  M: "[d5,f#5,a5] ~ [d5,f#5,a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, ~@6 e4 ~@5", // Em
  AA: "[[a3,e4,a4,c#5,e5]@25 ~@11]/3", // A
})).s("gm_piano").gain(0.53)

// chords · acoustic guitar nylon · "MUTED GTR"
const acoustic_guitar_nylon = note(`<
  ~@2 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 A B C B D B E A J K L M N K O P Q R S T Q R S T J K L M N K O P U@2 ~
>`.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]@6 [b3,d4]@6 [b3,d4,f#4]@6 [b3,d4,f#4]@5 ~, ~@6 g3@17 ~", // G Bm
  T: "[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
  U: "[[a2,e3,a3]@47 ~]/2", // A5
})).s("gm_acoustic_guitar_nylon").gain(0.46)

// drums · kick
const kick = s("bd").struct(`<
  ~ A B@25 C B@6 D B@3 D B@12 C B@6 D B@3 D B@11 D B@3 D B@3 D B@3 D B@3 D B@3 D B D B C ~@2
>`.pickRestart({
  A: "~@11 x", B: "x ~ x ~@2 x!2 ~ x ~@2 x", C: "x", D: "x!3 ~@2 x!2 ~ x ~@2 x",
})).gain(0.66)

// drums · snare
const snare = s("sd").struct(`<
  ~ 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 C B@7 F B@7 F B@7 H ~@3
>`.pickRestart({
  A: "~@3 x", B: "~ x ~ x", C: "~@3 x ~@7 x", D: "~@3 x ~@5 x ~ x", E: "x ~@20 x ~ x", F: "~@3 x ~ x ~@5 x",
  G: "~@3 x ~@8 x ~@8 x ~ x", H: "x!6",
})).gain(0.66)

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

// drums · clap
const clap = s("cp").struct("<~@34 [~ x ~ x]!8 ~@16 [~ x ~ x]!8 ~@8 [~ x ~ x]!23 ~@4>").gain(0.66)

// drums · low tom
const low_tom = s("lt").struct("<~@9 A ~@15 A ~@7 A ~@15 A ~@7 A ~@15 A ~@23 B ~@3>".pickRestart({
  A: "~@11 x", B: "~@5 x",
})).gain(0.66)

// drums · hihat
const hihat = s("hh").struct("<~@2 [x!4]!96 ~@3>").gain(0.52)

// drums · hihat · soft notes
const hihat_soft = s("hh").struct("<~@2 A@6 B A@15 B A@2 ~ A@4 B A@15 B A@2 ~ A@4 B A@15 B A@25 ~@3>".pickRestart({
  A: "~@2 x ~@2 x ~@2 x ~@2 x", B: "~@2 x ~@2 x ~@2 x ~@3",
})).gain(0.07)

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

// drums · open hat
const open_hat = s("oh").struct("<~@8 A ~@15 A ~@7 A ~@15 A ~@7 A ~@15 A ~@25 B ~@2>".pickRestart({
  A: "~@11 x", B: "x",
})).gain(0.66)

// drums · high tom
const high_tom = s("ht").struct("<~@9 A ~@15 A ~@7 A ~@15 A ~@7 A ~@15 A ~@23 B ~@3>".pickRestart({
  A: "~@7 x ~@4", B: "~ x",
})).gain(0.66)

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

// drums · ride
const ride = s("rd").struct("<~@34 [x!4]!8 ~@16 [x!4]!8 ~@8 [x!4]!23 x!2 ~@2>").gain(0.66)

stack(
  bass, piano, acoustic_guitar_nylon, kick, snare, snare_soft, clap, low_tom, hihat, hihat_soft, mid_tom, open_hat,
  high_tom, crash, ride
)

More by John Lennon