Music and The Home Computer - Creating Sound and Music on the PC

 

by John M. Zeigler, Ph.D.
Rio Rancho, NM USA

  O
 

ther articles of this series took us on brief tours of music appreciation software and software to aid in learning to play an instrument. In this installment, we'll look at how sound is created on the PC and how you can use software you may already have to indulge your creative impulses by writing your own music.

 

 

"The music goes round and round ..."

Waveform of a single piano noteSound is transmitted through the air as a complex series of compressions and rarefactions in the average density of air molecules, which our ears translate to electrical signals that our brains interpret. If, instead, we use a microphone to translate the sound into an electrical signal and send this to a device called an oscilloscope, we can actually see the complex structure of sound waves. The simplest continuously sounding single tone, as from a electronic tuning fork, is a single regularly varying sine wave (or "waveform") of the sort we learned about in high school algebra. Single tones from musical instruments are more "musical" - and more complex - because they superimpose additional sine waves ("harmonics") of different strength ("amplitude") and different numbers of peaks passing a given point per second ("frequency") on the basic sine wave. The waveform of a single piano note is shown at right, plotted as amplitude vs. time. It displays the main tone ("fundamental") dying off with time; the harmonics are seen as smaller "squiggles" superimposed on the much larger main tone. You can hear this note to see how the sound corresponds to the waveform. If a single piano note waveform is this complex, it doesn't take much thought to realize that even the simplest of music results in a VERY complex mixture of sine waves  The challenge for the computer is to reproduce this waveform as accurately as possible.

Although the sound from a PC comes from speakers, the component which actually interprets the instructions from the processor to make sound is the sound card. Modern sound cards have at their heart a special chip called a digital signal processor (DSP) that enables the card not only to interpret sound in various file formats (MIDI, WAV, etc.), but even to serve as a modem or answering machine. We will say nothing about these other, non-musical functions of the DSP, but it is worthwhile to talk about the two different methods by which the DSP creates sound.

Older sound cards use a method called "FM-synthesis" to reproduce the sound waveform. In this method, many sine waves of varying amplitude, frequency, and relative position ("phase") are added together to imitate the waveform as best as possible, given constraints imposed by the speed of the hardware and the complexity of the waveform. While this technique works well for some types of sound, it rarely reproduces accurately the timbre of musical instruments. For example, piano music reproduced on an FM-synthesis sound card usually sounds more like a harpsichord than a piano.

Newer sound cards use a more complex method called "wavetable synthesis" to generate sound. In this case, actual stored samples of the sound of various musical instruments are used to create the sound. This approach is a much more accurate method of reproducing sound and is the method on which all modern sound cards rely, albeit in slightly different forms. If you have an older PC with an FM-synthesis sound card and little speakers lacking a separate subwoofer, you can make a HUGE difference in the quality of sound you get from the system by replacing the sound card with a wavetable type and the speakers with ones having a powered subwoofer. At under $100, this is one of the few upgrades you can do on an older PC that really makes economic sense in terms of your enjoyment from the computer.

WAV vs. MIDI

The two major sound file types for the PC are WAV and MIDI, putting aside compressed formats like .RA and MP3. As the name implies, WAV files are representations of the actual shape of the sound waveform sampled many times each second, typically 11, 22, or 44 thousand times per second. For example, if you record sound into your PC from an outside source like TV or radio, the sound is sampled at least 11 thousand times a second to produce the computer waveform file. The more times per second the sound is sampled, the more accurate the reproduction and the larger the amount of data that must be recorded. Given what we've said about the complexity of sound waves, it will come as no surprise that WAV files are HUGE. Ten seconds of stereo sound in WAV format sampled at 11 thousand times per second is typically over 250,000 bytes in length! This is the reason that, prior to the general availability of broadband connections, music was almost never sent over the Web in native WAV files; they simply took too long to transmit. Even now, waveform music is usually sent over the Internet in compressed (i.e. smaller) formats like MP3 to make transmission times acceptable.

The other format used commonly for music is MIDI (.MID). MIDI files are fundamentally different from WAV files. Instead of representing the waveform point-by-point as in WAV files, MIDI files are actually a set of sequential instructions (hence the name "MIDI sequences") which tell the sound card's DSP what the pitch should be, how long it should last, what the dynamics are, the rate at which the note should be played, and, most importantly, what instrument the note is to be played on. The interpretation of these instructions into a voltage which can be sent to the speakers is then up to the sound card on your computer. Because of their relative simplicity, MIDI files are 50 to 100 times smaller than the corresponding WAV files. They are widely used to send music on the Web for that reason. One of the disadvantages of MIDI files is that, because the interpretation of the file is entirely up to the hardware and software available, the sound produced will differ slightly from computer to computer depending on the hardware capabilities and the degree of care with which the file is written. You can learn more about MIDI and the PC in my Music and the Home Computer article, An Introduction to MIDI for Pianists.

Composing on Your PC

It is possible to compose your own music on a PC. In essence, the process involves writing new MIDI sequences to describe your music, which you then audition using the PC speakers. Although the capabilities and ease of use vary greatly from program to program, most composition programs use a standard point-and-click interface to add notes and dynamic markings on a staff and/or accept notes played from a MIDI keyboard. The more powerful (and expensive) programs allow 128 or more separate channels (e.g. for orchestral music). You can print your music from all the programs. Once your sequence is written, it is possible to have the computer write the sequence out to a WAV format file, though this is rarely done in practice. Most computers already have software for creating MIDI sequences, though it tends to be limited in power and provides little or no help for the novice composer.

There is a lot of good information available on the Web to help the budding composer. One of the best sites is Robert Finley's Classical Midi Page, the home page of one of the finest authors of classical MIDI sequences. This site has all Mr. Finley's latest sequences, tips on MIDI sequencing, links and more. The Music Composition Frequently-Asked Questions (FAQ) is also valuable for those embarking on their first composing project. If you would just like to listen to classical MIDI sequences, try our Audition Room page, which has over 600 pre-auditioned solo piano sequences; for orchestral sequences check the The Classical MIDI Resource.

Composing for the Novice

If you want to write songs for the piano or try your hand at composing, you won't want a program designed for studio production of music. Instead, your best best is one of several hardware/software packages that provide both a small, but serviceable keyboard to plug into your computer and software to help you use it. Though it doesn't come with a keyboard, another excellent choice for the beginning composer is Voyetra's Discovering Keyboards. This program also provides an excellent piano learning environment, but goes further in offering a very approachable introduction to the hardware and software involved in creating, editing, and playing music on the computer, as well as a good composition program called Music Write. Either of these is more than adequate to introduce a child or beginning adult composer to composition on the PC.

For Your Magnum Opus

If you decide to take on a more ambitious composing project, you will probably want some more powerful composition software. A highly regarded, try-before-you-buy, shareware program is NoteWorthy Composer. It features a standard point-and-shoot interface that allows you to notate up to eight voices per staff as well as associated dynamic markings. Voyetra also has an excellent notation and composition program with similar capabilities called Digital Orchestrator.

Although some might debate it, most professional composers regard Cakewalk and Cakewalk Pro as the ultimate tools for composition and notation. These programs provide virtually every conceivable capability, but at the expense of having a very steep learning curve. Unless you are an accomplished composer and have an extensive MIDI hardware capability, the various Cakewalk programs are probably more power than you will need or want to deal with.

Editing Sound and Notation on a PC

Just as these programs can be used to create MIDI files, they can also be used to edit existing MIDI files. This is a good way of "improving" sequences you download, so long as you acknowledge the original author's contribution. The programs work the same basic way for editing as for creating MIDI files.

Virtually all computers with sound cards have software supplied with them that allows you to listen to, modify, and interconvert between WAV and MIDI (and other) formats. A couple of the most common ones are AudioStation and Sound Impression. There are many others as well. They all share, to varying degrees, the ability to work with existing files.

So long as you exercise care with respect to copyrighted material, you can use your existing sound card software or other commercial software to produce new sound files by recording, rearranging, stringing together, changing the dynamics of, and distorting WAV and related waveform files. For most users, the software they already have is adequate for this task, though you will need more powerful software to do professional-level editing. This can be a great deal of fun and is useful for producing amusing and interesting sound files of family and friends to use as sound effects in Windows, for example.

Synthesized or Synthetic?

In the last 30 years, computers and synthesizers have revolutionized both what we think of as music and how we create it. Those of you over the age of 40 can probably still remember the sensation that Wendy Carlos' synthesized recordings of Bach classics ("Switched-on Bach") made when they first appeared in the 1970's. The renditions that Carlos created over thousands of hours of work with bulky equipment and manual manipulation of patch cables can now be done by any talented musician in a few tens of hours with a PC and MIDI keyboard. While purists may argue about how "true" such recordings are to the composer's intent, the fact is that the hardware is now good enough and prices low enough that high quality reproduction of classical instrument sound is available to almost anyone. More importantly, synthesized music makes possible sounds and effects that are impossible to duplicate with musical instruments alone. Whatever the purists may think, digital music is here to stay.

We hope this article has given you some insight into how music is created for and played by the personal computer. If you got the idea that you don't have to be a passive receptor of music, but can actually use your PC to become an active creator of music and sound, then pat yourself on the back. The only thing left to say (with apologies) is: "Just do it!"

 
 
 
 
Page created: 12/8/01
Last updated: 02/02/24
 
Site Policies Credits About Feedback Reprinting
     

Reprinting from the Piano Education Page The Piano Education Page, Op. 10, No. 2, https://pianoeducation.org
© Copyright 1995-2024 John M. Zeigler. All rights reserved.