Chapter 3
Part 2
Digital audio and MIDI
Summary:
Basic concepts underlying sound
Facts about human perception of sound
Computer representation of sound (Audio)
A brief introduction to MIDI
1
Sound Facts
Sound is a continuous wave that travels through the air
The wave is made up of pressure differences.
Sound is detected by measuring the pressure level at a
location
Sound waves have normal wave properties (reflection,
refraction, diffraction etc.)
The human Ear detecting Sound
2
Sound Facts
Wave Characteristics
Frequency: Represents the
number of periods in a
second and is measured in
hertz (Hz) or cycles per
Air Pressure
Amplitude
second.
Human hearing frequency Time
range: 20Hz to 20kHz
(audio) One Period
Amplitude: The measure of One particular frequency component
displacement of the air
pressure wave from its
mean. Related to but not
the same as loudness
3
Sound Facts
Source Generates Sound
Air Pressure changes
Electrical .Microphone produces electric signal
Acoustic. Direct Pressure Variations
Destination Receives Sound
Electrical. Loud Speaker
Ears . Responds to pressure hear sound
4
How to Record and Play
Digital Audio
First, to record digital audio, you need a card which has
an Analog to Digital Converter(ADC) circuitry.
The ADC is attached to the Line In (and Mic In) jack of
your audio card, and converts the incoming analog audio
to a digital signal.
Your computer software can store the digitized audio
on your hard drive, visually display on the computer's
monitor, mathematically manipulate in order to add
effects, or process the sound, etc.
While the incoming analog audio is being recorded, the
ADC is creates many digital values in its conversion to a
digital audio representation of what is being recorded.
These values must be stored for later playback.
5
How to Record and Play
Digital Audio
In order to play digital audio (i.e WAVE file), you need a
card with a Digital To Analog Converter (DAC) circuitry
on it.
Most sound cards have both an ADC (Analog to Digital
Converter) and a DAC so that the card can both record
and play digital audio.
This DAC is attached to the Line Out jack of your audio
card, and converts the digital audio values back into the
original analog audio.
This analog audio can then be routed to a mixer, or
speakers, or headphones so that you can hear the
recreation of what was originally recorded.
Playback process is almost an exact reverse of the
recording process.
6
Digitizing Sound
Digitizing Sound
Microphone produces analog signal
Computers understands only
discrete(digital) entities
This creates a need to convert Analog
audio to Digital audio . specialized
hardware
This is also known as Sampling.
7
Principles of Digitization
Why Digitize?
Microphones, video
cameras produce analog
signals (continuous-
valued voltages)
To store audio or video Time
data into a computer,
we must digitize it by Sound as analog signal
converting it into a
stream of numbers.
8
Miscellaneous Audio Facts
Typical Audio Formats
Popular audio file formats include .au
(Unix), .aiff (MAC, SGI), .wav (PC, DEC)
A simple and widely used audio
compression method is Adaptive Delta
Pulse Code Modulation (ADPCM). Based on
past samples, it predicts the next sample
and encodes the difference between the
actual value and the predicted value.
9
Common Audio Formats
There are two basic types of audio files:
1. the traditional discrete audio file, that
you can save to a hard drive or other
digital storage medium, and
2. the streaming audio file that you listen
to as it downloads in real time from a
network/internet server to your
computer.
10
1. Discrete Audio File Formats
Common discrete audio file formats include
WAV, AIF, AU and MP3.
A fifth format, called MIDI is actually not
a file format for storing digital audio, but a
system of instructions for creating
electronic music.
11
WAV
The WAV format is the standard audio file
format for Microsoft Windows
applications, and is the default file type
produced when conducting digital recording
within Windows.
It supports a variety of bit resolutions,
sample rates, and channels of audio.
This format is very popular upon IBM PC
(clone) platforms, and is widely used as a
basic format for saving and modifying
digital audio data.
12
AIF/AIFF
The Audio Interchange File Format (AIFF)
is the standard audio format employed by
computers using the Apple Macintosh
operating system.
Like the WAV format, it supports a variety
of bit resolutions, sample rates, and
channels of audio and is widely used in
software programs used to create and
modify digital audio.
13
AU
The AU file format is a compressed audio
file format developed by Sun Microsystems
and popular in the Unix world.
It is also the standard audio file format
for the Java programming language.
Only supports 8-bit depth thus cannot
provide CD-quality sound.
14
MP3
MP3 stands for Motion Picture Experts
Group, Audio Layer 3 Compression.
MP3 files provide near-CD-quality sound
but are only about 1/10th as large as a
standard audio CD file.
Because MP3 files are small, they can easily
be transferred across the Internet and
played on any multimedia computer with
MP3 player software.
15
MIDI/MID
MIDI (Musical Instrument Digital
Interface), is not a file format for storing
or transmitting recorded sounds, but
rather a set of instructions used to play
electronic music on devices such as
synthesizers.
MIDI files are very small compared to
recorded audio file formats.
However, the quality and range of MIDI
tones is limited.
16
MIDI/MID
MIDI is a protocol that enables computer,
synthesizers, keyboards, and other musical
device to communicate with each other.
This protocol is a language that allows
interworking between instruments from
different manufacturers by providing a link
that is capable of transmitting and
receiving digital data.
MIDI transmits only commands, it does not
transmit an audio signal.
It was created in 1982.
17
MIDI
Musical Instrument Digital Interface
a protocol that enables computer, synthesizers, keyboards,
and other musical devices to communicate with each
other. Setup:
MIDI OUT of synthesizer is
connected to MIDI IN of sequencer.
OUT
MIDI OUT of sequencer is connected
THRU IN OUT IN
to MIDI IN of synthesizer and
MIDI Interface/Sound Card "through" to each of the additional
Synthesizer/Keyboard
(Sequencer) sound modules.
IN THRU Working:
MIDI Module A During recording, the keyboard-
equipped synthesizer is used to send
IN THRU MIDI message to the sequencer,
MIDI Module B which records them.
During play back, messages are sent
Etc.
out from the sequencer to the sound
Typical Sequencer setup modules and the synthesizer which will
play back the music.
18
Hardware Aspects of MIDI
MIDI connectors:
Three5-pin ports found on the back of every
MIDI unit
MIDI IN: the connector via which the
device receives all MIDI data.
MIDI OUT: the connector through which
the device transmits all the MIDI data it
generates itself.
MIDI THROUGH: the connector by which
the device echoes the data receives from
MIDI IN.
19
Components of a MIDI System
Synthesizer:
It is a sound generator (various pitch, loudness,
tone color).
A good (musicians) synthesizer often has a
microprocessor, keyboard, control panels,
memory, etc.
Sequencer:
It can be a stand-alone unit or a software
program for a personal computer. (It used to be a
storage server for MIDI data. Nowadays it is
more a software music editor on the computer.)
It has one or more MIDI INs and MIDI OUTs.
20
Basic MIDI Concepts
Track:
Track in sequencer is used to organize the recordings.
Tracks can be turned on or off on recording or playing back.
Channel:
MIDI channels are used to separate information in a MIDI system.
There are 16 MIDI channels in one cable.
Channel numbers are coded into each MIDI message.
Timbre:
The quality of the sound, e.g., flute sound, cello sound, etc.
Multitimbral . capable of playing many different sounds at the same time (e.g. piano,
brass, drums, etc.)
Pitch:
The Musical note that the instrument plays
Voice:
Voice is the portion of the synthesizer that produces sound.
Synthesizers can have many (12, 20, 24, 36, etc.) voices.
Each voice works independently and simultaneously to produce sounds of Different
timbre and pitch.
Patch:
The control settings that define a particular timbre.
21
MIDI: Data Format
MIDI messages are used by MIDI devices to communicate
with each other.
MIDI messages are very low bandwidth:
Information traveling through the hardware is encoded in
MIDI data format.
The encoding includes note information like beginning of
note, frequency and sound volume; upto 128 notes
The MIDI data format is digital
The data are grouped into MIDI messages
Each MIDI message communicates one musical event
between machines. An event might be pressing keys, moving
slider controls, setting switches and adjusting foot pedals.
10 mins of music encoded in MIDI data format is about 200
Kbytes of data. (compare against CD-audio!)
22
Advantages: of MIDI
Because MIDI is a digital signal, it's very
easy to interface electronic instruments to
computers, and then do manipulations on the
MIDI data on the computer with software.
For example, software can store MIDI
messages to the computer's disk drive.
Also, the software can playback MIDI
messages upon all 16 channels with the same
rhythms as the human who originally caused
the instrument(s) to generate those
messages.
23
How is MIDI file Different
from a WAV or MP3 Files?
A MIDI file stores MIDI messages. These messages are
commands that tell a musical device what to do in order to make
music.
For example, there is a MIDI message that tells a device to
play a particular note. There is another MIDI message that
tells a device to change its current "sound" to a particular patch
or instrument. Etc.
The MIDI file also stores timestamps, and other information
that a sequencer needs to play some "musical performance" by
transmitting all of the MIDI messages in the file to all MIDI
devices.
In other words, a MIDI file contains hundreds (to thousands)
of instructions that tell one or more sound modules (either
external ones connected to your sequencer's MIDI Out, or
sound modules built into your computer's sound card) how to
reproduce every single, individual note and nuance of a musical
performance. 24
How is MIDI file Different
from a WAV or MP3 Files?
A WAVE and MP3 files store a digital audio
waveform.
This data is played back by a device with a
Digital to Analog Converter (DAC) such as
computer sound card's DAC.
There are no timestamps, or other
information concerning musical rhythms or
tempo stored in a WAVE or MP3 files.
There is only digital audio data.
25
2.Streaming Audio File Formats
Streaming is a network technique for
transferring data from a server to client in a
format that can be continuously read and
processed by the client computer.
Using this method, the client computer can
start playing the initial elements of large
time-based audio or video files before the
entire file is downloaded.
As the Internet grows, streaming technologies
are becoming an increasingly important way to
deliver time-based audio and video data.
26
Streaming Audio File Formats
For streaming to work, the client side has to receive the
data and continuously “feed” it to the ‘player’ application.
If the client receives the data more quickly than required,
it has to temporarily store or ‘buffer’ the excess for later
play.
On the other hand, if the data doesn't arrive quickly
enough, the audio or video presentation will be
interrupted.
There are three primary streaming formats that support
audio files:
RealNetwork's RealAudio (RA, RM),
Microsoft`s Advanced Streaming Format (ASF) and
its audio subset called Windows Media Audio 7 (WMA) and
Apple.s QuickTime 4.0+ (MOV).
27
RA/RM(real audio)
For audio data on the Internet, the de facto
standard is RealNetwork's RealAudio (.RA)
compressed streaming audio format. These files
require a RealPlayer program or browser plug-in.
The latest versions of RealNetworks. server and
player software can handle multiple encodings of a
single file, allowing the quality of transmission to
vary with the available bandwidth.
Webcast radio broadcast of both talk and music
frequently uses RealAudio.
Streaming audio can also be provided in conjunction
with video as a combined RealMedia (RM) file.
28
ASF(Advanced streaming
formats)
Microsoft`s Advanced Streaming Format (ASF) is similar to
designed to Real Network's Rea lMedia format, in that it
provides a common definition for internet streaming media and
can accommodate not only synchronized audio, but also video and
other multimedia elements, all while supporting multiple
bandwidths within a single media file.
Also like RealNetwork's RealMedia format, Microsoft`s ASF
requires a program or browser plugin.
The pure audio file format used in Windows Media Technologies
is Windows Media Audio 7 (WMA files).
Like MP3 files, WMA audio files use sophisticated audio
compression to reduce file size.
Unlike MP3 files, however, WMA files can function as either
discrete or streaming data and can provide a security
mechanism to prevent unauthorized use.
29
MOV
Apple QuickTime movies (MOV files) can be
created without a video channel and used as a
sound-only format.
Since version 4.0, Quicktime provides true
streaming capability.
QuickTime also accepts different audio sample
rates, bit depths, and offers full functionality in
both Windows as well as the Mac OS.
Popular audio file formats are:
au (Unix)
aiff (MAC)
wav (PC)
mp3
30