Next Chapter
Previous Chapter
Table of Contents

Describing Musical Layout

It is often useful to experiment with different arrangements, or layouts, of compositional material. The layout macro defines an organization of containers (threads, algorithms, etc.). Unlike macros such as thread, merge and object, which all create new objects, layout provides a language for arranging structure that already exists. By defining different layouts it is possible to experiment with different organizations of the same material. For example, given the existence of four containers A, B, C and D, the example layout:

(layout comp1 (seq a b (mix c d@1)))
defines a sequence of three sections: A, B, and the third section is the mix of C and D in which D starts 1 second after C.

The next example:

(layout comp2 (mix a@1.5 (seq b c)@2 d))
defines a mix of three components: A, the sequence of B and C, and D. The @ appended to some components defines a local start time offset relative to other containers in the mix.


layout name {directive}                               [Macro]
name is the name of the layout, and directive is a single "top level" seq or mix directive:

seq {directive}+
mix {directive}+
Each seq and mix directive may contain sub-directives, which are the names of existing containers or other seq and mix directives. Inside a mix directive, any component may be optionally tagged by a start time offset @time, where time is the initial start time offset of the component in the surrounding mix. For example, foo@5 gives Foo a start time offset of 5 seconds and (seq d a)@.3 a seq directive a start time of .3 seconds. Components begin at mix time 0 by default. It is an error to specify a start time directives outside of a mix directive.

Layout Example

In this example three different layouts, named X, Y and Z, are created out of four threads, named P, I, R and RI, holding the prime, inversion, retrograde and retrograde-inversion forms of a series stream.

(let ((s (series 0 7 8 15 16 11 10 5 6 13 14 21
                 from (notes c4 fs5 fs4 c4)
                 forming (items p i r ri) 
                 returning note)))
  (dolist (x '(p i r ri))
    (thread (name x) ()
      (doitems (n s)
        (object midi-note note n amplitude .5 rhythm .25 
                duration .2))))

  (layout x (seq (mix p i) (mix r ri@1)))
  (layout y (mix (seq p ri)@.75 (seq r i)))
  (layout z (mix (mix i r ri)@1.25 p)))

Stella [Top-Level]: seq p,i,r,ri  
Length of pause between selections: (<cr>=None) 1
Start time offset: (<cr>=None) <cr>
Stella [Top-Level]: seq x,y,z 1,1,0
Stella [Top-Level]: 

Next Chapter
Previous Chapter
Table of Contents