Classic Computer Magazine Archive START VOL. 3 NO. 9 / APRIL 1989

Review

Breaking The Sound Barrier

The Replay 4 Sound Digitizing Package

by Jim Pierson-Perry
START Contributing Editor


From talking gas gauges and alarm clocks to berserker screams from computer games, there are hundreds of uses for digitized sound. Some of the most productive have been in the music industry with direct to disk recording and development of sampling keyboards. Macintosh users have long had the ability to digitize sounds and incorporate them into their programs. Now it is our turn.

Replay 4 (previously known as ST Replay) is a multifaceted package for sound digitization and playback. You can use it to turn your ST into a musical sampling instrument, add sounds to your own programs, create sound and picture shows or just have fun. It comes with a hardware cartridge for sound input and high-fidelity output. You also can play back sounds through the monitor speaker without using the cartridge at all.


Over the Waves

Before getting into the program, let's look at the basics of getting a sound from the real world into your ST. The most common picture description of a sound shows the amplitude (loudness) changing with time. To digitize sound, an analog to digital conversion device reads the amplitude of an input sound at set time periods. The resulting amplitude versus time data is called a sample. We can hear the digitized sound by putting the data through a digital to analog converter--for example the ST sound chip.

Ideally, playback of the sample data would give a perfect reproduction of the input sound. Two factors that limit this are the resolution of the digitizing process and the sampling rate. Resolution refers to how finely the digitizer differentiates between incoming amplitude values. The greater the resolution, the better the sound quality--similar to using a 64-shade versus an eight-shade gray scale for monochrome graphics.

replayfour1.jpg Main operations
screen from the
Replay 4 program.
The current sound
sample is shown in
the data window.
Sound output (play-
back) can be
directed either
through the internal
monitor speaker or
to your home stereo
system, via the
Replay 4 cartridge.

The sampling rate sets how often the digitizer takes data points. Sample rates are given in units of kHz (kilohertz). A 10 kHz rate digitizes 10,000 sample points per second. If there were no other considerations, you would use the highest sampling rate possible to best capture the input sound. Unfortunately, this requires a vast amount of memory for all but the shortest of samples (a two-second sound sampled at 50 kHz generates 100K data bytes).

The rule of thumb is to use a sampling rate at least twice that of the highest frequency in the input sound. As human ears typically can hear sounds over the range of 20 to 20,000 Hz, a sampling rate of 40 kHz should be sufficient. Going to a lower sampling rate could cause the digitizer to miss parts of the sound (aliasing) and give poor reproduction on playback. How low the sampling rate can be set depends on the frequency content of the input sound and personal taste for the playback quality.


Revvin' Up Replay

Replay 4 comes on an unprotected program disk and can be installed on a hard drive. It is compatible with both color and monochrome monitors and runs on all ST and Mega computers. The maximum sample size is determined by available computer memory. The program runs under GEM and supports desk accessories. The manual provides a good explanation of the program as well as tips on sampling and suggestions on using sample files from user programs.

The accompanying cartridge has female RCA phono jacks for sound input and output. Sound digitization can be done only through the cartridge. Sample playback can be directed either to the internal monitor speaker or via the cartridge to an external speaker except with sampling rates over 30 kHz which are only supported through the cartridge. Digitization is done at 8-bit resolution, the same as the popular Ensoniq Mirage sampler instrument. Hardware antialiasing filters are built into the cartridge input and output circuits. Typical input sound sources are the ear or headphone connectors on tape players and CDs. Electronic music instruments may need preamplification before going into the cartridge.

Two programs are provided on the disk: Replay 4, the sample editor, and Effects, a real-time sound processing application. A folder is also provided with the necessary hooks and examples to use Replay 4 with several ST programming languages (ST, Fast and GFA BASIC; HiSoft 68000 assembly). You are free to use digitized sounds created through Replay 4 in your own programming, commercial or public domain, without any legal restrictions or requirements from MichTron.


replayfour2.jpg Audio effect selec-
tions available with
the EFFECTS aux-
iliary program. This
demo program uti-
lizes the Replay 4
cartridge/software to
simulate some types
of audio signal
processing: echo,
reverb and dis-
tortion.

The Sample Editor

The heart of Replay 4 is its sample editor program. This controls the digitizing process, from initial sampling through final editing. Program operations are divided into three areas: sampling, editing and performance. All are done from a single workscreen where the main operations are selected by clicking on control buttons or using keyboard command equivalents. In a stroke of poor design, you must use the Esc key to quit these operations rather than just clicking on the buttons again.

A data display window takes up about half of the screen, graphically depicting the sample data and operations you do on it. Two cursors are within the window and mark the start and stop boundaries of the current working segment, out of the overall sample data buffer. The cursors initially are at the far ends of buffer, but may be moved so that only a specified piece of the buffer will be used. All sampling, editing and replay operations occur only within the cursor boundaries. This powerful concept lets you partition the buffer to store and work with multiple, independent samples.

Digitizing sound can be as simple as connecting the input cable to the cartridge and clicking on the SAMPLE button in the screen display. Sample data will be accumulated until all specified memory (between the buffer boundaries) is filled or input is stopped by pressing the Esc key. A variety of refinements can be used for improved or more efficient results. Default options are a sampling rate of 20 kHz and sound outputting to the monitor speaker; both can be changed from the command menu. A trigger threshold can be set such that sampling will not begin until the input sound reaches a specified amplitude.

The most critical part of sampling is proper setting of the input sound volume. A LISTEN function passes digitized input sound directly through to output. This is useful for initial setting of the input volume. For best results you will need to fine-tune it with the SCOPE function, which acts as an oscilloscope. While monitoring input amplitude on the SCOPE screen display, adjust the sound volume so that the sample waveform just spans the full display range. This maximizes the signal to noise ratio. Too little volume gives quiet samples with more apparent noise; too much volume causes distortion. Frequency content of the input sound can be examined with the SPECTRUM function. This calls up a dynamic bar graph in the display window that tracks real-time changes in the input sound over a 100-to-5,000 Hz range.

After digitization, sample data can be edited to remove unwanted segments or create special effects. Operations supported are cut/paste, copy, insert, delete and clear. These work on user-specified blocks of the sample data buffer set through the display window cursors. A MAGNIFY option can be used to zoom in on user selected data segments for more accurate editing and display. Partitions of the sample data buffer can be assigned to the ST function keys F1 through F10 as PRESETS. Pressing an assigned function key restores the cursor boundaries for its associated sample data segment.

Five special sample manipulation functions are provided: reverse, fade in/out, filter and overlay. Reverse turns around the sample data, similar to playing a record backwards. Fade in/out superimposes a linear volume increase or decrease on the sample data. Filter puts the sample data through a software low-pass filter which may help with aliasing problems at low sampling rates. Overlay lets you combine data segments from a single sample (for chorusing or echoes) or between two different samples.

Sample data can be played back as a single shot or continuously looping. Only the data segment between the current start and stop boundaries will be played. Samples can also be replayed under MIDI control. Two different MIDI modes are supported. The first maps a particular MIDI note to trigger a sample preset; pressing the MIDI key plays that sample. The second mode changes the pitch of the replayed sample in accordance with the MIDI note pressed. Higher notes cause the pitch to go up, lower notes brings the pitch down. This is exactly the way a sampler keyboard works. Pitch shifting can also be done under MIDI control in real-time on the input sound, rather than on a sample data set.


Audio Magic

The Effects program incorporates Replay 4 in a software simulation of an audio effects box. Input sound is manipulated in real-time to add reverb, echo, pitch shift, fade-in or distortion. You must have the cartridge to use this program. Several of the effects parameters can be varied and output can be directed to either the monitor or external speaker. While not of commercial quality, the program is a good example of how Replay 4 can be integrated within an application.


Sounds for the Masses

Replay 4 has become the de facto standard for Atari ST digitized sound. This is due to the ability to playback samples without special hardware and MichTron's legal policy of free use for samples created with the program. As a result, sample data files for Replay 4 have proliferated on national online services, particularly GEnie. There are also public domain programs that can play back the samples and combine them with graphics for a slide/sound show. (Editor's note: For a full-blown sound/animation editing system, START's Audio-Video Sequencer (AVS) from the November 1988 issue lets you combine tracks of sound samples and Cyber Paint animation sequences.)

Several commercial MIDI sample editor programs make use of Replay 4 for auditing sounds. This is much faster and more convenient than having to transfer data between the ST and sampler to check each step of editing.

Going a step farther, MichTron now includes the program DrumBeat (formerly Digidrums) with Replay 4. DrumBeat acts as a software drum machine. You can program rhythm patterns which are played back using digitized drum sounds created through Replay 4. Additional drum samples, in Replay 4 format, can be substituted for the base set. This lets you go from straight rock and roll to latin or orchestral percussion at will.


Conclusions

Overall, I am impressed with the sound quality and potential of Replay 4. This is a great package that offers something for everyone from hobbyist to programmer to teacher. Its acceptance by both commercial and public domain sources ought to promote more digitized sound applications. The sample editor program, however, still needs improvement in its user interface. Having to press the Esc key instead of using the mouse to cancel operations is awkward and just lazy programming. The manual could also benefit from a face lift to add illustrations and a better layout. A table of contents and/or index would also be appreciated along with a summary of the keyboard command equivalents.

The only bug I ran into was a holdover from earlier program versions. If you accidentally try to load a sample file from an empty drive, the standard GEM error box appears stating the drive is not responding. Clicking on the cancel option, the normal response will bomb the program and hang the system. A way around this is to use the START Selector (from START Special Issue #3) in an AUTO folder on your startup disk. Going through this file selector, rather than the default GEM version, I had no problems.

START Contributing Editor Jim Pierson-Perry is a research chemist and semi-professional musician. He lives in Elkton, Maryland.


PRODUCTS MENTIONED

Replay 4, $99.95. MichTron Inc., 576 South Telegraph, Pontiac, MI 48053, (313) 334-5700.