Microtonal uses part number 232 (0xe8)

For direct access, tunings and keyboard maps are both handled as strings of comma separated numbers. All spaces will be removed.

For scales, ratios or floating point numbers can be entered.

Ratios are in the form n1 / n2 to a maximum of normal integer range. If just a numerator is set it will be regarded as n/1.

Floating point numbers *must* include the decimal point and at least one digit (or a zero) either side. These will be padded out with leading and trailing zeros in the form nnnn.nnnnnn

In keyboard maps, non-sounding notes should be marked with an 'x' instead of the key number.

e.g.

Scale:
0076.049000, 0193.156860, 0310.264710, 5/4, 0503.421570, 0579.470570, 0696.578430, 25/16, 0889.735290, 1006.843140 1082.892140, 2/1

Keyboard Map:
0, 1, 2, 3, x, 5, 6, 7, x, 9, 10, 11

The scale/keymap sizes are generated internally by counting the number of entries in the strings.

When saving scales, for floating point numbers we now include the text it was derived from. On re-loading we then use this text to regenerate the number rather than the stored string representation of the number. This eliminates progressive loss of accuracy which could otherwise result from repeated load and save operations.

However, the stored representation is still saved for backward compatibility with older versions of Yoshimi.

We also now use doubles here in some places instead of floats, as the conversion to and from string form seems to be more accurate.

When setting scales/keymaps, or importing .scl/.kbm files the following error numbers may be returned:

 0  empty entry
-1  value too small
-2  invalid characters
-3  no file
-4  empty file
-5  short/corrupted file
-6  invalid octave size / invalid map size
-7  invalid note number
-8  out of range


