A Performance With RTMix

Dave Phillips

Now that Patrick has shown us how to record and play soundfiles, let's try doing something more complex with those soundfiles. Composer Ivica Ico Bukvic has written a very handy performance tool called RTMix that we'll use to create a complex mix out of our collection of recordings.

WARNING: The following tutorial will work for you only if you have a soundcard and driver that allows multiple simultaneous audio streams. The exercise described here was done with a SoundBlaster Live card, your mileage will certainly vary with the capabilities of your soundcard and its driver.

RTMix is currently available only in a precompiled binary (though the author plans to release the source code) so it either works for you or it doesn't. I'll assume it works for you and that when you start the program you see this display :

Figure 1: RTMix opening display
(Click here for large view)

RTMix is especially designed for the performing electro-acoustic musician. In essence, it is a front-end for a process scheduler, giving the performer an interactive interface for controlling a series of actions and processes, and it can schedule a variety of actions, not all of them necessarily musical.

The program runs a compiled series of scripted instructions. The instructions are limited to the following types :

  1. event
  2. warning
  3. text
  4. checkpoint
  5. pause
  6. stop
  7. clear

See the RTMix README for complete desciptions of those instructions. For this tutorial we're primarily interested in the event action. Armed with a set of soundfiles created with arecord (or anywhere else) we can now employ them in various interesting ways in RTMix. Our basic instruction looks like this one :

	event ([at]={"0.0"} [do]={"aplay some.wav"} [say]={"Now playing some.wav"} [kill]={"aplay"});;

In this example we define the event in this manner: "At time-point 0.0 have the aplay utility play the some.wav file. At the same time print 'Now playing some.wav' to the Notification Interface in the RTMix Playback tab. If the Panic button is pressed kill the aplay process". An empty parameter is indicated by the form {"none"}, and every action (event, warning, text, etc.) must define all of its parameters.

We can define a series of such actions to quickly create a rather complex mix, such as the one in this script :

	clear ([at]={"0.0"});;
	warning ([at]={"5.0"} [say]={"Five second warning!"} [dur]={"5.0"} [do]={"none"} [kill]={""});;
	event ([at]={"10.0"} [do]={"aplay /home/soundfiles/wav/buzztalk.wav"} [say]={"buzztalkin'"} [kill]={"aplay"});;
	event ([at]={"15.0"} [do]={"aplay /home/soundfiles/wav/coalmine_mondo_warp_1.wav"} [say]={"coal mine !"} [kill]={"aplay"});;
	event ([at]={"21.0"} [do]={"aplay /home/soundfiles/wav/hsim_warp_02b.wav"} [say]={"hsim"} [kill]={"aplay"});;
	event ([at]={"28.0"} [do]={"aplay /home/soundfiles/wav/lpcbel04.wav"} [say]={"lpcbel"} [kill]={"aplay"});;
	event ([at]={"36.0"} [do]={"aplay /usr/local/dump/wav/dp_piano_warp_1.wav"} [say]={"dp piano warp !"} [kill]={"aplay"});;
	event ([at]={"45.0"} [do]={"aplay /home/soundfiles/wav/synth01.wav"} [say]={"synth 1"} [kill]={"aplay"});;
	event ([at]={"55.0"} [do]={"aplay /home/soundfiles/wav/synth02_rev.wav"} [say]={"synth 2 reversed"} [kill]={"aplay"});;
	event ([at]={"66.0"} [do]={"aplay /home/soundfiles/wav/synth_b.wav"} [say]={"synth b"} [kill]={"aplay"});;

Figure 2 shows RTMix during the performance of this mix :

Figure 2: RTMix at work
(Click here for large view)

Coming full circle, I recorded the performance using arecord within RTMix itself by adding this line to the mix file shown above, capturing (via alsamixer) the Wave output channel of my SBLive soundcard :

	event ([at]={"5.0"} [do]={"arecord -f cd -d 120 -D hw:0,0 aplay_mix.wav"} [say]={"Recording is ON"} [kill]={"arecord"});;

Note that here I used the '-f cd' option to record a CD-quality WAV file (44.1 kHz sample rate). You can hear the somewhat hilarious results of this mix by downloading aplay_mix.mp3 (1.4 MB) or aplay_mix.ogg (1.2 MB) for you oggheads. A much better example of RTMix's capabilities can be heard in Ivica Bukvic's Tranquilscapes III: The Sea (MP3, 27 MB), a work for live guitar and a computer running the RTCmix audio processing environment.

Although the program is far from complete RTMix is already quite useful. I've had great fun scheduling realtime Csound output along with aplay and mpg123 playback. The author points out that you can use RTMix to schedule image viewers, animations, or just about anything else that could be launched from the Linux command prompt. As you can guess, it's easy to play with RTMix, but I can also easily see its great utility for a live performer in a more serious context. RTMix is very flexible and powerful Linux audio software, so have at it and let me know what interesting uses you find for it. Enjoy !

Back to Part 1 The arecord/aplay Mini-Howto