MIDI Support: Converters

## cpstmid

icps **cpstmid** ifn

### Description

This unit is similar to **cpsmidi**, but allows fully customized micro-tuning scales.

### Initialization

*ifn* – function table containing the parameters (*numgrades*, *interval*, *basefreq*, *basekeymidi*) and the tuning ratios.

### Performance

Init-rate only

**cpsmid** requires five parameters, the first, *ifn*, is the function table number of the tuning ratios, and the other parameters must be stored in the function table itself. The function table *ifn* should be generated by **GEN2**, with normalization inhibited. The first four values stored in this function are:

*numgrades* – the number of grades of the micro-tuning scale
*interval* – the frequency range covered before repeating the grade ratios, for example 2 for one octave, 1.5 for a fifth etc.
*basefreq* – the base frequency of the scale in Hz
*basekeymidi* – the MIDI note number to which *basefreq* is assigned unmodified

After these four values, the user can begin to insert the tuning ratios. For example, for a standard 12 note scale with the base frequency of 261 Hz assigned to the key number 60, the corresponding f-statement in the score to generate the table should be:

; numgrades interval basefreq basekeymidi tuning ratios (equal temp)
f1 0 64 -2 12 2 261 60 1 1.059463094359 1.122462048309 1.189207115003 ..etc...

Another example with a 24 note scale with a base frequency of 440 assigned to the key number 48, and a repetition interval of 1.5:

; numgrades interval basefreq basekeymidi tuning-ratios (equal temp)
f1 0 64 -2 24 1.5 440 48 1 1.01 1.02 1.03 ..etc...

### Author

Gabriel Maldonado

Italy

1998 (New in Csound version 3.492)

MIDI Support: Converters