MusicKit  0.0.0
MKTuningSystem Class Reference

A MKTuningSystem object represents a musical tuning system by mapping key numbers to frequencies. More...

#include <MKTuningSystem.h>


Detailed Description

A MKTuningSystem object represents a musical tuning system by mapping key numbers to frequencies.

The method -setFreq:forKeyNum: establishes a frequency/key number correspondence, defining the frequency value (in Hertz) for a specified key number. To tune a key number and its octaves at the same time, invoke the method setFreq:forKeyNumAndOctaves:. The frequencies in a MKTuningSystem object don't have to increase as the key numbers increase - you can even create a MKTuningSystem that descends in pitch as the key numbers ascend the scale. The freqForKeyNum: method retrieves the frequency value of the argument key number. Such values are typically used to set the frequency of a MKNote object:

[aNote setPar: MK_freq
toDouble: [aTuningSystem freqForKeyNum: c4k]];

The MKTuningSystem class maintains a master system called the installed tuning system. By default, the installed tuning system is set to 12-tone equal-temperament with A above middle C set to 440 Hz. A key number that doesn't reference a MKTuningSystem object takes its frequency value from the installed tuning system. The frequency value of a pitch variable is also taken from the installed system. The difference between key numbers and pitch variables is explained in the section entitled Representing Music Data. The entire map of key numbers, pitch variables, and frequency values in the default 12-tone equal-tempered system is given in the section entitled Music Tables.

You can install a tuning system by sending the install message to a MKTuningSystem object. Keep in mind that this doesn't install the object itself, it simply copies its key number-frequency map. Subsequent changes to the object won't affect the installed tuning system (unless you again send the object the install message).

Note that while key numbers can also be used to define pitch for MKNotes used in MIDI performance, the MKTuningSystem object has no affect on the precise frequency of a MKNote sent to a MIDI instrument. The relationship between key numbers and frequencies on a MIDI instrument is set on the instrument itself. (An application can, of course, use the information in a MKTuningSystem object to configure the MIDI instrument).


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