Download Activity 1.1.4 Representing Music Introduction

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Sound reinforcement system wikipedia , lookup

Sound recording and reproduction wikipedia , lookup

Music technology (electronic and digital) wikipedia , lookup

Transcript
Activity 1.1.4 Representing Music
Introduction
Almost everything can be
represented with zeros and ones.
How do zeros and ones represent
music, movies, text, and numbers?
In this activity, we'll focus on music.
The concepts apply to movies and
numbers as well.
How is music recorded and played
later? All microphones turn sound
into an electrical voltage between
two metal wires. The analog
voltage from the microphone is
converted in a computer to binary
digital information that the
computer records using only zeros
and ones.
Figure 1. A dynamic microphone works because
electrons in a wire get pushed when the wire
moves near in magnet's magnetic field.
Figure 2. Beyoncé Knowles
Materials

Computer with microphone and Audacity software
Procedure
Part I: Exploring Sound
1. Examine a spectrogram of yourself singing a note following these steps:
© 2015 Project Lead The Way, Inc.
Introduction to Computer Science Activity 1.1.4 Representing Music – Page 1
a. Open the Chrome web browser. Other browsers will not work for this task.
Navigate to http://borismus.github.io/spectrogram/.
b. Near the top of the browser, select Allow for access to your microphone.
Within the web page, set the controls so that Log scale is unchecked. You
should see a spectrogram1 on the screen that changes when you speak or
sing.
c. The amount of energy at any frequency is represented by the color of the
spectrogram. Time is represented on the x-axis. When sound waves vibrate
the microphone, the frequencies of the vibration are shown in black or red.
What do you see in the spectrogram when you speak?
d. The y-axis of the spectrogram is showing the frequency of the sound. This
particular web page allows you to use the mouse to control the speaker.
The spectrogram will display what is detected by the microphone. The
mouse input is shown in red, shifted slightly left from the time on the xaxis. Click and drag on the web page's canvas. What is the highest
frequency you are able to hear?
e. When you sing one note, your vocal chords vibrate with many frequencies
at once. Within one note, these frequencies are called harmonics2. The
lowest of these frequencies is the pitch of the note. How many harmonics
are shown when you sing a high note?
2. The following waveform shows a sound containing two frequencies. Count how
many vibrations per second (Hz) are shown. What are the two frequencies? This
can be a difficult question!
1
Spectrogram: A spectrogram displays the frequencies of sound present in sound vs. time, using color to
visualize the intensity of each frequency.
2 Harmonics: The components of a single note. Middle C, for example, is approximately 250 Hz has its
fundamental component at 250 Hz and 2nd, 3rd, 4th,... harmonics at 500 Hz, 750 Hz, 1000 Hz, etc.
© 2015 Project Lead The Way, Inc.
Introduction to Computer Science Activity 1.1.4 Representing Music – Page 2
3. A bit is a single binary digit, either 0 or 1. A group of bits are used to represent a
single sound wave pressure. That single pressure is the y-coordinate of a single
point on the graph above. The sound wave is represented using many of these
groups of bits, representing the y-coordinates of many points on the graph above.
The number of bits used for each pressure or position (the bit depth) determines
how many distinct pressures are possible for each value in the recording, as
shown in this table.
Number of bits used to
Number of possible
record each
values of each
pressure/voltage/position pressure/voltage/position
1
2
2
4
3
8
4
16
5
32
6
64
7
128
8
256
Consider a digital representation of the sound wave shown above in the previous
question. How many bits would have to be used to record each pressure? This is a
difficult question and a range of answers can be defended. Explain your
reasoning.
4. How many samples per second are needed to represent a digital recording for the
sound wave shown above? Explain your reasoning.
Part II: Manipulating digital sound
5. Open Audacity.
© 2015 Project Lead The Way, Inc.
Introduction to Computer Science Activity 1.1.4 Representing Music – Page 3
6. Press record. Say a sentence or make a sound. Press stop. You should see the
sound wave graphed as voltage vs. time.
If you want to try again, you can delete the track with the X to the left of the wave
form as shown in the following image:
7. Audacity by default records digital music using a sampling rate of 44,100 Hz for
both the left and right channels, with 32 bits per sample. How many bits would
Audacity use to record the four seconds of sound shown in Step 3?
8. The wave shown in Step 3 can be represented with a very small number of bits
compared to the large number of bits used per second by Audacity. What is it
about that wave that requires so few bits per second?
9. You will be making an app in which a ball makes different sounds depending on
which wall it bounces against. Record two sounds to be used in your app. Export
each sound as an MP3.
Note: If you are 12 years old or younger, do not allow your own voice to be
recorded for this purpose unless your parent/guardian signs a consent form.
Conclusion Questions
1. Data can represent many different things. We have to know what sort of thing is
being represented with data and know how it is being represented. For example,
the number 1000 could represent many different types of data. Explain.
2. How do computers represent sound?
3. Is your hearing digital or analog? Explain.
© 2015 Project Lead The Way, Inc.
Introduction to Computer Science Activity 1.1.4 Representing Music – Page 4