SSCSSS Version 2.0 - Tutorial - 10

Tutorial 10 - Complex Conditions

So far, each split has had only one condition. Conditions can be combined in two ways. Call the conditions seen so far "simple conditions". For a list of simple conditions, the harmonic must satisfy all of the conditions to be included in the wave. The second way is more complex. General Boolean combinations of simple conditions may be specified using Reverse Polish Notation (RPN) with "and", "or", and "not" as the Boolean operators.

Example 13

The simpler case, an "AND" list.

# Example  13 starts on the next line --

file ex13

voice ex13 Wv 0 28 103
set
filter lowpass 0 -6
split 4
condition < 4
split 4
condition >= 4
condition < 7
split 4
condition >= 7

# Example 13 ends on the previous line --

The first wave gets harmonics less than 4, or harmonics 1 through 3.

The second wave gets harmonics greater than or equal to 4 AND less than 7, or harmonics 4 through 6.

Finally, the third wave gets all harmonics greater than or equal to 7.

Example 14

General Boolean combinations of simple conditions can be altogether too complicated if you are not already familiar with such things, but one simple case can be useful. If you want to specify that a harmonic satisfying any of some set of conditions be included, as opposed to all, end the list with the word "or" (lower case required) repeated one less times than there are simple conditions.

# Example  14 starts on the next line --

file ex14

voice ex14 Wv 0 28 103
set
filter lowpass 0 -6
split 4
condition % 5 1
condition % 5 3
condition % 5 0
condition or
condition or
split 4
condition % 5 2
condition % 5 4
condition or

# Example 14 ends on the previous line --

The first wave gets every fifth harmonic starting with 1 OR 3 OR 5. (That is -- 1,3,5,6,8,10,11,13,15, ...)

The second wave gets every fifth harmonic starting with 2 OR 4. (That is -- 2,4,7,9,12,14, ...)