fheader file &rest strings | [Function] |
Sets the header of file to the concatenation of strings.
Example:
? (fheader "test.score" "envelope afn = [(0,0) (.1,1)]" "include frobber.hdr") #<File "test.score">
See Also:
headerfiles file &rest more-files | [Function] |
Returns a list of file names. Directory and file type components are "sticky", so these need to be specified only when they change. file is a file name or a string of file names, each delimited by a comma. more-files is any number of additional file names. The default directory is "~/" and the default file type is ".snd".
Example:
? (files "aa" "snd/bb" "cc") (#p"/user/hkt/aa.snd" #p"/user/hkt/snd/bb.snd" #p"/user/hkt/snd/cc.snd")
See Also:
pathnamesfind-item-stream name &optional errorp | [Function] |
#@name | [Read Macro] |
Returns the item stream named name. If errorp is t (the default), then an error is signaled if the stream does not exist, otherwise nil is returned.
Example:
? (setf x (items 1 2 3 named 'xyz)) #<CYCLIC-ITEM-STREAM Xyz> ? (find-item-stream 'xyz) #<CYCLIC-ITEM-STREAM Xyz> ? #@xyz #<CYCLIC-ITEM-STREAM Xyz>
See Also:
itemsfind-object name &optional errorp | [Function] |
#!name | [Read Macro] |
Returns the object named name. If errorp is t, then an error is signaled if the stream does not exist, otherwise nil is returned. The #! read macro can be used inside the definition of objects to make the referenced object become a subobject of the new container.
Example:
? (thread foo ()) #<THREAD Foo> ? (find-object 'foo) #<THREAD Foo> ? #!foo #<THREAD Foo> ? (thread bar () (object rest) #!foo (object midi-note) #!foo) #<THREAD Bar> ? (list-object #!bar) Bar: 1. #<REST unset 132200061> 2. #<THREAD: Foo> 3. #<MIDI-NOTE |---|------|------| 64| 0|> 4. #<THREAD: Foo>
See Also:
Describing Music Algorithmicallyfind-scale name &optional errorp | [Function] |
Returns the musical scale named name. If errorp is t (the default) then an error is signaled if the scale does not exist, otherwise nil is returned.
Example:
? (find-scale 'standard-chromatic-scale) #<EQUAL-TEMPERED-SCALE Standard-Chromatic-Scale>
See Also:
defscale, list-all-scalesfit number lb ub &optional mode &key :return-type | [Function] |
Forces number to lie between the low bound lb and upper bound ub according to mode. If mode is :reflect (the default), then the boundaries "reflect" the value back into the range. Otherwise, mode is :wrap, which returns the remainder of the value modulus the boundary range.The type of the value returned normally depends on the type of the arguments specified to the function. Use :return-type to force the return value to be either float, integer or ratio. float may be specified as a list (float digits) in which case the floating point return value will be rounded to digitnumber of places.
Example:
? (loop for i from -20 to 20 by 5 collect (fit i 0 10)) (0 5 10 5 0 5 10 5 0)
See Also:
expl, rescalefn function | [Macro] |
Creates a pattern item out of function. The item is funcalled each time it is encountered in the pattern.
Example:
? (setf x (items a (fn #'(lambda () (cons 1 (random 9)))))) #<CYCLIC-ITEM-STREAM 133341111>> ? (read-items x 8) (A (1 . 2) A (1 . 1) A (1 . 6) A (1 . 2))
See Also:
exprformatting-slots (object stream {keyword value}*) {slot | (slot {keyword value}*)}* | [Macro] |
Provides explicit control over printing slot values used when defining methods on write-event and print-object. formatting-slots uses formatting directives to control slot value printing. Directives may be applied globally to all slots or locally to a single slot. A local formatting directive always overrides a global directive with the same name. Directives are specified as keyword value pairs, where keyword is the name of the directive and value is its value.
Object is the object whose slots are to be printed. Stream is the output stream . Following stream comes zero or more global directives. Local directives are specified along with the slots in the body of the macro.
formatting-slots implements the following directives:
In addition to local directives, three special tokens &key, &rest and &optional may appear in the body of formatting-slots. These tokens implement a shorthand for formatting values in "lambda list" format. All slot directives appearing after &key will automatically contain a :print-if value of :bound and a :prefix value equal to the keyword name of the slot.
Example:
Music Kit syntax:
(formatting-slots (object stream :print-if :bound :prefix mk-make-prefix) freq amp)This causes the printed values of freq and amp to be delimited by a space and prefixed by their music kit message names. A typical display would look like:
freq:c4 amp:.9CLM syntax:
(formatting-slots (obj stream :preamble "(fm-violin " :postamble ")" :eol t) time dur freq &key :amp :ampenv)This prints the object in Lisp lambda list syntax. The slots amp and ampenv are treated as lisp keyword values and only appear if they currently have values. A typical display might look like:
(fm-violin 0.0 1.0 440.0 .5 :ampenv '(0 0 1 100))
function | [Pattern] |
Implements user defined pattern description by calling a function each time a new period of items is needed.
function implements the following option value pairs:
Example:
? (let ((n 60)) (setf x (notes in function with #'(lambda () (incf n))))) #<FUNCTIONAL-NOTE-STREAM 132004641> ? (read-items x 10) (CS4 D4 DS4 E4 F4 FS4 G4 GS4 A4 AS4)
See Also:
Item Streams