Contents



Going Beyond the Basics (cont'd)

Next
 

Text Output and Formatting (cont'd)

Selecting Text Strings from an Array or List

Suppose you have a set of .wav files containing waveforms, and you want to be able to switch from file to file based on some numeric value or sequence. You could do this easily with a DH_TextArray. This module stores a list of text strings. Each string is given an index, starting at 0. You can load the strings from a text file. Then, the value of the Index input will select which string is output at the Text Out.

Index Text String
0 wave_a.wav
1 wave_b.wav
2 wave_c.wav
... etc.


First, create a text file in your SynthEdit directory that lists the file names, one per line, each followed by a semicolon (;)

wave_a.wav;
wave_b.wav;
wave_c.wav;
... etc.

Enter the name of the text file into the DH_TextArray's File Name, and make sure that the Array Size is set at least as high as the number of .wav files in the list.

Valid index values for the DH_TextArray range from 0 to 1 less than the number of .wav files in the list. Scale your numeric input, if necessary, so that it fits this range.

Connect your scaled input to the DH_TextArray's Index input, and connect the DH_TextArray's Text Out to your wave file player through a Patch Mem - Text.


In general, any time you want to select a text string based on the value of a numeric index, a DH_TextArray would be your choice.

top

Next