MusicKit  0.0.0
MKSynthData Class Reference

MKSynthData objects represent DSP memory that's used in music synthesis. More...

#include <MKSynthData.h>


Detailed Description

MKSynthData objects represent DSP memory that's used in music synthesis.

For example, you can use a MKSynthData object to load predefined data for wavetable synthesis or to store DSP-computed data to create a digital delay. Perhaps the most common use of MKSynthData is to create a location through which MKUnitGenerators can pass data. This type of MKSynthData object is called a patchpoint. For example, in frequency modulation an oscillator MKUnitGenerator writes its output to a patchpoint which can then be read by another oscillator as its frequency input.

You never create MKSynthData objects directly in an application, they can only be created by the MKOrchestra through its allocSynthData:length: or allocPatchpoint: methods. MKSynthData objects are typically owned by a MKSynthPatch, an object that configures a set of MKSynthData and MKUnitGenerator objects into a DSP software instrument.

The methods setData: and setConstant: are used to load a MKSynthData object with data from an array or as a constant, respectively. These methods are simple versions of the more thorough methods setData:length:offset: and setConstant:length:offset:, which allow you to load an arbitrary amount of data into any portion of the SynthData's memory. The data in a MKSynthData object, like all DSP data used in music synthesis, is 24-bit fixed point words (data type DSPDatum). You can declare a MKSynthData to be read-only by sending it the message setReadOnly:YES. You can't change the data in a read-only MKSynthData object.

An instance of MKSynthData consists of an MKOrchAddrStruct, a structure that describes the DSP location of the object's data, and a length instance variable, an integer value that measures the size of the data in DSPDatum words. However, it doesn't contain a copy of the memory itself. When you load data into a MKSynthData, it's instantly sent to the DSP device driver.

DSP memory allocation and management is explained in the MKOrchestra class description; many of the return types used here, such as DSPAddress and DSPMemorySpace, are described in MKOrchestra. In general, the design of the MKOrchestra makes intimate knowledge of the details of the DSP unnecessary.

See also:
MKSynthPatch, MKOrchestra, MKUnitGenerator

The documentation for this class was generated from the following file: