#import <DSPSerialPortDevice.h>
Public Member Functions | |
(id) | - setUpSerialPort: |
This is invoked by Orchestra open to set up the serial port. | |
(id) | - setSendsSettings: |
Set whether settings, such as the sampling rate are sent by the object (via the SCI port) to the device. | |
(BOOL) | - sendsSettings |
Returns value of sendsSettings instance variable. | |
(BOOL) | - supportsSamplingRate: |
This method returns YES if the device supports the specified sampling rate or if that sampling rate is obtainable as half of one of the sampling rates the device supports. | |
(BOOL) | - hardwareSupportsSamplingRate: |
This returns YES if rate is a sampling rate actually supported by the device. | |
(int) | - hardwareSupportedSamplingRates: |
This method mallocs and returns in *rates an array of sampling rates supported by the hardware. | |
(BOOL) | - supportsHalfSamplingRate: |
This returns YES if rate is available only as half of one of the sampling rates supported by the hardware. | |
(double) | - defaultSamplingRate |
This method returns a default sampling rate for this device. | |
(int) | - inputSampleSkip |
Returns samples skipped for sound input (i.e. | |
(int) | - outputSampleSkip |
Returns samples skipped for sound output (i.e. | |
(int) | - inputInitialSampleSkip |
Returns samples initially skipped for input. | |
(int) | - outputInitialSampleSkip |
Returns samples initially skipped for output. | |
(int) | - inputChannelCount |
Returns number of input sound channels. | |
(int) | - outputChannelCount |
Returns number of output sound channels. | |
(int) | - inputPadding |
Returns number of extra samples to append to each input sample frame. | |
(BOOL) | - setUpAfterStartingSoundOut |
This is invoked by Orchestra open to determine whether to send setUpSerialPort: before or after calling DSPMKStartSoundOut(). | |
(id) | - unMuteSerialPort: |
This is invoked by Orchestra open to unmute the serial port device. | |
(id) | - closeDownSerialPort: |
Subclass may override this method to do any special muting or other things needed for clean shut-down. | |
(id) | - adjustMonitor:forOrchestra: |
Implement this to make any adjustments to the DSP monitor before it is loaded. |
SSAD64x Singular Solutions AD64x ADC & DAT interface. StealthDAI2400 Stealth DAI2400 DAT interface. ArielProPort Ariel ProPort interface.
These class descriptions appear at the end of this document. The file DSPSerialPortDevice.h contains the interface declarations for these classes. It also contains defines for "classes" that are fully represented by the DSPSerialPortDevice class itself:
ArielDigitalMic Ariel Digital Microphone MRDigitalEars Metaresearch Digital Ears
To use a DSPSerialPortDevice or subclass instance, you simply send the orchestra instance the message setSerialPortDevice: with an argument of your DSPSerialPortDevice instance. In order to access the device for sound output, you must also send to the orchestra the message setSerialSoundOut:YES. Similarly, to access the device for sound input, you must send the orchestra setSerialSoundIn:YES. To find out if you can use a particular sampling rates, you send the message supportsSamplingRate: to the DSPSerialPortDevice or subclass instance. To find the default sampling rate, send it the message defaultSamplingRate.
To implement a new DSPSerialPortDevice subclass for a new device, you override a number of methods. The most important is setUpSerialPort:. Other methods you might want to override include hardwareSupportedSamplingRates:, inputSampleSkip and outputSampleSkip.
The DSPSerialPortDevice class also supports "half sampling rates". For example, if the hardware supports 44100, 48000 and 32000, then the Music Kit software will also allow the device to be used at 22050, 42000 and 16000. These half sampling rates are entirely automatic - the designer of a subclass need not think about this at all. He need only implement hardwareSupportedSamplingRates:.
If you have several Orchestra instances (for example, if you have a cube with an Ariel QuintProcessor) and each has its own serial port, each can have its own instance of DSPSerialPortDevice or one of its subclasses.
- (id) setUpSerialPort: | (id) | orchestra |
This is invoked by Orchestra open to set up the serial port.
orchestra | is an id. |
Reimplemented in SSAD64x, StealthDAI2400, and ArielProPort.
- (id) setSendsSettings: | (BOOL) | yesOrNo |
Set whether settings, such as the sampling rate are sent by the object (via the SCI port) to the device.
yesOrNo | is a BOOL. |
- (BOOL) sendsSettings |
Returns value of sendsSettings instance variable.
- (BOOL) supportsSamplingRate: | (double) | rate |
This method returns YES if the device supports the specified sampling rate or if that sampling rate is obtainable as half of one of the sampling rates the device supports.
rate | is a double. |
return ([self hardwareSupportsSamplingRate:rate] || [self hardwareSupportsSamplingRate:rate*2])
Subclass should not override this method, but should implement hardwareSupportedSamplingRates: instead.
- (BOOL) hardwareSupportsSamplingRate: | (double) | rate |
This returns YES if rate is a sampling rate actually supported by the device.
rate | is a double. |
- (int) hardwareSupportedSamplingRates: | (double **) | rates |
This method mallocs and returns in *rates an array of sampling rates supported by the hardware.
rates | is a double **. |
Reimplemented in SSAD64x, StealthDAI2400, and ArielProPort.
- (BOOL) supportsHalfSamplingRate: | (double) | rate |
This returns YES if rate is available only as half of one of the sampling rates supported by the hardware.
rate | is a double. |
return ([self supportsSamplingRate:rate] && ![self hardwareSupportsSamplingRate:rate]);
- (double) defaultSamplingRate |
This method returns a default sampling rate for this device.
- (int) inputSampleSkip |
Returns samples skipped for sound input (i.e.
Reimplemented in SSAD64x.
- (int) outputSampleSkip |
Returns samples skipped for sound output (i.e.
Reimplemented in SSAD64x.
- (int) inputInitialSampleSkip |
Returns samples initially skipped for input.
- (int) outputInitialSampleSkip |
Returns samples initially skipped for output.
- (int) inputChannelCount |
Returns number of input sound channels.
- (int) outputChannelCount |
Returns number of output sound channels.
- (int) inputPadding |
Returns number of extra samples to append to each input sample frame.
- (BOOL) setUpAfterStartingSoundOut |
This is invoked by Orchestra open to determine whether to send setUpSerialPort: before or after calling DSPMKStartSoundOut().
- (id) unMuteSerialPort: | (id) | orchestra |
This is invoked by Orchestra open to unmute the serial port device.
orchestra | is an id. |
Reimplemented in SSAD64x.
- (id) closeDownSerialPort: | (id) | orchestra |
Subclass may override this method to do any special muting or other things needed for clean shut-down.
orchestra | is an id. |
Reimplemented in SSAD64x.
- (id) adjustMonitor: | (DSPLoadSpec *) | system | ||
forOrchestra: | (id) | orchestra | ||
Implement this to make any adjustments to the DSP monitor before it is loaded.
system | is a DSPLoadSpec *. | |
orchestra | is an MKOrchestra *. |