ITEC 109 Lecture 25 Sound.

Slides:



Advertisements
Similar presentations
CS 102 Computers In Context (Multimedia)‏ 04 / 13 / 2009 Instructor: Michael Eckmann.
Advertisements

Sound, Part 3. Multiple Echoes Here is a recipe to create multiple echoes: def echoes(sndfile, delay, num): s1 = makeSound(sndfile) ends1 = getLength(s1)
Chapter 8: Making Sounds by Combining Pieces. Chapter Objectives.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 8: Making Sounds by Combining Pieces.
Unit Generators and V.I.s Patches are configurations of V.I.s Both Patches & Virtual Instruments can be broken down into separate components called Unit.
Phun With Sound Basic Concepts For Hardware (and other) Hackers.
The frequency spectrum
Digital audio recording Kimmo Tukiainen. My background playing music since I was five first time in a studio at fourteen recording on my own for six months.
W2D1. JPEG images Representing avg. pixel colour for large vs. small blocks Idea behind the Fourier transform: Pixel values:
Audio and Acoustics Theory
Animation and Sound Pertemuan 02 Matakuliah: L0182 / Web & Animation Design Tahun: 2008.
Digital Audio Multimedia Systems (Module 1 Lesson 1)
Computer Science 101 Introduction to Programming with Sounds.
Digital audio. In digital audio, the purpose of binary numbers is to express the values of samples that represent analog sound. (contrasted to MIDI binary.
Computer Science 121 Scientific Computing Winter 2014 Chapter 13 Sounds and Signals.
Fall 2004EE 3563 Digital Systems Design Audio Basics  Analog to Digital Conversion  Sampling Rate  Quantization  Aliasing  Digital to Analog Conversion.
Introduction to Interactive Media 10: Audio in Interactive Digital Media.
Lecture # 22 Audition, Audacity & Sound Editing Sound Representation.
Computing with Digital Media: A Study of Humans and Technology Mark Guzdial, School of Interactive Computing.
ACOUSTICS AND THE ELEMENTS OF MUSIC Is your name and today’s date at the top of the worksheet now?
COMP Representing Sound in a ComputerSound Course book - pages
ITEC 109 Lecture 26 Sound (2). Sound Review Sound –How does it work in real life? –What are the different types of waves that represent sounds? –How are.
CSC361/661 Digital Media Spring 2002
Digital Media Dr. Jim Rowan ITEC Monday, August 27.
Digital Media Dr. Jim Rowan ITEC Monday, August 27.
Computer Some basic concepts. Binary number Why binary? Look at a decimal number: 3511 Look at a binary number: 1011 counting decimal binary
Basics of Digital Audio Outline  Introduction  Digitization of Sound  MIDI: Musical Instrument Digital Interface.
Signal Digitization Analog vs Digital Signals An Analog Signal A Digital Signal What type of signal do we encounter in nature?
COSC 1P02 Introduction to Computer Science 4.1 Cosc 1P02 Week 4 Lecture slides “Programs are meant to be read by humans and only incidentally for computers.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 8: Making Sounds by Combining Pieces.
Introduction to SOUND.
Day 6 Exam I is on Thursday. Be sure to attend lab this week.
More Meaningful Jargon Or, All You Need to Know to Speak Like a Geek Sound.
AGENDA Pick Up Quiz from the Side of the Room
Week 2 Sound Physics, Ranges of Hearing Frequency, Wavelength, Period, Velocity Audio Engineering & Sound Production Unit code: AUD202 AUDIO & ACOUSTICS.
Georgia Institute of Technology Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Sept 2005.
Sound Representation Digitizing Sound Sound waves through Air Different Voltages Voltage converted to numbers.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 3 – Digital Audio Representation Klara Nahrstedt Spring 2009.
Encoding and Simple Manipulation
Chapter 21 Musical Sounds.
CS 102 Computers In Context (Multimedia)‏ 03 / 30 / 2009 Instructor: Michael Eckmann.
Recording Arts Intro Part 2 Fall How sound waves interact… When different waves collide (e.g. sound from different sources) they interfere with.
Sound in Multimedia Psychology of sound what do you use it for? what techniques for its communication exist? Science of sound why does it exist? how it.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 6: Modifying Sounds Using Loops.
Chapter 2 Basic Science: Analog and Digital Audio.
Digital Audio. Acknowledgement Some part of this lecture note has been taken from multimedia course made by Asst.Prof.Dr. William Bares and from Paul.
Intro-Sound-part1 Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Oct 2009.
CS1315: Introduction to Media Computation Sound Encoding and Manipulation.
Chapter 8: Making Sounds by Combining Pieces. Chapter Objectives.
Encoding How is information represented?. Way of looking at techniques Data Medium Digital Analog Digital Analog NRZ Manchester Differential Manchester.
Multimedia Sound. What is Sound? Sound, sound wave, acoustics Sound is a continuous wave that travels through a medium Sound wave: energy causes disturbance.
Digital Audio I. Acknowledgement Some part of this lecture note has been taken from multimedia course made by Asst.Prof.Dr. William Bares and from Paul.
COSC 1P02 Introduction to Computer Science 5.1 Cosc 1P02 Week 5 Lecture slides Psychiatrist to patient "You have nothing to worry about - anyone who can.
What is sound? Sound is a longitudinal wave which travels through the air through a series of compressions and rarefactions.
Lifecycle from Sound to Digital to Sound. Characteristics of Sound Amplitude Wavelength (w) Frequency ( ) Timbre Hearing: [20Hz – 20KHz] Speech: [200Hz.
Fourier Analysis Patrice Koehl Department of Biological Sciences National University of Singapore
The Physics of Sound.
What is a wave? Definition: a disturbance in space and time
The Unit Planner 5 – Microphones & Sound Radio Broadcasting 4
Sound Elaine S. Vejar NSF GK-12 Fellow-Vibes and Waves in Action
Objective Sound and Psychoacoustics
Multimedia Fundamentals(continued)
MECH 373 Instrumentation and Measurements
Sound & Sound Waves.
How sound works: Acoustics, the physics of sound
Digital Music Scott Bennett 1/3/2019.
Lecture 2: Frequency & Time Domains presented by David Shires
Sound Sound is a type of energy made by vibrations. When any object vibrates, it causes movement in the air particles. These particles bump into the particles.
COMS 161 Introduction to Computing
CS1315: Introduction to Media Computation
Presentation transcript:

ITEC 109 Lecture 25 Sound

Review Photography Arrays of data Simple transformations

Objectives See another real world usage of arrays Sound

Sound Pressure in the air Sounds are made up of rises and falls in pressure Compressions / rarefactions Waves of sound data Frequency Amplitude Shape

Waves Simple wave Cycle Amplitude Sine wave Compression Simple wave Sine wave Cycle One compression and rarefaction Amplitude Distance from 0 point to greatest pressure Volume Formula for converting to decibels (db) Rarefaction

Waves Pitch Chipmunk effect Real sound How often the cycle occurs Longer= lower Shorter= higher Chipmunk effect Real sound Several waves combined Sine waves don’t work

Computers Analog (real world) / Digital (0s and 1s) hz = cycles per second Computers Analog (real world) / Digital (0s and 1s) Pick a ceiling / floor for amplitudes How many cycles a second are there? Record X times a second (sampling) CD quality = 44.1khz recording means 44,100 samples per second 44,100 ints per second (10 megs a minute) CDs hold 650 MB or ~70 minutes of audio

Code Python has lots of APIs for sounds JES makes life easy sampleRate=22050; #Use for all your code duration=1; # How long to play the sound (seconds) numSamples = sampleRate*duration; mySound = makeEmptySound(duration*sampleRate); setSampleValueAt(mySound, 0, 440); #To play the sound play(mySound); #To play and make sure it is unique blockingPlay(mySound); Note: This doesn’t actually make noise

Problem People are used to Computers deal with

Transformation Each note is mapped to a specific frequency Multiply by the 12th root of 2 to goto the next note 261.626 * 2^(1/12) = 277.183 = C# 261.626 hz

Problem Just knowing the frequency isn’t enough Compression / rarefaction Need to generate a wave Sound different

Array tie in Array holds the sampled values for the wave This array is small compared to a regular CD. For example, a crumb compared to the 16ft party sub that is an audio CD 10 10 10 10 5 5 5 5 1 2 3 4 5 6 7

Square Need both rarefaction and compression How many array values for the top / bottom Cycles in a sample (frequency) Half a cycle on top Half on bottom Compression Rarefaction

Code Play A4 for 1 second SamplingRate = 22050; amp = 4000; example = makeEmptySound(SamplingRate*1); interval = 1.0/440; samplesPerCycle = interval*SamplingRate; halfCycle = samplesPerCycle/2; value=440; num=1; for I in range (0, example.getLength()): if (num > halfCycle): num=0; value=value*-1; num=num+1; raw = value * amp; setSampleValueAt(example,i, raw); play(example)

Triangle Shape analysis Start at amplitude, add increment until half cycle Decrement for other half Starting value Slowly incrementing Slowly decrementing

Code SamplingRate = 22050; amp = 4000; example = makeEmptySound(SamplingRate*1); interval = 1.0/440; #What could this be? samplesPerCycle = interval*SamplingRate; halfCycle = samplesPerCycle/2; value= 440/2.0; increment = amp / samplesPerCycle; num=1; for i in range(0, example.getLength()): if (num > halfCycle): num=0; increment=increment*-1; num=num+1; value=value+increment; setSampleValueAt(example,i, value*amp); play(example)

Reality What can you do with these simplistic music creation tools? Academic curiosity or actually useful?

Figure out duration (1 second) Do the wave Sine wave Math.sin(value); + for loop Figure out duration (1 second) Determine interval (space between samples) 1/frequency Figure out how many samples per cycle Interval * Sampling Rate Feed sin a value for each sample

Code Creates the note A4 for 1 second SamplingRate = 22050; amp = 4000; //For volume example = makeSound(SamplingRate*1); interval = 1.0/440; samplesPerCycle = interval*SamplingRate; maxCycle = 2*3.14159; for i in range(0, example.getLength()): raw = Math.sin( (i/samplesPerCycle) *maxCycle); raw = raw * amp; setSampleValueAt(example,i, raw); Note: Values will always range from 0 to 2Pi The base sine wave is then adjusted for volume (multiplied by the amplitude)

Demo Process Program Note->Frequency->Sample Creates X sample notes Plays based on what is typed in Simulator loop

Auto-tune What is it? Example How? Examine frequency Increase or decrement to right frequency Makes horrible singers sound like pop singers…

Summary Music on computers Note->frequency Shape of wave Arrays are crucial Note->frequency Shape of wave Square Triangle Sine