Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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