Advanced Techniques Creating Banks of Triggerable Samples (RMFX) |

Ordinarily, the custom Beatnik Instruments included in an RMF file are played by notes stored in the MIDI files included in the same RMF file. However, all Beatnik playback platforms also include a programming interface with commands that allow the software developer to play individual notes whenever desired, using any available Instrument, without involving any MIDI file. When this technique is combined with an RMF file that contains sampled audio clips, you get the ability to trigger any sample - a music premix, a dialog line, or a sound effect - interactively, at any time. This section describes how to make and use RMF files containing just banks of samples - and no Song data - for use in this way. Beatnik's term for such an RMF file is RMFX.
Samples Are Stored as Custom Instruments in the RMFX File
All sound resources in RMF files are accessed through the scheme of MIDI musical instrument programs. That may seem a little strange for sounds intended for playback at natural pitch - exactly the kinds of samples you'll most often want to use in RMFX files - but recall that Beatnik Instruments are always based on digital audio Samples. That means they can contain recordings of any kind of sound at all, and not just the single musical tone usually used in conventional Instruments. It also means that the Custom Instruments in RMF files can be used like little audio cartridges, each one loaded with its own sound recording, ready to be triggered at any time. For example, an audio logo to play when the mouse rolls over the company's logo image, or a sound effect to play when the user clicks on a link.
Events Come from the Programming, Not the RMFX File
For these kinds of effects, you'll rely on the developer of the Web page (or the Director Movie, or the application, depending on your context) to do all the Instrument selection and note event triggering - so there's no longer any need to include any Custom Songs (imported MIDI data) in your exported RMF file. All the RMF file needs to include is the Custom Samples, and the Instruments that are needed to access the samples.
Planning an RMFX File
There are basically two ways to arrange an RMFX file:
Option A: Collect all the Samples into a single Instrument, with a separate Keymap Zone for each Sample. In this approach, different note numbers trigger different Samples, and they all play at their correct pitch. This approach means more work if you want to play the samples at different musical pitches, but in many applications - like spoken dialog or music remixers - you may not need to re-pitch the sounds anyway. Option B: Create a separate Instrument for each Sample. In this approach, you can easily play the sample at different musical pitches by changing the note number in your `noteOn()` or `playNote()` commands.
It's best to decide which of these two setup options you want to use before you start building your RMFX file. With a little experience you'll learn to mix the two options together within a single RMFX file, but for your first experiments you may want to pick just one or the other.
Building an RMFX File
Constructing simple RMFX files can be very easy, as the Beatnik Editor commands Make Instrument Using... and Export RMF... automate most of the detail work. Basically, you just drag your Samples in, create the Instrument(s) in one operation, and then generate the RMFX file in a second operation.
With the Beatnik Editor open:
Create a new Session file for your RMFX project. From the File menu, select the New command. A new Session document window called Untitled Session will appear. Go to the File menu again, select the Save As... command, and save your new Session file in an appropriate folder, with an appropriate filename. Import your Samples. In your Session document window, click the Samples tab. Then collect the sample files that you want to use anywhere on your desktop, and drag them all into the empty Samples list area. This will produce a new Sample item for each dragged sample file, each with the same name as the file. Any loops will be preserved. Compress your Samples. Still in the Samples tab of your Session document window, select all of your Samples, and then go to the Sample menu and select the Compression... command. The Compression dialog box will appear. Use the Compression dialog box to apply the right compression for your material. In most cases, this will be one of the MP3 options. You can apply the same compression type to all of your Samples in a single operation. Create your Instrument or Instruments. Still in the Samples tab of your Session document window, select all of your Samples, and then go to the Sample menu and select the Make Instrument Using... command. The Make Instrument dialog box will appear. Set your Instrument options, and then click the OK button: If you decided to Combine Samples Into One Instrument, pick that option and also pick the sub-option One per key, starting at. You can change the starting key if you want to. If you decided to Separate Into Multiple Instruments, pick that option. If you want the samples to sound at their original pitches, you'll have play them at the indicated Root Key note. You can change the Root Key note if you want to. Your new Instrument or Instruments will appear in the Instruments tab of the Session document window, numbered starting at 0. If you ever want to start adding variations to your Sample playback, like a volume envelope, filtering, or modulation, you can modify the Instrument or Instruments in the Instrument Editor window. Check your Instrument or Instruments. In your Session document window, go to the Instruments tab and double-click the newly created Instrument or Instruments. The Keymap Zones page of the Instrument Editor window will show the MIDI note numbers you'll need to use (in `playNote()` and `noteOn()` commands) to trigger each Sample in each Instrument, so you may want to take notes. You can also audition a selected Instrument with the keyboard in the Player window, if you'd like to verify that all your Samples are playing correctly. Export your RMFX file. In the Instruments tab of your Session document window, make sure the Show: menu says Bank 2: Custom Melodic, and then select all the Instruments shown. Now go to the File menu and select the Export RMF... command. One of the Export RMF dialog boxes will appear, asking whether you want to create an RMF file or an RMFX file. Pick the RMFX option, and then click the OK button. The Save RMF File dialog box will appear. Use it to save your new RMFX file in an appropriate folder, with an appropriate name. The RMFX file is ready for use in your production.
Note: If you want the RMFX file to include a copyright notice, credits, and other `meta-data' information, you'll have to change this procedure slightly. Before step 6, use the Instrument menu command Make Song Using to create a Custom Song, then use the Song menu command Song Info to enter your info. Then, rather than using the Export RMF... command on your custom Instruments, apply it to the Custom Song instead. True, this will add a very small `dummy' MIDI file to your RMFX file - but because meta-data is attached to Songs rather than the RMF file itself, it's the only way to attach the copyright notice, etc.
Triggering RMFX Samples from the Production
To trigger the samples in your RMFX samples from a Web page or Director movie, the programmer will need to use the appropriate combination of the Music Object commands `playNote()`, `noteOn()`, and/or `noteOff()` commands (using the optional Bank and Program parameters - be sure to indicate Bank 2, as RMFX samples are always in the Beatnik Custom Instruments bank). For programming details, please refer to the Music Object Web Authoring Documentation, or the Beatnik Xtra User's Guide. (Application programmers using the Beatnik Audio Engine should consult the BAE Client API Developer Reference for the equivalent information for that context.)
If you chose Option A (Single Instrument): To trigger a full sample, use the command `noteOn()`, supplying the note number for the desired sample. No `noteOff()` is needed, as reaching the end of the sample produces the same effect. However, if the Sample loops, it will continue to play until a corresponding `noteOff()` is received. Alternatively, you could use `playNote()` instead of `noteOn()`, as long as the duration is longer than the Sample's own length. To stop a sample before it reaches the end, or to exit a loop, send a corresponding `noteOff()` command when you want the sample to stop. Alternatively, you could use `playNote()` instead of `noteOn()` and `noteOff()`, with a duration shorter than the Sample's own length. Be sure to indicate Bank 2, as RMFX samples are always in the Beatnik Custom Instruments Bank. If you chose Option B (Multiple Instruments): To trigger the selected sample at its natural pitch, use the command `noteOn()`, supplying the Root Key note for the selected sample. No `noteOff()` is needed, as reaching the end of the sample produces the same effect. However, if the Sample loops, it will continue to play until a corresponding `noteOff()` is received. Alternatively, you could use `playNote()` instead of `noteOn()`, as long as the duration is longer than the Sample's own length. To trigger the selected sample at a transposed pitch, use the command `noteOn()`, supplying a pitch other than the selected instrument's Root Key note. The sample's pitch will be transposed by the same amount as the difference between the Root Key and the played note number. For example, if you play an Instrument at a note that's 12 semitones above its Root Key, the Sample will play back one octave higher than its natural pitch. Note: If the Sample contains rhythmic music material, changing the pitch will also directly affect its tempo. To stop the sample before it reaches the end, or to exit a loop, send a corresponding `noteOff()` command when you want the sample to stop. Alternatively, you could use `playNote()` instead of `noteOn()` and `noteOff()`, with a duration shorter than the Sample's own length. Be sure to indicate Bank 2, as RMFX samples are always in the Beatnik Custom Instruments bank.

Advanced Techniques / Creating Banks of Triggerable Samples (RMFX) top |