The MusicKit defines a set of Objective C classes and informal protocols, C functions, and assorted constants and data types that are useful for creating music, sound, DSP and MIDI applications under NeXTSTEP, OpenStep, Windows9X, MacOS X and MacOS X-Server V1.2.
The MusicKit provides a set of music
representation classes―most notably
MKNote
, MKPart
and
MKScore
, as well as
MKEnvelope
, MKWaveTable
,
MKTimbre
, and
MKPartial
s―that provide a flexible
high-level structure for musical data. The
MusicKit also provides a number of file
formats for storing these structures. ScoreFile
is a simple text-based scripting language that allows musical data to
be represented in a convenient, human-readable form and supports
simple programming structures. Alternatively, the
MusicKit supports reading and writing
musical data as Standard MIDI files, binary
scorefiles (called “playscore files” for historical
reasons) and NeXTSTEP archived objects. The
MusicKit's representation system includes a
number of enormously valuable features. The noteTag
construct supports representation of phrase structure and makes it
easy to create effects such as legato, which require continuity from
one note to the next. The noteUpdate
construct
allows any aspect of a sounding note to be changed at any time.
The MusicKit makes scheduling and
sequencing extremely simple. A MusicKit
"performance" consists of sending scheduled Objective-C messages and
handling asynchronous events such as incoming MIDI
and NeXTSTEP events. The
MKConductor
class is in charge of dispatching
all messages and managing the notion of time. A
MKConductor
may have a tempo, a time map, or
may be set to synchronize to MIDI time code. Since
all time control is managed in the MKConductor
itself, the difference between these time representations is
completely transparent.
Another aspect of the MusicKit performance
is a dynamically patchable MKNote
-handling
network consisting of three classes,
MKPerformer
s,
MKNoteFilter
s and
MKInstrument
s.
MKPerformer
subclasses are
MKNote
-generators, that sequence over
NSArray
s of MKNote
s or
create MKNote
s on the fly. They contain outputs
that may be connected to MKNoteFilter
s or
MKInstrument
s. MKInstrument
subclasses realize MKNote
s in some manner, for
example by playing them on the DSP or via
MIDI, and contain inputs that may be connected to
MKNoteFilter
s or
MKPerformer
s. MKNoteFilter
s
are intermediate processors that contain both inputs and outputs. This
scheme makes it easy to create a performance scheme for nearly any
application. The inputs and outputs are represented as
MKNoteSender
s and
MKNoteReceiver
s, respectively.
The MusicKit's performance apparatus is based on the notion that messages execute quickly. Thus, time stays constant during the execution of a scheduled or event-triggered message. This has the advantage of allowing a large number of DSP updates to happen at the exact same time. The DSP and MIDI driver support time-ordered queues of events, thus allowing the application some latitude in computing these updates, while still providing an instantaneous execution of the updates themselves.
The MusicKit has extensive support for
sound processing and synthesis on multiple DSP
chips. Instances of the MKOrchestra
class
correspond to DSP chips and manage dynamic memory
and processing time allocation. Full dynamic loading during a
performance is supported. Synthesis insruments are represented as
MKSynthPatch
subclasses. The
MusicKit SynthPatch library is an auxiliary
library that consists solely of MKSynthPatch
subclasses, each of which implements a generic synthesis
technique. For developers or composers who want to create their own
synthesis or processing configuration, the
MKUnitGenerator
class is provided. Each
MKUnitGenerator
subclass corresponds to a
DSP module such as a filter, oscillator, or delay
unit. By interconnecting these MKUnitGenerator
s
using "patchpoints", a huge variety of synthesis and processing
techniques may be implemented. The
MusicKit UnitGenerator library is an
auxilliary library that consists solely of
MKUnitGenerator
subclasses. Finally,
adventurous developers may write their own DSP unit
generators in MC56001 assembly language (using
an extensive set of macros to simplify the process) and use the tool
dspwrap to automatically generate Objective-C
MKUnitGenerator
subclasses.
Currently, only the MC56001 is supported. The
ArielQP
and ArielQPSat
classes support the Ariel QuintProcessor hardware, available for the
NeXTcube.