Class
transposerA pattern that combines transposition data with transposition offsets to return notes, key numbers or lists of the same. Transposed data may be optionally retrograded and inverted.
transposer supports the following slot
initializations:
:of {list | pattern}:by {note | keynum | pattern}:on can also be used for this
initialization.
:stepping {pattern}:by except that a new transposition
offset is selected each time an element is transposed rather than once
each period.
:form {:p
| :i | :r
| :ri | pattern}
:p
stands for prime, :i for inversion, :r for retrograde and :ri for retrograde-inversion. Either symbols or
keywords can be used to specify the row form. A new row form is read
each time the transposition offset changes.
:mod {number | pattern}:scale {scale}See generic pattern initializations for documentation on additional keyword initializations to the pattern.
;; Wandering chords. (define pat1 (new transposer :of (new weighting :of '(((0 2 6 11) :weight 1) ((0 3 5 10) :weight .25) ((0 4 9 15) :weight .5) ((0 3 11) :weight .5) ((0 8 11) :weight .5))) :stepping (new range :from 60 :to 70 :downto 50 :stepping (new weighting :of '(-1 1 -2 2 -3 3))))) (define (play-pat reps pat rate) (process repeat reps each k in (next pat) output (new midi :time (now) :keynum k :duration (* rate 1.5)) wait rate)) (events (play-pat 50 pat1 .3) "test.mid") ⇒ "test.mid" ;; Random 12-tone generator (define (ran-row end) (let ((rows (new transposer :of (new cycle :of '(0 1 6 -5 10 11 5 16 15 21 26 20)) :on (new weighting :keynums '(c4 cs3 b3 fs4 fs3)))) (rhys (new weighting :of `((t :min 4) (s :min 2) (q :weight 3) (te :min 3) (tq :min 3) ,(new cycle :of '(e. s)) (e :weight 2)))) (amps (new weighting :of '((mf :weight 7) (mp :weight 3) p)))) (process while (< (now #t) end) for k = (next rows) for r = (rhythm (next rhys) 70) for a = (amplitude (next amps)) output (new midi :time (now) :keynum k :amplitude a :duration r) wait r ))) (events (ran-row 30) "test.mid") ⇒ "test.mid"