
PITCH CONVERTERS

.nf
			\fBoctpch\fR(pch)	(init- or control-rate args only)
			\fBpchoct\fR(oct)	   "		"
			\fBcpspch\fR(pch)	   "		"
			\fBoctcps\fR(cps)	   "		"
			\fBcpsoct\fR(oct)	(no rate restriction)
.fi
.sp .5
where the argument within the parentheses may be a further expression.

These are really \fBvalue converters\fR with a special function of
manipulating pitch data.

Data concerning pitch and frequency can exist in any of the following
forms:

.nf
	name					abbreviation
.sp .5
	octave point pitch-class (8ve.pc)			\fBpch\fR
	octave point decimal				\fBoct\fR
	cycles per second				\fBcps\fR
.fi

The first two forms consist of a whole number, representing octave
registration, followed by a specially interpreted fractional part.  For
\fBpch\fR the fraction is read as two decimal digits representing the 12
equal-tempered pitch classes from .00 for C to .11 for B.  For \fBoct\fR,
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 (\fBcps\fR), 8.09 (\fBpch\fR), 8.75
(\fBoct\fR), or 7.21 (\fBpch\fR), etc.  Microtonal divisions of the
\fBpch\fR 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

.nf
			\fBcpspch\fR(8.09)
.fi

will convert the pitch argument 8.09 to its c.p.s. (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

.nf
			\fBcpsoct\fR(8.75 + K1)
.fi

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.
.sp .5
\fBN.B\fR.  The conversion from \fBpch\fR or \fBoct\fR into \fBcps\fR is not
a linear operation but involves an exponential process which may be
time-consuming if executed repeatedly at audio rates.  Audio-rate arguments
within \fBcpsoct\fR are permitted but should be used sparingly.
.bp
