accumulation | [Pattern] |
Enumerates items together with the set of items that have been enumerated so far. The process starts over when all the items have been collected.
Example:
? (setf x (notes c4 d e f g in accumulation)) #<ACCUMULATING-NOTE-STREAM 131656351> ? (read-items x) (C4 C4 D4 C4 D4 E4 C4 D4 E4 F4 C4 D4 E4 F4 G4)
See Also:
Item Streamsalgorithm | [Class] |
An object that computes musical events. Algorithms are created using the algorithm macro.
Slots declared by algorithm:
See Also:
algorithm [Macro], generator, heap, merge, threadalgorithm name type ({slot value}*) {form}* | [Macro] |
Creates an algorithm object. An algorithm generates musical events of a specified type. name is the name of the algorithm. type is the class of event that the algorithm computes. Following type comes an initialization list containing zero or more slot value pairs. For each pair, slot is the name of a slot in either the algorithm or the musical event, and value is its evaluated initial value. The initialization list is processed once, each time the algorithm is scheduled to begin creating musical events so it is useful for specifying initial states and values that remain constant for all the events generated.
Following the initialization list comes zero or more forms. These forms define the program the algorithm uses to create musical events. Three extensions to standard Common Lisp syntax are supported in program statements:
(algorithm foo midi-note (length 12 amplitude .1) (setf note (item (notes c4 d e f g))) ; set note slot (setf rhythm (between .1 .4)) ; set rhythm slot (setf duration rhythm)) ; set duration slot
Example:
;;; This algorithm reads 8 periods of an 8 note item stream ;;; to generate 64 midi-notes. each midi-note has a rhythm ;;; and duration of .1 seconds. Notes are randomly selected ;;; from 1 octave of the C minor scale. A crescendo is ;;; calculated every 8 events using the algorithm's count ;;; value (how many events have been generated so far) as a ;;; MOD 8 index interpolating between .25 and .75. (algorithm pulse midi-note (rhythm .1 duration .1) (setf note (item (notes c4 d ef f g af bf c5 in random) :kill 8)) ; stops after 8 periods. (setf amplitude (interpl (mod count 8) 0 .25 7 .75)))
See Also:
generator, heap, merge, mute, thread, Describing Music Algorithmically, Working with Algorithms in Real-Timeamplitude | [Item Type] |
A logical amplitude value. A logical amplitude is a floating point number 0 <= number <= 1, or a symbol from the set: niente pppp ppp pp p mp mf f ff fff ffff.
See Also:
amplitude [Function], amplitudesamplitude amp &key :loudest :softest :power | [Function] |
Returns a numeric value for the amplitude amp. :softest is the value to return when the logical amplitude is 0.0, and defaults to *amplitude-minimum*. :loudestis the value to return when the logical amplitude is 1.0, and defaults to *amplitude-maximum*. If the loudest and softest values are both integer then amplitude returns an integer value. :power is the power curve between the softest and loudest value, and defaults to *amplitude-power*. amplitude returns the value:
softest + (loudest - softest) * amp^power.
Example:
? (loop for a to 1 by .25 collect (amplitude a)) (0.0 0.25 0.5 0.75 1.0) ? (loop for a to 1 by .25 collect (amplitude a :power 2)) (0.0 0.0625 0.25 0.5625 1.0) ? (loop for a in '(p mp f ff) collect (amplitude a :softest 0 :loudest 127)) (42 56 84 98)
See Also:
amplitude [Item Type], amplitudes, *amplitude-minimum*, *amplitude-maximum*, *amplitude-power*,*amplitude-maximum* | [Variable] |
The default true maximum amplitude when the logical amplitude is 1.0. If the true maximum and minumum are both integers then amplitude returns integer values. The default maximum is 1.0.
See Also:
amplitude, amplitudes, *amplitude-minimum*, *amplitude-power**amplitude-minimum* | [Variable] |
The default true minimum amplitude when the logical amplitude is 0.0. If the true maximum and minumum are both integers then amplitude returns integer values. The default minimum is 0.0.
See Also:
amplitude, amplitudes, *amplitude-maximum*, *amplitude-power**amplitude-power* | [Variable] |
The default power curve between logical amplitudes 0.0 and 1.0. The default power is 1.0, which causes a linear rise over the range of amplitudes.
See Also:
amplitude, amplitudes, *amplitude-minimum*, *amplitude-maximum*amplitudes {amp}+ {option value}* | [Macro] |
Creates an item stream of amplitude values. Each amp may be an amplitude or an item stream.
amplitudes implements the following options:
Example:
? (setf x (amplitudes p mf mp fff in random for 8)) #<RANDOM-ITEM-STREAM 136712611> ? (read-items x) (0.4 0.6 0.9 0.5 0.6 0.6 0.5 0.5)
See Also:
amplitude [Item Type], Item Streams