You are on page 1of 26

Lab #3:

Music Synthesis with MATLAB


Brian Kang Thomas Zachariah
ELEC 401.01 October 3, 2012

Table of Contents

History Of Music Synthesizing Musical Note Frequency Audio Sampling

ADSR Enveloping
MATLAB Lab Experiment Code Results Conclusion

History of Music and Synthesizing

Pythagoras was first to believe that notes can be represented mathematically All instruments notes can be represented by their frequencies

http://9waysmysteryschool.tripod.com/sacredsoundtools/id13.html

History of Music Synthesizing

How is music created today? MIDI used as industry standard MIDI carries information that specifies a notes pitch and duration

http://opusonemusic.net/Helpfiles/OSX/Help/pages/MIDIConnections.html

Musical Note Frequency

A Note represents the duration and pitch of a sound Two notes with frequencies in a ratio of 2n sound similar To differentiate notes of same pitch, notation system created for octaves

http://library.thinkquest.org/15413/theory/note-reading.html

Musical Note Frequency

A4, 440Hz is the standard tuning pitch Historical Reasons for standard tuning pitch Practical Reasons for standard tuning pitch

https://www.youtube.com/v/rFOl-9SNxLY

Musical Note Frequency

http://piano.about.com/library/pitch-notation/b1_scientific-pitch-notation_2.html

History of Music Synthesizing

How is music created today? MIDI used as industry standard MIDI carries information that specifies a notes pitch and duration

http://opusonemusic.net/Helpfiles/OSX/Help/pages/MIDIConnections.html

Note Frequency Equation

Any note is an integer of half steps from A4 12 is notes between any two notes of same pitch

Audio Sampling

Signals must be sampled at least at the Nyquist Rate


o o

Facilitates reconstruction of an unaliased analog signal from digital data Allows the intended music to be produced from the discrete waveforms we make in MATLAB

As a practice, audio signals are often sampled a few times more than the Nyquist rate

Audio Sampling
Standard Sampling Rates
Sampling Rate
8,000 Hz 16,000 Hz 32,000 Hz 44,100 Hz 48,000 Hz 88,200 Hz

Use
Telephone transmission VoIP (Online Phone Services) Digital FM Radio Audio CD & MP3 Format Audio in Standard Professional Digital Video Audio from Professional Recording Equipment destined to CD, MP3, etc.

96,000 Hz
192,000 Hz 352,800 Hz

Audio in High Definition Professional Digital Video


Audio in High Definition Professional Digital Video x2 Digital eXtreme Definition!!!

ADSR Enveloping

To produce less artificial notes, an ADSR envelope can be applied to note waveform.
o o o o

Attack: initial run-up from zero to peak Decay: run down from attack to sustain level Sustain: level of main sequence of sound's duration Release: decay to zero after sustain

http://commons.wikimedia.org/w/index.php?title=File:ADSR_parameter.svg

ADSR Enveloping

ADSR profiles are designed to replicate the spectral content of acoustic instruments Different ADSR profiles are used to generate the sound of specific instruments Synthesizers allow defining of envelopes to create many different types of sound

ADSR Envelope on a Casio CZ synthesizer


http://projectemp.wordpress.com/index.html

MATLAB

Short for Matrix Laboratory Used for numerical computation, visualization, and programming Used for wide range of applications:
signal processing and communications image and video processing control systems test and measurement computational finance computational biology

Flow Chart

Lab Experiment Code


Brian's Code

Returns note

Lab Experiment Code


Brian's Code

Returns chord vectors

Lab Experiment Code


Thomas's Code - note.m

.15 .1

.6

.15

Envelope can scale to any duration of waveform (2000 in example graphs)

Lab Experiment Code


Thomas's Code

Results
Thomas's Theoretical Results

https://www.youtube.com/v/fMqKXtogWgk

Results
Thomas's Results

Results
Brian's Theoretical Results

https://www.youtube.com/v/h-0G_FI61a8

Results
Brian's Results

Conclusion

Musical notes can be generated by producing


waveforms of its corresponding frequency Music can be synthesized with computers and other mediums like the 555 timer If sampling rate is too low, happens MATLAB is awesome!!!

Citations
INFORMATION

McClellan, James H., Ronald W. Schafer and Mark A. Yoder. DSP First: A Multimedia Approach. Upper Saddle River, N.J.: Prentice Hall, 1998 Charles Dodge, Thomas A. Jerse. Computer Music. New York: Schirmer Books, 1997. Self, Douglas. Audio Engineering Explained. Oxford, UK: Focal, 2010.

MUSIC

Nobuo Uematsu. To Zanrkand. Final Fantasy X OST. Square-Enix, 2001

Koji Kondo. Underwater Theme. Super Mario Bros. Nintendo, 1985

IMAGES & VIDEOS http://library.thinkquest.org/15413/theory/note-reading.html http://piano.about.com/library/pitch-notation/b1_scientific-pitch-notation_2.html http://opusonemusic.net/Helpfiles/OSX/Help/pages/MIDIConnections.html http://9waysmysteryschool.tripod.com/sacredsoundtools/id13.html http://commons.wikimedia.org/w/index.php?title=File:ADSR_parameter.svg http://projectemp.wordpress.com/index.html https://www.youtube.com/v/h-0G_FI61a8 https://www.youtube.com/v/fMqKXtogWgk https://www.youtube.com/v/rFOl-9SNxLY

Questions?

You might also like