This site is now just an archive over the rise and fall of Flash. The domain is available for sale
Login | Register

Creating Dynamic Soundtracks Using Layering

Editors note: "This tutorial was written by DoReMedia, a company selling SFX, but describes smart, general, principles for using sound in Flash."

19. January 2001, DoReMedia INTRODUCTION
The time has come for interactive soundtracks on the web. Broadband Internet connections are attainable for most businesses and consumers, and compression technology has become standardized. Tools such as Macromedia Flash offer powerful functionality for integrating synchronized, multi-layered soundtracks. So why are most developers still using loops?

The answer is that longer, dynamic musical arrangements still require too much download time for the average end user, even with the availability of faster internet connections. Luckily there is a compromise: using component audio pieces and layering techniques a designer can reduce file size and break away from the tedium of beat loops. The use of this techinque allows the developer to create the feel of a custom full production soundtrack to their multimedia projects without exposing the user to extreme download times.

As the visual component of web sites continues to advance, these techniques will provide the opportunity to offer interactive audio accompaniment that enhances the multimedia experience. The goal here is to have the end user reaching to turn their speakers up, not off!

Here's how it works. Most music is made up of many instuments played in rhythm and harmony with one another. In the recording studio, these instruments are recorded onto separate tracks. These tracks are then individually mixed and re-arranged to create the final product, a song. DoReMedia's approach is to leave
these songs in their un-mixed format,essentially turning the multimedia designer into the recording studio producer. For effective synchronized multimedia, the developer needs as much control to shape the soundtrack as to shape the visuals. Pre-recorded production music tracks don't provide this flexibility. DoReMedia Sound Familiesâ„¢ do.

Sound Families give you 3 "sets" of sounds: Layers, Chunks, and Sound Effects (SFX). This tutorial will focus on Layers and how they can be used to create dynamic, interactive soundtracks with small file sizes.

A typical Sound Family will have 4 to 6 layers, for example: drums, bass, rhrythm guitar, lead guitar, and synth. These instrument parts make up the main musical theme of a song. Each instrument part, or layer, is the smallest repeating riff of each instrument - usually 1, 2 or 4 bars (2 - 8 seconds) in length. DoReMedia Sound Families are engineered so that each of these short layer parts are accurate to the millisecond in length, and therefore loop perfectly. This is critical to keeping layers synchronized, as you will see in the following illustrations.

First, start by creating a new movie symbol {Insert > New Symbol} and calling it "soundtrack".

We will construct our audio layers in this separate movie, which will give us the ability to target it whenever we want, and keep the main timeline uncluttered.

Open the library {Window > Library} and double click on the movie symbol you just created. This will bring up a new timeline for this movie symbol. Add as many layers as you have instruments, naming them to correspond to each instrument (ie. Drums, bass, rhythm guitar, etc.). Flash will allow between 4 and 8 simultaneous sound layers, depending on your sound card.

If you have not yet imported your audio files, do so now {File > import}. If there is not already a keyframe on frame one, add one from the insert menu {Insert > Keyframe}. In the timeline, double click on the keyframe you just added, or highlight the keyframe to open the Frame Properties dialogue box {Modify > Frame}. Click on the sound tab. Your imported audio files should all appear from the pull down menu. Select your drum track. Set the sync method to "Event" and enter a loop value of 16 (this can be changed later).

You now have a drum track which will last somewhere between 16 and 64 bars, depending on the length of the original clip. In order to see the visual display of the audio in the timeline, go to frame 600 or so and select all layers, then insert frames {Insert > Frame}. You can easily add or remove frames later.

Follow the same procedure for the other layers, selecting the corresponding instrument. When you are finished, you should have multiple layers with a different instrument on each layer.

*It should be noted here that the event sync method is preferrable if you want to keep file size to a minimum. The streaming method does not allow Flash to re-use the small component pieces from the cache, but rather, it copies the audio data into each frame. In this example, using the event method thus far would mean about 10 bars of total audio (approximately 20 seconds) to be downloaded (5 layers x 2 bars each), whereas the streaming method would force a download of 160 bars (5 layers x 2 bars each x 16 repetitions). Quite a difference!

Play your movie to hear all of the instruments mixed together. You have just laid the foundation which will allow you to build an interactive, dynamic soundtrack.

Once you have your individual instrument tracks accessible in this way, you can make use of a few simple techniques which will allow you to really harness the power of sound and music to a level unachievable with loops or pre-recorded production music. The primary way to make use of layers is to use Flash's envelope functionality from the sound instance dialogue box. Envelope simply means a volume control. Essentially what you will be doing is muting and unmuting individual tracks to create dynamics.

In the frame properties dialogue box {Modify > Frame}, go to the sound tab for any instrument layer. In the window which displays the audio waveform, click anywhere in the window. Flash will add an envelope which you can adjust by grabbing the box and dragging.

The goal is to bring layers in and out at various points where they repeat (you will see vertical lines showing the repeat points). It is a good idea to make a change in 4 or 8 bar increments to be consistent with standard musical phrasing.

One approach might be to build your song gradually, starting with only the drums, then adding the bass 8 bars later, followed by the guitar and so on until you reach a climax. Then you can repeat your movie and do it again! It's up to you. This approach will create more variances in the music and stay interesting much longer than a single loop.

Once your soundtrack movie is as you like it, it's time to trigger it from your main movie. You can simply drag it from the library onto your timeline, or use frame actions and tell targeting. More information about tell targeting is available in Flash's help files and documentation.


About Jens C Brynildsen

Jens has been working with Flash since version 3 came out. Since then, he's been an active member of the Flash community. He's created more than a hundred Flash games (thus the name of his blog) but he also creates web/standalone applications, does workshops and other consulting. He loves playing with new technology and he is convinced that the moment you stop learning you die (creatively speaking). Jens is also the Editor of this website.

Get new stories first

Click to follow us on Twitter!



No comments for this page.

Submit a comment

Only registered members can comment. Click here to login or here to register