13.07.2015 Views

Tutorials and Topics - Peabody Computer Music

Tutorials and Topics - Peabody Computer Music

Tutorials and Topics - Peabody Computer Music

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Exercises in the fundamentals of MSPTutorial 6: A Review of FundamentalsIn this chapter, we suggest some tasks for you to program that will test yourunderst<strong>and</strong>ing of the fundamentals of MSP presented in the Tutorial so far. A few hintsare included to get you started. Try these three progressive exercises on your own first, innew file of your own. Then check the example patch to see a possible solution, <strong>and</strong> readon in this chapter for an explanation of the solution patch.Exercise 1• Write a patch that plays the note E above middle C for one second, ten times in a row,with an electric guitar-like timbre. Make it so that all you have to do is click once toturn audio on, <strong>and</strong> once to play the ten notes.Here are a few hints:1. The frequency of E above middle C is 329.627557 Hz.2. For an “electric guitar-like timbre” you can use the AIFF file gtr512.aiff that was usedin Tutorial 3. You’ll need to read that file into a buffer~ object, <strong>and</strong> access the buffer~with a cycle~ object. In order to read the file in directly, without a dialog box to findthe file, your patch <strong>and</strong> the audio file should be saved in the same folder. You caneither save your patch in the MSP Tutorial folder or, in the Finder, option-drag a copyof the gtr512.aiff file into the folder where you have saved your patch.3. Your sound will also need an amplitude envelope that is characteristic of a guitar: veryfast attack, fast decay, <strong>and</strong> fairly steady (only slightly diminishing) sustain. Try using alist of line segments (target values <strong>and</strong> transition times) to a line~ object, <strong>and</strong> usingthe output of line~ to scale the amplitude of the cycle~.4. To play the note ten times in a row, you’ll need to trigger the amplitude enveloperepeatedly at a steady rate. The Max object metro is well suited for that task. To stopafter ten notes, your patch should either count the notes or wait a specific amount oftime, then turn the metro off.Exercise 2• Modify your first patch so that, over the course of the ten repeated notes, the electricguitar sound crossfades with a sinusoidal tone a perfect 12th higher. Use a linearcrossfade, with the amplitude of one sound going from 1 to 0, while the other soundgoes from 0 to 1. (We discuss other ways of crossfading in a future chapter.) Send theguitar tone to the left audio output channel, <strong>and</strong> the sine tone to the right channel.Hints:93

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!