Strudelify

Mary Had a Little Boy

Snap

KeyC minorTempo120 bpm
0:00/0:00
// Mary Had a Little Boy — Snap
// 120 bpm, 4/4, key C minor. Source: midi.
// Generated by strudelify. One cycle = one bar.
// note: Full arrangement: all 148 bars on a 16-step grid, each part at one level. 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.
// A part's distinct bars are riffs (A, B, C...) played in order: edit a riff to change every repeat.

// bass · slap bass 1 · "SLAP BASS"
const bass = note(`<
  [bb1@2 ~@2 g1@2 ~ f1!2 ~ f1 ~ g1 ~ g1 ~]!88
  ~@8
  [bb1@2 ~@2 g1@2 ~ f1!2 ~ f1 ~ g1 ~ g1 ~]!49
  [bb1@3 ~@13]
  ~@2
>`).s("gm_slap_bass_1").gain(0.31)

// chords · piano · "A.PIANO"
const piano = note(`<
  ~@20 A B C D A E C F G ~@15 A E C F A@2 C F ~@12 A E C D A E C H A I C D A E C D ~@44 A E C F A E C F A E C F A E C F
  ~@8
>`.pickRestart({
  A: "[c4,eb4,g4] ~@2 [c4,eb4,g4] ~@2 [c4,eb4,g4] ~@3 [c4,eb4,g4] ~ [c4,eb4,g4] ~ [c4,eb4,g4] ~", // Cm
  B: "[c4,eb4,g4] ~@2 [c4,eb4,g4] ~@2 [c4,eb4,g4] ~@3 [c4,g4] ~ [c4,d4,f4] ~ [c4,eb4] ~, ~@5 eb4 ~@2", // Cm C5 Dm7 Cm
  C: "[ab3,c4,eb4] ~@2 [ab3,c4,eb4] ~@2 [ab3,c4,eb4] ~@3 [ab3,c4,eb4] ~ [ab3,c4,eb4] ~ [ab3,c4,eb4] ~", // Ab
  D: "[ab3,c4,eb4] ~@2 [ab3,c4,eb4] ~@2 [ab3,c4,eb4] ~@3 [ab3,eb4,g4] ~ [ab3,d4,eb4,f4] ~ [ab3,c4,eb4] ~", // Ab Abmaj7 Ddim Ab
  E: "[c4,eb4,g4] ~@2 [c4,eb4,g4] ~@2 [c4,eb4,g4] ~@3 [c4,eb4,g4] ~ [c4,d4,f4] ~ [c4,eb4] ~", // Cm Dm7 Cm
  F: "[ab3,c4,eb4] ~@2 [ab3,c4,eb4] ~@2 [ab3,c4,eb4] ~@3 [ab3,eb4,g4] ~ [ab3,d4,f4] ~ [ab3,c4,eb4] ~", // Ab Abmaj7 Ddim Ab
  G: "[g3,c4,eb4] ~@15", // Cm
  H: "[ab3,c4,eb4] ~@2 [ab3,c4,eb4] ~@2 [ab3,c4,eb4] ~@3 [ab3,c4,eb4,g4] ~ [ab3,c4,f4] ~ [ab3,c4,eb4] ~", // Ab Abmaj7 Fm Ab
  I: "[c4,eb4,g4] ~ eb4 [c4,eb4,g4] ~@2 [c4,eb4,g4] ~@3 [c4,eb4,g4] ~ [c4,d4,f4] ~ [c4,eb4] ~", // Cm Dm7 Cm
})).s("gm_piano").gain(0.35).pan(0.4)

// chords · pizzicato strings · "PIZZICATO"
const pizzicato_strings = note(`<
  ~@12 A B C D A E C D F ~@7 A B C D A G C D A G C D A G C D H ~@7 A B C D A B C D ~@20 A B C D A B C D A B C D A B C D
  A B C D A B C D A B C D A B C D ~@4 A B C D A B C I ~@24
>`.pickRestart({
  A: "[c5,eb5,g5] ~@2 [c5,eb5,g5] ~@2 [c5,eb5,g5] ~@3 [c5,eb5,g5] ~ [c5,eb5,g5] ~ [c5,eb5,g5] ~", // Cm
  B: "[c5,eb5,g5] ~@2 [c5,eb5,g5] ~@2 [c5,eb5,g5] ~@3 [c5,eb5,g5] ~ [c5,d5,f5] ~ [c5,eb5] ~", // Cm Dm7 Cm
  C: "[ab4,c5,eb5] ~@2 [ab4,c5,eb5] ~@2 [ab4,c5,eb5] ~@3 [ab4,c5,eb5] ~ [ab4,c5,eb5] ~ [ab4,c5,eb5] ~", // Ab
  D: "[ab4,c5,eb5] ~@2 [ab4,c5,eb5] ~@2 [ab4,c5,eb5] ~@3 [ab4,eb5,g5] ~ [ab4,d5,f5] ~ [ab4,c5,eb5] ~", // Ab Abmaj7 Ddim Ab
  E: "[c5,eb5,g5] ~@2 [c5,eb5,g5] ~@2 [c5,eb5,g5] ~@3 [c5,eb5,g5] ~ [c5,d5,f5] ~ [c5,d5,f5] ~", F: "[c5,eb5,g5] ~@15",
  G: "[c5,eb5,g5] ~@2 [c5,eb5,g5] ~@2 [c5,eb5,g5] ~@3 [c5,eb5,g5] ~ [d5,f5] ~ [c5,eb5] ~", H: "[g4,c5,eb5] ~@15",
  I: "[ab4,c5,eb5] ~@2 [ab4,c5,eb5] ~@2 [ab4,c5,eb5] ~@3 [ab4,eb5,g5] ~ [ab4,d5,f5] ~ [ab4,b4,c5,eb5] ~", // Ab Abmaj7 Ddim Ab
})).s("gm_pizzicato_strings").gain(0.26).pan(0.7)

// drums · kick
const kick = s("bd").struct("<~@4 [x!4]!108 ~@4 [x!4]!24 ~@8>").gain(0.46)

// drums · rim
const rim = s("rim").struct(`<
  ~@20 A B A C A D@2 C ~@16 B A E F D@2 G H ~@12 I G J G K G L M L G D G@2 L G N ~@16 O G D P D G A L D C A G D@3 Q ~@12
  A@2 D P A@2 D R D@3 S D B D C ~@8
>`.pickRestart({
  A: "~@2 x ~ x ~ x!2 ~ x!2 ~ x ~ x!2", B: "~@2 x ~ x ~ x!2 ~ x!2 ~ x!4", C: "~@2 x ~ x ~ x!2 ~ x!7",
  D: "x ~ x ~ x ~ x!2 ~ x!2 ~ x ~ x!2", E: "x!3 ~ x ~ x!2 ~ x!2 ~ x!4", F: "x!3 ~ x ~ x!2 ~ x!7",
  G: "x ~ x ~ x ~ x!2 ~ x!7", H: "x ~ x ~ x!12", I: "~@2 x ~ x ~@2 x!6 ~ x!2", J: "~@2 x ~ x ~ x!2 ~ x!4 ~ x!2",
  K: "x ~ x ~ x ~ x!3 ~ x!6", L: "x ~ x ~ x ~ x!2 ~ x!2 ~ x!4", M: "x ~ x ~ x ~ x!10", N: "x ~@2 x ~@2 x ~ x!8",
  O: "~@2 x ~ x!4 ~ x!2 ~ x!4", P: "x ~ x ~ x!4 ~ x!7", Q: "x!3 ~ x ~ x!5 ~ x!4", R: "x ~ x!2 ~ x!2 ~ x ~ x!6",
  S: "x ~ x ~ x!4 ~ x ~ x!5",
})).gain(0.26)

// drums · snare
const snare = s("sd").struct("<~@8 [~ x ~ x]!104 ~@4 [~ x ~ x]!24 ~@8>").gain(0.46)

// drums · hihat
const hihat = s("hh").struct("<~@8 A@88 B@16 ~@4 C A@3 D A@11 B@8 ~@8>".pickRestart({
  A: "~ x ~ x ~ x ~ x", B: "x!8", C: "x!4 ~ x ~ x", D: "~ x ~ x!3 ~ x",
})).gain(0.51)

// drums · tambourine
const tambourine = s("tb").struct("<~@8 [x!16]!104 ~@4 [x!16]!23 [x!15 ~] ~@8>").gain(0.36)

// drums · shaker
const shaker = s("sh").struct("<~@8 A@12 ~@8 B A@15 ~@8 A@12 ~@16 A@16 ~@20 A@23 C ~@8>".pickRestart({
  A: "~@2 x!2 ~@2 x ~@3 x ~@3 x ~", B: "~ x ~ x ~ x ~ x", C: "~ x ~ x ~ x ~@2",
})).gain(0.41)

stack(bass, piano, pizzicato_strings, kick, rim, snare, hihat, tambourine, shaker)

More by Snap