Content Creation


While a detailed discussion of content creation techniques in DirectMusic Producer is beyond the scope of this case study, there are some techniques worth considering here. Download size and the unpredictable nature of user interactions are particularly important issues when designing interactive music for a web site. Unlike most games, web sites can potentially be viewed for long periods with very little interaction. Alternatively, the interactions may come thick and fast, and the music must be able to respond without becoming incoherent. Consider these issues carefully when creating content. Make sure that DLS instruments make the most of a small amount of sample data. Build variety into your patterns to maintain interest when no script routines are being triggered. Create Segments that can transition smoothly at any point.

DLS Instrumentation

Long loading times are a big turnoff for web site users, and although our DirectMusic content loads separately from the rest of the site, it is still important to keep the size of the download to a minimum. You should pay particular attention to the DLS instrument sample data, as this is the bulk of downloaded material.

It is important to minimize sample data, while maintaining the highest possible quality. The target download size for this site is less than 100KB. To meet this requirement, we choose instruments that do not require large samples. Long multi-sampled orchestral instruments require many more samples than anyone has the patience to download. Use short looping source samples that spread across the keyboard without suffering undesirable effects. For example, use samples of analog style waveforms, such as sawtooth waves, as the basis for DLS instruments. Only a few cycles are required and a wide variety of sounds can be created from the same source. For drums and percussion, create a small number of source hits instead of long loops. Also, reuse samples at various pitches and with various envelopes as the basis for different instruments to get the most mileage out of them. Be creative and generate many rich, multi-layered sounds all from the same source samples.

Sample Format and Compression

DirectMusic can use DLS instruments created from wave files across a range of sample rates and bit depths. I find that 22.05 kHz, 16-bit samples usually strike the best balance between size and quality and often respond well to compression. It is possible to combine different sample rates within an instrument or DLS collection though; this is sometimes necessary to get the best results.

DirectMusic in DirectX 8 has incomplete support for MP3 and WMA compression, so Microsoft ADPCM is the best compression type available in most cases. ADPCM compression reduces the bit depth to 4 bit, so do not reduce a 16-bit sample to 8 bit if you plan to compress the sample. The compression ratio achieved is typically just short of one to four, so in some circumstances it is worth using a 44.1 kHz sample if it compresses well, rather than an uncompressed 22.05 kHz version.

It is important to consider how different timbres respond to compression. For instance, when using ADPCM compression on 22.05 kHz drum sounds, you may find that a snare drum hardly suffers at all, while a cymbal can become gritty and lose its shine or a rounded bass drum may gain clearly audible compression artifacts. In some cases, simply replacing one sample with another of the same type of sound can be enough to get the quality you want without drastically increasing the file size. Alternatively, you may need to use a higher sample rate version of the source sample in order to achieve an acceptable compressed version. For this reason, you should always keep a backup of the highest quality version of every sample in your project.

Instrument Choices

Considering what we know at this point, we decided that our instrumentation should lean toward analog style pads, basses and synths based on a small number of samples, and programmed rhythm parts using a small palette of drum sounds. Of course, instrument choices can change during the creative process. Our site uses two instruments (Guitar1 and Marimba) that do not conform to these instrument choices. We felt that the trade-off between variety and download size was justified. You should consider the eventual cost in download time of each instrument that you use from the very beginning.

In our final DLS Collection, four samples make up the six non-percussion instruments. The sample Pad1 is the source for three of these instruments — Arpeggio1, Pad1, and Wibble.

click to expand
Figure 18-3: The DLS Collection.

Look in the Waves folder in Flash.dlp, and observe that the final version uses nine samples amounting to 207KB of storage space, uncompressed. Of these, seven responded well to ADPCM compression, and the final run-time DLS file weighs in at 89KB — within our target range even before we create the final downloadable archive, at which point we can expect some further file compression.

By making the right instrument choices, reusing samples, and selectively using compression, it is possible to create a good quality sound palette and keep the download to an acceptable size.

The Styles and their Patterns

After identifying the required musical content and establishing the resource limits that constrain it, the next step is composition and creating the DirectMusic assets. The source material played back by Segments is contained in Styles. A Style is like a collection of MIDI tracks combined with many settings unique to DirectMusic that influence the way they play back. You can import MIDI files created in another sequencer or create content in DirectMusic Producer. The MIDI content in a Style is organized into patterns. We must create a pattern for each musical passage and define the conditions under which they will play back.

Styles for Each Content Zone

The music for our site is contained in one Style (see Figure 18-4), since the music design avoids drastic stylistic variations within the site. If the site had distinctly themed zones as discussed above, we would almost certainly want to use a separate Style for each zone, although the organization of DirectMusic assets is a matter of personal preference.


Figure 18-4: The Style, expanded to show all the patterns.

Pattern Structure

All the patterns in the Style share more or less the same structure. They are all eight bars long, and they all share the same chord sequence (as defined in the Chords for Composition track) and draw on a main pool of pattern parts contained in "All" and "All2." These patterns serve as a source of linked Pattern Parts for the other patterns and have a groove level of 100 so that they themselves never actually play. Linking pattern parts reduces duplication of content and further reduces the size of the final run-time files.

Our patterns fall into two groups. Patterns 101 to 106 are derived from All, while 201 to 204 are derived from All2. Patterns 101 to 104 provide a progression and some variation for the main page of the site, and Patterns 105 and 106 add a guitar motif with varying accompaniment for half of the content pages. Patterns 201 to 204 provide the music for the remaining content pages, based on a sparser arrangement of the same basic elements.

click to expand
Figure 18-5: A Pattern Part using Variation Switch Points.

The percussion parts use variations and variation switch points to avoid repetition and add interest to the rhythms. By adding variation switch points at frequent intervals in every variation, the path through the Pattern Part changes every time. This works particularly well with percussion parts, where some amount of unpredictability can greatly enhance the sense of a live performance.

Groove Levels

See the groove levels used by all the Patterns in Main.stp below.

click to expand
Figure 18-6: The Style Designer window showing the Groove Range settings for each Pattern.

Patterns 101 to 106 use groove levels one to seven roughly in order of intensity. Groove level one is the most sparse, used only by the Segment Intro.sgp when the site loads. The Segment Front.sgp, featured on the main page of the site, uses groove range two to four, thus selecting from Patterns 102 to 104. Guitar.sgp uses groove range five to seven or Patterns 105 and 106.

We assigned Patterns 201 to 204 to the groove range 11 to 16; Minimal.sgp uses this groove range. The assignment of groove levels to patterns allows us to choose specific patterns or groups of patterns for playback from a Segment. The Repeat Pattern menu in the Segment's Groove Track Properties dialog box adds a further dimension to these playback choices. You can use the drop-down menu shown below to select the method for choosing from multiple patterns of the same groove level.

click to expand
Figure 18-7: The Repeat Pattern menu.

Weighting groove ranges can influence the choice of patterns for playback at run time. As the list of groove level assignments in Figure 18-6 shows, we assigned Patterns 201 to 203 to a single groove level, while we assigned Pattern 204 to the range 14 to 16, or three groove levels. If the Segment uses groove range 11 to 15 (as the final version does), Pattern 204 will be selected 40 percent of the time, while each other pattern appears 20 percent of the time.

In a more complex project with distinctly separate content zones and Styles or where embellishments such as fills and breaks are required, it is necessary to create custom patterns for those events. You can assign these patterns to one of the various embellishment types for playback from custom Segments. Our web site did not need such patterns.

The Primary Segments

As you know, primary Segments play back music from a Style, and secondary Segments play motifs and controller data or trigger timed script routines. Our site uses four primary Segments. The Intro plays when the web site loads using the lowest groove level. Intro's expression controller data fades in the Arpeggio and Wibble instruments. Intro also has a Segment Trigger Track that triggers a secondary Segment containing filter cutoff controller data and then triggers the next primary Segment. Main, shown below, plays after Intro and on every subsequent visit to the main page. Guitar triggers when the user clicks through to the first, third, and fifth content pages. Minimal triggers when the user clicks through to the second, fourth, and sixth content pages. Please be aware that I disabled the second content page in the HTML version of the site for this project.

Figure 18-8 shows Main.sgp as seen in the Segment Designer window. All of our primary Segments are constructed in the same way. Each Track influences the selection and manipulation of Patterns in different ways, as we can see by looking at Chord Tracks.

click to expand
Figure 18-8: Main.sgp.

Chord Tracks and ChordMaps

There are many reasons to use Chord Tracks in a DirectMusic project. Having a Chord Track in a primary Segment allows any secondary Segments to match the changes in harmony. This ensures coherent playback, regardless of when the secondary Segments trigger. DirectMusic can manipulate the harmony of properly mapped Patterns in real time, enabling key changes and variable chord sequences. The eight-bar chord sequence in our Patterns is expanded into a 16-bar sequence in the Segments, simply by extending the Chord Track. No new note data is required.

The most important thing when working with chords in DirectMusic is to map the Chords for Composition accurately. If done correctly, harmonic changes work properly.

click to expand
Figure 18-9: The Chord Properties dialog.

After assigning chords to the relevant measures, set the playmode for the different tracks so that, for instance, percussion parts do not transpose. Inversion boundaries are also useful to restrict the range across which a part can transpose.

The seven different playmodes provide much control over Pattern Part responses to chords in a Chord Track. You can also override the Pattern Part playmode setting on a note-by-note basis.

The rollover events on the main page of our site illustrate the different playback modes. For instance, the lozenge-shaped buttons each play a single note using the Chord/Scale playmode. These notes are therefore transposed to the current chord and scale, maintaining their harmonic functions. The Wide Sounds logo plays a motif that uses the Pedal Point playmode, playing the same notes every time unless those notes don't appear in the current scale. If the notes fall outside the scale, they are transposed to the nearest appropriate note.

It is possible to create variable branching chord sequences using ChordMaps and Signpost Tracks. By using weighted connection lines between the chords in a ChordMap and a set of signposts to determine the boundaries of the chord sequence, you can create anything from simple alternating key changes to rambling, unpredictable freeform chord patterns. This kind of sophistication is not necessary for our simple site, but it can add a huge amount of variability while barely increasing the size of the download.

The Secondary Segments

Now that we have our primary Segments, we can create the secondary Segments containing motifs and controller data that will be triggered on top. In the planning stages of the Wide Sounds site, we established that we needed a number of motifs. Loz1.sgp through Loz6.sgp are individual notes used as rollover sound effects for each of the six content buttons. WideLogo.sgp is a rollover sound effect for the Wide Sounds logo. WipeUp.sgp is an opening motif for clicking through to a content page. WipeDown.sgp is a closing motif for returning to the main page. Lastly, there is an extra motif, Scr.sgp, that is unused in the HTML version of the site; it is a tuned clicking loop used while scrolling text in the Flash version.

Note

My preference is to create motifs as Pattern Tracks in Segments rather than use the motif object type within a Style. This is because I find them easier to control and more flexible than motifs.

It is very important to test motifs thoroughly in context, bearing in mind that you can call the triggering routines at any time.

You can use the Secondary Segment toolbar in DirectMusic Producer, shown below, to audition motifs while a primary Segment is playing. Play every combination you can think of, and observe what happens when multiple instances of the same motif trigger in quick succession. This may cause overlapping notes to cut off, polyphony to be exceeded, or the motif to sound extremely loud. If undesirable effects occur, you will need to add functionality to your script to prevent the playback of multiple instances.

click to expand
Figure 18-10: The transport controls and Secondary Segment toolbar.

Once you create your script, you can test the functionality of motifs (and the script routines that drive them) further, but in the early stages the Secondary Segment toolbar is a great help.

There is one final secondary Segment in the project, triggered upon loading and left to loop continuously from then on. ClickFilt1.sgp contains a Pattern Track with filter cutoff controller curves affecting the instrument Arpeggio.

click to expand
Figure 18-11: Controller data in a CC Track, simulating an LFO.

The purpose of this Segment is to act as an LFO, constantly tweaking the instrument's filter cutoff to add interest to the sound.

AudioPaths and Effects

Real-time effects can give depth to sounds made from small source samples, turn mono into stereo, transform a sound into something completely different, and enhance the depth of the mix. However, when using many effects, it is important to consider the type of computer the end user has. It is a good idea to test using a minimum spec PC to make sure that you have glitch-free playback.

Look at FlashPath.aup and observe our AudioPath; it consists of four mix groups. One is dry, two use different combinations of Reverb and Echo, and the other uses the I3DL2 Reverb. A configuration like this should not cause any playback problems. Using the reverbs and stereo delays adds significant depth and atmosphere to the overall sound, which is, after all, created entirely from tiny mono samples.

click to expand
Figure 18-12: FlashPath.aup in the AudioPath Designer window.

To ensure that any Segments you audition in DirectMusic Producer play back on the correct AudioPath, select FlashPath.aup from the default AudioPath drop-down menu located above the Project folder.

Testing the Functionality

Just as the Secondary Segment toolbar allows you to test the playback of motifs and other secondary Segments, the Transport List and Controls allow you to select primary Segments for playback.

Right-clicking on the Transition (A/B) button brings up the Transition Options dialog (see Figure 18-13), allowing you to audition the various transition methods between primary Segments. The available settings correspond to those in the Boundary tab of the Segment Properties dialog, many of which can also be set in the script. This is a good way to test how the transitions sound and fine-tune your boundary settings before you create the script.

click to expand
Figure 18-13: The Transition Options dialog.

At this point, we have created and tested all of the required content, as defined in the planning stage. In summary, the project consists of one Style, one DLS Collection, four primary Segments, seven secondary Segments, and one AudioPath. We are now ready to script the project.




DirectX 9 Audio Exposed(c) Interactive Audio Development
DirectX 9 Audio Exposed: Interactive Audio Development
ISBN: 1556222882
EAN: 2147483647
Year: 2006
Pages: 170

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net