OverviewClamps PackagesCM DictionaryClamps DictionaryFomus

line

Class

line

Enumerates data in sequential order and sticks on the last element once it has been reached.

See generic pattern initializations for documentation on keyword initializations to the pattern.

Examples

;; The line pattern.
(define pat1 (new line :of '(a b c d)))

(next pat1 12)
 (a b c d d d d d d d d d)

(define pat1 (new line :of `(a b c ,(new weighting :of '(d e)))))

(next pat1 12)
 (a b c e e d e d e d d d)
;; Metric figures using line.
(define pat1
  (new heap :of (list (new line :rhythms 's 
                           :for (new weighting :of '(4 6 8)))
                      (new line :rhythms 'e :for 
                           :for (new weighting :of '(2 3)))
                      (new line :rhythms 'q :for 1))))

(define (play-pat reps pat lb ub)
  (process repeat reps
           for r = (* (next pat) .5)
           output (new midi :time (now)
                       :keynum (between lb ub)
                       :duration (* r 2.5))
           wait r))
                 
(events (play-pat 40 pat1 40 80) "test.mid")
 "test.mid"

See Also