Contents



Going Beyond the Basics (cont'd)

Next
 

Text Output and Formatting (cont'd)

Combining Text Strings from Different Sources

DH_TextAppend is a simple module that takes any number of text strings as input, and puts them together into a single string.
"This " "This is easy!"
"is "  
"easy!"  

Consider a modulation routing situation where any of several modulation sources can be connected to any of several destinations. We also want to specify the degree to which each source will affect each destination.

We decide on a multiple-row format. In each row, a source and a destination can be selected by popup menus, and a horizontal slider then controls the amount of effect that source will have on that destination. 4 such rows are illustrated in the image on the right.

Our text display combines 3 text strings: a selection from the list of sources, a formatted slider value, and a selection from the list of destinations.


The source and destination selections will each come from a DH_TextList. All rows will use the same lists of sources and destinations, so the same source and destination list text files can be used by the DH_TextLists in every row.

The slider output can be converted to text by a DH_Format, which lets us control the number of decimal places displayed, and also provides a convenient place to add spaces to separate the value from the source and destination strings. The format string I used is " - %.2f - ".

We do run into a slight complication connecting the DH_TextLists' Text I/O pins to the DH_TextAppend, because they're all on the left side, and SynthEdit won't allow the connections. That's easily solved with a couple of DH_TextRedirectors, so our connections to the DH_TextAppend look like this:


Adding the DH_PopupMenu modules so that the sources and destinations can be selected, and a DH_TextIO for the text display, we get the following structure for the prefab for a row:


 

top

Next