octpch(pch) (init- or control-rate args only) pchoct(oct) (init- or control-rate args only) cpspch(pch) (init- or control-rate args only) octcps(cps) (init- or control-rate args only) cpsoct(oct) (no rate restriction)
These are really value converters with a special function of manipulating pitch data.
Data concerning pitch and frequency can exist in any of the following forms:
name abbreviation octave point pitch-class (8ve.pc) pch octave point decimal oct cycles per second cpsThe first two forms consist of a whole number, representing octave registration, followed by a specially interpreted fractional part. For pch, the fraction is read as two decimal digits representing the 12 equal-tempered pitch classes from .00 for C to.11 for B. For oct, the fraction is interpreted as a true decimal fractional part of an octave. The two fractional forms are thus related by the factor 100/12. In both forms, the fraction is preceded by a whole number octave index such that 8.00 represents Middle C,9.00 the C above, etc. Thus A440 can be represented alternatively by 440 (cps),8.09 (pch), 8.75 (oct), or 7.21 (pch), etc. Microtonal divisions of the pch semitone can be encoded by using more than two decimal places.
The mnemonics of the pitch conversion units are derived from morphemes of the forms involved, the second morpheme describing the source and the first morpheme the object (result). Thus
cpspch(8.09)will convert the pitch argument 8.09 to its cps (or Hertz) equivalent, giving the value of 440. Since the argument is constant over the duration of the note, this conversion will take place at I-time, before any samples for the current note are produced. By contrast, the conversion
cpsoct(8.75 + K1)which gives the value of A440 transposed by the octave interval K1 will repeat the calculation every, K-period since that is the rate at which K1 varies.
N.B. The conversion from pch or oct into cps is not a linear operation but involves an exponential process that could be time-consuming when executed repeatedly. Csound now uses a built-in table lookup to do this efficiently, even at audio rates.