I am trying to write a sound such that I can play double or triple stops in a Sound style. I am trying to do

eantieinteraction =  
  Sound[{Ds[3], Cn[3], {Ds[6] + En[6], Fn[4]}, Cn[3], Dn[3]}, 10]

where A[n] is a SoundNote with duration n and pitch A. When I evaluate the above code, I get this output

 {SoundNote[DSharp, 3, Violin], 
  SoundNote[C, 3, Violin], 
  SoundNote[DSharp, 6, Violin] + SoundNote[E, 5, Violin] + SoundNote[F, 4, Violin], 
  SoundNote[C, 3, Violin], 
  SoundNote[D, 3, Violin]},

Is it possible to do double stops in this way?


I'm note much of a musician, so I'm not sure if the following code produces what you want, but I hope it does.

Cn[tmin_, tmax_] := {"C", {tmin, tmax}}
Dn[tmin_, tmax_] := {"D", {tmin, tmax}}
Ds[tmin_, tmax_] := {"D#", {tmin, tmax}}
En[tmin_, tmax_] := {"E", {tmin, tmax}}
Fn[tmin_, tmax_] := {"F", {tmin, tmax}}

notes = {Ds[0, 3], Cn[3, 6], Ds[6, 12], En[6, 11], Fn[6, 10], Cn[12, 15], Dn[15, 18]};

Sound[{"Violin"}~Join~(SoundNote @@@ notes)]


  • $\begingroup$ Not exactly what I was looking for, but it does the job $\endgroup$ Jul 1 '19 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.