M


Intro       Symbols A B C D E F G H I J K L M N O P Q R S T U V W X Y Z       Index  
M4C [Syntax]

The M4C syntax implements score file output for M4C, a sound synthesis language developed by James Beauchamp at the University of Illinois.

See Also:

m4c-note, m4c-score-file

 


m4c-note [Class]

An abstract class defining score file output forall M4C note classes: Pl, Pladsr, Glide, GL1-10, GFins, Buzz, PMins, PMeins, cornet, clarinet, alt_sax, piano. Instrument parameter names are documented in the M4C tutorial. Exceptions to the tutorial are:

m4c-note declares the following slots:

ins {string | symbol}
Holds the name of the M4C instrument that will play the note. Defaults to the name of the note class.
Additional slots are inherited from note.

See Also:

M4C, defobject,

 


m4c-score-file [Class]

An event stream class implementing M4C score files. This class is automatcally chosen when you specify a file with a .sc extension.

m4c-score-file declares the following slots:

orchestra {filename}
The filename of the M4C orchestra to process the score file. Defaults to "/usr/CMP/m4c/m4c/classorch/m4c.class".
args {string}
Optional arguments to pass to the orchestra. Defaults to "-NH -e".
output {filename}
The sound file to compute. Defaults to name.snd, where name is the name of the score file.
channels {integer}
The number of channels for the sound file. Defaults to 1.
srate {integer}
The sampling rate of the sound file. Defaults to 22050.
play {t | nil}
If t (the default) the sound file is played after it is computed.
listing {filename}
The listing file to write. Defaults to name.list, where name is the name of the score file.
Additional slots are inherited from event-stream.

See Also:

event-stream, M4C

 


make-item-stream type pattern items &rest keywords [Function]

Creates an item stream of the specified type and pattern. Items is the list of items. keywords are item stream macro options specified using their Lisp keyword form.

Example:

;;; same as (notes c4 d e f g in heap for 10)

? (setf x (make-item-stream 'notes 'heap '(c4 d e f g) :for 10))
#<HEAP-NOTE-STREAM 133074501>

? (read-items x)
(D4 G4 F4 E4 C4 F4 C4 D4 E4 G4)

See Also:

Item Streams

 


map-data function stream [Function]

Maps function over each item in stream. Function is passed one argument, the currently mapped item. Note that items are often transformed into an internal form different than what was externally specified to the item stream.

Example:

(defun stream-list (stream)
  (let ((l '()))
    (map-data #'(lambda (x) (push x l)) stream)
    (nreverse l)))

(defun stream-items (stream)
  (let ((l '()))
    (map-data #'(lambda (x)
                    (if (typep x 'item-stream)
                        (push (stream-items x) l)
                        (push x l)))
               stream)
    (nreverse l)))

See Also:

doitems, item, read-items

 


*mapping-level* [Variable]

Controls the depth that containers are recursively visited when mapped by commands in Stella. The default value is 1, which means that subobjects but not subcontainers of a mapped container are visited. Set to t to enable full recursion.

 


*mapping-mode* [Variable]

Determines the type of object mapped by commands in Stella. The value may be :data or :containers. The default value is :data.

 


merge [Class]

An object that accesses subcontainers in parallel. merge uses a scheduling queue to ensure that the musical events produced by its subcontainers appear in the proper, time sorted order.

merge inherits its slots from container.

See Also:

algorithm, generator, heap, merge [Macro], thread

 


merge {name} ({slot value}*) {form}* [Macro]

Defines a merge object. Macro syntax is otherwise identical to that of thread.

Example:

(merge moo ()
  (thread sub1 ()
    (object midi-note note 'b2 rhythm 1 duration 1 amplitude .5)
    (object midi-note note 'f3 rhythm 2 duration 2 amplitude .7))
  (let ((rhy .1) (dur .2) (amp .5))
    (thread sub2 ()
      (doitems (x (notes c4 d ef f g in random for 10))
        (object midi-note note x rhythm rhy
                duration dur amplitude amp)))))

See Also:

algorithm, generator, heap, mute, thread, Describing Music Algorithmically

 


message-case message {(type {form}*)}* [Macro]

Conditional evaluation based on MIDI message types. A clause is selected if its type matches the MIDI type of message. In addition to the message types enumnerated in MIDI Message Types, message-case supports the following abstract types:

key-down
A note-on with a velocity greater than zero. This filters out note-on messages with zero velocity, which MIDI interprets as note-off messages.
key-up
Either a note-off or a note-on with zero velocity.
{t | else}
A clause with either of these types is evaluated if none of the previous clauses matched the actual type of the message.

See Also:

MIDI Support in Common Music, Working with Algorithms in Real-Time

 


MIDI [Syntax]

Common Music implements 32 channel, direct-to-driver MIDI support for the Mac, NextStep and SGI, and 16 channel midi file support on all platforms. Common Music reads and imports single and multi-track (level 0 and 1) files and writes level 0 files. Most functions and macros related to MIDI are documented in MIDI Support in Common Music.

See Also:

midi-file, midi-port, midi-message, midi-note, MIDI Support in Common Music, Working with Algorithms in Real-Time

 


midi-file [Class]

An event stream class implementing MIDI score files. This class is automatcally chosen when you specify a file with a .midi extension.

midi-file implemnts the following slots:

chanmap {sequence}
An optional channel map used to resolve 32 logical MIDI channels to the 16 true channels in each MIDI serial port. The map is expressed as a list or vector of 32 lists (c p), where c is the true channel (0-15) and p is the port number (0-1).
divisions {integer}
The number of divisions per quarter note. Defaults to 96.
timesig {list}
The time signature for the file. Defaults to (4 4). The time signature list may contain up to four values: (n d &optional clocks-per-quarter 32nds)
tempo {number}
The tempo of the file. Defaults to the standard MIDI tempo 120.

Stella's import command supports the following options for MIDI files:

start {number}
A start time in the file to start importing. Defaults to the beginning of the file.
end {number}
The end time in the file to stop importing. Defaults to the end of the file.
track {integer}
The track number to import. Defaults to 0.
container {name}
The container to place imported data in. If nil (the default) then the data is imported to a new thread named after the midi file.
note-type {note | pitch | degree}
Determines how MIDI key numbers in the file are represented in the imported data. Default to note.

See Also:

import command, MIDI, midi-port

 


midi-message [Class]

Represents a raw MIDI message of any type. Most useful for representing control, meta and system messages. In particular, it is much easier use the midi-note class for representing MIDI note values than to code seperate note on and note of pairs using midi-message.

Slots declared by midi-message:

message {integer}
The midi message, represented as a formatted 28 bit fixnum. See MIDI Support in Common Music for more infomation on MIDI messages.
data {list}
A list of any additional data bytes.
Additional slots are inherited from note.

Example:

? (object midi-message rhythm 0 message (make-control-change 0 60 60))
#<CtrlChng: 0, 60, 60>

See Also:

MIDI, midi-note,

 


midi-note [Class]

Creates a MIDI note-on and note-off pair out of a more general representation of frequency, rhythm, duration and amplitude.

Slots declared by midi-note:

channel {integer}
A MIDI channel number between 0 and 31. Defaults to 0.
note {note | degree | pitch}
The frequency expressed as a note, degree or pitch reference.
duration {number}
The duration of the note in seconds or milliseconds depending on the current clock mode. Duration defaults to the value of rhythm.
amplitude {number}
A logical amplitude 0.0 < 1.0 or an integer MIDI velocity 0 to 127. Defaults to 64.
release {number}
An logical note off velocity 0.0 < 1.0 or an integer MIDI velocity 0 to 127. Defaults to 127.
Additional slots are inherited from note.

Example:

;;; this algorithm generates 80 midi-notes. sin is used to compute
;;; four periods of note values expressed as integer scale degrees
;;; (key numbers) ranging between 20 and 100. the amplitude, rhythm
;;; and duration of each midi-note is constant.

(algorithm sinus midi-note (length 80 amplitude 0.5 
                                   rhythm 0.1 duration 0.1)
  (setf note
        (round (rescale (sin (* 2pi (/ count length) 4))
                        -1 1 20 100))))

See Also:

MIDI, midi-message

 


midi-port [Class]

An event stream class implementing direct-to-driver MIDI input and output in some ports of Common Music.

midi-port implements the following slots:

to {symbol}
The name of the MIDI port. Possible port names are A, :A, B, :B, Phone or Printer. Defaults to A.
chanmap {vector}
An optional channel map for the stream. If supplied, the value is a 16 element vector of channel numbers. The channel of each event becomes an index into this vector to determine the true channel in the stream.

See Also:

MIDI, midi-file

 


*midi-preferences* [Variable]

Macintosh only. A list of the known midi drivers and ports, sorted in descending order according to their relative preference. The default value is ((:apple :oms :mtp :midiqt) (:a :b)). Note that the MidiQT extension and QuickTime Midi Player share a keyword, i.e. :midiqt. The variable's primary use is to provide midi-open with the means to discriminate between multiple possibilities, whenever it it is called without parameters.

 


mirror stream [Macro]

Enumerates a period of items from the item stream stream followed by a strict retrograde of that period. stream may implement any pattern.

Example:

? (setf x (mirror (items a b c d in heap)))
#<FUNCTIONAL-ITEM-STREAM 137562641>

? (read-items x 16)
(A D B C C B D A D C B A A B C D)

See Also:

repeat, retrograde

 


mode-degree reference mode [Function]

Quantizes referenceto a degree in mode. Reference may be a note, degree, or pitch.

Example:

? (setf m (defmode (whole-tone on 'c4) 2 2 2 2 2 2))
#<MODE: Whole-Tone (on C)>

? (mode-degree 'cs4 m)
60

? (mode-degree 63 m)
62

See Also:

defmode, mode-note, mode-pitch

 


mode-note reference mode [Function]

Quantizes referenceto a note name in mode. Reference may be a note, degree, or pitch.

Example:

? (setf m (defmode (whole-tone on 'c4) 2 2 2 2 2 2))
#<MODE: Whole-Tone (on C)>

? (mode-note 'cs4 m)
C4

? (mode-note 63 m)
D4

See Also:

defmode, mode-degree, mode-pitch

 


mode-pitch reference mode [Function]

Quantizes referenceto a pitch in mode. Reference may be a note, degree, or pitch.

Example:

? (setf m (defmode (whole-tone on 'c4) 2 2 2 2 2 2))
#<MODE: Whole-Tone (on C)>

? (mode-pitch 'cs4 m)
261.625

? (mode-pitch 63 m)
293.66

See Also:

defmode, mode-degree, mode-note

 


multiple-item-bind ({var}+) {item} {form}* [Macro]

Binds each var to a field of the multiple-item item within the scope of the macro.

See Also:

defmultiple-item

 


MusicKit [Syntax]

Produces score file input and output for the Music Kit, a sound synthesis package implemented in Objective C on the NeXT Computer. The Music Kit is developed by David Jaffe at CCRMA, Stanford University. Visit the Music Kit home page.

The Music Kit syntax provides note definitions for all predefined Music Kit instruments.

See Also:

music-kit-note

 


music-kit-note [Syntax]

An abstract class defining the basic set of slots available to all music kit note classes: Wave1vi, Wave1i, Pluck, Mixsounds, Mkmidi, Fm2pvi, Fm2pnvi, Fm2cvi, Fm2cnvi, Fm1vi, Fm1i, Dbwave2vi, Dbwave1vi, Dbfm1vi).

Slots declared by music-kit-note:

type {:duration | :noteOn | :noteOff | :noteUpdate | :mute}
The Music Kit note type of the note. Defaults to :duration.
tag {integer}
The Music Kit note tag of the note.
part {info
The part info name defining the Music Kit part of the note. Defaults to the part class of the note.
Additional slots are inherited from the note class.

See Also:

MusicKit

 


mute {name} ({slot value}*) {form}* [Macro]

Defines an algorithm that does not output events. A muted algorithm may be used in conjunction with sprout to create musical structure dynamically. Except for the lack of note class specification, macro syntax is identical to algorithm.

Example:

(mute hush (length 10)
  (vars (s (notes c4 fs c5 fs c6 fs in heap)))
  (setf rhythm (item (rhythms q e h in random)))
  (let ((o (item s)))
    (format t "~%Sprouting algorithm at ~S." time)
    (sprout
      (algorithm nil midi-note (start time length (between 20 50)
                                rhythm .1 duration .1
                                amplitude .5)
        (setf note (item (intervals 0 1 2 3 in random
                                    from o)))))))

See Also:

algorithm, generator, heap, merge, thread, Describing Music Algorithmically