Lecture # 23 Sound Synthesis & Sound Arithmetic
description
Transcript of Lecture # 23 Sound Synthesis & Sound Arithmetic
Foundations of Computing
Lecture # 23Sound Synthesis& Sound ArithmeticA sound fontdogJaneknowsFredRalphtheloves
Jane
loves
Fred
MIDI - Musical Instrument Digital InterfaceObject representation of music
Every sound hasPitch (frequency of the sound)Delay (how long after last sound start to start playing)Duration (how long should it play)Timbre (which instrument should it sound like?)GuitarClarinetViolinA MIDI fileAn array of notes
0 (262, 0,10,1)1 (300, 10,10,1)2 (262, 10, 10, 1)3 (300, 0, 10, 1)
Pitch (middle C)DelayDurationInstrument Number
During performance numbers areassigned to different instruments
MIDI demohttp://www.free-midi.org/midi1/v/vangelis-chariots_of_fire.mid
A MIDI fileAn array of notes
0 (262, 0,10,1)1 (300, 10,10,1)2 (262, 10, 10, 1)3 (300, 0, 10, 1)
How do we transpose to a higher key?
Increase pitch of each noteA MIDI fileAn array of notes
0 (262, 0,10,1)1 (300, 10,10,1)2 (262, 10, 10, 1)3 (300, 0, 10, 1)
How do we make it play faster?
Reduce delay and duration of each note
A MIDI fileAn array of notes
0 (262, 0,10,1)1 (300, 10,10,1)2 (262, 10, 10, 1)3 (300, 0, 10, 1)How do we change from guitar to flute?Assign a different instrument tothat numberSynthesizing an instrumentMix different harmonicsAdd noiseAdjust Attack, Dwell, Sustain, ReleaseSynthesizing an InstrumentAttack - when string is plucked or note is struckDwell - energy left from attackSustain - while the note is heldRelease - after player stops
Synthesizing an InstrumentAttack - when string is plucked or note is struckDwell - energy left from attackSustain - while the note is heldRelease - after player stops
Synthesizing an InstrumentAttack - when string is plucked or note is struckDwell - energy left from attackSustain - while the note is heldRelease - after player stops
Synthesizing an InstrumentAttack - when string is plucked or note is struckDwell - energy left from attackSustain - while the note is heldRelease - after player stops
Synthesizing an InstrumentAttack - when string is plucked or note is struckDwell - energy left from attackSustain - while the note is heldRelease - after player stops
Sampled / Object
SampledJane loves FredObject
Sound Editing and Processingwith AudacityEdit SoundDrag and Drop (universities-deep_thoughts.wav)File >> Import >> AudioNotice new track (two if it is stereo)File >> Import >> Audio (theknack.wav)Notice second trackSelect TrackSelect Time Shift actionMove TrackMix and Render (barnyard: cow, horse, duck)Play/Mute/AlignUndo (Cntrl-Z)
Edit SoundSplitAlignSelect AllImport Dance MusicTrimShapeRecordSing a round/Play aroundAmplify/DistortBlendArithmetic with SoundsArithmetic on SoundSound is an array of amplitudes (numbers)The higher the amplitude, the louder the soundAdding two sounds togetherMake a sound louder or softerBlends of two soundsEchosAdding two sounds
Laser GunsDistress+=
New Sound
Adding two sounds AlgorithmLaser = laser gun sound;Warn = warning message;NewSnd = new array(Laser.length);
for (each index i in NewSnd){NewSnd[i]=Laser[i]+Warn[i]; }Adding Sounds DemoDrag or manufacture 2 or more trackPlayShiftMix and RenderMaking a sound louder
Amplify Sound DemoEffects -> AmplifyMaking a sound louderfor (each index i in oldSound){newSound[i]=oldSound[i]*3; }General Amplify algorithmamp = 3.0; three times as loud
for (each index i in oldSound){newSound[i]=oldSound[i]*amp; }General Amplify algorithmamp = 0.5; half as loud
for (each index i in oldSound){newSound[i]=oldSound[i]*amp; }Blending two sounds
Music
Words50% music, 50% words
Blending Sounds Demo2+ Tracks -> Effects -> AmplifyTracks -> Mix RenderAlgorithm for Blending two soundsB = blend value between 0.0 and 1.0
for (each index i in Snd1){newSnd[i]=(1.0-B)*Snd1[i]+ B*Snd2[i]; }Singing a Round by yourselfRow Row Row your boat
Sing in a round
Singing a round by yourself
Time delay+
=Singing a round by yourself Demo2+ tracks -> align/shift/pasteTracks -> Mix RenderSinging a round by yourselfsong = the original song;delay = how many samples to delay;newSng = new array(song.length+delay);
for (each index i in song){newSng[i] = song[i]; }
for (each index i in song){newSng[i+delay] = newSng[i+delay]+song[i]; }EchoesAn echo occurs because sound returns delayed and softer after bouncing off of something
OriginalCanyon Echo (large delay)Room Reverb (small delay)
Echoes DemoAudacityEffects -> EchoEchoes Algorithmsound = the original sound;delay = how many samples to delay;softness = 0.1;newSound = new array(sound.length+delay);
for (each index i in sound){newSound[i] = sound[i]; }
for (each index i in sound){newSound[i+delay] = newSound[i+delay] + sound[i]*softness; }ReviewSound Synthesis (MIDI, timbre, pitch, etc)Change PitchChange TempoChange Speed
Piano 1SYbasse2Volutes3Strings5Rhodes 6SYbrass7SYchoir8Timbal 9Drums 10