Skip to main content
1 of 2
Michael Seifert
  • 15.3k
  • 35
  • 72

If you have the two lines separately like this, you can use sampled audio to turn each Sound into a waveform. Then you can simply add the two waveforms together to "mix" them.

rh = Sound@MapThread[SoundNote[#1, #2, "Piano"] &, {note1, time1}]
lh = Sound@MapThread[SoundNote[#1, #2, "Piano"] &, 
  {Join[ConstantArray[None, 4], (note1 - 12) /. {None - 12 -> None}], 
     Join[ConstantArray[b, 4], time1]}]

{rhaudio, lhaudio} = PadRight[First@*AudioData /@ {rh, lh}];
(* Note that the two clips are of different lengths;  
   PadRight pads the end of the shorter one with silence *)

Audio[rhaudio + lhaudio]

This yields an audio clip with the left hand coming in one quarter-note early. I think the 4s in the definition of the left-hand line should be 6s instead.

Michael Seifert
  • 15.3k
  • 35
  • 72