next up previous contents
Next: Transforming linkIn into linkOut: Up: A Manual for SAWDUST Previous: Combining elements to form   Contents

Subsections

Combining Links: mingle and merge

mingle and merge are two commands for combining links.

mingle: concatenate a sequence of links

Explanation:

*    mingle
name:        mg1                        # name of mingle
0:        l1                            # constituent links
1:        l2
2:        l3
4:        
statements=    1                        # number of mingle iterations

mingle concatenates a sequence of links:


\begin{displaymath}l1~\rightarrow~l2~\rightarrow~l3~\rightarrow~l1~\rightarrow~l2~\rightarrow~l3~\rightarrow~l1~\rightarrow~~\ldots ~ (etc.)\end{displaymath}

Each link will be played only the number of statements given it. For example, if a mingle consists of links $l1$, $l2$, and $l3$, and if $l1$ was given 6 statements, $l2$ 4 statements and $l1$ 2 statements, when played the mingle will be:


\begin{displaymath}l1~\rightarrow~l2~\rightarrow~l3~\rightarrow~l1~\rightarrow~l...
...~l2~\rightarrow~l1~\rightarrow~l2~\rightarrow~l1~\rightarrow~l1\end{displaymath}

$l1$ will be played 6 times, $l2$ 4 times, and $l3$ 2 times.

The mingle's number of statements determines the number of times the entire sequence will be played.

merge: interlace the constituent elements of a sequence of links

Explanation:

*    merge
name:        mr1                        # name of merge
0:        l1                            # consituent links
1:        l2
statements=    1                        # number of merge iterations

merge takes a sequence of links, and interlaces their constituent elements.

For example, if $l1$ consists of elements ${a1~a2~a3}$, (2 statements) and $l2$ consists of elements ${b1~b2}$ (2 statements), the resulting merge would be:


\begin{displaymath}a1~\rightarrow~b1~\rightarrow~a2~\rightarrow~b2~\rightarrow~a...
...~b1~\rightarrow~a1~\rightarrow~b2~\rightarrow~a2~\rightarrow~a3\end{displaymath}

As in a mingle, each link is played only the number of statements given it.

Calculating the duration and frequency of merges and mingles

Both mingle and merge will create the same frequency, only if all their links contain the same number of elements:


\begin{displaymath}f ~=~ sampling\_rate ~/~ \sum_{i = 0}^N link\_duration_i \end{displaymath}

were $link\_duration_i$ is the duration of the $i$'th link.

If all their links do not contain the same number of elements, determining the frequency is more difficult. In general, the frequency created by a merge will be lower than that of a mingle, since its period length will be longer.

Mingles and merges calculate their durations in the same way:


\begin{displaymath}duration ~=~ M\_statements ~\times~
\sum_{i=0}^N (link\_statements_i ~\times~ link\_duration_i)\end{displaymath}

where $M\_statements$ is the number of statements given to a mingle or a merge.

Examples of a merge and a mingle

Here are two links: link $A$ has three elements, and link $B$ has four elements. Each link is given 3 statements.

1in \includegraphics*{linkB.eps} 3.5in \includegraphics*{linkA.eps}

The elements of link $A$ are a1, a2, a3. The elements of link $B$ are b1, b2, b3, b4.

Below on the left are three statements of a mingle of link $A$ with link $B$. On the right is a merge of $A$ with $B$.

1in \includegraphics*{merge.eps} 3.5in \includegraphics*{mingle.eps}

A mingle concatenates its links; a merge interlaces the constituent elements of its links.


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