• home
  • forum
  • my
  • kt
  • download
  • Beating the Loop

    Author: 2007-06-09 17:22:59 From:

    The SWF File

    Here is an example of the finished product. There are two tracks you can listen to that are a combination of the loops on the left. You can download this example at the end of the tutorial.

    More often than not, you go to a website with a Flash animation and the whole music track is made of a single 2-second loop. This gets on anyone's nerve, no matter how good the loop is. We all know this is a necessary evil to prevent long download periods. One way to avoid this is to create different loops for different scenes. This is still going to give the feeling that the music becomes very repetitive very quickly. It also means that you have to create a lot of short loops that may or may not have a tying effect between the scenes of your movie. Another way of doing it might make your music flow a little better between your scenes. The idea is not new, composers have been doing it for ages.

    What you need to do first is to get some music material (loops or original material you write). Arrange them in a sound editing software (such as ACID from Sonic Foundry) so that they are all playing at the same speed. Once your different files play at the same speed, you've got your foot in the door.

    The SWF File

    Now you can decide to layer these loops in different ways. Here's an example:

    Loop #1 can be made up of a

    • drum loop,
    • a bass loop
    • and a keyboard loop.

    Loop #2 could be made up of

    • the same drum loop,
    • a guitar loop
    • and the same keyboard loop.

    And so on. This involves making 3, 4, 5 or more small loops, but put together in different arrangements, they become more complexe and they keep a certain unity within scenes.

    Now how can you organize this in Flash? Well follow these steps:

    • Import all your sound files in Flash.
    • Create a movie clip symbol.
    • Add a blank keyframe with the Stop action in the first frame.
    • Create as many layers in your movie clip as you have loops imported in your presentation. In this example, we'll say 6 (as shown in this image). This will give you a good variety.

    Possible Variations

    • Now you need to create 2 keyframes for each variation of your loops. In this tutorial, I create 8 variations, and this is how they are laid out:

     Track 1Track 1   Track 1Track 1 
    Track 2  Track 2Track 2Track 2Track 2 Track 2
    Track 3Track 3  Track 3Track 3Track 3  
      Track 4Track 4Track 4 Track 4 Track 4
    Track 5   Track 5Track 5Track 5Track 5 
      Track 6Track 6 Track 6Track 6Track 6Track 6

    As you can see, you can make up to about 72 different permutations with these 6 small loops. Again these loops don't have to be the same length (or duration), but they have to play at the same speed. Now back to the keyframes:

    • Why 2 keyframes: The first keyframe is to set the previous sound file to stop before starting to play the next one. The second keyframe contains the actual sound as a Start event.
    • Still in that first keyframe, go to the Sound tab and add the appropriate sound for that layer (if your on layer 1, add your sound 1). Make it a Stop event.
    • In each second keyframe for each pair of keyframe, set the sound you want to play (one per layer) to Start Event and make it loop 999 times, putting a STOP action in the Action tab.
    • Repeat this operation for each layer.
    • Insert a new layer and drag it to the top. Create a keyframe for every keyframe on the other layers. So for each first keyframe of each pair of keyframes (where the stop sound event happens), insert a label for that loop (You can call it Loop1, Loop2, Loop3, etc.)

    Adding Interaction

    Your layers should look something like this:

    I've added a blank keyframe every time I had a sound playing in the frame before, but you don't need to do this since your music track will jump from the Stopped keyframe containing the loops to the next label (stopping the sound on that layer before it starts playing again in sync with the others).

    The last thing you need to do is to add a Mute option.

    • This is done by adding a keyframe across all the layers at the end of your movie clip.
    • In all the layers for that frame, add the sound for that layer and make them Stop events.
    • Now add a Stop action on the top layer and give the frame a label such as "MUTE"

    That's it, your multi-scene, multi-loop player is done. Now let's give it some interaction.

    • Let's put an instance of your movie clip on a keyframe in your main timeline.
    • Give that instance a name (such as LOOPS).
    • Create a button that will call on these loops
    • Place instances of this button on the main timeline.

    Adding Interaction (cont)

    • Right-click on the first one and add the following script in the action properties:
      On (Press)
       Begin Tell Target ("/loops")
       Go to and Play ("loop1")
       End Tell Target
      End On
      
    • Do this for every button, but change the name of the label depending on the actual label you are targeting in your loops movie clip instance.
    • For the Mute button, add the following script:
      On (Press)
       Begin Tell Target ("/loops")
       Go to and Stop ("Mute")
       End Tell Target
      End On
      

    You've just created your dynamic music scene.

    Note that this example describes the process and assumes everything is in the same level. But if you decide to put your music loops on a different level (level 1 for example), and that your buttons on your main movie (level 0, for example), you have to tell your button to target the right level by adding the level in your target, like this: Begin Tell Target ("_level1/loops"). This will make your movie more effective between scenes!

    » Level Advanced

    Added: : 2000-04-20
    Rating: 7.75 Votes: 157
    Hits: 20801
    » Author
    Composer for the past 10 years, Robert has worked on different projects such as film, television and website development. Composing, arranging, recording, and mixing most of his material, he has developed many skills necessary in today¡¯s cultural and multimedia industry.
    » Download
    Download the files used in this tutorial.
    Download (716 kb)

    discuss this topic to forum

    relation tutorial

    No information

    Category

      3D (36)
      Math Physics (18)
      3rd Party (10)
      Navigation (70)
      Actionscripting (228)
      Optimization (17)
      Animation (166)
      Projector (11)
      Audio (54)
      Special Effects (170)
      Backend (26)
      Text Effects (92)
      Drawing (34)
      Tips and Techniques (58)
      Dynamic Content (38)
      Tricks (8)
      Games (114)
      Utilities (24)
      Getting Started (99)
      Video (59)
      Interactivity (48)
      Web Design (37)

    New

    Hot