cps2deg
Returns the nearest scale index to the value given in cps pitch.
Syntax
Usage
When given a cps pitch value, cps2deg returns the nearest scale degree, and an 'error' value.
The scale degree is suitable for use in the csound opcode cpstun, or the cslc UDO cpstun3.
The error value measures the deviation between the returned scale degree, and the nearest neighbouring note in the scale. Can be positive or negative.
Outputs and Arguments
i/kscaledegree -- The scale degree index into the scale
i/kerror -- Deviation amount to the next nearest note in the scale.
icps -- cps pitch input
iscalefn (optional, default=gi_CurrentScale) -- the table number to retrieve the scale degree from.