cpstmid Real-time MIDI:Converters cpstmid cpstmid Get a MIDI note number (allows customized micro-tuning scales). Description This unit is similar to cpsmidi, but allows fully customized micro-tuning scales. Syntax icps cpstmid ifn 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 GEN02, 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... Examples Here is an example of the cpstmid opcode. It uses the file cpstmid.csd. Example of the cpstmid opcode. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. See Also cpsmidi, GEN02 Credits Author: &namegabriel; Italy 1998 Example written by &namekevin;. New in Csound version 3.492