next up previous contents
Next: Transforming linkIn into linkOut: Up: A Manual for SAWDUST Previous: Combining Links: mingle and   Contents

Subsections

Transforming linkIn into linkOut: vary

vary transforms an initial link into a final one. The two links to not have to have the same number of elements: if they are different, Sawdust silently adds ``zero'' elements to the smaller of two links. (A ``zero'' element is one whose amplitude and duration are set to zero.)

The following description is by Gary Grossman, Sawdust's principal designer and implementer:

When a vary object is played, Sawdust selects polynomials that connect the amplitude value of each element of the first link with the amplitude value of the corresponding element of the last link. It does the same for the sample hold values of the corresponding elements of the two links. After first playing a single iteration of the first link, it computes and plays a new link at each iteration, according to the evaluation of the polynomial for each amplitude and sample hold value, for the number of iterations given as its repeat specification.

The polynomials can be of degrees 3 to 7.

Here are plots of the polynomials used by vary:

1in \includegraphics*{poly4.eps} 3.5in \includegraphics*{poly3.eps}

\includegraphics*{poly5.eps}
1in \includegraphics*{poly7.eps} 3.5in \includegraphics*{poly6.eps}

The above plots show the variety of paths which can be followed by the amplitude and sample values of each element.

The algorithm for vary

vary makes a transformation from the first link to the last link. These links do not have to have the same number of elements. If one link has fewer elements than the other, Sawdust silently adds zero-valued elements to the link with fewer elements.

Each element in the first link is connected to its corresponding element in the last link with a polynomial. At each step of the transformation, the magnitude of each elements' amplitude and duration are changed, as determined by its polynomial.

Thus, the amplitude and sample value for each element may follow different polynomials, and so their transformations may be independent of each other.

As the amplitudes raise and lower, following their polynomial, they will increase up to 4096, and lower down to zero.

The sample values, on the other had, will grow and shrink only up to user-determined amounts (see upper and lower sample bounds? below).

The command vary

To define a vary, you must input

A name for the vary.

The initial and final link names

Whether the last link will be played.

Whether you want to specify the transformation duration in terms of steps or time.

Whether the roots of the polynomial should be frozen for each statement of the vary.

The polynomial degrees for the amplitude and and sample values.

The upper and lower bounds for the samples.

The number of statements (iterations) of the vary.

Example:

    *    vary
    name:        v2                    
    first link name:    l1            
    (samples = 60)
    last link name:        l2
    (samples = 100)
    play last link?        y            
    steps or time?        time        
    time=            441000            
    freeze?            y                
    4 elements in link
    amplitude degrees:    3 4 5 6        
    sample degrees:        6 5 4 3        
    upper sample bounds =    10000    
    lower sample bounds =    0
    statements=    1

Explanation:

    *    vary
    name:        v2                 # name of vary (identifier)

    first link name:    l1          # name of the first link
    (samples = 60)                  # Sawdust reports first link duration
    last link name:        l2       # name of the last link
    (samples = 100)                 # Sawdust reports last link duration

    play last link?        y        # 

    steps or time?        time      # calculate the transition with
                                    # 'number of steps' or 'samples'?
    
    time=            441000         # duration of transformation in samples

    freeze?            y            # at each 'statement', either use
                                    # the same zero crossings
                                    # (freeze=y), or 'jiggle' them randomly 
                                    # a little bit.

    4 elements in link
    amplitude degrees:    3 4 5 6   # polynomial degrees for each amplitude
    sample degrees:        6 5 4 3  # polynomial degrees for each sample

    upper sample bounds =    10000  # limits
    lower sample bounds =    0

    statements=    1                # how many times should it be played?

steps or time?

The question steps or time? asks if the vary's duration should be calculated in terms of steps (the number of steps you wish the transformation to take) or time (the number of samples you wish the transformation to take).

The calculation of steps or time is made using the following functions:


\begin{displaymath}time ~=~ {steps \over 2}~(first\_link\_samples ~+~ last\_link\_samples)\end{displaymath}


\begin{displaymath}steps ~=~ { { 2 \times time } \over
first\_link\_samples ~+~ last\_link\_samples}\end{displaymath}

freeze?

The question freeze? asks whether the zero-crossings of the polynomials should remain the same from statement to statement, or whether they should change.

If freeze? is answered ``y'', then each statement of the vary will be identical with the others.

If freeze? is answered ``n'', then a small, random value will be added to each zero-crossing, and thus each statement of the vary will be different from the others.

amplitude and sample degrees

This assigns a polynomial to the elements in the links. If the first and last links do not have the same number of elements, ``zeroed'' elements are added to the one with fewer elements.

    4 elements in link
    amplitude degrees:    3 4 5 6   # polynomial degrees for each amplitude
    sample degrees:       6 3       # polynomial degrees for each sample

In the above example, Sawdust reports there are 4 elements in the link.

It then asks for the polynomials to be assigned to the amplitudes. In the response above, the first element's amplitude is given a 3rd degree polynomial, the second element's amplitude is given a 4th degree polynomial, the third a 5th degree, and the fourth a 6th degree polynomial.

Sawdust then asks for the sample assignments. In the above example, the first element's sample is given a 6th degree polynomial, and the second, third, and fourth elements are all given a 3rd degree polynomial.

If you type in fewer degree values than there are elements, Sawdust will take the last degree value, and apply it to the remaining elements. (This applies to the amplitudes as well.)

upper and lower sample bounds

The upper and lower sample bounds assigns limits to how long and short a sample value can become.

As a rule of thumb, 100 and 10 are good uppper and lower bounds.

The lower bound cannot be less than 0.

For elucidation, if the upper bound is set at 1000, that means that an element could have the frequency $sampling\_rate ~/~ 1000$ which at the sampling rate of 44100 samples per second, means a frequency of 44 Hz., which is pretty low. If you make the upper bound greater than that, the frequency will be even lower.

statements

statements is the number of times the vary will be repeated.


next up previous contents
Next: Transforming linkIn into linkOut: Up: A Manual for SAWDUST Previous: Combining Links: mingle and   Contents
Arun Chandra 2001-05-18