Audio Compression and MIDI Files

       Audio Compression and MIDI Files

Audio Compression:

Audio compression has two major uses:
■Enabling audio clips to be used on Web sites
■Enabling storage of high-quality music in less space
By using audio-editing software, such as Real’s RealSystem Producer or Microsoft Windows Media
Encoder, you can compress high-quality sound for use on Web sites with a minimal loss of quality but
a large reduction in file size.
The latest example of a sound format being popularized by the Web is the MP3 file type, a digital
sound-only flavor of MPEG that has become an overwhelmingly popular downloadable sound format
on the World Wide Web. MP3 files can have near-CD quality, depending on the sampling rate used to
create them, but they are far smaller than normal CD-quality WAV files. For example, a 48,000Hz 
16-bit stereo sound file encoded with the default PCM method requires 188KB of disk space per second, whereas the same file encoded with the very high-quality MP3 format using 192Kb sampling
requires only 23KB of disk space per second.


MIDI Files:

MIDI is a powerful programming language developed in the 1980s to permit electronic musical instruments to communicate. MIDI was the breakthrough standard in the electronic music industry, an
industry that to this day shuns nearly all attempts at hardware standardization in favor of proprietary
systems. With MIDI you can create, store, edit, and play back music files on your computer either in
tandem with a MIDI-compatible electronic musical instrument (typically a keyboard synthesizer) or
with just the computer. MIDI files, which are usually stored with the .MID or .RMI file extension, are
wholly digital files that do not contain recordings of sound; instead, they contain the instructions the
audio hardware uses to create the sound. An hour of stereo music stored in MIDI format requires less
than 500KB.
A MIDI file is actually a digital representation of a musical score. It is composed of a collection of separate channels, each of which represents a different musical instrument or type of sound. Each channel specifies the frequencies and duration of the notes to be “played”by that instrument, just as a
piece of sheet music does. Thus, a MIDI file of a string quartet contains four channels representing
two violins, a viola, and a cello.

Note:
MIDI files are not intended to be a replacement for sound files such as WAVs; they should be considered a complementary technology. The biggest drawback of MIDI is that the playback technology is limited to sounds that can be readily
synthesized. The most obvious shortcoming is that MIDI files are incapable of producing voices (except for synthesized
choir effects).
Additionally, the quality of your sound card directly influences what MIDI sounds like when you play it back. Because
MIDI files can be played back with FM synthesis or wavetable synthesis, older low-cost sound cards without wavetable
features will produce MIDI music that sounds like an orchestra of kazoos. Unfortunately, even with a high-quality
wavetable sound card, some MIDI files still sound bad because they were produced for playback on FM-synthesis sound
cards. Even though most sound cards sold today feature some form of wavetable synthesis, the number of instruments and
the quality of the patch sets (the digital samples) can vary widely from card to card. Inexpensive wavetable cards might
support only 32 voices, whereas better cards can support 256 or more.
Check the MIDI files you want to play back to see how many voices are needed to fully support the file before you
decide you need a “better”MIDI-compatible sound card with more voices.

All three MPC specifications, as well as the PC9x specification, call for all audio adapters to support
MIDI. The general MIDI standard used by most of the audio adapters on the market provide for up to
16 channels in a single MIDI file, but this does not necessarily limit you to 16 instruments. A single
channel can represent the sound of a group of instruments.
Because MIDI files consist of digital instructions, you can edit them much more easily than you can a
sound file, such as a WAV file. With the appropriate software, you can select any channel of a MIDI
file and change the notes, the instrument used to play them, and many other attributes that affect
the sound the PC produces.
Some software packages can even produce a manuscript of the music in a MIDI file by using standard
musical notation. A composer can write a piece of music directly on the computer, edit it as needed,
and then print out sheet music for live musicians to read. This is an enormous benefit for professional
musicians, who historically have had to either employ music copyists or publishers or spend long
hours copying music by hand.

Playing MIDI Files

When you play a MIDI file on your PC, you are not playing back a recording. Your system is actually
creating music from scratch. To do this, the computer requires a synthesizer, and every MIDI-capable
audio adapter has one. As the system reads the MIDI file, the synthesizer generates the appropriate
sound for each channel, using the instructions in the file to create the proper pitches and note
lengths and using a predefined patch to simulate the sound of a specific musical instrument. A patch
is a set of instructions the synthesizer uses to create sound similar to a particular instrument. You can
control the speed at which the music plays and its volume in real-time with the MIDI player software.

FM Synthesis

Until the mid-1990s, most low-cost sound boards generated sounds by using FM (frequency modulation) synthesis, a technology first pioneered in 1976. By using one sine wave operator to modify
another, FM synthesis creates an artificial sound that mimics an instrument. The MIDI standard supported by the adapter specifies an array of preprogrammed sounds containing most of the instruments used by pop bands and orchestras.
Over the years, the technology has progressed (some FM synthesizers now use four operators) to a
point where FM synthesis can sound moderately good, but it is still noticeably artificial. The trumpet
sound, for example, is vaguely similar to that of a trumpet, but it would never be confused with the
real thing. Today, virtually all sound cards use more realistic wavetable sound (see the following section), although many still offer FM synthesis as an option.

Wavetable Synthesis

Today, few sound cards use FM synthesis for their sole method of playing MIDI files because even at
its best, the sound it produces is not a realistic simulation of a musical instrument. Using a technology that was theorized at about the same time as FM synthesis, a company called Ensoniq developed
a method of sampling any instrument—including pianos, violins, guitars, flutes, trumpets, and
drums—and storing the digitized sound in a wavetable. Stored either in ROM chips or on disk, the
wavetable supplies an actual digitized sound of an instrument that the audio adapter can manipulate
as necessary. Early wavetable features for audio adapters were added with daughtercards, but almost
all audio adapters in use today have wavetable features built in.
A wavetable synthesizer can take a sample of an instrument playing a single note and modify its frequency to play any note on the scale. Some adapters produce better sound by using several samples of
the same instrument. The highest note on a piano differs from the lowest note in more than just
pitch, and the closer the pitch of the sample is to the note being synthesized, the more realistic the
sound is.
Thus, the size of the wavetable has a powerful effect on the quality and variety of sounds the synthesizer can produce. Originally, the best-quality wavetable sound cards stored several megabytes of
sound samples on the card itself, either in permanently attached memory chips or specialized memory modules. Some also supported daughtercards for the installation of additional memory, enabling
you to customize the samples in the wavetable to your own specifications.
To save money without compromising quality, most current PCI-based wavetable sound cards, including Creative Labs’Sound Blaster Live! and Audigy series, use so-called “soft wavetable”techniques,
which borrow 2MB, 4MB, 8MB, or more from main computer memory for storage of wavetable samples, which are also called patch sets. The SoundBlaster Audigy series from Creative Labs can use as
much as 1GB of RAM for its samples, which are referred to as sound fonts. With most soft wavetable
audio adapters, you can adjust the amount of RAM your samples will use; smaller sample sizes save
RAM but might not provide you with all the instruments you want for certain music tracks

Tip:
If your system has both a soft wavetable sound card and integrated AGP graphics, your usable RAM is reduced by the
memory sharing performed by both devices. A 4MB MIDI patch set and AGP graphics set for 8MB of RAM will reduce a
64MB system to 52MB of usable RAM. Because memory sharing such as this is common, a memory upgrade from
64MB total to 128MB total will actually more than double your usable system RAM.


MIDI Connectivity

The advantages of MIDI go beyond the internal functions of your computer. You can also use your
audio adapter’s MIDI interface to connect an electronic keyboard, a sound generator, a drum machine,
or other MIDI device to your computer. You can then play MIDI files by using the synthesizer in the
keyboard instead of the one on your adapter or create your own MIDI files by playing notes on the
keyboard. With the right software, you can compose an entire symphony by playing the notes of each
instrument separately into its own channel and then playing back all the channels together.
Some manufacturers even offer high-end MIDI cards that can operate in full-duplex mode, meaning
you can play back prerecorded audio tracks as you record a new track into the same MIDI file. This is
technology that only a few years ago required the services of a professional recording studio with
equipment costing hundreds of thousands of dollars.
To connect a MIDI device to your PC, you need an audio adapter that has the MIDI ports defined by
the MIDI specification. MIDI uses two round, five-pin DIN ports (see Figure 1) for separate input
(MIDI-IN) and output (MIDI-OUT). Many devices also have a MIDI-THRU port that passes the input
from a device directly to output, but audio adapters generally do not have this. Interestingly, MIDI
sends data through only pins 1 and 3 of the connector. Pin 2 is shielded, and pins 4 and 5 are
unused.

The primary function of the audio adapter’s MIDI interface is to convert the parallel data bytes used
on a computer’s system bus into the serial MIDI data format. MIDI uses asynchronous serial ports that
run at 31.25Kbaud. MIDI communications use 8 data bits, with 1 start bit and 1 stop bit, for a speed
of 320 microseconds per serial byte.

Note
You can obtain the most recent specifications for the MIDI standard for a modest fee from the MIDI Manufacturers
Association’s sales-fulfillment address: MMA, PO Box 3173, La Habra, CA 90632-3173 USA.
The MIDI Manufacturers Association also has a Web site at www.midi.org.

MIDI runs over special unshielded twisted-pair cables that can have a maximum length of up to 50
feet (although most of the cables sold are 10 or 20 feet long). You also can daisy-chain multiple MIDI
devices together to combine their capabilities. The total length of the MIDI chain is not limited as
long as each individual cable is less than 50 feet.
Many audio adapters do not have MIDI ports directly on the adapter card. Instead, they use a separate
connector that plugs into the adapter’s game port and provides the MIDI ports. Unfortunately, this
connector is rarely included in the box with the adapter. You have to purchase it separately from the
audio card manufacturer.
If you are using a “legacy-free”PC that doesn’t include a MIDI/gameport connector, you can attach
MIDI interfaces via your USB ports. For a selection of various USB-compatible MIDI devices, go to
www.usbstuff.com/midi.html.


MIDI Software

Windows 9x, Me, 2000, and XP all include basic software that enables you to play MIDI files in the
form of the Media Player application, and these versions of Windows also include a selection of MIDI
music files. For full MIDI capabilities, however, you’ll need sequencing software to either manipulate
the tempo of MIDI files and the sounds used to play them or cut and paste together various prerecorded music sequences.
Many audio adapters come with a selection of software products that provide some MIDI capabilities,
and shareware and freeware tools are available on the Internet. However, the truly powerful software
that enables you to create, edit, and manipulate MIDI files must be purchased separately.


Recording
Virtually all audio adapters have an audio input jack. With a microphone, you can record your voice.
Using the Sound Recorder application included with all versions of Microsoft Windows, you can play,
edit, or record a sound file in the WAV format.

The WAV files you create can be used in many ways, including: 
  • ■Assigning specific WAV files to certain Windows events with the Sounds option in the Windows Control Panel
  • Voice annotations that can be attached to various types of documents through Windows OLE and ActiveX controls
  • Narration for presentations using PowerPoint, Freelance Graphics, Corel Presentations, or other products                          
WAV files can be converted into MP3 or WMA files to save space and for use on the Web.

Audio CDs
One convenient and entertaining use of a CD-ROM drive is to play audio CDs while you are working
on something else. Virtually all CD-ROM drives support audio CDs. The music can be piped not only
through external speakers connected to the audio adapter, but some also support audio through headphones plugged into the front-mounted external jack provided on many CD-ROM drives. Most sound
7
cards include a CD player utility, as does Windows, and free versions are available for download on
the Internet. These programs usually present a visual display to simulate the control panel of an audio
CD player. You operate the controls with a mouse or the keyboard and can listen to audio CDs as you
work on other things.
If you want to hear CDs through your system’s speakers, be sure your CD audio cable is attached to
both the rear of the CD-ROM drive and your sound card. Some new systems feature digital speakers
attached to the USB connection. These can provide excellent sound, but if used with older or cheaper
CD-ROM drives, they might produce no sound at all. USB-based speakers mustbe used with CD-ROM
drives that support a feature called digital audio extraction (DAE) if you want CD-based music to play
through them. Check your CD-ROM drive’s spec sheet for information about this feature.



No comments:

Powered by Blogger.