10
$\begingroup$

I would like to create a chord using multiple instruments. This started as an attempt to explain music to a friend but my curiosity has taken over. I am familiar with the SoundNote function.

I know that SoundNote can create a chord using the same instrument:

Sound[SoundNote[{"C4", "G3"}, 1, "Harpsichord"]]

And it can create a series of notes with different respective instruments:

Sound[{SoundNote["C", 0.5`, "Oboe"], SoundNote["G", 0.5`, "SynthVoice"], SoundNote["C5", 0.5`, "Organ"]}]

What I'm wondering is if there is a way to play more than one sound with specific notes at the same time.

$\endgroup$
11
$\begingroup$

This example in Documentation exactly answers your question. You just need to specify overlapping time intervals. Lets expand your specific case. Below after every second a new instrument will come in and they will all end at the same time.

Sound[{SoundNote["C", {0, 4}, "Oboe"], 
       SoundNote["G", {1, 4}, "SynthVoice"], 
       SoundNote["C5", {2, 4}, "Organ"], 
       SoundNote["E3", {3, 4}, "VoiceAahs"]}]

enter image description here

$\endgroup$
  • $\begingroup$ Anyone ever made the Dr Who theme with Mathematica? (serious question) $\endgroup$ – Mike Honeychurch Dec 10 '12 at 8:17
  • 1
    $\begingroup$ @MikeHoneychurch if someone would dare - they need to read Chapter 9 of Mathematica Cookbook by @SalMangano - some excellent examples there. $\endgroup$ – Vitaliy Kaurov Dec 10 '12 at 8:52
  • 2
    $\begingroup$ @MikeHoneychurch Import["https://sites.google.com/site/thedoctorwhos/DoctorWho2005.mid"] (Mathematica 9, Who knows about 8) :) $\endgroup$ – cormullion Dec 10 '12 at 9:44

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.