<< Chapter < Page Chapter >> Page >

Most of us listen to music on our computers. Some of us even compose music using existing software. But we can also program a computer to produce sounds. Some of these sounds will be musical, others will show the range of sounds we can hear as human beings. But why do this? This is the age of the Hubble Space Telescope sending us stunning false colour pictures of galaxies billions of light years away. What is the point of looking at the rings of Saturn through a small telescope? Only the simple pleasure of watching Saturn with our own eyes! Similarly, by programming a computer to produce even simple sounds, we can intimately understand how sound works. This will in turn let us deeply appreciate the music we listen to and maybe even give us the courage to compose our own music!

So let us begin with some definitions. What is sound? Sound is our brain's response to vibration. If there is no vibration, there is no sound. Many objects vibrate. If you tap an object, it will go up and down, up and down, up and down and so on until it runs out of energy. An up and down motion is one cycle of vibration or simply one vibration. The number of times an object vibrates every second is its frequency of vibration. The distance it goes up or down as it vibrates is its amplitude of vibration.

When we talk about programming a computer to produce sound, we talk about writing a computer program that will make a loudspeaker produce sound. In this program, we send a 1 to flex the loudspeaker as far as it can go in one direction (say outwards) and send a -1 to flex the loudspeaker as far as it can go in the other direction (inwards). We can also send a number between -1 and 1 and put the loudspeaker somewhere between those two extreme positions. For example, if we send a 0, the loudspeaker goes back to its rest position. OK so how often can we set the loudspeaker position? Prepare to be amazed. When playing music from your CD, your CD player program is changing the loudspeaker position 44,100 times a second! Assume we have written a similar program which is sending a 1 followed by a -1 continuously. A 1 followed by a -1 vibrates the loudspeaker once. As we are sending these numbers continuously, the loudspeaker vibrates continuously at a rate of 22,050 vibrations every second. But we wont hear a thing because we can only hear up to 20,000 vibrations a second. Let us modify this program to send 22,050 1s followed by 22,050 -1s continuously. The loudspeaker now vibrates just once every second. Again we wont hear a thing because we start to hear only at 20 vibrations a second. So what is the point of sending all these numbers?! Well, we now know that by programming a computer we can produce the entire range of sounds we can hear: starting from those with a frequency of just 20 vibrations a second up to those with a frequency of 20,000 vibrations a second and beyond. There is no musical instrument that can do this. But I hear you scream "We still haven't heard a thing!!". Let us fix that by sounding a note of music.

A bookmark of a web page contains its URL address (e.g., http://www.google.com) and an easy to remember name (e.g., Google) for recalling it later. We bookmark a web page because we find it interesting. A musical note is a bookmark too. It points to a sound we find interesting among all possible sounds. Just like the web bookmark this bookmark contains two pieces of information - a letter from A to G padded with a number and its frequency of vibration. For example, the note A440 used to tune all the musical instruments of a concert orchestra has a frequency of 440 vibrations every second. To sound the note A440 we simply vibrate the loudspeaker 440 times every second. As you know, we can set the loudspeaker position 44,100 times every second. So we have 44,100 / 440 = about 100 numbers to make one vibration of the note A440. Now if we send 50 1s followed by 50 -1s, will we hear the note A440?! Actually, we will hear a note with a frequency of 441 vibrations every second! Very close to A440 but off-tune by just 1 vibration every second. Big deal you say and you will be right. Its impossible to produce an exact note on any instrument, even a computer instrument. We can get closer but only as far as the computer's capability will allow. On my computer, the operation 44,100 / 100 says 100.22727272727273 numbers are available to make one vibration of the note A440. Does this mean if we send 50.113636363636367 1s and 50.113636363636367 -1s we will hear the note A440? Well, we will get as close as possible to the note A440 on this computer but there is a different problem. We can send 50 1s or 50 -1s but how can we send 50.113636363636367 of anything? We cant so we get around this by sending 50 1s or 50 -1s as usual while adding up the 0.113636363636367 deficit for each send. When that summed up deficit crosses 1.0 we send a 51 1s or 51 -1s once and go back to sending 50 1s or -1s again until next time the deficit crosses 1.0. Table 1 below will make this clear.

Vibration Number Number sent Amount sent Deficit
1 1 50 0.113636363636367
1 -1 50 0.22727272727273401
2 1 50 0.34090909090910104
2 -1 50 0.454545454545468
3 1 50 0.568181818181835
3 -1 50 0.6818181818182021
4 1 50 0.7954545454545691
4 -1 50 0.909090909090936
5 1 51 0.0227272727273031 = 1.0227272727273031 - 1
5 -1 50 0.13636363636367013 = 0.0227272727273031 + 0.113636363636367

To be continued soon.

Questions & Answers

what is microbiology
Agebe Reply
What is a cell
Odelana Reply
what is cell
Mohammed
how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Sound encounter of the computer kind. OpenStax CNX. Dec 02, 2007 Download for free at http://cnx.org/content/col10495/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Sound encounter of the computer kind' conversation and receive update notifications?

Ask