Master Foo's Institute of Technology

Music

Music

Digital Sounds

Back in the day, there were cassette tapes and radio. Then came the computer and the compact disc, and music entered the digital realm. With digitization, music could be piped through the internet and copied to hundreds of computers at once, which led to all sorts of problems with copyright. But nevermind: today, we'll be looking at different ways to store music digitally, record it to a computer, and edit it.

The physics

If you want to skip this, you can. It's just a quick explanation of how sound works in the real world.

We are sure that you have dropped a stone into a pond at least once in your life. If not, we're sure you can imagine the waves that emenate from where the pebble hits the water. In the same way, a speaker makes waves in the air and they spread around it, eventually bringing sound to your ears. To be exact, the wave compresses and rarefacts the air, which, when it reaches your ears, creates pressure on your ear drums at whatever frequency that it is compressing the air at. A simple wave vibrating at 440 hz looks like this close up:

image

It sounds like this, which is not very pleasant. That's because music is much more complex and messy:

image

It sounds a little better!

install audacity

If you want audacity, our free1 audio editing software, then just nip over here, grab their installer, and you'll be good to go.

Editing

Today, we'll be looking at ways to retrieve and edit audio, using our favorite audio editing software, audacity. No mics required, even though you could take a trip to your local tech store and get one for 10$, as I'll be providing brief audio clips for you: audio clip 1 and audio clip 2. Download them and keep them safe.

image - audacity

Recording

This big button:

image

records things through whatever it's assigned to. This menu:

image - menu, mic line in

tells audacity which source to use. For now, we'll just use the wav files I provided earlier.

Wav

So why wav files? Wav files are an uncompressed file format(usually), in which they contain the full fidelity of the sound as it was originally recorded, and don't skimp on quality. If you want to know more, check out the note below.

encoding - lossy compression

If you look at the number of samples per second in a standard audio clip (44100), and multiply it by the sample size (around 8 bits) the resultant file is huge (in comparison to the size of, say, an email (1kb) or an html file and it's images (~10kb). Uncompressed audio, then, is tremendous in size and for most applications, impractical. The solution is to trade off quality for a smaller size. By compressing (dropping details) the audio (or any media), the sound quality gets worse and worse with more compression, but fits into a smaller space. Therefore, uncompressed files are optimal for intermediate-editing (retain nuances) and compressed files are optimal for distribution over the internet. A notable exception are cds, which are essentially uncompressed wavs.

Noise removal

Taking a look at the file marked audmainviolin.wav2, and you'll notice, amoung other things, a terribly screwup. Yes, I know that. There's also some noise, a constant background hiss. We can use the noise removal tool by selecting a part of the recording that's just noise (click-drag to select; try to get as much as possible) and then effect>Noise Removal. Get a profile (first step) and then select everything (ctrl-a) and then do noise removal again, this time doing the second step. Make sure you're not too aggressive with the noise removal, because you'll otherwise 'deaden' the sound (the sound will become flat and lifeless).

Removing screwups

If you haven't noticed, I screw up badly by the fifth note (it was intentional). I later fix it, though, and deleting the part in the middle where I hit the wrong note and then correct can be removed. Just find where I screw up (you might have to listen a few times) and then select from there up to the right note, and hit the delete key. It might sound the slightest bit discontinuous, but if you zoom in and select right up to both ends, it'll sound natural.

You can use the deletion technique on several other things, such as getting rid of the space before and after the recording (recording this was a one man deal, so there was deadtime attributed to running to the computer and stopping the recording), or cutting out 'dirty' words for public consumption.

Layering

Now, I gave you two files to work with, and they're both of violins(the horror!): one is loud, while you can barely hear the other one. Classical enthusiasts might recognize the theme of the Saint-Saens 3rd Violin Concerto, and would know that the accompanying orchestra comes in very quietly before the solo.

To achieve this affect, you can open up the other file and the two files should now play together when you hit play. Leave a little time for the solo violin to come in, and so that it sounds somewhat like this 3.

FX

You should have noticed that the clip ends far before the song does: it doesn't even come to a cadence (resting point), and the clip doesn't sound good. Fading the end, though, should prove to be adventageous. Try selecting the end portion of the recording, and then effect>fade out. If you did it right, it should work like a charm.

Export

Now, we're done with mixing up our little clip, and we want to show it to all our friends. Wav is entirely too large, though. Let's look at some other options before we leave audio for the land of the visual.

MP3

This is probably one of the most recognizable formats in the world. "Mp3? Isn't that file sharing stuff?" If you want to think about it in that way, yes. It offers fairly good compression, but if you want to do mp3 exports from audacity, you'll need to grab the lame dll. Audacity should have instructions on their website.

Ogg

This is another formt that offers pretty good quality; some people do listening tests, and some determined that this format beat all the others is quality. Although it's (disputably) better and can be exported from audacity natively(without an extra dll), it's really about who uses what format: if you want to play ogg files with wmp, you need to install the filters for ogg files. If more people pick up ogg4, then it might be viable to use ogg. If you need listeners now, though, it could be adventageous just to use the mp3 format.

wma and acc

These two formats are the brain children of microsoft and apple respectively, which were meant to bring drm into music. Both options have a choice of drm and drm-less flavors, with music bought from the itunes store being the drm acc sort, while the music that comes from microsoft's urge is of the same ilk, just with wma. Of course, since they're proprietary formats, not too many people can play them, and it's just a big mess.

Had enough noise? Let's move onto making pictures.


1 open source
2 Yes, that's me playing. Stop laughing.
3 you can try overlaying several copies of the accompanying part, and then tweaking them to sound different, so you get a more orchestra-like sound. Here's my attempt.
4 since mp3 has some ownership issues, it could be potientially dangerous legally to use mp3. But it's unlikely something will happen, imho.