Strudelify

Imagine

John Lennon

KeyC majorTempo73 bpm
0:00/0:00
// Imagine — John Lennon
// 73 bpm, 4/4, key C major. Source: midi.
// Generated by strudelify. One cycle = one bar.
// note: Tempo changes preserved in elapsed time; displayed bars use the dominant tempo.
// note: pitch bends are ignored
// note: sustain pedal (CC 64) lengthens the held notes
// note: Full arrangement: all 58 bars on a 16-step grid, each part at one level. Source detail keeps the original performance.
setcpm(73/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.

// chords · piano · "tk1"
const piano = note(`<
  A@2 B C D C E C F C B C G H I J K L M C D C N C O P Q J R S T U T S V W X L M C D C N C O P Q J R S T U T S V Y@3
>`.pickRestart({
  A: "[~@15 c3, ~@15 c2@17, ~@15 [e3,g3]@5 [e3,g3]@4 [e3,g3]@4 [e3,g3,b3]@4, ~@9 c3@2 c3@2 c3@2 ~]/2", // Em
  B: "~@7 b3, f2@13 a#3@3, [f3,a3,c4]!2 c4@2, ~ c3@2 c3@2 c3@3, ~@2 [f3,a3]!2", // F
  C: "~@7 c3, [c2,d4], [e3,g3]!3 [e3,g3,b3], ~ c3@2 c3@2 c3@2 ~", // Csus2 Em
  D: "~@7 b3, f2@13 a#3@2 ~, [f3,a3,c4]@4 [f3,a3,c4]@4 c4@7 ~, ~@2 c3@4 c3@4 c3@5 ~, ~@8 [f3,a3]@4 [f3,a3]@3 ~", // F
  E: "[f3,a3,c4] ~@6 b3, f2@13 a#3@3, ~ c3@2 c3@2 c3@3, ~ [f3,a3,c4] c4@2, ~@2 [f3,a3]!2", // F
  F: "[f3,a3,c4] ~@6 b3, f2@13 a#3@2 ~, ~@2 c3@4 c3@4 c3@5 ~, ~@4 [f3,a3,c4]@4 c4@7 ~, ~@8 [f3,a3]@4 [f3,a3]@3 ~", // F
  G: "[f3,a3,c4] ~@6 c3, f2, ~ c3@2 c3@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~@5 [c3,c4]@2 ~@6 e3@2, [c2,g2,e3] [e2,b2,e4], ~ c3@2 ~@2 e3@2 ~, ~ [g3,b3] g#3 [g#3,d4]", // C E5 G G#dim
  W: "~@6 f3@2 d4 ~@5 g3@2, [f2,c3] [g2,d3], [a3,c4]!2 b3 [b3,d4], ~ f3@2 ~@2 g3@2 ~", // F5 G5 Am Bm
  X: "~ c3 g1 c3 a1 c3 b1 c3, [e3,g3]@15 ~, [c2,g2] ~@3", // Em C5
  Y: "[~@6 f3@2 d4 ~@6 g3@2 [c2,g2,e3,g3]@21 ~@10, [f2,c3]@8 [g2,d3]@9 ~@31, [a3,c4]@4 [a3,c4]@4 b3@4 [b3,d4]@5 ~@31, ~ f3@2 ~@2 g3@2 ~@17]/3", // C F5 G5 Am Bm
})).s("gm_piano").gain(0.35)

// bass · electric bass finger · "tk2"
const bass = note(`<
  ~@13 A B C D E F E F E F E F A B C D G H G H G H G I E F E F E F E F A B C D G H G H G H J K@2
>`.pickRestart({
  A: "f2@7 ~ e2@7 ~", B: "d2@7 ~ c2@7 ~", C: "g1", D: "g2@7 ~", E: "c2@15 ~", F: "f2@15 ~", G: "f2@7 ~ g2@7 ~",
  H: "c2@7 ~ e2@7 ~", I: "c2 ~", J: "f2 g2", K: "[~ c2@22 ~@9]/2",
})).s("gm_electric_bass_finger").gain(0.4).pan(0.6)

// chords · string ensemble 2 · "tk3"
const string_ensemble_2 = note(`<
  ~@17 A B A B A B A C D E F G H I J K L M N O P Q P Q P Q P R D E F G S I J K L M N T@2
>`.pickRestart({
  A: "[e4,g4]", B: "[f4,a4]", C: "[f4,a4]@4 ~ [f4,a4] [a4,c5]@2", D: "[a4,c5,f5]", E: "[a4,d5,f5]",
  F: "[d4,b4,d5]@3 [e4,c5,e5]", G: "[f4,d5,f5]@3 ~", H: "~@2 [f5,a5]@2 [g5,b5]@3 d6", I: "[e5,g5,c6] [e5,g#5,b5]",
  J: "[f5,a5]@2 [a5,c6]@2 [g5,b5]@3 [b5,d6], c5 d5", K: "[e5,g5,c6]@8 [e5,g#5,b5]@7 ~",
  L: "[f5,a5]@2 [a5,c6]@2 [g5,b5]@3 d6, c5 d5, ~@14 b5 ~", M: "[e5,g5,c6]@8 [g#5,b5,e6]@7 ~",
  N: "[c5,a5,c6] [d5,g5,b5]", O: "[e5,g5,c6]@15 ~", P: "e4@3 g4, [g3,c4]", Q: "f4@3 g4, [a3,c4]", R: "[a3,c4,f4]",
  S: "~ [f5,a5] g5 d6, ~@8 b5@7 ~", T: "[~ [e5,g5,c6]@22 ~@9]/2",
})).s("gm_string_ensemble_2").gain(0.18).pan(0.4)

// chords · piano · "tk5"
const piano_2 = note("<A@2 B C D ~@53>".pickRestart({
  A: "[~@15 c3, ~@15 c2@17, ~@15 [e3,g3]@5 [e3,g3]@4 [e3,g3]@4 [e3,g3,b3]@4, ~@9 c3@2 c3@2 c3@2 ~]/2", // Em
  B: "~@7 b3, f2@13 a#3@3, [f3,a3,c4]!2 c4@2, ~ c3@2 c3@2 c3@3, ~@2 [f3,a3]!2", // F
  C: "~@7 c3, [c2,d4], [e3,g3]!3 [e3,g3,b3], ~ c3@2 c3@2 c3@2 ~", // Csus2 Em
  D: "~@7 b3, f2@13 a#3@2 ~, [f3,a3,c4]@4 [f3,a3,c4]@4 c4@7 ~, ~@2 c3@4 c3@4 c3@5 ~, ~@8 [f3,a3]@4 [f3,a3]@3 ~", // F
})).s("gm_piano").gain(0.35)

// drums · kick
const kick = s("bd").struct("<~@13 A@3 B A@11 B A C@5 A B A@11 B A@6 D E ~>".pickRestart({
  A: "x ~@3 x!2 ~@2", B: "x", C: "x ~@7 x ~ x ~@4 x", D: "x ~@7 x ~@6 x", E: "~ x ~@14",
})).gain(0.35)

// drums · snare
const snare = s("sd").struct("<~@13 A@3 ~ A@11 ~ A@7 ~ A@11 ~ A@5 B C ~@2>".pickRestart({
  A: "~ x ~ x", B: "~@4 x ~@6 x!2 ~@3", C: "~@4 x ~@3 x ~ x!2 ~@4",
})).gain(0.35)

// drums · low tom
const low_tom = s("lt").struct("<~@24 [~@7 x] ~@19 [~@7 x] ~@9 [~@7 x] ~@3>").gain(0.31)

// drums · hihat
const hihat = s("hh").struct("<~@13 A@3 B A@7 C A@3 B A@7 ~ A@7 C A@3 B A@6 D ~@2>".pickRestart({
  A: "x!8", B: "x", C: "x!7 ~", D: "x ~ x ~ x ~ x ~ x ~ x ~ x ~@2 x",
})).gain(0.31)

// drums · high tom
const high_tom = s("ht").struct("<~@12 A ~@11 B ~@10 C ~@8 B ~@10 D ~@2>".pickRestart({
  A: "~@10 x!2 ~ x!2 ~", B: "~@13 x ~@2", C: "~@13 x!2 ~", D: "~@3 x",
})).gain(0.31)

// drums · crash
const crash = s("cr").struct("<~@36 x ~@19 [~ x ~@14] ~>").gain(0.22)

stack(piano, bass, string_ensemble_2, piano_2, kick, snare, low_tom, hihat, high_tom, crash)

More by John Lennon