 # Scala help

This help file belongs to Scala version 1.88 and 2.44.

Brackets indicate an optional parameter. Parentheses indicate a choice of options. Items in capital letters are commands. Words preceded by a slash are command qualifiers. Long commands and options can be abbreviated.

New users should read the sections Commands and Qualifiers for the command language format. See also About... for background info, Introduction for how you can set up things to tune electronic instruments with Scala and HELP for usage of the HELP command.

```ADD  [scalenr.]
```
Multiply the pitches of the current scale with those in the given scale at the same degree and replace them in the current scale. This means their logarithms (value in cents) are added. The default scale is 0 (current scale), so when no number is given the pitches are multiplied with themselves. The amount of scales is set in file scala.ini (default 30), and shown with SHOW SETTINGS. If the scales have different size then octave equivalence is used and the current scale will keep its size. Instead of a scale number, a filename may also be given.
For adding a constant term to all pitches use MOVE/FREQUENCY. See also SUBTRACT. Qualifiers cannot be combined.
```   /ADD
```
Instead of multiplying the pitches, take the summation tones.
```   /GOLDEN
```
Take the golden mediant value of the pitches, i.e. (num(a) + phi * num(b)) / (den(a) + phi * den(b)), where phi is the golden ratio: 1.61803398875 approximately. All pitches must be rational.
```   /MEANSQUARE
```
Take the mean of the pitches squares, i.e. (a2 + b2) / 2.
```   /MEDIANT
```
Take the mediant value of the pitches, i.e. (num(a) + num(b)) / (den(a) + den(b)). All pitches must be rational. See also SUBTRACT/MEDIANT.
```   /POWER
```
Take the pitches of the current scale to the power of the pitches of the given scale, i.e. (ab).
```   /SUMMATION
```
The current scale is replaced by a scale with all sum tones of the current or given scale, using octave equivalence. The size of the new scale will be the square of the number of notes in the given scale, but less if there are duplicate sum tones. Warning: the original 1/1 remains in the scale. To remove it, do DELETE 0. See also SUBTRACT/DIFFERENCE.

APPEND

```APPEND  pitch  [scalenr.]
```
Insert a new pitch in the current (number 0) or given scale after the last position making the size of the scale increase by one. The maximum size of a scale is set in file scala.ini (default 1200). See INSERT to insert a new pitch at another degree than after the last one. See also EXTEND.
```   /EXPRESSION  expression
```
Evaluates the given expression the same way as the CALCULATE command and appends it to the current scale. It does not show the result nor store it in a pitch memory. Cannot be combined with other qualifiers.
```   /FACTOR  factor  [scalenr.]
```
Interpret the pitch parameter as a linear factor and not as cents when it has a decimal point. Can only be combined with /INTERVAL and /LINE.
```   /FREQUENCY  frequency  [scalenr.]
```
Interpret the parameter as a frequency relative to the base frequency of SET FREQUENCY. Can only be combined with /LINE.
```   /INTERVAL  interval  [scalenr.]
```
Specify the interval with the last degree instead of the absolute pitch. Can only be combined with /FACTOR and /LINE.
```   /GIVENBEATS  position  interval  frequency
```
Specify a new pitch in the current scale by its beat frequency against a given rational interval on a given scale degree. This scale degree does not have to be inside the scale, octave equivalence is assumed. The beat frequency is relative to the base frequency of 1/1. When a negative beat frequency is given, the resulting pitch will be lower than the given interval, otherwise higher. Do SORT afterwards if necessary. See also SHOW BEATS, LINEARTEMP/GIVENBEATS and REPLACE/GIVENBEATS. Cannot be combined with other qualifiers.
```   /LINE  pitch-list
```
Append all the pitches given in the parameter, separated by spaces. Can only be combined with /FACTOR, /FREQUENCY, /INTERVAL and /NOTATION.
```   /NOTATION  notename  [notation-system]  [scalenr.]
```
Specify the pitch by note name. The nominal note value according to the given notation system will be appended to the scale. The current notation is the default one. Can only be combined with /LINE, in which case the notation system can only be the current one.
```   /SCALE  scalenr.  [scalenr.]
```
Shift the pitches of the given scale by the formal octave of the current or given scale and add them to this scale. Instead of a scale number, a file name may also be given for the first parameter. Cannot be combined with other qualifiers.

APPROXIMATE

```APPROXIMATE  [highest-prime]
```
Replace each pitch in the current scale with the closest fraction to the pitch with numerator and denominator consisting only of prime factors not exceeding the prime count. The prime count is set with keyword Prime_Count in scala.ini (default value 10 which is 29-limit). If the given parameter is not a prime, then the next higher prime will be the limit. If no parameter is given, then the prime limit set with SET LIMIT is effective. Because the run time of this command is exponential with the number of primes involved, you need to either use a low limit, or use the /LIMITED qualifier. The primes which will be used will be shown first.
```   /LIMITED  [highest-prime]
```
Replace only when there exists a fraction whose
• prime exponents of numerator and denominator are inside the limits set by SET EXPLIMIT
• prime limit is not greater than the given parameter or the default limit set with SET LIMIT
• distance to the approximated note is not greater than the difference set with SET MAXDIFF. The initial value of 0.0 means no maximum difference.
Cannot be combined with /INSERT and /MOULD.
```   /FLOATS_ONLY  [highest-prime]
```
Replace only the floating point pitches (those given in cents) in the current scale. Cannot be combined with /INSERT and /MOULD.
```   /CONSISTENT  resolution  [highest-prime]
```
Replace pitches only with ratios which are consistent in the given resolution of equal tempered steps/octave and the given prime limit. If the prime limit is not given, then the limit set with SET LIMIT is effective. Also the /WEIGHTED qualifier works implicitly here, so the current attribute should first be set to a useful value. If attribute weighting is not desired, then do SET ATTRIBUTE NONE. If the given resolution is equal to the number of tones in the current scale, then a JI-epimorphic scale with standard mapping will likely result. To calculate the number of steps/octave if the formal octave is not 2/1, do for example CALCULATE 3\13 = 8.202087 / octave.
See also SET ATTRIBUTE ET_STEP. Cannot be combined with /INSERT, /MOULD or /WEIGHTED.
```   /WEIGHTED  [highest-prime]
```
Does not only take distance into account, but also the current attribute value given by SET ATTRIBUTE. The optimality criterion (which is minimised) is the sum of the absolute pitch difference and the weighting factor given by SET WEIGHTING multiplied with the attribute value of the tested ratio. For the attribute one that gives a harmonic complexity value should be chosen (like DEPTH, ENTROPY, GRADUS, HARMON, HEIGHT, MANN, MAX, PROOIJEN, RHSM, RECTANGULAR, TENNEY, TE_NORM, TRIANGLE, TR_LOG, VOGEL, WEIL, WILSON) and not CENTS for example. If HARMON is chosen, the absolute inverse of it is taken into the weighted sum. If the weighting factor is higher, then the attribute value weighs more and the pitch difference less. The absolute pitch difference is weighted in cents. If NONE is chosen, then it works as though /WEIGHTED was not used.
The harmonicity function can be parameterised with the SET HARMCONST command and the coefficients and weighting factor viewed with SHOW HARMCONST. This qualifier should be used in combination with /LIMITED, otherwise the computation time will be too long. Cannot be combined with /CONSISTENT and /INSERT.
```   /INSERT  pitch  [highest-prime]
```
Insert all approximations to the given pitch in the current scale. All the same constraints of /LIMITED apply, so it need not be combined with this qualifier. You must use SET MAXDIFF first to set the range in which approximations will be sought. The initial value of 0.0 does not mean no maximum difference here, but exactly zero. The range of pitches to be inserted is from (pitch - max.diff.) to (pitch + max.diff.). If highest-prime is not given, the limit set with SET LIMIT applies. Any pitches already in the current scale will remain there. So if only the approximations are wanted, do CLEAR first. Set any exponent limits with SET EXPLIMIT.
Approximations below 1/1 will not be inserted, if the pitch is above 1/1 and vice versa. If more approximations are found than the maximum scale size, then "Overflow in scale size" will occur. Cannot be combined with other qualifiers.
```   /INTERVALS  scalenr.  max-difference
```
Temper the intervals of the current scale to get as many of them as close as possible to the pitches in the given scale. All intervals which are within the distance of the given maximum difference to one of the approximants in the given scale are taken into account. The quadratic error of these intervals will be minimised. All intervals of the current scale except the formal octave are subject to approximation. To see them, use SHOW INTERVALS.
This command can be used to increase the number of consonant triads, tetrads, etc. in a scale, or temper them to distribute the error more egally over the present consonant chords. Then the given scale should contain the intervals which are considered consonant in the chords to be improved. However this method only optimises individual dyads and not larger chords as a whole, so for larger chords this method may be suboptimal. If the result scale contains duplicate pitches they will be removed.
It's worthwile to experiment with which approximants to include and which not. For instance to optimise major triads it could be chosen to include 6/5, 5/4 and 3/2, or only 5/4 and 3/2. For the most consonant intervals, it's useful to also include the octave inversions.
A list of the used approximants will be given with the number of times each one was used in the approximation. They may also be floating point values.
Instead of a scale number parameter, a filename may be given. Try this command multiple times consecutively to see if the scale can be further improved. Example: There's a scale named cons_7.scl in the archive with consonant 7-limit intervals. To optimize the number of 7-limit tetrads and triads in a just scale by egalizing the septimal kleisma, do: APPROXIMATE/INTERVALS cons_7 225/224. The qualifiers /LEASTSQUARE and /MINIMAX are similar, try comparing the results. See also PERMUTE/INTERVALS, PROJECT/TEMPER and ITERATE/WHILE.
```   /LEASTSQUARE  scalenr.  max-difference
```
Checks each interval in the current scale to see if it is within the given maximum difference from intervals in the given scale which contains consonance targets. If so this interval will be optimised least squares towards these intervals. Note that multiple target intervals may be within range for each interval. The formal octave will not be changed, nor will it influence the result. Octave extension is not assumed. The maximum difference can be given in cents or as ratio. The given scale does not need to contain only rational pitches. An n-limit diamond without 2/1 could be a good choice of intervals.
If the result scale contains duplicate pitches they will be removed. If this operation is repeated until the scale no longer changes, the result is called a Lesfip (LEast Squares FIxed Point) scale, a scale type invented by Gene Ward Smith. In case there is no or no unique solution, a "no solution" message will be given. In that case you can try either to use a higher maximum difference or to add more consonance target intervals. If the given scale contains pitches, for example 2/1, equal to or higher than pitches in the current scale, a warning will be given.
```   /MINIMAX  scalenr.  max-difference
```
As /LEASTSQUARE but with minimax optimisation instead of least squares. If this operation is repeated until the scale no longer changes, the result is called a Mimafip (MIniMAx FIxed Point) scale. In case there is no solution or nothing to change, a "no solution" message will be given. In that case you can try either to use a higher maximum difference or to add more consonance target intervals.
Note that you can also do combinations, like making a Mimafip from a Lesfip scale (which usually makes the most sense) or vice versa. See also PROJECT/MINIMAX and ITERATE/WHILE.
```   /MOULD  scalenr.
```
The given scale must contain a set of small pitches which are considered to be "commas" whose difference is negligible when added to or subtracted from the pitches of the current scale. For each pitch, all possible combinations of adding or subtracting the commas once or not, will be visited and be evaluated according to the current attribute and maximum pitch difference. This means that these settings influence the result: SET ATTRIBUTE and SET MAXDIFF. Prime limit or exponent limits do not play a role. Set maxdiff to zero if you want no limit to the difference.
This function can be used to shape a periodicity block after creation with PIPEDUM. If the set of commas is the same as the set of defining intervals of the periodicity block, then the result will still be a periodicity block. So if the defining intervals are placed in scale number 1, then after doing PIPEDUM/SCALE 1 and NORMALIZE you can do APPROXIMATE/MOULD 1. The set of commas is not checked for independence, contrary to the PIPEDUM command. To see the shape, use the LATTICE command. A useful attribute is HARMON in this case, but any other one defined for rational intervals may be used too. After creating a p.b., the command KEY/CENTRE can be used first to set the tonic more to the centre of the lattice, if desired.
If /WEIGHTED is used in combination, then the pitch deviation and the value of SET WEIGHTING also play a role. The weighting factor should probably be set to a higher value than the default 1.0. It's best to experiment a bit with different settings. The error function is then the weighting factor times the attribute value plus the logarithmic pitch deviation.
Note that one can also put one comma in the given scale, for example the schisma (\$s). Instead of a scale number, a filename may also be given. Can only be combined with /WEIGHTED.
```   /SUPER
```
The intervals of the current scale will be replaced by their nearest superparticular (epimoric) approximation. A superparticular ratio is one of the form (n+1)/n when numerator and denominator are in lowest terms. The formal octave (last scale degree) will also likely be changed. The scale may not contain one step intervals smaller than 2147483647/2147483646. That will be the case with duplicate pitches so then the UNIQUE command must be used to remove them. See also RATIO/SUPER. Cannot be combined with other qualifiers.

ASSUME

```ASSUME  scalenr.  [scalenr.]
```
Make floating point pitches of the current scale into rational ones if the same pitch is present in the first given scale as a rational value. This only happens if the values are exactly the same. Positive powers of 2 will be made rational even if they're not in the given scale.
Instead of the current scale another scale can be given in the second parameter. And instead of a scale number, a filename may be given in the first parameter. The file intnam.par is useful because it contains many rational pitches. See also APPROXIMATE and UNRAT.
```   /COMBINATION
```
Also compare combinations (product and quotient) of any two pitches in the given scale. Many more rational values can be found this way. It may also find extra rational values when applied to the current scale itself if it's partially rational.

AVERAGE

```AVERAGE  pattern
```
Replace each pitch in the current scale with a mean of that pitch with the pitches given by the relative offsets in the given interval pattern. Which kind of mean is determined by the qualifier.
For example, AVERAGE 1 will take the mean of a pitch with the next degree.
AVERAGE 1 1 will give a moving average of three consecutive pitches.
AVERAGE -1 will take the means of pitches with their previous degree.
AVERAGE 2 will take the mean of a pitch with the one two steps further, etc.
The pattern may consist of any amount of numbers. Octave equivalence is assumed. An effect of this command is that it makes deviations from equal temperament smaller, as the moving average operation smoothes out fluctuations in a time series. For 12-tone meantone scales, try AVERAGE 7. See also DOUBLE and EGALIZE. Qualifiers cannot be combined.
```   /GEOMETRIC
```
Uses the geometric mean, like sqrt(a * b). This is the default qualifier.
```   /ARITHMETIC
```
Uses the arithmetic mean, like (a + b) / 2.
```   /HARMONIC
```
Uses the harmonic mean, like 2 * a * b / (a + b). It is the arithmetic mean with the intervals reversed.
```   /RMS
```
Uses the root mean square, like sqrt((a2 + b2) / 2).
```   /SUBC_HARMONIC
```
Uses the subcontrary to harmonic mean, like (a2 + b2) / (a + b).

BISTEP

```BISTEP  scalenr.  [scalenr.]
```
Modify the current or given scale in the second parameter in such a way that the least-squares difference with the nearest pitches in the given scale is minimised. The current scale must have exactly two different interval sizes between consecutive pitches, i.e. the step intervals. You can check this with SHOW INTERVALS; the scale must have two intervals listed with interval class 1. The operation leaves the pattern of interval sizes intact and the formal octave also remains the same. The least-squares difference with corresponding (nearest) pitches in the given scale is minimised. The given scale does not have to have the same size as the current scale. The formal octave does not have to be the same; the difference between the formal octaves does not influence the result. The nearest pitches to the ones of the current scale will be selected for approximating them. Instead of a scale number, a filename may also be given as first parameter.
If the scale structure is a linear temperament, then CALCULATE/LEASTSQUARE can also be used. This gives an identical result (size of the fifth). Example: Suppose the scale to be approximated is 1/1 9/8 5/4 4/3 3/2 5/3 15/8 2/1 and the current scale is 1/1 200.0 400.0 500.0 700.0 900.0 1100.0 2/1. Then the result is 1/1 194.693 389.386 502.654 697.347 892.040 1086.733 2/1. Qualifiers cannot be combined.
```   /UNIQUE  scalenr.  [scalenr.]
```
As above but if the given scale has fewer pitches than the current or given scale in the second parameter, or if it has pitches that are closest to more than one pitch in it, then those pitches are only counted once in the calculation and are ignored for approximation of pitches further removed from them.
This means that if the given scale consists of only one pitch, then the result will contain this pitch exactly.
For example, suppose the current scale has 12 tones and interval pattern a b b a b a b a b b a b, and the given scale is 9/8 5/4 4/3 3/2 5/3 15/8 2/1, then only 7 pitches of the current scale are matched and their differences minimised and the remaining pitches are calculated according to the interval pattern.
```   /FACTOR  factor  [scalenr.]
```
Change the current or given scale such that the ratio of the large step to small step becomes the given factor. Which means if the factor is 1 it becomes an equal temperament. The factor can also be negative. If the factor is between 0 and 1 then the large and small steps change place. When the factor is equal to \$f then the scale becomes a golden temperament. When it equals \$i it becomes a silver temperament.
```   /MATCH  pitch  [scalenr.]
```
Instead of a scale to approximate, give one pitch that must be matched in the current or given scale. This is the same as using BISTEP/UNIQUE with the other scale containing only this given pitch.
```   /PERMUTATION  count  scalenr.
```
Create a scale with two interval sizes in such a way that the least-squares difference with corresponding pitches in another scale is minimal. The scale will have the same size and formal octave as the given scale. The count which is given is the number of intervals with one size, while the number for the other size will be the remaining number of scale size minus count. All interval patterns (permutations of the two intervals) are tested and the one giving the lowest least-squares difference to the given scale will be taken. This is the difference with BISTEP without /PERMUTATION. For long scales it may take a lot of computing time. Instead of a scale number, a filename may also be given. The given scale may also be 0, in which case the current scale will be replaced with the approximation. See also PERMUTE/MATCH.
```   /MIN_ABS  count  scalenr.
```

CALCULATE

```CALCULATE  expression
```
Evaluate a given arithmetical pitch expression and show the result. The expression may consist of pitches given as a ratio, in cents, from a pitch memory or scale degree (see help of \$, %, [ and Expressions), all mixed, and the following operations:
 + : multiplication - : division and reciprocal (inversion) * : power (right operand is pitch) ^ : power (right operand is linear value) \ : root | : reduction (divide or multiply the left by the right operand until the result is smaller than the right operand and larger than 1/1) plus : summation min : subtraction (see below) div : logarithmic ratio (left and right operand must have the same sign) round : round to nearest logarithmic multiple of right operand trunc : truncate to smaller logarithmic multiple of right operand great : greater one of the operands less : lesser one of the operands med : mediant (see below) phi : golden mediant (see below) bimod : ratio of bimodular approximants (see below) abs : if the right operand is smaller than 1/1, take the reciprocal lin : specify right operand is linear value num : if the right operand is rational, take the numerator, otherwise the linear value den : if the right operand is rational, take the denominator, otherwise 1/1

Furthermore parentheses may be used to influence the order of evaluation. It calculates the result and shows it in various units. The result is stored in pitch memory 0 (\$0).
The order of precedence of operations is 'num', 'den', 'lin' and unary - first, then *, ^ and \, then |, then 'round' and 'trunc', then 'great' and 'less', then +, -, 'plus' and 'div', then 'med', 'phi' and 'bimod', then 'abs', then 'min'. When precedence is the same, the order of evaluation is from left to right.
For example: 3/2*12-2*7 or 3*12|2 or 3^12|2 gives the Pythagorean comma. The difference between * and ^ is that with ^ the right operand is read as a linear value instead of as cents, may also be negative and may not be a parenthesized expression. With a nonnegative integer or ratio as the right operand, * and ^ give the same result. Example: to calculate how many cents is 3 steps of 22-tET with a 2/1 octave, do CALC 2^3/22 (or 2*3/22).
Strictly speaking, 'lin' is not an operation but when it is put in front of a pitch value which contains a decimal point, then it is interpreted as a linear factor instead of a cents value. It may not be negative.
Note that the 'div' operation is the logarithm with the right operand as the base. For example we want to know how many steps of the 25th root of 5 go into one octave, so we do CALC 2 div 5\25. We could then use this value as a base for attributes, like: SET ATTRIBUTE ET_STEP \$0. Though the step size can be used directly too, e.g. CALC 5\25 and then SET STEP_UNIT \$0. Another example: to scale a pitch, let's say 100.0 cents proportionally to the ratio between a tempered and the pure octave you do CALC 100.0*(2/1 div 1201.636)
The 'round' operation can be used to calculate the nearest step in an equal temperament. For example the fifth in 31-tET is found by CALC 3/2 round 2\31. The 'med' and 'phi' operations need a rational number for both operands. The mediant is (num(a) + num(b)) / (den(a) + den(b)) and the golden mediant (num(a) + phi * num(b)) / (den(a) + phi * den(b)), where phi is the golden ratio: 1.61803398875. The latter function gives the convergent value when you repeatedly take the mediant of the result and the previous result, like with Fibonacci summing sequences. These values are useful to use as generator for a linear temperament. The bimodular approximant of an interval r is (r-1)/(r+1) which is close to the logarithmic size for values of r near one. The 'bimod' operation gives the quotient of the bimodular approximants of the left and right operand. So it is therefore a measure of relative logarithmic size of two intervals, like the 'div' operand is. When both intervals are rational the ratio's numerator and denominator can be interpreted as a number of steps in an equal temperament, perhaps to be multiplied by an integer, giving a temperament which represents both intervals well. Another example with operand 'div' is the following: suppose you want to scale an interval (say \$1) equal to the size of another interval relative to the octave (say \$2), you do: CALC \$1 * (2/1 div \$2), as like in MULTIPLY/ABSOLUTE.
The COPY/PITCH/RANDOM command can be used to obtain a random pitch value to use in a calculation.
The subtraction operation min when not between parentheses, can be used only once in an expression and has lowest precedence. The result will also be given as a frequency difference. It is relative to the base frequency of SET FREQUENCY.
Example: 3/2 min 700.0. It can also be used to calculate beat frequencies between harmonics, in the same example: 3 min 2+700.0. To use subtraction in an expression, put it between parentheses.
For the format of pitch operands, see Expressions. Remember that not only literal values can be used but also pitch memories, scale pitches and [ ] for the nearest scale pitch.
Extra units in which the result is expressed are specified in parameter file calcval.par and may be edited as wished. Note names can be given at the end but it is not default. See also SET CALC_OUTPUT, SHOW/ATTRIBUTE PITCH and SHOW/UNITS PITCH.
To display results in another form, or write them into a text file, use the ECHO command with its lexical functions.
Several Scala commands store their results in the first couple of pitch memories so they can be also used again in pitch expressions here. See also APPEND/EXPRESSION.

```   /FACTOR
```
Interpret all pitch values in the expression with a decimal point not as cents but as a linear factor. This is the same as putting the word lin in front of every pitch value. Can only be combined with /NOOUTPUT.
```   /NOOUTPUT
```
Store the result(s) in pitch memory 0 (and higher) and do not show any results. See also help of :=.
```   /LEASTSQUARE
```
With this qualifier, there is no parameter. It calculates the least-squares fifth for a meantone scale (cycle of fifths). It can also be used to calculate the (formal) fifth or generator for attaining one (just) interval exact. First the size (number of notes) is asked. This is used for giving a hint for the number of fifths to be stacked to approximate the intervals. If you know this already, it can be entered, otherwise use 0. Then the formal octave is asked, usually this is 2/1. This may also be given as an expression, for example 2\7 is the 7th root of 2/1. Then the degree for the fifth is asked, again for hinting the number of fifth steps. Hit enter for taking the nearest equal tempered degree which is usually the easiest. Next, enter the number of pitches to be approximated. This number should include the fifth itself, even if it's not to be included in the least-squares average. Namely, the first approximant is taken to be the formal fifth (generator). So enter 2 if you do not want to approximate, but have one exact scale interval. Subsequently each interval to be approximated is entered, followed by the number of steps to approximate it (for the fifth this is one). The default one is the lowest (either upwards or downwards). If the approximation is not very close, then also the number of steps to the second best approximation is suggested. Then comes a weighting factor, which can be given as a ratio or floating point value. Enter a weight of zero if the approximant is to be excluded from the average. If weights are not identical, then usually ratios with higher primes are given less weight. Give zero weight to the formal fifth if it doesn't approximate some interval itself, or in case of attaining one exact scale interval. For downwardly stacked fifths, enter a negative value for the number of steps. Intervals with a weight of zero will not be included in the standard and highest deviation. The result is shown with the deviation from the given generator. If it is idential to an entry in the list of linear temperaments, then the name will be shown.
The result is also stored in pitch memory 0 (\$0), so it can be used with the LINEARTEMP command. Example: a 4/17-comma meantone fifth is the negative least-squares average for 3/2 and 5/4. To calculate this enter subsequently: 12, 2, 7, 2, 3/2, 1, 1.0, 5/4, 4, 1.0
Another example: for a meantone scale with an exact 13/10 augmented third, enter this subsequently: 12, 2, 7, 2, 3/2, 1, 0.0, 13/10, 11, 1.0
The minimax result, see /MINIMAX, is also given next and stored in pitch memory 1 (\$1). Can only be combined with /NOOUTPUT.
```   /MINIMAX
```
As /LEASTSQUARE except that the fifth giving the lowest maximum error is calculated instead of the least-squares error. The errors are calculated as the difference in cents times the given weight. Example: a 1/5-comma meantone fifth has the same error for 3/2 and 5/4. To calculate this enter subsequently: 12, 2, 7, 2, 3/2, 1, 1.0, 5/4, 4, 1.0
The result is stored in pitch memory 0 and the least squares result is also given and stored in pitch memory 1. Can only be combined with /NOOUTPUT.
```   /TOP
```
As /MINIMAX except that the period (formal octave) and generator (formal fifth) are jointly optimised. Depending on the given weights, the (weighted) minimax solution will be given first, then followed by the TOP (Tenney Optimal Primes) solution, which is minimax with the approximants being weighted by the inverse of their logs, and the given weights ignored. Because the period is optimised too, do not forget to include it (or a multiple) in the approximants.
For example, suppose the period is 600.0 cents, then enter 2/1 as an approximant, followed by 0 steps of the generator. Enter for the size some number of notes for which the approximate generator and period form a well-formed scale (have Myhill's property). Then the mapping is more quickly entered by taking defaults from the suggested numbers of steps. The intervals should not be entered octave reduced, so enter 2, 3, 5 etc., not 2, 3/2, 5/4. If there is not a single, but a range of solutions, which happens when there are zeroes in the generator part of the mapping, then it tries to balance the weighted errors. The generator is stored in pitch memory 2 (\$2) and the period in pitch memory 3 (\$3). The minimax pair in \$0 and \$1. Can only be combined with /NOOUTPUT. See also PROJECT/TEMPER/TOP.
```   /RMS_TOP
```
As /TOP except that the optimum is not minimax, but least squares. The difference with /LEASTSQUARE is that the period and generator are jointly optimised. First the weighted least squares solution is given, followed by the TOP-RMS solution, which is least squares with the approximants being weighted by the inverse of their logs, and the given weights ignored. Because the period is optimised too, do not forget to include it (or a multiple) in the approximants. TOP-RMS is also called TE for Tenney-Euclidean. The generator is stored in pitch memory 2 (\$2) and the period in pitch memory 3 (\$3). The least squares pair in \$0 and \$1. Can only be combined with /NOOUTPUT. See also PROJECT/TEMPER/RMS_TOP.

CATALOGUE

```CATALOGUE  [first]
```
Show size (number of notes) and formal octave of all nonempty working scales and pitch memories. If a parameter is given, it's the first scale or pitch memory to be shown. Show also whether scales consist completely of rational pitches or not, indicated with the word rational. The last column contains part of the description text and if that is absent, the first few pitches of the scale are shown.
Subsequently show the values in the pitch memories which are different from the initial value 1/1.
The number of scales and pitches which are available is shown with SHOW SETTINGS. The scale memories with the highest numbers are used for UNDO, and should not be used for scales that must be kept. The number of scale memories, undo-memories and pitch memories is set in the file scala.ini. Qualifiers cannot be combined.
```   /PITCH  [first-pitch]
```
```   /SCALE  [first-scale]
```
Show the nonempty scale memories only.

CD

```CD  [directory]
```
Change the working directory to the given directory. The original directory will be restored when leaving the program. Without parameter, the current directory path appears on the screen. Wildcards * and ? can be given too, then the first matching name will be taken. To change back to the previous directory, enter CD - . To change to the install directory, enter CD ^ .

CHORDS

```CHORDS  first-number  last-number  [chord-size]
```
Shows the approximations in the current scale to all just chords between the given two harmonic numbers. The chord-size parameter is the number of notes in the chords. The default value is 3. The minimum value is 2 but you can also give a 0 which means all sizes not exceeding the scale size will be searched for. What is shown is first the chord, then the nearest approximation in scale degrees and then the standard deviation between the chord notes and scale notes. If the chord size is five or smaller, then the inverse chord is shown too. If the first number is higher than the last number then the inverse (subharmonic) chords will be searched instead. The name of the chord will be shown if it's in chordnam.par.
For example, if first-number is 3, last-number is 6 and size is 3, then the chords searched for are 3:4:5, 3:4:6, 3:5:6 and 4:5:6.
The approximations start only on degree 0, so if the current scale is not equal tempered and chords on another position would be requested, then KEY must be done first. See also SHOW LOCATIONS. If the current attribute is NOTATION then an extra line is shown with the note names of the approximating chord. See also SET NOTATION.
```   /CONSTRAINED
```
Show only chords for which the differences with the pitches of the current scale do not exceed the maximum difference set with SET MAXDIFF. A value of 0 cents for the maximum means that only exact (just) matches will be shown. If there is at least one note in the chord with a larger difference, then the chord will not be shown. Another constraint (if this qualifier is not given in combination with /MATCH) is that only chords whose prime exponent numbers do not exceed the limits set by SET EXPLIMIT and without primes larger than the limit set with SET LIMIT are shown. Can only be combined with /MATCH.
```   /MATCH  [position-or-search-pattern]  [chord-size]
```
Show occurrences of chords given by name in the current scale. The chords to be searched are from the list in file chordnam.par. If the chord-size parameter is given, only chords of "chord-size" tones will be matched, otherwise chords of any size (or when it's 0). If this parameter is negative, then it means that chords with at least that positive size will be matched. For an occurrence to be found, the tones of the chord must be within plus or minus three formal octaves of the scale, assuming octave equivalence.
If no first parameter is given, or if it's an asterisk, then chords will be matched at all positions in the scale. If the current scale is an equal temperament, only chords starting from the first tone of the scale will be matched. Otherwise, use CHORDS/MATCH 0 to do this, or use any positive number to match at another scale degree. If the first parameter is a name pattern, then only chords having a name that matches the pattern will be matched with the scale. It can be given as a regular expression, for the syntax see Patterns. Wildcards are * and ?. If it consists of more than one word, it must be surrounded by double quotes ("). Matching is case-insensitive. A whole word of the name must be matched in order for it to be found. To match part of a word, the pattern may begin and end with a * character. A literal chord given as a list of intervals is by the way not considered a name pattern. To do such search, use SHOW LOCATIONS.
Displayed are the scale degrees that form the chord, and its name. If the pitches do not match exactly, then their difference in cents with the scale pitches will also be given. The current scale must be in ascending order. If the current attribute is a notation system, set with SET NOTATION, then a second line with the note names will be shown.
The chord matching can be further restricted with the /CONSTRAINED qualifier, see above. Can only be combined with /CONSTRAINED.
```   /ALL_SHOW  [search-pattern]  [chord-size]
```
Show all chords from the list if no parameter is given. If a name pattern is given, show all chords having a name that matches the pattern. In this case there is only one parameter, the pattern, which may contain spaces. If the name pattern contains spaces, it must be surrounded by double quotes (") if the second parameter is also to be given.
The displayed chord list can be restricted further to only give chords with a given number of notes. To show all chords with a certain number of notes, make the first parameter "*", for example to show all chords with 4 notes do CHORDS/ALL * 4. The intervals are given as they appear in the file chordnam.par. See also LOAD/CHORD and SHOW ITEMS. Can not be combined with other qualifiers.
```   /CENTS_SHOW  [search-pattern]  [chord-size]
```
As /ALL_SHOW, but shows the intervals of the chords in cents, relative to the first note. Can not be combined with other qualifiers.
```   /SORTED_SHOW  [search-pattern]  [chord-size]
```
As /CENTS_SHOW, but shows the chords sorted by interval size in ascending order. Can not be combined with other qualifiers.
```   /ODD_LIMIT  limit  [position]
```
Show all occurrences in the current scale of chords which odd-limit is within the given limit. The differences of the chord tones with the pitches of the current scale will not exceed the maximum difference set with SET MAXDIFF. A value of 0 cents for the maximum means that only exact matches will be shown. If there is at least one note in the chord with a larger difference, then the chord will not be shown. The maximum chord size which will be shown is 32 tones.
If no second parameter is given, then chords will be matched at all positions in the scale. If the current scale is an equal temperament, only chords starting from the first tone of the scale will be matched.
If the formal octave of the current scale is a whole number, then these multiples of the chord's fundamental will not be shown. Subchords of chords matched will also not be shown.
The current scale must be in ascending order. If the current attribute is NOTATION then an extra line is shown with the note names of the approximating chord. Can not be combined with other qualifiers.

CLEAR

```CLEAR  [scalenr.]
```
Empty the given scale. Default is 0 (current scale). Qualifiers cannot be combined.
```   /ALL  [last-scalenr.]
```
Empty all scale memories, including the current scale, but not the highest ones used for UNDO. If a parameter is given then empty all scale memories from 0 (current scale) to the given last scale (may include undo-memories). Warning: This cannot be undone with UNDO, except for the current scale.
```   /COMMANDS
```
Empty the command history. With the cursor up and down keys you can cycle through the previously entered commands. This command itself is not stored in the history. Not implemented in the console version, pre 2.0.
```   /MAPPING
```
Set the keyboard mapping to the default values and the size to zero. This zero size will work as a linear mapping when sending a scale to a synthesizer. There is no parameter. See also SHOW MAPPING.

CLOSE

```CLOSE
```
Close the text file opened with FILE. It is not necessary to do this before EXIT because it's done automatically.

CLS

```CLS
```
Clear the screen (c.q. text of main window).

COLLAPSE

```COLLAPSE  [interval-class]  [scalenr.]
```
Replace the current or given scale with its set of intervals of the given interval-class. The default interval-class is 1, which means adjacent pitches (as shown by SHOW/INTERVAL). It may be any integer number. Then what were intervals will become pitches. Mathematically it is called the difference operator for a periodic sequence.
To remove any identical values afterwards use UNIQUE. An equal temperament would then be reduced to one interval. This command can amongst others be useful prior to FIT. If this command is repeated, it gives an effect similar as EUCLID does. Qualifiers cannot be combined.
```   /ALL  [scalenr.]
```
Replace the current or given scale with its set of unique intervals of all interval-classes. This command may cause the scale to become very large. An equal tempered scale will stay the same. See also SHOW/TOTAL INTERVALS.
```   /COMMAS  [scalenr.]
```
Replace the current or given scale with the set of essential tempering commas of the current scale, which must be rational. These commas are candidates to be tempered out. A rational interval is an essential tempering comma if it's smaller than the smallest interval in the scale and if there are three pitches i, j and k in the scale such that the comma equals i*j/k. See also SHOW/DIFFERENCE INTERVALS.
```   /ERECT  [scalenr.]
```
Do the reverse operation to COLLAPSE 1. The pitches will be added up consecutively so that they will become the successive intervals of one step.

COMPARE

```COMPARE  [file-mask]  [scale-size]
```
Compare the current scale with all scales in memory, then with all modes in the mode list (based on the octave) and subsequently with files in the current directory that satisfy the file mask, which may contain the wildcards * and ?. For a match to be shown, the scales must have equal size and their successive intervals must be equal, but the key (transposition) does not have to be equal. The key for which the scales match is displayed. See also KEY. Also if the successive intervals are equal in reverse order then this match is displayed. See also INVERT. Next, it is checked whether the pitches of the current scale form a subset of any scale. If the subset forms a known mode then its name is given. Not checking for subsets is done by specifying the current scale size like this: COMPARE *.scl n. So if both a file mask and a scale size are given, the scale size acts as an extra filter and only scales with that size will be checked, the same way as with the DIRECTORY command.
Additionally, it can be checked if scales match within a given difference limit, in the same ways as described above. If no pitches differ more than the limit, it is a match. The maximum difference is set with SET COMPDIFF. If this is not desired, do SET COMPDIFF 0.0.
If there were files with the same scale size, then afterwards those with the least differences not being equal will be shown. Those differences are the average absolute, root mean square and highest absolute difference. Next the same comparisons will be shown for files with the same scale size tried in all other keys. If the other keys didn't give a better approximation than the same key, then "idem" will be written. Then comparisons only in the original key will be shown for scales with not necessarily the same size. Only the number of tones of the smaller one of the two scales will be considered. If all comparisons were equal for scales with any size, then "idem" will be written.
To compare with the last scale loaded or saved, do COMPARE %scl. See also SHOW DIFFERENCE to compare with one particular scale or file.
```   /MEMORY_ONLY  [scale-size]
```
Compare the current scale only with all scales in memory, so not with files and modes. Can only be combined with /SUPERSET.
```   /SAVE_LIST
```
Save the filenames shown by the command to be equal or inversely equal in any key to a scale list file with name comp.lst. Approximately equal files are not added. This list file is used when "@comp" is given instead of a filename mask. For instance to do a much quicker compare against the same files a second time, or to load them all into memory, or to invoke an operation on all of them using ITERATE. Cannot be combined with /MEMORY_ONLY. If combined with /SUPERSET there is only one optional parameter scale-size.
```   /SUPERSET
```
Also indicate the cases when the current scale is a superset of the scales and modes it is compared with. To check also if the current scale is approximately a superset, set the maximum difference with SET COMPDIFF. If this is not desired, do SET COMPDIFF 0.0. If you want to check all modes of the current scale for it, then use the command ITERATE/KEY COMPARE/SUPERSET. Can only be combined with /MEMORY_ONLY and /SAVE_LIST.
```   /EQUAL  [first-scalenr.]
```
Check all scale memories for duplicate scales, current scale included. Scale numbers with equal scales will be displayed and their respective descriptions. They have to be exactly equal, so the SET COMPDIFF setting has no influence. The lowest scale number to be checked can be given as parameter. If you want to check scale files for equality, they have to be loaded into memory first with LOAD/ALL. Cannot be combined with other qualifiers.
```   /PITCH  pitch  [file-mask]  [position]
```
Search for the given pitch in the files that satisfy the file mask. The scale degree where the pitch is found is shown and the scale size. The maximum difference is set with SET COMPDIFF. If this is not desired, do SET COMPDIFF 0.0. If a position is given, then only scales are listed which have the pitch at this degree. If 0 is given, then its meaning is the last degree, or formal octave. If it is "n" then it equals the number of notes in the current scale.
Can only be combined with /RATIONAL and /SAVE_LIST, with the latter the list file is named search.lst. Use this list file with "@search". To search for a chord instead of a single pitch, create a scale with the chord tones (with INPUT/LINE for example) and use /SUPERSET.
```   /RATIONAL
```
To be used with /PITCH, it will only find rational pitches. The pitch parameter itself doesn't need to be rational. Must be combined with /PITCH, can also be combined with /SAVE_LIST.
```   /SIZE_PITCH  pitch  [file-mask]  [scale-size]
```
As /PITCH where it is different only if a scale size parameter is given. Then only scales with that size will be searched. If 0 or no parameter is given, then it means any size. Can only be combined with /RATIONAL and /SAVE_LIST.
```   /RANGE  [file-mask]  [scale-size]
```
Search for scales which have a given number of pitches within a given interval. They will also match the given file mask and size. First the lower and higher interval of the range will be asked. Then the number of tones in the range must be given. This can also be 0. If the default -1 is entered it means scales with any number of tones greater than 0 in the range will be shown. The pitch order does not matter. Can only be combined with /SAVE_LIST. The name of the list file will be comprange.lst.

CONVERGENTS

```CONVERGENTS  number  [octave]  [min-deviation]
```
Show the convergents (continued fraction) of a nonnegative linear number. At the left it is shown whether the displayed fraction is higher or lower than the given number by a plus or a minus sign, or if it's equal (within the computer's floating point resolution) with an equal sign. For every convergent the total number of (semi-)convergents is then displayed, followed by the fraction. Then the continued fraction expansion is shown. If an asterisk appears, then the ratio is too large to be displayed and only the fractional part (between 0 and 1) is shown. The last column shows the difference between the ratio and the number. If the octave parameter is given, the number will be divided by the log of it. The output can be truncated at the end by giving a third parameter which is interpreted as the minimum deviation for inclusion in the list so the higher denominators are omitted.
If you want the parameter to represent a logarithmic pitch value, use /CENTS or /LOGARITHMIC. The parameter may also be given as a ratio smaller than 1, or be a pitch memory or scale degree (see help of \$ and %). If you want to enter a value in cents, but it to be interpreted as a linear value, then put 'c' in front of the value, like this: c702.0. See also RATIO (/FAREY, /PARENTS, /CHILDREN and /STERN), DIVIDE/FIND and SET ATTRIBUTE (DEPTH, FRACTION, STERN). The attribute STERN is the same as the sum of the number of semi-convergents in the second column.
Use this command among others to find out what is a good scale size for a linear temperament with a given generator. See also LINEARTEMP and DIVIDE/GENERATOR. To see convergents' denominators of scale pitches it's also possible to use SET ATTRIBUTE CONVERGENTS.
```   /SEMI
```
Also show all semi-convergents. They are indicated with an 's' and precede the full convergent that they belong to.
```   /CENTS  pitch  [octave]  [min-deviation]
```
Interpret the parameter as being a cents value and show the convergents. If it's rational then the logarithm will be taken first. If the octave parameter is given, the number will be divided by the log of it. It can be a rational or cents value. Cannot be combined with /LOGARITHMIC.
```   /LOGARITHMIC  number  [octave]  [min-deviation]
```
Take first the logarithm of the parameter and then show the convergents. If it's smaller than 1.0 the reciprocal will be taken. For a pitch memory or scale degree it is the same as /CENTS. In absence of the octave parameter, it's the binary logarithm, otherwise the given octave is the logarithm's base. It can be a rational or floating point number. This shows which equal temperaments contain an approximation to the given number. Cannot be combined with /CENTS.

COPY

```COPY  scalenr.  scalenr.
```
Copy the first to the second given scale. The current scale is number 0. The number of scale memories and undo-memories is set in scala.ini. The total number of scales is the sum of these two. To undo a scale operation, UNDO or COPY can be used. Copying scales into the undo-memories should be avoided. See also PUSH, POP and UNDO.
```   /PITCH  pitch  pitchnr.
```
Assign a pitch to the given pitch memory. Warning: it is not copying one pitch memory to another. To do that, use a \$-value with the first pitch (see help of \$). The highest pitch memory is set in scala.ini (default 10). See also help of :=. Can only be combined with /RANDOM.
```   /NOTATION  notename  [pitchnr.]  [notation-system]
```
Puts the nominal note value according to the given notation system in the given pitch memory. For notations of equal tempered systems this is the equal tempered value. For diatonic notations, all accidentals may be used in any combination. Octave numbers can be appended to the note name with a period in between, for example: c#.1. The default pitch memory is number 0. The default notation system is the current one. See also the %noteval() function in the ECHO command. Cannot be combined with other qualifiers.
```   /RANDOM  [scalenr.]
```
Copy a random non-empty scale to the current or given scale. The current scale will not be chosen. The chances for all non-empty scales to be copied are the same. See also SEED. Can only be combined with /PITCH.
```   /PITCH/RANDOM  lower-bound  higher-bound  [pitchnr.]
```
Assign a random pitch to the given pitch memory. The default pitch memory is 0. The pitch will be distributed logarithmically uniform between the given lower and higher bound. If the higher bound is lowest then it will be considered as the lower bound. Afterwards, the pitch value may not only be used as pitch but also as a parameter for a command.
```   /FREQ_MAP
```
Copy the base frequency to the reference frequency of the current keyboard mapping. See also SET MAP_FREQ. There is no parameter. Cannot be combined with other qualifiers.
```   /MAP_FREQ
```
Copy the reference frequency of the current keyboard mapping to the base frequency. See also SET FREQUENCY. There is no parameter. Cannot be combined with other qualifiers.

CPS

```CPS
```
Create a Wilson Combination Product Set. First is asked Enter number of factors to select from:, which is the number of factors the set will be taken from. Then Enter combination count:, which is the number of factors in each product. Subsequently all the factors must be entered which can have any ratio or cents value.
In order to obtain from there a useful scale, the central tone can be deleted with the DELETE command with degree 0 as parameter. Alternatively MOVE/KEY for another degree. Next, reduce the pitches to the range of one given formal octave using REDUCE. Then SORT and eventually an octave can be added with APPEND, or use NORMALIZE. To take a useful attribute in combination with a CPS scale, do SET ATTRIBUTE SEP_PRIMES.
```   /SCALE  [scalenr.]
```
Instead of entering the factors one by one, the current or given scale is used. If the current scale is used, it will be replaced with the result. Only the combination count needs to be entered, except when in combination with /DUDON. Degree 0 with 1/1 is not used, so if a factor of 1/1 is desired, there needs to be an extra one in the scale besides degree 0.
Instead of a scale number, you can also give a filename. Can not be combined with /FACTOR.
```   /CORNER
```
Create a larger Combination Product Set by also taking combinations of the generating intervals themselves. So once one interval is selected, it is put back in the set so it can be taken again (drawing with replacement). The lattice of the result scale is then in the form of a corner. It is similar to /SUPERSTELLATED, a one-sided form of it. Use the LATTICE command to see the difference. Can only be combined with /FACTOR and /SCALE.
```   /EXPANDED
```
Create an expanded Combination Product Set by taking several combination counts of the generating intervals. First enter the number of factors. Then the first combination count (default 1) and the last combination count. All combination counts from the first until the last will be combined in the scale. If all counts from 1 to the number of factors is taken then it produces an Euler-Fokker genus. Can only be combined with /FACTOR and /SCALE. See also EULERFOKKER.
```   /STELLATED
```
Create a stellated Combination Product Set. The input values are given as with a normal CPS. A stellated CPS is a CPS where all otonal (harmonic) and utonal (subharmonic) chords are completed by adding missing tones. For example, in a 2 out of 4 CPS (Hexany), there are 6 tones forming 4 otonal and 4 utonal triads. These are completed to tetrads, so 8 tones are added making a total of 14. If the Hexany is pictured as an octahedron, the added tones are points above the faces, giving a starlike shape, hence the name. If the number of factors is not twice the combination count, then the otonal and utonal chords are not equal in number but stellation is still possible.
Contrary to the unqualified CPS command, the central tone, 1/1, is not in the scale unless it is added in the stellation process. So one doesn't need to delete it afterwards. The tonic is by default the smallest product. Do NORMALIZE afterwards to get an octave reduced scale.
Note that Erv Wilson's definition of stellation only encompasses the case where the combination count is half the number of factors, and the generalisation of it here to all combination counts is not necessarily what he would intend it to be, nor with /SUPERSTELLATED.
Can only be combined with /FACTOR and /SCALE.
```   /SUPERSTELLATED
```
Create a superstellated Combination Product Set. This is a CPS which results from CPS/STELLATED, but where the incomplete chords formed by the extra tones of the stellation are also completed; and if that forms new incomplete chords, they are also completed, and so on. Note that this operation is how Erv Wilson defined "stellation". Perhaps confusingly, the names in this program have been chosen to distinguish and characterise the two kinds of stellation.
Can only be combined with /FACTOR and /SCALE.
```   /FACTOR
```
Create a Combination Product Set by giving the generating intervals as linear factors which need not have a period. Cannot be combined with /DUDON and /SCALE.
```   /DUDON  comma-list
```
Creates a Dudon scale, a name given by Gene Ward Smith for a scale containing all the odd divisors of both the numerator and denominator of a given comma. It considers a comma as a coincidence between primes and gathers all harmonic paths to arrive to it. For the sake of generality this function also includes the even divisors. They can be removed afterwards with the NORMALIZE command. If a list of commas is given instead of one, it compiles all the divisors together in one scale. So it's the same as taking the union with the MERGE command. Such a scale is similar to a CPS because it's identical to an expanded CPS with all combinations of the prime factors of the comma's numerator merged with the same of the denominator. Instead of commas, commatic approximations to simple intervals also produce interesting results. The given intervals must be rational. Of course it is also possible to use positive integers instead of ratios. The scale then consists of all divisors of the given number(s).
Afterwards reduce the pitches to the range of one given formal octave using NORMALIZE. You can also temper out the comma used to create the scale with the PROJECT/TEMPER command. This will result in a scale with one tone less if you apply UNIQUE to it. These scales are also called Clippers. Or you could discard the comma from the scale by doing DISCARD/SMALLEST. If more than one comma was used, it will only remove the smallest comma, so repeat it for the next smallest, etc. Can only be combined with /SCALE.

DELETE

```DELETE  position  [scalenr.]
```
Delete a position (degree) from the current or given scale. Positions may not be higher than the number of notes in the scale. If degree 0 with the value 1/1 is deleted, then all pitches shift downward by the amount of degree 1. If more than one position is given as parameter, they need to be separated by spaces. For deleting pitches at repeated positions use SAMPLE. See also LIMIT/DELETE, INSERT and SELECT. Qualifiers cannot be combined.
```   /START  first-position  [scalenr.]
```
Delete all pitches at the given position and higher from the current or given scale. The same operation can be done with EXTEND and SELECT/RANGE.
```   /INTERVAL  position  [scalenr.]
```
Delete the interval at the given position (degree) from the current or given scale. The position may not be higher than the number of notes in the scale. The pitches above the given position will then shift downward. See DISCARD/EQUAL to delete an interval with a given size.
```   /EQUAL  pitch  [scalenr.]
```
Delete the given pitch from the current or given scale. If there are more degrees with the same pitch, then these are all deleted.
```   /GREATER  pitch  [scalenr.]
```
Delete all pitches from the current or given scale that are greater than the given pitch.
```   /NEAREST  pitch  [scalenr.]
```
Delete the pitch from the current or given scale that is nearest to the given pitch. Degree 0 will not be deleted or found as nearest.
```   /SMALLER  pitch  [scalenr.]
```
Delete all pitches from the current or given scale that are smaller than the given pitch.
```   /EGALIZE  [scalenr.]
```
Delete one pitch from the current scale or given scale so as to make the scale more equal tempered. If the scale would not become more equal tempered by deleting one pitch, then nothing happens. All interval classes are considered in this. The sum of absolute logarithmic differences of all intervals with the equal tempered intervals is minimised. Note this is not the same as the average distance from equal tempered shown by SHOW DATA. The formal octave will be kept.
```   /FACTOR  factor  [scalenr.]
```
Delete all rational pitches which contain the given factor from the current or given scale. The factor can be an integer (prime or not) or a ratio. See also PROJECT.
```   /DEN_FACTOR  factor  [scalenr.]
```
As /FACTOR, but deletes rational pitches which denominator contains the given factor. The factor should be an integer (prime or not). If it's a ratio, then the denominator is simply ignored.
```   /FLOATS  [scalenr.]
```
Delete all floating point pitches from the current or given scale.
```   /MODEL  scalenr.  [scalenr.]
```
For each pitch in the first given scale, the nearest pitch from the current or second given scale will be deleted. The formal octave will not be deleted. Instead of a scale number, a filename may also be given for the first parameter. See also SELECT/MODEL.
```   /RANDOM  [count]  [scalenr.]
```
Delete a randomly chosen pitch from the current or given scale. The formal octave may also be deleted. If a count is given then so many randomly chosen pitches will be deleted with each the same probability. See also SAMPLE/RANDOM, SIEVE/RANDOM and SEED.
```   /OVER  [scalenr.]
```
Delete all rational pitches from the current or given scale which numerator has a higher prime limit than the denominator. The formal octave and floating point pitches are not deleted.
```   /UNDER  [scalenr.]
```
Delete all rational pitches from the current or given scale which denominator has a higher prime limit than the numerator. The formal octave and floating point pitches are not deleted.
```   /ODD_OVER  [scalenr.]
```
Delete all rational pitches from the current or given scale which numerator has a higher odd limit than the denominator. The formal octave and floating point pitches are not deleted.
```   /ODD_UNDER  [scalenr.]
```
Delete all rational pitches from the current or given scale which denominator has a higher odd limit than the numerator. The formal octave and floating point pitches are not deleted.

DIFFERENCE

```DIFFERENCE  scalenr.  [scalenr.]
```
Remove pitches that are both in the first scale and the second scale from the second scale. The current scale is default for the second parameter. The first parameter may also be a filename. See also INTERSECT and MERGE.
For the exclusive-or of two scales (i.e. obtain the pitches not contained in both) see command file xor.cmd.
```   /ALL  [first-scalenr.]  [last-scalenr.]
```
Perform the difference with all scales in the given scale range with the current scale. If no parameters are given then all working scales from 1 and higher will be done but not the Undo scales. The last scale number is inclusive.

DIRECTORY

```DIRECTORY  [file-mask]  [scale-size]
```
Show the list of files that satisfy the given filename pattern. If it is omitted, the file mask will be *.scl. It will show the name, size and part of the description as the window width permits. If no filename extension is given, '.scl' will be assumed. If the scale size parameter is also given, then files which conform to the file mask and which have this scale size are shown. It must be a positive number. If only a scale size is given and no file mask, then all scale files with that number of notes will be shown.
For file types other than scales, the size or description lists these numbers:
• Keyboard mapping files: mapping size
• MIDI files: number of tracks
• WAV, AAC, FLAC, MP3, OGG, DSF files: number of audio channels
• BMP, GIF, PNG files: number of pixels hor x ver
• Scale list files: number of lines
• ZIP files: number of archived files
For MIDI files which have been tuned by Scala, "P" or "M" is shown after the filename, "P" if pitch bend tuned and "M" if tuned with MIDI Tuning Standard.
To get a list of scale files which have a certain property, use one of the qualifiers listed below. It is also possible to list scales with a given number of pitches within a given range. To do this use COMPARE/RANGE.
```   /DESCRIPTION  search-pattern  [file-mask]
```
Show the list of scale files which have the given search pattern in the scale description. It may contain wildcards like * and ?, see help of Patterns for the syntax. If it consists of more than one word, it must be surrounded by double quotes ("). To avoid that, you can also use a ? instead of a space, but that may give extra results. Matching is case-insensitive.
The default file mask is *.scl. Cannot be combined with other qualifiers.
```   /FIND  search-pattern  [file-mask]
```
Searches the files according to the given file mask for the given search pattern. Show all lines in the files that contain the pattern. If no file mask is given then all files in the current directory will be searched. If the pattern consists of more than one word, it must be surrounded by double quotes ("). Matching is case-insensitive. See also Patterns. For example to see if there's something about horograms among the tips, do DIR/FIND horogram tips.par. This function is used by the SHOW ITEMS command internally. Cannot be combined with other qualifiers.
```   /MAPPING  [file-mask]  [map-size]
```
Show the list of keyboard mapping files that satisfy the given filename pattern and mapping size, if given. Works by assuming filename extension '.kbm'. Can only be combined with /NAME_ONLY.
```   /NAME_ONLY  [file-mask]
```
This will only display the filenames, which is quicker. Scales and mappings cannot be selected by size, only file mask. Can only be combined with /SAVE_LIST.
```   /SAVE_LIST  [file-mask]  [output-filename]  [scale-size]
```
Save the filenames shown by the command to a scale list file with the given name or dir.lst, which is default. This list file is used when "@dir" is the given parameter instead of a filename mask. This enables checking scale files to have a combination of properties. Or if the list file is used with COMPARE, it allows a much quicker comparison against these files. You can also use it to load them all into memory, or to invoke an operation on all of them using ITERATE. Can only be combined with /NAME_ONLY, /EULERFOKKER, /LINEARTEMP, /MODE, /PROPER, /RATIONAL, /TRIVALENT and /WELLTEMP.
```   /SIZE  [file-mask]  [scale-size]
```
Show the amount of scales that satisfy the given filename pattern for each scale size up to 1200 tones. If it is omitted, the file mask will be *.scl. If the scale size parameter is given, then only the amount for this size will be shown. Cannot be combined with other qualifiers.
```   /WIDE  [file-mask]
```
This will only display the filenames, and more than one per line. Cannot be combined with other qualifiers.
```   /EULERFOKKER  [file-mask]  [scale-size]
```
This will display only scales which are complete Euler-Fokker genera, such as is shown by SHOW DATA as "scale is a complete genus musicum". Scales must be rational, and also degenerate genera with a single dimension will be shown. The prime-limit is shown behind the filename. Can only be combined with /SAVE_LIST.
```   /HARMONIC  [file-mask]  [scale-size]
```
This will display only scales which are complete harmonic or subharmonic scales, such as is shown by SHOW DATA as "Length of longest (sub)harmonic part" when this is one less than the scale size. Scales must be rational. Can only be combined with /SAVE_LIST.
```   /LINEARTEMP  [file-mask]  [scale-size]
```
This will display only scales which are linear temperaments, such as is also shown by SHOW DATA as Myhill's property or as equal temperament. In the latter case, "ET" is put behind the filename. Can only be combined with /SAVE_LIST.
```   /MODE  [file-mask]  [scale-size]  [size]
```
This will display only scales which are subsets of equal temperaments with 2400 tones or less, such as is also shown by SHOW DATA. The value of 2400 for the highest ET can be changed by adding a key Max_ET_Mode to file scala.ini. If the scale size parameter is given, then only files which have this scale size are shown. When the third parameter which is mode size is given, then only the subsets of that ET are given. To show this for all scale sizes, use 0 for the scale size parameter. The file mask cannot be omitted if the mode size is given. For example, to show all subsets of 31-tone ETs, do DIR/MODE *.scl 0 31.
Can only be combined with /SAVE_LIST. In that case the mode size parameter cannot be given.
```   /NON_MONO  [file-mask]  [scale-size]
```
This will display only scales which are not monotonic ascending, such as is also shown by SHOW DATA. Can only be combined with /SAVE_LIST.
```   /CIRCULATING  [file-mask]  [scale-size]
```
This will display only scales where the best fifths form a closed circle, such as is also shown by SHOW DATA. The scale must be in ascending order. To use this command for another generator you can add a key to the scala.ini file: Dir_Circ_Gen 1.5 for example with a frequency ratio specified as a linear factor. Can only be combined with /SAVE_LIST.
```   /CS  [file-mask]  [scale-size]
```
This will display only scales which are a Constant Structure, such as is also shown by SHOW DATA. It only checks scales with not more than 150 pitches, otherwise they will be shown anyway. Can only be combined with /SAVE_LIST.
```   /PROPER  [file-mask]  [scale-size]
```
This will display only scales which are proper or strictly proper, such as is also shown by SHOW DATA. Can only be combined with /SAVE_LIST.
```   /RATIONAL  [file-mask]  [scale-size]
```
This will display only scales which consist entirely of rational pitches. The prime-limit is shown behind the filename. If the scale has all superparticular steps, then "S" is shown behind the prime-limit. Can only be combined with /SAVE_LIST.
```   /STEPS_SHOW  small-count  large-count  [file-mask]
```
This will display only scales which have the given number of small and large one-step intervals and not more than two different sizes of them. If one or both of the given counts is 0, then that count will be ignored. So if both are 0, then all files with 2 step sizes will be shown. See also LINEARTEMP/STEPS_SHOW and MODE/STEPS_SHOW. Note that this does not imply that the scales have Myhill's property since only interval class 1 is examined. If the scale does have Myhill's property then this is indicated with "M" behind the filename. Cannot be combined with other qualifiers.
```   /TRIVALENT  [file-mask]  [scale-size]
```
This will display only scales which are trivalent, such as is also shown by SHOW DATA. It means that all interval classes have exactly three sizes. Can only be combined with /SAVE_LIST.
```   /WELLTEMP  [file-mask]
```
This will display only 12-tone scales with 2/1 as octave, which are well-temperaments or French temperaments ordinaires, such as is also shown by SHOW DATA. In the latter case, "ORD" is put behind the filename. Can only be combined with /SAVE_LIST.
```   /CREATE  directory
```
Create a new directory in the current one. If it already exists, nothing will be done. To see the current directory, use CD with no parameter. Cannot be combined with other qualifers.

```DISCARD  margin  [scalenr.]
```
Find clusters of notes that are within the given range from each other, and delete all but the one with the highest absolute harmonicity value. The margin can be given in cents or as a ratio. If there are notes with equal harmonicity values which are highest, they are kept. The harmonicity value of a floating point pitch is considered to be zero, so they are always deleted if there is a rational pitch within the margin. If all notes are floating point pitches then the lowest scale degree will be kept. The default scale is the current scale.
The harmonicity function can be customised with the SET HARMCONST command and the coefficients viewed with SHOW HARMCONST.
After doing this command, the notes will be in ascending order. An example, to remove notes within a syntonic comma do: DISCARD \$k. To remove notes by distinguishing them in other ways, see LIMIT. Qualifiers cannot be combined.
```   /SMALLEST  [scalenr.]
```
Use as margin the smallest interval of the current or given scale. This is equivalent to doing DISCARD %si. To see what is the smallest interval SHOW DATA can be done.
```   /EQUAL  interval  [scalenr.]
```
Delete from all intervals in the current or given scale which are equal to the given interval, the pitch with the lowest absolute harmonicity value. If the harmonicity values are equal then the highest pitch will be deleted. The harmonicity value of a floating point pitch is considered to be zero. After doing this command, the notes will be in ascending order and unique.
```   /NONSUPER  [scalenr.]
```
Delete the pitches whose interval to the previous pitch, if rational, is not a superparticular ratio. The last pitch may also be deleted. This command may be repeated until the scale is completely superparticular. Use SHOW/INTERVAL SCALE to see the result and SHOW DATA to check if the scale is superparticular.
```   /TEMPER  scalenr.  [scalenr.]
```
Temper out the smallest one step interval in the current or given scale by changing the other intervals. A set of pitches which must remain the same must be specified in the first scale parameter. Instead of a scale number, a filename may also be given. All pitches in the first scale parameter must be expressible as a combination of the one step intervals in the other scale. To check this, the command SHOW/INTERVAL COMBINATION can be used. If this is not the case, then an Illegal argument message is shown. If there is no possible solution, for example if too many pitches are given to remain fixed, then a "no solution" message will show. Note that these pitches do not necessarily have to be present in the current scale. They may also be outside the scale's range. If the formal octave of the second scale must remain the same, it must be included in the first scale. The smallest interval can be seen with SHOW DATA. Irrational intervals can also be tempered out, the procedure is not based on primes like PROJECT/TEMPER is. Use UNIQUE afterwards to remove the double pitches. See also MODE/SOLVE.

DIVIDE

```DIVIDE  interval  count  [lower-bound]
```
Show divisions of the given interval in superparticular ratios where the second parameter is the number of ratios. The first parameter must be a ratio larger than 1. Only one permutation of each division is given; the interval sizes are in descending order. The highest prime limit of the ratios is also shown. If a lower bound parameter is entered, then only divisions with all intervals greater than or equal to it are shown. Qualifiers cannot be combined.
```   /EGALIZE  interval  count  [scalenr.]
```
As above, but only shows the division in which the superparticular ratios differ the least from one another. This is the division shown last in the above command, so if you only need to see the most even division this saves much time. You can also store the result in a scale when a scale number is given as third parameter. This parameter has no default value, so if you want to store it in the current scale, use number 0. Afterwards you can change it to the most equal scale with PERMUTE/EGALIZE and KEY/EGALIZE.
```   /SUPER_LIMIT  interval  count  [highest-prime]
```
As without qualifier, but if the highest prime parameter is given then only show divisions which have a lower or equal prime limit.
```   /FIND  interval  [octave]  [max-difference]
```
Show the equal tempered divisions of the given formal octave wherein a scale degree approximates the given interval. The default octave is 2/1. If no maximum difference parameter is given, then successively better approximations will be shown, multiples of earlier shown divisions will not be shown, and three dots will indicate that all intermediate temperaments successively approximate the given interval better and better until the one on the next line. If a maximum difference is given (cents or ratio), then all divisions with a deviation less than that will be shown. It stops when the deviation is zero. If the given octave is an integer division of 2/1 then the division for 2/1 is also shown between parentheses.
This command can also be used to approximate a triad with an equal temperament. For example, to approximate 5:6:8 do DIVIDE/FIND 6/5 8/5.
To approximate more than interval with an equal division, use the command FIT/MODE. The formal octave needs to be present in the scale then.
To find a least-squares approximation of more than one interval, use the command FIT.
```   /ALL_FIND  interval  [octave]
```
Like /FIND, but show all successive equal tempered divisions. It continues also when the deviation is zero. Divisions which are a multiple of one shown above will have an indication which division that is.
```   /REL_FIND  interval  rel-max-difference  [octave]
```
Like /ALL_FIND, but shows all successive equal tempered divisions with a maximum difference relative to the step size. The second parameter is given as a percentage of logarithmic step size. So when it's 50.0 or higher then all divisions will be shown. It stops when the deviation is zero.
```   /CONSISTENT  intervals  [octave]  [max-difference-or-steps]
```
Like /FIND, but instead of the best direct approximation, the best consistent approximation is given. Consistent approximation means that the constituent prime factors of the interval ratio are approximated to the nearest step in each successive division, and these step numbers are added to approximate the ratio. This often gives a different result than the direct approximation. If the shown division is consistent for the harmonic limit of the given interval, this is indicated with a 'h'. Harmonic limit being in this case the maximum of numerator and denominator, but is shown only if it's less than 10000. If not and it's consistent for the prime limit of the interval, it's indicated with a 'p'. See also EQUALTEMP/DATA and EQUALTEMP/CONSISTENT.
If no third parameter is given, then all divisions will be shown. If it is a ratio or cents value, then it's interpreted as a maximum difference for the approximation. If it's an integer value, then it's interpreted as a number of steps and only the divisions where the consistent approximation is the same number of steps will be shown. The numbers given between < and | are the number of equal tempered steps for the primes in the given interval(s) in ascending order.
Example: to see in which octave divisions the syntonic comma vanishes, do DIVIDE/CONSISTENT \$k 2/1 0, vanishing means it is zero steps. When it's zero steps, the number and size in cents is omitted as it's always zero.
More than one rational interval can be given, but they must be surrounded by double quotes to form a single parameter. Then if a third parameter is given, only the divisions in which all intervals have this number of steps will be shown. The difference given is the highest difference for the given intervals.
For each result division, the TOP-RMS and TOP errors are given in cents for the constituent primes of the given intervals. And as last the best division for each. See also EQUALTEMP/CONSISTENT, EQUALTEMP/VANISH and QUANTIZE/CONSISTENT.
```   /LIMIT_CONS  intervals  [octave]  [max-difference-or-steps]
```
As /CONSISTENT, but only shows those divisions which are prime limit consistent in the highest limit of the given intervals. So all which are indicated with a 'p'.
```   /RANGE  low-interval  high-interval  [octave]
```
Like /ALL_FIND, but shows results for a given interval range. If the octave parameter is not given, 2/1 is the default. It shows all equal temperaments with tone(s) in the given range and it continues when the deviation is zero. The high interval must not be smaller than the low interval. The range may lie outside the octave range. Divisions which are a multiple of one shown above will have an indication which division that is. See also SHOW/RANGE LOCATIONS.
```   /GENERATOR  interval  generator  [octave]
```
Shows divisions of the (octave extended) given interval which approximate the given generator. If the octave parameter is not given, 2/1 is the default formal octave (period). Only successively better approximations with an error less than the size of the generator will be shown, unless the maximum deviation set with SET MAXDIFF is not 0.0 cents. Then all approximations not exceeding this difference will be shown. The results given are: the number of octaves and the number of generator steps (between the brackets, also called the mapping), the resulting interval using the given generator, the difference with the given interval (the comma which can be tempered out), and the generator to attain the given interval exactly. At the next line, the number of tones that produce a well-formed scale is given, i.e. has Myhill's property or is equal tempered, see LINEARTEMP/WELLFORMED. See also CONVERGENTS, LINEARTEMP/ALL_SHOW and LINEARTEMP/NEAREST.
```   /FIRST_GEN  interval  generator  [octave]
```
As above, but only shows the first approximation with a nonzero generator count.

DOUBLE

```DOUBLE  [interval-class]  [expansion]  [position]
```
Double the number of pitches in the current scale by inserting a mean between pitches separated by the given interval-class. The default interval-class is 1, which means adjacent pitches. It may be any integer number. The default expansion factor is 2, i.e. doubling. To triple by inserting two means, do DOUBLE 1 3. Expansion may be any positive number. To insert new pitches only between one pair, give the upper scale degree number as the third parameter, for example to insert one pitch between degrees 6 and 7, do DOUBLE 1 2 7.
The qualifiers select the pitch-averaging operation. Geometric mean is the default. See also AVERAGE, SAMPLE, SYMMETRIZE, MORPH and INSERT/SPLIT. Qualifiers cannot be combined.
```   /GEOMETRIC
```
Uses the geometric mean, i.e. sqrt(a * b). This divides an interval equally. This is the default qualifier.
```   /ARITHMETIC
```
Uses the arithmetic mean, i.e. (a + b) / 2. Densifying a scale by inserting harmonic or arithmetic means is also known as katapyknosis.
```   /HARMONIC
```
Uses the harmonic mean, i.e. 2 * a * b / (a + b). It is the arithmetic mean with the intervals reversed. Densifying a scale by inserting harmonic or arithmetic means is also known as katapyknosis.
```   /SUBC_HARMONIC
```
Uses the subcontrary to harmonic mean, i.e. (a2 + b2) / (a + b).
```   /RHSM
```
Uses the root harmonic square mean, i.e. sqrt(2 * a2 * b2 / (a2 + b2)).
```   /RMS
```
Uses the root mean square, i.e. sqrt((a2 + b2) / 2).
```   /LOGARITHMIC
```
Uses the logarithmic mean, i.e. log(mean) = (b * log(a) + a * log(b)) / (a + b). Specifying another expansion factor than 2 is not allowed.
```   /SUB1_GEOMETRIC
```
Uses the first subcontrary to geometric mean, i.e. ((b - a) + sqrt((a - b)2 + 4a2)) / 2. Specifying another expansion factor than 2 is not allowed.
```   /SUB2_GEOMETRIC
```
Uses the second subcontrary to geometric mean, i.e. ((a - b) + sqrt((a - b)2 + 4b2)) / 2. Specifying another expansion factor than 2 is not allowed.
```   /COUNTER_LOG
```
Uses the counterlogarithmic mean, i.e. log(mean) = (a * log(a) + b * log(b)) / (a + b). Specifying another expansion factor than 2 is not allowed.
```   /MEDIANT  [interval-class]  [position]
```
Uses the mediant, i.e. (num(a) + num(b)) / (den(a) + den(b)). All pitches must be rational. Specifying another expansion factor is not allowed. See also INSERT/MEDIANT.
```   /GOLDEN  [interval-class]  [position]
```
Uses the golden mediant, also called noble mediant, which is (num(a) + phi * num(b)) / (den(a) + phi * den(b)), where phi is the golden ratio: 1.61803398875 approximately. All pitches must be rational. Specifying another expansion factor is not allowed.
```   /EPIDEN  [interval-class]  [expansion]  [position]
```
Uses the epimoric mean, i.e. (2 * a * b - a - b) / (a + b - 2), which is produced by the arithmetic mean of the Epimoric Denominator, see also SET ATTRIBUTE EPIDEN. The above formula is for expansion factor 2. Higher ones are also allowed. However if one of the two pitches which are being interpolated is 1/1, then the mean cannot be calculated and one is added instead to the epimoric value of the other pitch. If both pitches are superparticular (epimoric), then this mean equals the mediant.

DWARF

```DWARF  scale-size  octave  [highest-prime]
```
Create a dwarf scale with the given number of tones and formal octave (period). Such scales are rational, and have pitches with the smallest numerator (modulo the octave) which is prime consistent with their scale degree. They were invented by Gene Ward Smith.
The octave must be a prime number, although for non JI-epimorphic results other integers may be used too. If no third parameter is given, the prime limit will be asked. The limit set by SET LIMIT will be the default when no value is entered. The highest prime which can be used is set in scala.ini. Subsequently the number of steps for each prime will be asked (also called the val). They may not have a common divisor, the GCD must be 1. One or more may be 0 however, and this excludes the corresponding prime from the scale. The number of primes must also be more than 1, so a limit of 2 cannot be used. For larger scales and few number of primes, this command may take a while to run.
If the third parameter, the prime limit is given, then the number of steps for the primes do not need to be given because the patent val (also called standard val) will be assumed (this is the best approximation to the primes given a fixed formal octave and number of tones). The result scales are JI-epimorphic which can be checked with SHOW DATA. Afterwards, KEY/CENTRE may be used to simplify the ratios by transposing the scale. Or SORT should be done afterwards to put the scale in ascending order. See also EQUALTEMP/DATA for vals which may be better than the patent vals. See also HOBBIT.

ECHO

```ECHO  [text]
```
Writes the given text to the screen. Use this to displaying text in a command file. Without text, an empty line will be written. This command can also be used to display pitch values on the screen or simultaneously display them and write them to an output file, see FILE. In the following functions, a pitch parameter is a pitch expression, see help of Expressions, or an arithmetical pitch expression, see CALCULATE.
The parentheses are always mandatory. No spaces can be put between the function name and the parenthesis. The following lexical functions exist:
%attrib(pitch,attribute)
Gives the attribute value of a pitch for the given attribute kind. Some attributes are disallowed, namely those that do not solely depend on the pitch itself, for example: DIFF_ET, DISSONANCE, INTERVAL, MULTIPLE, NOTATION, OTHER_SCALE, etc. See also SET ATTRIBUTE.
%attrib(degree)
Gives the value of the current attribute of a scale degree of the current scale. It may be outside the range of the current scale. Instead of a number %i can be used when used under the ITERATE command. The disallowed attributes are INTERVAL, NOTATION and OTHER_SCALE.
%bpm(pitch)
Gives the frequency in beats per minute relative to the base frequency.
%cents(pitch)
Gives the cents value.
%den(pitch)
Gives the denominator of a rational pitch.
%desc(scalenr.)
Gives the description belonging to the scale memory.
%ellis(pitch)
Gives the frequency in Ellis relative to the base frequency. Ellis is the number of cents and octaves relative to the 64-foot C (16.3516 Hz).
%factor(pitch)
Gives the linear value.
%hertz(pitch)
Gives the frequency in Hertz relative to the base frequency.
%i()
Gives the current scale degree or iteration number if applicable under execution of an ITERATE command.
%image(pitch)
Gives the ratio of a rational pitch or cents value of a floating pitch.
%listfactor(scalenr.)
Gives the scale as a list of linear factors starting at degree 1. So put 1.0 in front for degree 0 if necessary.
%log_fract(pitch)
Gives the number of octaves as a fraction with maximum denominator 999.
%midi(pitch)
Gives the fractional MIDI note number relative to the base frequency.
%n(scalenr.)
Gives the number of notes in a scale memory. Adding and subtracting is also possible, like %n-1(0).
%name(pitch)
Gives the interval name of a rational pitch.
%note(pitch,notation-system)
Gives the shortest note name according to the given notation system. See help of SET NOTATION for the list of notation systems. If the notation system is omitted, the current notation system is used.
%note2(pitch,notation-system)
As above, but gives a second name too if there is one.
%noteoct(pitch,notation-system)
Gives the shortest note name plus octave number according to the given or current notation system.
%noteval(note-name,notation-system)
Gives the nominal note value according to the given notation system. For equal tempered systems this is the equal tempered value. For equal tempered systems which are diatonic, all accidentals may be used in any combination. Octave numbers can be appended to the note name with a period in between, for example: c#.1 The same name can be used in the score files for EXAMPLE. For Sagittal notations, only the current form is recognised, see SET SAGITTAL. To store a note value in a pitch memory, use COPY/NOTATION. The notation system parameter can be omitted, in which case the current notation is used. However if the note name contains parentheses you must not omit the comma after the note name to resolve the ambiguity.
%num(pitch)
Gives the numerator of a rational pitch.
%octcps(pitch)
Gives the Csound/SAOL oct value relative to the base frequency.
%primes(pitch)
Gives the prime factorisation of a rational pitch.
%reci(pitch,unit)
Gives the reciprocal linear value times the given unit.
%scl(appendix)
Gives the name of the last scale file saved or loaded, regardless to which scale memory. If appendix is a non-empty string, then it is appended while replacing the original file extension. So if it was .scl, then %scl() is equivalent to %scl(.scl). This function can also be used to specify a filename for the commands COMPARE, FILE, LOAD, REMOVE, SAVE, SEND/FILE, SET DESCRIPTION and TYPE. If there was no file loaded or saved before and the appendix parameter is empty, then the value will be "scala-temp".
%sep_primes(pitch)
Gives the prime factorisation of a rational pitch, not using exponents and excluding prime number 2 (for example 3.3.5.7).
%synth()
Gives the current synthesizer model name.
%sys()
Gives the current notation system name.
%units(pitch,units_per_octave)
Gives the logarithmic value in terms of the given unit.
To get pitch values from the current scale (number 0), use % followed by a degree number, for example: %cents(%5).
To get interval values from the current scale, use %% followed by a degree number, for example: %cents(%%5).
These functions can be mixed with other text or used more than once per line. They cannot be nested. They can be employed to write input files for other programs, like Pure Data for example, or be used to output user calculated data.

EGALIZE

```EGALIZE  factor  [scalenr.]
```
Move the pitches of the current or given scale towards or away from the equally tempered value. If the given factor is zero, the resulting scale will be an equal-tempered scale, if it is 1.0, the scale will remain unchanged. A factor larger than 1.0 increases the unevenness of the scale. The factor linearly influences the logarithmic difference of the scale pitches and the corresponding equally tempered pitch. The formal octave remains the same. The factor may be given as a fraction or as a floating point value and may also be negative. A value of -1 will reverse the sign of the difference with the equal-tempered value. To view the effect of this command do SET ATTRIBUTE DIFF_ET. See also AVERAGE.

EQUALTEMP

```EQUALTEMP  division  [octave]  [scale-size]
```
Create an equal-tempered scale with the given formal octave (also called modulus or interval of equivalence) divided into the given number of steps (division). The division may be either a positive integer or floating point number. If the octave parameter is not given, 2/1 is assumed. If a scale size is given, the resulting scale will have that number of notes, otherwise it will be the same as the division, or if the division was given as a floating point number, the nearest integer above that. To create a (non-octave) scale by giving the size of the step rather than dividing a formal octave, enter 1 for the division, the step size for the octave and the number of tones as the last parameter.
Equal tempered means that beating frequencies are proportional to the pitch. So it's different from equal beating temperaments, see also LINEARTEMP/EQUALBEATS. Qualifiers cannot be combined.
```   /CONSISTENT  limit  [octave]
```
Shows all the equal divisions that are consistent in the given limit. The default octave parameter is 2/1. Shown are the division, its consistency limit and consistency level for the given limit if it's odd. So all divisions with a consistency limit of the given limit or higher are shown. To see more aspects, check the divisions with EQUALTEMP/DATA. See also DIVIDE/CONSISTENT and QUANTIZE/CONSISTENT.
```   /DATA  division  [octave]  [alternative-fifth]
```
Shows structural properties of the temperament and relations between several intervals. The best approximations to major third, perfect fifth and harmonic seventh are shown and other interval sizes derived from them. If another formal octave than 2/1 is entered, the given comma sizes are with respect to the nearest octave approximation.
"Misfit numbers" are an invention of Fokker and are sums of squared errors in cents. M1 only counts 3/2, M2 is the sum of squared errors of 3/2 and 5/4, M3 of 3/2, 5/4 and 7/4, M4 adds 11/8 and M5 adds 13/8.
"Relative errors" are a percentage of the average deviation in terms of step size. The average absolute error is a quarter step, because the error varies between zero and half a step. R1 only counts 3/2, R2 is the sum of relative errors of 3/2 and 5/4 divided by two, R3 of 3/2, 5/4 and 7/4 divided by three, etc. like with the misfit numbers.
"Highest errors" shows the highest absolute error among all intervals in the diamond of limits 3 to 13. It's expressed as a percentage of the size of half a step, so it will not exceed 100%. H1 which only counts 3/2 is always half the value of R1.
"Combined error factor", from Mandelbaum, is the sum of the squared errors of the first basic three divided by the size of half a step. This makes it a kind of normalised version of the misfit number M3. The second combined error factor is given if the highest consistently represented harmonic is 9 or higher. It then includes the errors of the higher odd consistent harmonics reduced by the octave like 9/8, 11/8, etc.
The command also shows chromatic distributions and all possible strictly diatonic subscales and some subscales of other forms. With those, the diatonic semitones have a hyphen if their size matches the structural size, and note G is in upper case if the fifth equals the basic fifth.
If the third parameter is given, it is used as the best fifth, instead of the nearest approximation. It must be a positive step number in the upper half range smaller than the given division.
```   /DIFFERENTIAL  division  [octave]
```
Create a Dudon differentially coherent scale, which is a scale where difference tones between two pitches a fixed number of steps away, are also scale tones under octave equivalence. A simple example of such a scale is 1/1 6/5 3/2 8/5 19/10 2/1. The first parameter is the number of tones in the scale. The default octave parameter is 2/1. Then the interval class from which the difference tone results is asked followed by the target interval class for it. The default target given will be the nearest one. This is a negative number, since the difference tone will be smaller than 1/1. The last question asks for a scale position to exclude from the set of equations. The reason for this question is the fact that there is one more interval than tones to calculate, since the octave is given and fixed. So one tone has to be excluded, and cannot (in general) be differentially coherent. If the given number is from 0 to n-1 (n = the number of tones), then it only determines the mode or key of the result scale. The approximations to the excluded tone are then the same. If the given number is from n to 3*n-1, one equation is changed for one tone to become the target of two difference tones. This results in better or worse approximations, usually with less equal scales. Finally, if the given number is -1, then the best approximation of all will be taken. Sometimes it may seem there is a better approximation than the one taken, but then it will have duplicate tones, so it's not selected.
Because the result scale will be a JI scale, it's useful to do FAREY with a high enough order afterwards to make it rational. Only the denominator can easily become larger than the highest usable integer, and in that case there's no point in doing FAREY. The command EQUALTEMP/DATA tells which interval class has the best approximation to its difference tone.
Note that there are more ways than this method to create differentially coherent scales. Another way is to make a (large) harmonic scale with HARMONIC and then delete higher prime limit notes with LIMIT/DELETE or delete some other selection. See also HARMONIC/DIFFERENTIAL, SHOW/DIFFERENCE LOCATIONS and SUBTRACT/DIFFERENCE.
```   /FRACTIONAL  division  [octave]
```
Create a rational approximation to an equal tempered scale by way of a linear fractional transformation. It is a sort of combined harmonic/subharmonic scale with regularly varied numerators and denominators. The formal octave must be a ratio. If it is not a superparticular ratio then sometimes no rational result can be obtained, and then "Invalid argument" will be given. This scale model was invented by Daniel P. Stråhle in 1743. See also HARMONIC/OVER_UNDER. This is the same type of scale, however in the case here it is less general but the steps are chosen to get the best approximation of an equal temperament with integer numerator and denominator steps.
```   /FREQUENCY  division  [octave]  [first-pitch]
```
Create a scale where the differences between successive frequencies form an arithmetic series. This means that the difference of these differences is a constant. It will be calculated from the given parameters. The default octave parameter is 2/1. If the third parameter is not given, then the differences will be equal, so it will be a constant series. If the value for the first pitch is too high or too low, a non-monotonic scale will result. See also HARMONIC/ARITHMETIC and MOVE/FREQUENCY.
```   /LENGTH  division  [octave]  [first-pitch]
```
As above, but create a scale where the differences between successive reciprocal frequencies (string lengths) form an arithmetic series. See also HARMONIC and MOVE/LENGTH.
```   /LOGARITHMIC  division  [octave]  [first-pitch]
```
As /FREQUENCY, but the logarithms of frequencies will form an arithmetic series. If the first-pitch parameter is not given, it will therefore be a normal equal temperament. Check the result with SHOW/INTERVAL SCALE. See also LINEARTEMP/VARIED.
```   /MISFIT  first-division  [octave]
```
Like /DATA, but only shows the Misfit numbers, Relative errors, Highest errors, Pepper ambiguities, TOP and TOP-RMS errors, the Combined error factor and the Weighted triad dissonance for the given and higher divisions. If the given division is not integer or contains a period, only that division will be shown.
```   /SCALE  division  [octave]  [scalenr.]
```
Create an equal temperament in another scale memory than the current scale. The default scale number is 1.
```   /SHORTDATA  division  [octave]  [alternative-fifth]
```
Like /DATA, with the difference that the output ends halfway to enable quicker check of the properties at the beginning.
```   /SUPERVANISH  division  highest-prime  [octave]  [steps]
```
Create a set of superparticular commas which vanish in the given equal division for a given prime limit. Vanishing means that their consistent representation in the division is zero steps. But the number of steps can also be specified as another value than 0 in the last parameter. Then the calculated intervals of course don't vanish. The current scale will be silently replaced by this list of commas, so you must do SHOW to see the result. It is sorted in prime limit order, so after doing SORT, it will be in ascending pitch order. The highest prime that can be used is 41. See also /CONSISTENT and /VANISH.
```   /UNIQUE  limit  [octave]  [first-division]
```
Shows all the equal divisions in which the harmonics until the given limit have a unique representation. The default octave parameter is 2/1 and first division 2. Shown are the division and its uniqueness limit. To see more aspects, check the divisions with EQUALTEMP/DATA.
```   /VAL  division  [octave]  [highest-prime]
```
Show the patent val of the given division, then the second best val and the set of second best elements corresponding to the patent val. A val is a list of number of steps for each prime starting with 2 and written like this example: <12 19 28|. The purpose is used as a function, it assigns a whole number to a just interval in a consistent way. That means when two just intervals are added (ratios multiplied), the whole numbers can be added as well for the same result. The default prime limit is the one set with SET LIMIT. See also DWARF, HOBBIT and PROJECT/VAL.
```   /VANISH  division  highest-prime  [octave]  [steps]
```
Create a set of commas which vanish in the given equal division for a given prime limit. Vanishing means that their consistent representation in the division is zero steps. Integer multiples of vanishing commas will not be given. Only the commas which are smaller than two times the step size in the division will be given, if SET MAXDIFF is set to zero, or that value otherwise. The number of steps can also be specified as another value than 0 in the last parameter. Then the calculated intervals of course don't vanish. Only intervals of positive size will be found, even when the number of steps given is negative.
The current scale will be silently replaced by this list of intervals, so you must do SHOW to see the result. After doing SORT, the larger intervals can be easily deleted. If you wish to check if commas vanish in multiple divisions at the same time, then copy the scale to another scale memory and do INTERSECT with the list of another division. See also /CONSISTENT and DIVIDE/CONSISTENT.
This command can also be used to find unison vectors to make a periodicity block, see PIPEDUM.
See LIMIT/MAX_ATTRIB if you want to reduce the results.

EUCLID

```EUCLID  iterations  [rank]
```
Performs the Euclidean algorithm on the current scale with the given number of iterations and shows the results. By default, the second largest pitch is subtracted from the largest pitch as many times as goes in each iteration. If this is more than one time, the intermediate result is also shown, indicated by an apostrophe on the first line. Iteration stops if one of the two largest intervals have become zero. The default second parameter is 1. If it's 2, then the third (rank+1) largest pitch is subtracted from the largest pitch, etc. The scale must have at least rank+1 pitches. If the current scale has rational intervals, they are also shown as rationals. If multiple instances of the same interval occur, only one row will be displayed. A plus sign in the first column indicates a change of the smallest "defining" interval. Also the sum count of all but the smallest interval is given and the remainder being the sum size of the smallest interval.
The algorithm is also known as Viggo Brun's algorithm. See also CONVERGENTS and INSERT/RANKING.

EULERFOKKER

```EULERFOKKER
```
Create an Euler-Fokker genus. This is a scale with a rectangular lattice. See also LATTICE. With this command however the factors are not restricted to being prime, or even integer or rational. Such scales are also called Carthesian scales.
The first question is Enter number of dimensions: that is for the resulting lattice to have. Then Enter factor 1 which need not be an integer but can be any pitch. Then Enter multiplicity 1: that is the number of lattice steps in the first dimension. Then it goes on for the remaining dimensions and the concluding question is Enter formal octave (enter for none): for an eventual separate last degree as interval of equivalence. For example to create a genus  enter: 2, 3/1, 3, 5/1, 2, 2/1 and then do NORMALIZE. Also multilinear temperaments (temperaments with more than one chain of fifths) can be made. For example to create a tuning with two 12-note chains of a 700 cents generator with a distance of 16.667 cents enter: 2, 700.0, 11, 16.667, 1, 2/1 and then do NORMALIZE.
If there are large multiplicities for rational factors, the origin might be moved from the lower left corner of the lattice in order to preserve the rationality of scale, in case of overflows otherwise. See also KEY/CENTRE for moving the origin to the middle of the lattice.
```   /CORNER
```
A partial Euler-Fokker genus will be created with tones smaller than or equal to a given upper bound. So instead of the multiplicities, a single upper bound, which must be a positive number and can also be floating point, is given. Ernest McClain invented this scale model and called it "musical yantra". This model only uses integer factors which are also prime. Scala doesn't have this restriction. See also LIMIT/MAX_ATTRIB which can be used to make upper bounds based on other complexities.
```   /TRIANGLE
```
Only the lower triangular part of the normally rectangular lattice will be made. The genus will be cut off at the line (plane, etc.) going through all the endpoints of the basis.

EXAMPLE

```EXAMPLE  input-file  [output-file]
```
Create a MIDI file from a text score using the current scale or a scale specified in the score. Pitches can be expressed in many different ways and tunings can be varied without having to change the score. The resulting MIDI file makes use of pitch bend messages for tuning or MIDI Tuning Standard single note tuning change messages if the qualifier /MTS is used. Because pitch bend messages affect all notes on a MIDI channel, this command's algorithm chooses channels on a kind of round-robin basis. All channels will be used if necessary, unless some are explicitly excluded by exclude statements in the input file. If the amount of channels (16 or less) is not sufficient, which means there are too many simultaneous notes, then no output file will be generated. The instrument that plays the file is to be tuned to 12-tone equal temperament and be using the default standard pitch bend range of -2..2 semitones (4096 steps/100 cents). However the resolution can be changed by key MIDI_Pb_Resolution in file scala.ini if necessary:
MIDI_Pb_Resolution 4096.0
The default extension of the input text file is .seq. If no output-file parameter is given, it will be given the same name as the input file but with extension .mid. To use a MIDI file as input, use the /MIDI qualifier, see below.
In the input file you can specify notes, ladders and chords where degrees of the current scale will be chosen as the nearest representation for each of the pitches of the ladder or chord. So for instance to hear what's the best approximation of a just major chord, save a two-note scale with pitches 5/4 and 3/2 and specify this scale in a chord statement in the input file. 0 addtime <time offset> 0 default <filename> 0 division <units per quarter note> 0 equal <division> [<formal octave>] 0 exclude <channel no. (1..16)> 0 frequency <frequency for degree> [<degree>] 0 key <degree/pitch/name> 0 load <filename> 0 lt_gens <formal fifth> [<formal octave>] 0 lt_pars <generator> <division> [lower bound] [<formal octave>] 0 notation <notation system> [<formal octave>] 0 offset [<name>] 0 outfile <filename> 0 relative 0 transpose <degree/pitch/name> 0 val <val> 0 velocity <default onset key velocity (0..127)> <time> bend <degree/pitch/name> <time> chord <filename> <duration> [<degree/pitch/name>] [<offset degree>] [<velocity>] <time> ladder <filename> <duration per note> [<degree/pitch/name>] [<offset degree>] [<velocity>] <time> mnote <channel no. (1..16)> <note no. (0..127)> <duration> [<velocity>] <time> note <degree/pitch/name> <duration> [<velocity>] <time> parameter <parameter no. (0..127)> <value> <time> portamento <degree/pitch/name> <end degree/pitch/name> <duration> [<velocity>] (only /MTS) <time> program <program no. (1..128)> [b] <time> tempo <microseconds per quarter note/q.n. per minute> [pm] <time> text <text info> <time> timesig <num/den> [<MIDI clocks>] [<32nd-notes>] <time> touch <value (0..127)> <time> track <track no. (1..16)> If a zero is specified above as time parameter, this means that its scope starts on the position it has in the score. It does not mean that the statement may only appear at the beginning, except for "exclude", "frequency" and "division". It is important to remember this number zero is ignored. The other statements may appear anywhere and more than once. Their scope is everything below until an eventual other statement of the same kind. The zero may not be omitted and is reserved for future use. The tempo can be changed independent of the start times. This is the meaning of the parameters:
• <time> is the start time in units of 1/240 part of a quarter note. This is the default unit. Another unit can be specified with the "division" statement, which must appear at the beginning and gives the number of ticks for one quarter note. The maximum value is 32767 and the default 240. It's advisable not to make it smaller than 2 to avoid problems with MIDI file players. For negative values see the MIDI file specification standard.
• <duration> is in units of 1/240 part (or other division) of a quarter note.
• <filename> is the name of a scale file or "0" for the current scale. ("0" only allowed with "ladder", "chord" and "load".)
• <formal octave> is a literal pitch value representing the period.
• <notation system> is a name of a notation system, for example E31. The default notation system is E12. See also SET NOTATION.
• <offset degree> is the degree of the given chord or ladder that receives the pitch of the preceding parameter.
• <val> is a list of integers separated by spaces and enclosed between < and |. It can serve as a mapping from primes to scale degrees.
• <velocity> is an optional onset key velocity value that overrides the default value for those particular note(s) only.
• <degree/pitch/name> is either a degree number or a pitch value enclosed in square brackets (meaning approximate) or a pitch value enclosed in parentheses (meaning literal) or a note name according to the specified notation system. If it's in square brackets then the nearest pitch in the scale to the given pitch will be taken. If it's between parentheses then that pitch value will be taken, even if it's not in the current scale. See help Pitches for all the possibilities to specify a pitch value.
When a note name is used, it is like giving an equal tempered pitch in square brackets. That means the nearest pitch in the scale to the nominal value for the note name will be taken. If the note is outside the scale range, then an octave number must be given after the note name with a full stop in between without spaces, for example: D#.-1 or Ab;.3. However if notation systems for just intonation are used (EITZ, JI, JI2, SAJI1 .. SAJI4, SA12R, SAHTT) or LT, then a note name is not approximated by a scale pitch, but taken literally, like a pitch value between parentheses. The octave value can be changed however at the notation statement (default 2). The current scale will then be irrelevant.
For notation systems whose name begins with an E and which are diatonic, all accidentals may be used in any combination, that is all of them except E9, E10, E16 and E18. For other ones, only the names which are explicitly given in the SHOW SCALE command can be used. So one can easily transform pieces from one temperament to another by giving another "notation" statement.
The following are all valid parameters for the "note" statement:
```0 note 4          400  ! Degree number, pitch depends on scale
0 note -8         400  ! Degree number, pitch depends on scale
0 note |-2 0 1>   400  ! Degree number, pitch depends on scale and val
0 note E\         400  ! Note name, pitch depends on scale and notation system
0 note E\.-2      400  ! Note name, pitch depends on scale and notation system
0 note (5/4)      400  ! Literal pitch
0 note (386.3)    400  ! Literal pitch
0 note (|-2 0 1>) 400  ! Literal pitch
0 note [5/4]      400  ! Approximate pitch, pitch depends on scale
0 note [|-2 0 1>] 400  ! Approximate pitch, pitch depends on scale```
• If there are MIDI channels which should not be retuned, these channel numbers should be specified with "exclude" (for a drum track for example; (10 is standard, 16 for SoundBlaster). It must then appear at the beginning and may appear more than once. Only one channel can be given as a parameter. If you need to exclude multiple channels, then use multiple exclude statements.
• With "default" you can specify a scale to be used in case the current scale is empty. If the current scale is not empty, then this statement has no effect.
• With "load" the used scale can be replaced. This can be done at any time point. The current scale will also be superceded and can be reinstated with "load 0".
• With "outfile" the name for the output-file can be declared. If no output-file parameter is given with the command, this name will be used, otherwise the parameter will supercede it.
• With "equal" the used scale will be replaced by an equal temperament. This can be done at any time point. The current scale will also be superceded. The formal octave parameter is optional. Default is 2/1. See also EQUALTEMP. The current scale can be reinstated with "load 0".
• With "key" one can change the tonic of the used scale. The parameter is the new key. It's relative to degree 0 of the original scale. You can use this prior to a modulation. A pitch value between square brackets or a note name may also be the parameter. In those cases the nearest scale degree will be taken. The key value will be reset to 0 at the beginning of each track. See also KEY.
• With "transpose" one can do a frequency transposition. It's like using "frequency" but then with a relative value instead of an absolute one. The changes are cumulative and in addition to the given absolute frequency. The parameter may be a scale degree, a pitch between parentheses or square brackets, or note name. A scale degree of 0 has the effect of resetting the transposition to zero, otherwise the effect is cumulative. The time value is ignored but the position of the statement is important. All statements below are affected, regardless of their time value until a new track begins. The transpose value will be made zero at the beginning of each track. Note that when a scale degree is given as parameter, only the frequency changes but not the key, unless a "key" statement is given at the same spot.
• "notation" sets the notation system to be used. The initial value is E12. See also SET NOTATION. The optional octave parameter can be used to give another octave value for the notation, for example to use stretched or shrinked octaves without having to change the note names. The value must be enclosed in parentheses. Example: 0 notation E15 (1170.0) could be used to notate 78 cents ET (Alpha scale).
• The "lt_pars" statement sets the notation to LT and specifies the parameters for this notation. So a "notation lt" statement is implicit. See also SET LT_PARS. The third parameter, lower bound, is not strictly necessary here but provided for compatibility with the SET LT_PARS command. It's not a restriction for the gamut in any case. An alternative for this statement is "lt_gens", so only of one them should be used. This specifies the generator not as an equal tempered scale degree, but as a pitch.
• The "val" statement can be used to specify a mapping from primes to scale degrees, for example: 0 val <31 49 72 87 107|. This does not change the used scale. It enables scale degree numbers to be specified as prime exponent vectors like this: 0 note |1 0 -1 3> 100. The number of elements in the vector must be equal to or less than in the val statement. The scale degree number is obtained by adding the pairwise multiplied elements of val and note vector. If the note vector is shorter, then zeroes will be assumed as missing values.
• With "note" one can specify a single note with the given pitch and duration. The velocity parameter is optional, if it's not given then the value given with the "velocity" statement is taken. The pitch can be specified as a scale degree number, a literal pitch surrounded by parentheses (see also Pitches), a literal pitch to be approximated by the current scale surrounded by square brackets, or a note name in the specified notation system. In the latter case, the nearest scale pitch to the nominal value of the note name will be taken, so the notation system should be suitable for the current or specified scale for proper results. However if the notation is for just intonation (EITZ, JI, JI2, SAJI1 .. SAJI4, SA12R, SAHTT) or LT, then the literal value will be taken, and the current scale will be irrelevant. The scale degree number may also be given in prime exponent notation, see above.
• With "bend" all sounding notes in the current track will be bent by the given interval. The effect is cumulative. So in order to sound a trill, you need alternating positive and negative intervals. The interval limit will depend on the tuning of the notes, unless the /MTS option is used in which case it is the whole pitch bend range. If it is reached it will be kept at the maximum or minimum pitch bend value. The difference with "transpose" is that the latter only affects the pitch of notes coming after the statement.
• With "chord" one can have a chord where the pitches are in a scale file. The filename can be a normal filename, in which case the pitches are approximated by the pitches in the current scale. It can also be a filename enclosed in parentheses, in which case the pitches are taken literally. A zero can be given and then the current scale is the chord. The pitch parameter after the duration parameter is optional and it is an offset pitch for the chord. If it's omitted then the root gets 1/1 as pitch. Then the offset degree is the degree of the chord that receives the pitch of the preceding parameter. If it's omitted then it is degree 0. The velocity parameter is as with "note".
• With "ladder" it's the same as with "chord" except that the tones do not sound simultaneously but after one another.
• With "portamento" you can create a sliding tone. The first pitch is the start and the second the end pitch. It only works with the /MTS qualifier. Without it you will get a note with the first pitch.
• To set another base frequency than 261.626 Hertz for middle C, use the "frequency" statement. It can also be specified relative to another degree than 0, by putting the degree number behind the frequency. For example "0 frequency 440.0 9". Then a scale must be present in memory or be specified in the file above the frequency statement. This influences all notes after the given time, not limited by track statements.
• With "offset" the note name corresponding to 1/1 for the given notation system can be changed. See also SET OFFSET. Without parameter, it's restored to the first name (e.g. C for most notations). This statement doesn't alter the frequency, nor the key of the scale, but only what note name refers to which scale degree. If the notation system is changed, then a new offset statement should follow it, if it has been previously given.
• The "tempo" statement changes the global tempo from the given time on. The parameter is in microseconds per quarter note. It can also be given in quarter notes per minute. Then put "pm" behind the value with space in between. For example: "0 tempo 120 pm".
• If the "relative" statement is given then all subsequent time values are not interpreted as absolute time but relative to the end time of the previous statement. So if you want consecutive notes with no pause in between them then all time values must be zero. Other positive time values give a pause, negative time values are also allowed for overlapping notes. The time value of the relative statement resets the absolute time to this value, as does the time of the track statement. The "relative" statement will usually be used at the beginning of the input file so it specifies relative time for the whole file.
• If the "addtime" statement is given then all subsequent time values will have the specified offset added. This makes it easy to repeat a phrase by copying it, so the times don't need to be changed if it's preceded by the addtime statement. It can also be used to prevent the times to become large. The effect is cumulative, except for when the value is 0, which will reset the offset to zero. The offset can not be negative.
• With the "text" statement you can put a song title, author name, copyright notice, track title or whatever in the MIDI file. The text itself must be enclosed by double quotes ("). Up to 128 of these statements can be given.
• With "timesig" the default value of 4/4 can be changed. <num/den> is the signature, where the denominator must be a power of two. <MIDI clocks> is optional, default is 24. It is the number of MIDI clocks in a metronome click. <32nd-notes> is also optional, default is 8. It is the number of notated 32nd-notes per MIDI quarter note.
• Then there is the "track" statement which may be used to group notes and programs in the case when more than one program is used simultaneously. In this case the "program" statement must come after the "track" statement. If no "program" statement is given then a program change message will not be inserted in the output file for that track. To use a range from 0 to 127 put "b" behind the program number. Then it's the same as the binary number in the MIDI file.
It is not necessary to use different track numbers for different track statements if the same program number is used within them. You can give a program change at any point in a track. This changes the program for all subsequent notes in the track(s) with that track number. You cannot use more than one program number simultaneously within one track. A track ends when there is a new track statement or at the end of the file. The time of a track statement is ignored unless there is a preceding "relative" statement. Then this time is the absolute starting time of the track. Track statements have no bearing on other things than program changes, parameter messages, key and transpose statements.
• With the "parameter" statement a MIDI parameter (controller) message can be given (like volume, pan, modulation, etc.) If it is given inside a track, it affects the subsequent notes in that track.
• With the "mnote" statement a MIDI note message can be given, circumventing the pitch bend processing. This can be used for the drum sounds on MIDI channel 10 of the General MIDI Standard. Warning: only use MIDI channels with this statement which have been excluded with the exclude command, otherwise strange results can occur due to active pitch bends on that channel.
• With the "touch" statement a MIDI channel aftertouch (channel pressure) message can be given. If it is given inside a track, it affects the subsequent notes in that track.
The default file extension for scale files in the input file is '.scl' and for the output file parameter it's '.mid'.
If there is an error in the input file, then the message "Error in file format" will be given followed by the contents of the line that causes the error. If a wildcard is given in the filename then the first file that matches the name will be used. A .seq input file can also be generated from a MIDI file with EXAMPLE/CREATE.
The generated MIDI file format is SMF1 (file type 1). Some hardware sequencers or sequencers built in synths have trouble with this type if it's not "one channel per track". In that case you can convert the file to SMF0 (or eventually back to SMF1 again) with some MIDI toolset or utility like MIDI1TO0.EXE for Windows from Günther Nagler, see http://www.gnmidi.com.
```   /MIDI  input-file  output-file
```
Retune a MIDI file using the current scale and keyboard mapping by translating it to a new MIDI file with an additional track containing pitch bend messages. The same algorithm as above is employed. The instrument to be used must be tuned to 12-tone equal temperament and be using the default standard pitch bend range of -2..2 semitones, unless qualifier /MTS is also used. There is no requirement for the input file to adhere to 12-note tuning, it is only used as a score. Therefore the note numbers in the input file are not assumed to have any relation to 12-tone equal temperament or any other tuning.
If there are MIDI channels which should not be retuned, these channel numbers should be entered first with the command SET EXCLUDE (for a drum track for example).
The current keyboard mapping is used for the mapping of note numbers to scale degrees (see LOAD/MAPPING and SHOW MAPPING). Only the keyboard mapping's range is ignored, the whole MIDI range is useable. To have a standard mapping, do CLEAR/MAPPING first (which is the initial situation). The mapping's reference frequency also has influence (it can be changed with SET MAP_FREQ). If a special mapping is used, then make sure that any unmapped note numbers are not used in the MIDI file. Also if an unequal scale is used, make sure it is in the right key for the music (use KEY or SET MIDDLE to set the middle note in the keyboard mapping). The following conclusion is important because people often have the wrong assumption here: The mapping of note numbers only depends on the keyboard mapping and NOT on the pitch values in the scale! It also does NOT depend on the pitches which MIDI note numbers normally represent! There is NO matching of pitches based on their values going on. The ordering of pitches in the scale is always respected. So reordering them can be used to effect.
Any pitch bend messages in useable channels will be filtered out. Parameter (controller) messages may produce unexpected results since they apply to one channel and a channel in the output file may be used for more than one channel in the input file. This only happens if there's a shortage of output channels however. If this is the case then these parameter messages will be ignored and left out.
The algorithm tries to preserve any different program numbers for different channels as much as possible. This means that when many different program numbers are used, this will result in many pitch bend messages because there will be less channels available per voice. If there are not enough free channels, it is first tried to use a channel with a different program number. If this does not succeed, then the operation fails. In that case, try again after modifying the MIDI file to make use of less different program numbers.
Three other settings apart from SET EXCLUDE influence the result. If SET CONTROLLER OFF is done then the parameter (control) messages in the input file are not transferred to the output MIDI file. This is useful if these messages have adverse effects because of the MIDI channels being used differently and for more than one input channel.
If SET PITCH_BEND OFF has been done, then pitch bend messages are not added to the pitch bends for the tuning. This could sometimes make the pitch bend values out of range, if that happens they will be limited.
If SET PROGRAM OFF has been done, then program change messages are not transferred to the output file. This can be useful if a preselected voice is wanted or in case instruments are used that have a slow response to these messages which causes notes to be lost.
If SET CONTROLLER OFF has been done, then parameter change messages are not transferred to the output file.
During the translation, the track names are written to the screen and also the used program numbers and controller types (if present). Afterwards the amount of pitch bend messages written to the output file is shown. If a wildcard is given in the filename then the first file that matches the name will be used.
The file written is a standard MIDI file type 1, even if the input file type is type 0. Some sequencer programs can only handle type 0, see above for converting MIDI files. The DIRECTORY command indicates retuned MIDI files like this with "P" behind the filename.
Scala version 2.x can also do real-time MIDI retuning according to the current scale and keyboard mapping, see the Tools:Microtuning MIDI Relay dialog.
Cannot be combined with /CREATE, /NOTATION, /PITCH or /SCALE.
```   /MTS
```
Instead of using pitch bend messages, use the MIDI Tuning Standard tuning dump when combined with /MIDI and MIDI Tuning Standard real-time single note tuning changes when translating sequence files. All other messages will be kept intact and no channel swapping will occur. So there also is no limit to the number of simultaneous tones because of the channel limit with pitch bends. An extra track is created with the tuning dump, based on the current scale and keyboard mapping for /MIDI/MTS. The current device ID set with SET DEVICE_ID will be used. If SET PITCH_BEND OFF is done first, then pitch bend messages in the input file are prevented from being written to the output file.
Warning: few MIDI file players or synthesizers support this standard. The DIRECTORY command indicates retuned MIDI files like this with "M" behind the filename. Cannot be combined with /CREATE, /NOSWAP, /NOTATION, /PITCH or /SCALE.
```   /NOSWAP
```
Causes the MIDI channels of the input file to be unchanged in the output file, so no channel swapping will occur and the number of pitch bend messages will likely be higher than otherwise. Also there is no checking whether there are simultaneous notes on a channel which cannot be retuned together. It will only work well if each midi channel only plays at most one note at a time (or only octave intervals), otherwise sounding notes will inadvertedly be retuned. Messages on the excluded MIDI channels will be copied to the output file unchanged.
This qualifier is only useful if one plans on editing the output file afterwards. Must and can only be combined with /MIDI.
```   /CREATE  input-file  output-file
```
Take a MIDI file as input and translate it to a sequence file to be used as input file to the EXAMPLE command. The output file is meant to be read or modified, otherwise direct retuning with EXAMPLE/MIDI would be more efficient. The current keyboard mapping is used to map MIDI note numbers to scale degrees. If you set the octave degree of the mapping to a number greater than 12, it means you will have unused scale degree numbers which can be used to add more pitches to the resulting file later. If the MIDI file represents 12-tone music and you want to map this to a selection of some equal temperament, then KEY/MAPPING can be used to create the mapping.
If SET PROGRAM OFF is done first, then program change messages are not transferred to the output file. And if SET CONTROLLER OFF is done first, then parameter change messages are not transferred to the output file. Pitch bend messages are translated to transpose statements unless SET PITCH_BEND OFF is done first. In that case they will still be visible as comments. The MIDI channels which are excluded with SET EXCLUDE will not be translated with "note" messages but with "mnote" messages. This means they are not remapped to other notes or channels so they will still sound the same. This is necessary if the standard MIDI percussion channel 10 is used for instance. Key aftertouch messages are ignored. System exclusive and various other messages will be visible as comments.
Can only be combined with /NOTATION, /PITCH and /SCALE.
```   /NOTATION
```
Can only be combined with /CREATE and causes the pitches not to be specified as scale degree numbers but as note names. A notation statement will be added to the output file, which can of course be changed for interesting results. Key signature statements in the MIDI file will be observed and be taken into account for the note spelling, based on the cycle of fifths. So it's important that the MIDI file has these statements correct.
The current keyboard mapping determines the mapping of MIDI note numbers to note names. With this option it's not useful to have another octave degree than 0 or 12 because this function effectively assumes that the note numbers in the midi file represent 12 notes per octave. The current scale plays no role. Degree 0 will become C or B#, degree 1 C# or Db, etc.
The current notation is ignored except for one instance which is the feature to use the LT notation instead of E12. The division in SET LT_PARS must be set to 12, and the generator, lower bound and octave parameters are ignored. Then the note names will also be based on the MIDI file's key signature statements just like the letter names. So 0 sharps will be the gamut -3 .. 8, otherwise Eb .. G#.
```   /PITCH
```
Can only be combined with /CREATE and causes the pitches not to be specified as scale degree numbers but as literal pitch values taken from the current scale. It can be of any size or order, so the pitches can be completely remapped if desired. The current keyboard mapping determines the mapping of MIDI note numbers to scale degrees. Key signature statements in the MIDI file will not be observed. If you want approximate pitches instead of literal pitches, open the generated .seq file in an editor and replace the ( and ) characters by [ and ] respectively.
```   /SCALE
```
Can only be combined with /CREATE and causes the pitches not to be specified as scale degree numbers but as note names, where these are the names of the current scale pitches for the current notation system. They can be seen with SHOW/NOTATION SCALE. So the difference with /NOTATION is that instead of using 12-tET note names, the names can be chosen freely and are specified by the current scale. It can be of any size or order, so the pitches can be completely remapped if desired. A notation statement with the current notation system will be added to the output file. The offset and tolerance for the current note names is taken into account too. If there are pitches in the current scale without a note name, they will be omitted in the generated output file. So it can therefore be used as a filter for notes in the MIDI file, for example if it's too complex to be retuned in whole. If you are missing notes in the .seq file, then check if all scale degrees have a note name by doing SET ATTRIBUTE NOTATION and SHOW SCALE. If the current notation is LT, then statements for the LT parameters will also be added. This notation is useful to remap pitches based on the linear temperament model with generator-octave pairs where both can be chosen ad libitum.
The current keyboard mapping determines the mapping of MIDI note numbers to scale degrees. Key signature statements in the MIDI file will not be observed.
```   /WAVE  output-file  duration  [partial-file]
```
Creates a linear PCM .wav file with the sound of the current scale as a chord. The first parameter is the name of the wave file. If no filename extension is given, '.wav' will be assumed. The second parameter is the duration in seconds. The default waveform is a sinewave but additive synthesis can be employed by supplying a file with the partials and their amplitudes as third parameter. It should contain two non-comment lines, the first with the relative frequencies of the partials, expressed as ratio or in cents. The second will have the relative amplitudes where the amplitude of the fundamental is not specified and assumed to be 1. The amplitudes are expressed as ratio or linear factor. In order to hear beating of partials in a tempered chord, it is necessary to specify them in a partial file. So for example for a major chord, you should have at least partials 2, 3, 4 and 5. An example file part.par with odd harmonics is included. You can also let partials decay exponentially. In order to do that a third line with the fractions of amplitude per second can be added. The maximum number of partials is 256. Lines beginning with '!' will be ignored, except when a line with "! VOSIM" is present. An example file is vosim.par. With appropriate parameters you can make voice-like sounds.
The advantage of Wave files over MIDI files is that the frequency resolution is almost unlimited so both relative and absolute frequencies are extremely precise. Therefore the files can be used as reference for tuning instruments. Any frequencies higher than half the sample frequency will be muted in order to prevent aliasing (frequency crosstalk).
The frequencies written to the file are relative to the base frequency (see SET FREQUENCY). The number of samples per second can be set with SET WAVEFILE as well as the choice between 16 and 32 bit samples and the number of audio channels. If the number of channels is 2 then the scale degrees are spread over the left and the right channel in ascending order. The volume is set automatically to get the best resolution without clipping occurring.
On Windows for the best audio playback quality the free foobar2000 program is recommended. For example, to produce a 10 second tone of 440 Hertz in a440.wav, do this: CLEAR
SET FREQUENCY 440
EXAMPLE a440.wav 10
Cannot be combined with other qualifiers.

EXCHANGE

```EXCHANGE  position  position  [scalenr.]
```
Exchange two scale degrees in the current or given scale. The positions may not be higher than the number of notes in the scale. If degree 0 with value 1/1 is exchanged, then all pitches will shift.
The other command to select and interchange a whole scale or pitch memories is SWAP. Qualifiers cannot be combined.
```   /INTERVAL  position  position  [scalenr.]
```
Exchange the two intervals at the given positions in the current or given scale. The positions must be positive and not higher than the number of notes in the scale.
```   /EQUAL  interval  and-interval  [scalenr.]
```
Replace the given interval(s) in the current or given scale with the given other interval and vice versa. The scale must be non-empty. It isn't necessary that both intervals are present in the scale. If only one is present, it works the same as REPLACE/EQUAL.

EXIT

```EXIT
```
Leave the program. In version 2.x, you can also press Ctrl+Q.

EXPONENTIATE

```EXPONENTIATE  power  [base]
```
Change all pitches of the current scale by the given power. The default base is 2. The base-logarithmic values of the pitches are raised to the given power. Power may be a ratio or floating point value, base can be given as ratio or cents value. If the base is 2, octaves will remain the same, because 2/1 has a logarithmic value of 1. If the power is greater than 1, pitches greater than the base will become higher and pitches below lower and conversely. The base must be larger than 1. See also MULTIPLY and STRETCH.
```   /LOGARITHMIC  add-constant  [base]  [first-position]
```
Change all pitches of the current scale by adding the given constant to them and then taking the logarithmic value with the given base. The default base is 2, and it must be larger than 1. The constant cannot be 0.0 unless first-position is not 0, which is default. If it's one less than the base then degree 0 will not be changed. It can be negative, but then the absolute value of the sum is taken before the logarithm. The constant may be a ratio or floating point value, the base can be given as ratio or cents value.

EXTEND

```EXTEND  new-size  [scalenr.]
```
Change the number of tones in the current or given scale to the given size. If it is smaller than the current size, the last degrees are removed. If the size is greater, extra tones are added by octave extension, where the formal octave (interval of equivalence) is the last tone of the original scale. If the scale is equal tempered, it will remain so with the same step size.
To increase the number of tones by densifying the scale, use the command DOUBLE. To do the same by duplicating pitches, use SAMPLE.
```   /ABSOLUTE  pitch  [scalenr.]
```
Increase the number of tones in the current or given scale until the formal octave is equal to or higher than the given pitch, or the maximum scale size is reached. Cannot be combined with other qualifiers.
```   /RELATIVE  factor  [scalenr.]
```
Multiply the number of tones in the current or given scale by the given factor. If it's not a whole number, then the product will be rounded to the nearest integer. Cannot be combined with other qualifiers.
```   /CHORD  count  interval-list
```
Checks in the current scale on each degree if a subset of the interval list exists on that degree and then adds the missing interval(s) there, but only if at least the given count of intervals is found. The count given may not be larger than the length of the interval list. This command therefore completes partial chords. The command does only one run. The interval-list can be in any order, not necessarily ascending.
For example, to complete major triads do EXTEND/CHORD 1 3/2 5/4. See also SHOW LOCATIONS, POLYCHORD and PRODUCT. Do NORMALIZE afterwards to get an octave reduced scale. Cannot be combined with other qualifiers.
```   /CHILDREN  [scalenr.]
```
Adds the Farey child fractions of all rational pitches in the current or given scale to it. To get the child fractions of the next level, repeat this command. Can only be combined with /PARENTS, then it adds both Farey child and parent fractions. Note that it is possible to create a scale by starting with a scale of size one with 1/1 at degree 1. Afterwards NORMALIZE can be used. See also RATIO/CHILDREN.
```   /PARENTS  [scalenr.]
```
Adds the Farey parent fractions of all rational pitches in the current or given scale to it. To get the parent fractions of the next level, repeat this command. To get all parent fractions, repeat this command until no more pitches are added. Can only be combined with /CHILDREN. See also RATIO/PARENTS.

FAREY

```FAREY  order  [highest-prime]
```
Replace each pitch in the current scale with the closest fraction to the pitch with denominator smaller than or equal to the given order. A Farey order is the maximum denominator. A prime limit can be given as second parameter and then the approximating fractions will not exceed that limit. This is a rational approximation that is different from the method used with APPROXIMATE. See also ASSUME and FIT/HARMONIC. If you want only one particular denominator, then use QUANTIZE/LINEAR. Warning: if the order is high then this takes a lot of computing time. Specifying a prime limit will add to the computing time.
```   /BEATS
```
Replace each pitch in the current scale with the fraction which gives the lowest beat frequency with the scale pitch, where the denominator is smaller than or equal to the given order. Note that giving a high order is meaningless since the beating partials could be so high that they are inaudible. See also RATIO/FAREY. Can only be combined with /FLOATS_ONLY.
```   /FLOATS_ONLY
```
Replace only the floating point pitches (those shown in cents) in the current scale. Can only be combined with /BEATS.
```   /LOGARITHMIC  order  [octave]
```
Find the nearest Farey fraction of the logarithm of each pitch. So the result will be some step of an equal division whose cardinality does not exceed the given order. So here the order means maximum division. The default octave and base of the logarithm is 2/1. See also RATIO/FAREY/LOGARITHMIC and FIT/MODE. Cannot be combined with other qualifiers.
```   /LEASTSQUARE  order
```
Replace each pitch in the current scale with a fraction approximating the pitch with denominator smaller than or equal to the given order, where all pitches have the same denominator. The denominator giving the best least squares difference for all intervals (between each pair of pitches) will be chosen. See also FIT/HARMONIC. Cannot be combined with other qualifiers.
```   /MINIMAX  order
```
Replace each pitch in the current scale with a fraction approximating the pitch with denominator smaller than or equal to the given order, where all pitches have the same denominator. The denominator giving the smallest maximum logarithmic difference for all intervals (between each pair of pitches) will be chosen. See also FIT/LINEAR and FIT/HARMONIC. Cannot be combined with other qualifiers.
```   /FIND_KEY  order
```
Find out which key of the current scale has the most Farey ratios with the given order, or in case of multiple ones, which one also has the lowest order. It doesn't matter whether the pitches are rational or not. Shown will be the actual Farey order (highest denominator), the scale key and the number of notes in the scale which are under this order. Note that the current scale is not changed to the key shown.
Pitch memory 0 (\$0) will be set to the interval that the base frequency is to be changed with in order to give the Farey ratios the lowest possible integer frequency. To see this, do SET FREQUENCY \$0 and then SHOW/FREQUENCY SCALE.

FILE

```FILE  filename
```
Creates a text file with the given name and make subsequent program output be written to the file as well as to the screen. To end this and close the file, use the CLOSE command. To create a file with the same name as the last scale file loaded or saved, do FILE %scl(.txt). To create a file with the current date and time, put "%date" somewhere in the filename, and then this token will be replaced by the current date and time separated by an underscore. For example if you want to automatically keep a log of all Scala output, you could create a directory called 'log' and put this command in startup.cmd: FILE log\Scala_%date.log

FIT

```FIT  [max-deviation]  [scalenr.]
```
Show the best least-squares fittings of an equal tempered scale to the given scale with decreasing step sizes, so that each pitch in the scale is approximately an integer multiple of this step, not all necessarily different. All scale pitches must be greater than 1/1. If the scale is not in non-descending order, it will be sorted first. You can give a pitch more weight by including it more than once in the given scale. Approximations are shown with step sizes down to about one twelfth of the smallest interval in the scale. Only successively better approximations are shown, unless a maximum standard deviation is given. Then all fittings with a lower deviation are shown. The linear least-squares approximation which is given first is the value for which degree one is one step, degree two, two steps, etc. This value does not necessarily occur in the list that follows. Subdivisions of the given approximations are not given since their standard deviation is not better but equal. If the steps match any known mode, the name will be given. For fitting to integer divisions, use FIT/MODE. See also CALCULATE/LEASTSQUARE. Qualifiers cannot be combined.
```   /MINIMAX
```
In addition to the best least-squares fittings explained above, also give the best minimax fittings, i.e. for which the maximum deviation among the steps is minimal. The linear minimax approximation which is given first is the value for which degree one is one step, degree two, two steps, etc. FIT/MINIMAX works slower then FIT only. See also CALCULATE/MINIMAX.
```   /LINEAR
```
Show the best minimax fittings of a scale with linearly quantized steps so that each pitch in the scale including 1/1 is approximately a linear integer multiple of this step, not all necessarily different. Only successively better approximations are shown. A maximum deviation can also be given. If so, then the first result will be stored in pitch memory 0. Then afterwards you can do QUANTIZE/LINEAR \$0 to obtain the approximation. This function is similar to the /HARMONIC option but that uses the standard deviation and this the maximum deviation and the steps do not have to be inverse integers. See also FAREY/MINIMAX and QUANTIZE/LINEAR.
```   /MODE  [division]  [scalenr.]
```
Show the best least-squares and minimax fittings of modes of increasingly larger equal tempered scales compared to the current scale, where the octaves are the same. Displayed are the division followed by the step counts. If a division parameter is given, only the best mode-fitting of that division is shown. With use of the optional second parameter, the division parameter must be given too. Then give a 0 for any division.
These properties of the mode are shown:
• whether the approximating mode is proper, strictly proper or not (Rothenberg propriety), indicated by letters P, SP or N;
• whether it has Myhill's property (two interval sizes per interval class), indicated by "M", has two or more identical blocks of one ore more intervals (repeating interval pattern), indicated by "B", has the Generated property (formed by a cycle of a single interval), indicated by "G", or neither, indicated by a blank;
• whether it has maximal evenness, indicated by "ME", distributional evenness, indicated by "DE", 3-distributional evenness, indicated by "D3", trivalence, indicated by "T3" or neither;
• whether it is self-inverse, indicated by "I", or symmetrical (with inversional symmetry on another degree), indicated by "S" or neither;
• the standard deviation (SD:) of it from the given scale, given in cents;
• the maximum deviation (M:) of it from the given scale, given in cents;
• the name of the mode pattern, if any. Only the first name in the mode list will be shown. To see if there are more names belonging to the same mode pattern, you need to use MODE/ALL_SHOW.
Sometimes the standard deviation can be higher than the previous one. This is because the algorithm shifts the pitch of degree 0 to find a better fitting, but for the standard deviation given this is not taken into account. It can also be that only the maximum deviation is better than the previous one but not the standard deviation.
The default highest ET that will at least be checked is 2400 and it can be changed by adding a key Max_ET_Mode to file scala.ini. For any negative value of division, the successive divisions will be shown until (the positive value of) that division, otherwise it will stop at the default given above. See also MODE. To change the scale into a given mode, use QUANTIZE. To fit all modes of the current scale do ITERATE/KEY FIT/MODE.
```   /ALL_MODE  [first-division]  [last-division]
```
As above, only all successive divisions will be shown, instead of only increasingly better approximations. The parameters can be a range of divisions. If a first division is given, this will be the first division shown. If the scale has small step intervals, some step approximations may be 0. With this qualifier divisions with 0 step approximations will not be shown if no first-division parameter is given.
```   /HARMONIC  [first-harmonic]  [scalenr.]
```
Show the best least-squares deviation fittings of harmonic scales with increasingly higher first harmonic. If the number of notes in the scale is fifteen or less then the matched harmonics are shown, otherwise only the first and last harmonic and the amount of harmonics matched. An unmatched pitch is indicated with an 'x'. A harmonic will only match one pitch of the scale; the one that is closest to it. If all consecutive intervals of the harmonic scale are superparticular then this is indicated by the letter S. If moreover the approximation consists of successive harmonics, then this is indicated by the letter H instead. The standard deviation is also shown in cents.
If the first-harmonic parameter is given, then only the best fitting of that harmonic scale will be displayed, instead of successive higher ones. If it's negative, then all higher ones are shown, starting from the given parameter without the minus. See also HARMONIC. To find subharmonic fittings, do INVERT first.
To obtain a fitting of a harmonic scale, use the command SELECT/MODEL on a harmonic scale with the given bounds with the parameter scale as model. See also QUANTIZE/LINEAR and FAREY/MINIMAX.
```   /ARITHMETIC  [scalenr.]
```
Show approximations of the current or given scale by an integer arithmetic sequence with a positive difference between successive numbers. This difference is a constant by the definition of an arithmetic sequence. Only successively better approximations are shown for increasing differences. If there are no more even slightly better approximations, then the output stops. Harmonic scales will have a difference of 1, therefore are shown with 1*n. The root mean square and minimax deviations from the arithmetic sequences are shown as linear values and not in cents. All scale pitches must be greater than 1/1. To check for negative differences (subharmonic series), do INVERT first. See also HARMONIC/ARITHMETIC.

FLIP

```FLIP  first-prime  second-prime  [scalenr.]
```
Exchange for all rational pitches in the current or given scale the exponents of the two given prime factors. This will cause the lattice to be mirrored in the main diagonal between the two prime axes. For example, if the primes are 5 and 7, and there's a pitch 28/25 (2.2.7/5.5) it will become 20/49 (2.2.5/7.7).
Instead of a prime, 1 may also be given for the second parameter. This will cause the lattice to be projected onto the first prime's axis. To view the result of this command, use LATTICE, or do SET ATTRIBUTE PRIMES. See also PROJECT.

FRETBOARD

```FRETBOARD  interval-list
```
Check if the given interval or chord is present in the current scale and show the fingering on a diagram of a fretboard (fingerboard of a fretted string instrument). The tonic for the interval or chord is asked, which may be given as a scale degree number or a note name in the current notation system. Secondly the string tuning is asked, which must be given as a list of note names or scale degree numbers (or mixture thereof) separated by spaces, from low to high. Default is the standard guitar tuning of EADGBE. More examples are in the file fretstr.par. The note names should be in the current notation system, which may be any except the just systems JI, JI2, SAJI* and EITZ. The intervals don't need to be exact to be found in the current scale and the maximum width of the range is determined by the SET TOLERANCE command, so if the tolerance factor is set to 1/3, then the maximum difference is one sixth of the average one-step interval in the scale.
The intervals in the list are separated by spaces. But they can be separated by colons as well. In that case the values with decimal points are read as linear factors instead of cents values, for example: 4:5:6:7. See also SHOW LOCATIONS.
In the diagram a fret number of 0 indicates the open string. The nut is shown as a double vertical line. Numbers and the letter 'O' indicate the frets against which the string should be pressed (finger to the left side). The 'O' means that it's a root tone, the next note is indicated with '1', etc. If all notes can be played simultaneously on different strings then the message "Notes on different strings" is given. If you wish to see longer strings for example 2 octaves instead of 1, extend the scale with the EXTEND command.
See also SHOW TRANSPOSE to find suitable open string tunings. See SHOW STRINGLEN to calculate fret positions.
```   /CHORD  search-pattern
```
Finds the first match of the given pattern in the list of chords and use the intervals from that chord to show on a fretboard for the current scale. To explore the available chord names, use CHORDS/ALL_SHOW. For the syntax of the name pattern, see Patterns. Can only be combined with /NOTATION.
```   /MODE  search-pattern-or-mode
```
Finds the first match of the given pattern in the list of modes and show that mode on a fretboard for the current scale. A list of steps may be given too. To explore the available mode names, use MODE/ALL_SHOW. For the syntax of the name pattern, see Patterns. Can only be combined with /NOTATION.
```   /NOTATION
```
Show note names in the current notation system at the finger positions instead of tone numbers.
```   /SCALE  scalenr.
```
Instead of an interval list, give a scale number or filename and use the intervals from that scale to show on a fretboard for the current scale. Can only be combined with /NOTATION.

HARMONIC

```HARMONIC  first-harmonic  last-harmonic  [skip-step]
```
Create a harmonic scale with all harmonic numbers between and including the given ones. To create a subharmonic scale, do INVERT afterwards or reverse the parameters. Degree 0 will represent the first harmonic.
If parameter step is given then harmonics are skipped by that amount if higher than 1. This value may also be noninteger (>= 1.0), in which case the harmonics will obey this formula : floor(first-harmonic + n * step), n >= 0.
The first harmonic may be 0 in the above formula, but a 1 will in this case be the first note. The first and last harmonic and step may be given as floating point number or ratio.
To create a scale with an irregular set of harmonics, use INPUT/FACTOR. See also EQUALTEMP/FREQUENCY, MODULATE, FIT/HARMONIC and DOUBLE. Qualifiers cannot be combined.
```   /ARITHMETIC  first-harmonic  last-harmonic  add-step
```
Here the third parameter does not cause harmonics to be skipped but is the common difference between each successive tone. This is a term proportional to the frequency. The resulting scale is an arithmetic sequence. The step may be given as floating point number or ratio, as the first and last harmonic. Use ASSUME to find ratios afterwards. See also EQUALTEMP/FREQUENCY and FIT/ARITHMETIC.
```   /DIFFERENTIAL  scale-size  first-harmonic  [octave]
```
Create a subset of a harmonic scale which is Dudon differentially coherent in interval class 1. This is a scale where difference tones between two adjacent pitches are also scale tones under octave equivalence. It selects one possibility out of potentially a very large amount. The computation time grows exponentially with the scale size, first harmonic and formal octave so they cannot be large. The selection is based on the evenness of intervals and amount of extra coherence in interval class 2. The default formal octave is 2/1 and it needs to be an integer. If not it will be rounded to the nearest integer. A maximum difference from equal tempered can be set with SET MAXDIFF. When it is 0.0 cents it means there is no maximum difference. But setting it will greatly reduce the computation time. In case no differentially coherent scale can be found, "No solution" will be given. If you do SET ATTRIBUTE MULTIPLE before showing the scale you can best examine the result. See also DWARF, EQUALTEMP/DIFFERENTIAL and SHOW/DIFFERENCE LOCATIONS.
```   /LOGARITHMIC  first-harmonic  last-harmonic  [skip-step]
```
As a normal (sub)harmonic series, but takes the log of the harmonic numbers instead. For good results, the first harmonic should not be less than 2.
```   /NEAREST  scalenr.  first-harmonic
```
As /DIFFERENTIAL with the difference that it does not try to get the highest evenness, but the closest approximation to the given scale. The size and octave will be those of the given scale, which must be in ascending order. A maximum difference can be set with SET MAXDIFF. When it is 0.0 cents it means there is no maximum difference. But setting it will greatly reduce the computation time. If it's too small though it may give "No solution". Instead of a scale number, a filename can also be given.
```   /OVER_UNDER
```
Create a sort of combined harmonic/subharmonic scale with regularly varied numerators and denominators. First the scale size is asked, followed by the formal octave, which must be a ratio. Then the numerator step is asked, which is the amount by which the numerator will be increased when going to the next scale degree. Lastly the denominator step is asked, the amount by which the denominator will be increased when going to the next scale degree. A negative step value is intended here to successively decrease the denominator, although a positive step can be entered too. The first harmonic/subharmonic will be determined by these parameters and if it cannot be a whole number then "Invalid argument" will be given. This should only occur if the formal octave is not a superparticular ratio. For example: 7, 2/1, 2, 1 will give the following scale: 1/1 10/9 16/13 34/25 3/2 38/23 20/11 2/1 or written in non-simplified form: 28/28 30/27 32/26 34/25 36/24 38/23 40/22, 42/21. If the denominator step is 0, then a harmonic scale will result, if the numerator step is 0, a subharmonic scale results. The step values may be noninteger, in which case the floor formula shown above is used. This scale model was invented by Daniel P. Stråhle in 1743 as a means of approximating an equal tempered scale. His numerator step is +7 and denominator step -5 for the 12-tone equal tempered scale. See also EQUALTEMP/FRACTIONAL.
```   /RMS
```
Create a scale with the frequencies of vibration modes of an ideal rectangular membrane. The formula is sqrt(n2 + r m2) where n and m are integers and r is the aspect ratio of the rectangular shape (ratio between length and width). If n and m start at 1, the edges are fixed, if they start at 0, they are loose. The range of n and m will be asked for, and then r, which must be positive.
```   /ROOM_MODES  length  width  height
```
Create a scale with the resonance frequencies of a shoebox shaped room. The dimensions can be given as ratio or floating point number and are in metres. The assumed speed of sound is 344 metres/sec and is the speed in air of around 20 degrees Celsius. An integer value is used to have as many intervals visible as ratios as possible. Then the maximum reflection order is asked (highest order of standing wave). The default is 4. Then it is asked whether to calculate axial modes. These are the strongest. Then the tangential modes which have half the energy of the axial modes. Only the tangential modes of the same order for each reflection in each plane is calculated (eg: 1,1,0: 1,0,1: 0,1,1: 2,2,0: 2,0,2: 0,2,2 etc.) Then the oblique modes have one fourth the energy of the axial modes. Again only the same order for each reflection in each configuration (eg: 1,1,1: 2,2,2: 3,3,3: 4,4,4 etc.) is calculated. Any duplicate modes will be removed, for example when width equals height.
To see the scale as actual frequencies, use SET ATTRIBUTE FACTOR and SHOW. For all practical purposes, any modal frequencies above 300 Hz will be swamped by other room acoustic effects. But for scale creation that should of course not bother you. If you want to see results for a different speed of sound, you can use the MOVE command afterwards with the ratio of new speed / 344. If you want different highest orders for different modes then calculate them separately and use MERGE to put the scales together afterwards. When ready you can use DELETE 0 to delete the 1/1 pitch and you then have a scale. The speed of sound then makes no difference anymore.
```   /SURD  first-harmonic  last-harmonic  [add-constant]
```
Create a surd scale which is like a normal (sub)harmonic series but takes the square root of the harmonic numbers and then add a constant instead. The default constant is 1. The first harmonic can be 0 if the constant is not 0 also. Degree 0 will represent the first harmonic. For inverse surd scales use the INVERT command afterwards. This scale model was invented by John Chalmers in 1997.

HELP

```HELP  [subject]
```
Type the command HELP followed by a subject item to get information about it. If no subject is given, then all help topics will be displayed. Subjects may be abbreviated, like commands and qualifiers can. Square brackets indicate that a parameter to a command is optional. Often the number and meaning of parameters vary with the command qualifier (see help items Commands and Qualifiers). If no parameters are shown it means they are the same as for the command without qualifier. H is an abbreviation for the HELP command.
In the GUI-version you can use the help buttons in the dialog windows, do Help:Contents or press F1. Then enter the command or topic and click on the Find button or press Enter. Double-click on one of the subjects to see its help. You can also select an item name if one is present in the main window or tip window by double clicking on it and then press F1. It then directly shows the help for that item.

HOBBIT

```HOBBIT  scale-size  octave  [highest-prime]
```
Create a Just Intonation hobbit scale with the given number of tones and formal octave (period). Such scales have pitches with the smallest Tenney weighted Euclidean L2 norm which are prime consistent with their scale degree. They were invented by Gene Ward Smith and are usually tempered, so that can be done afterwards with the PROJECT command for example.
If no third parameter is given, the prime limit will be asked. The limit set by SET LIMIT will be the default when no value is entered. The highest prime which can be used is set in scala.ini. Subsequently the number of steps for each prime will be asked (also called the val). They may not have a common divisor, the GCD must be 1. One or more may be 0 however, and this excludes the corresponding prime from the scale. The number of primes must also be more than 1, so a limit of 2 cannot be used. For longer vals (more primes) this command may take a while to run.
If the third parameter, the prime limit is given, then the number of steps for the primes do not need to be given because the patent val (also called standard val) will be assumed (this is the best approximation to the primes given a fixed formal octave and number of tones). The result scales are JI-epimorphic which can be checked with SHOW DATA. SORT could be done afterwards to put the scale in ascending order. See also EQUALTEMP/DATA for vals which may be better than the patent vals. See also DWARF.
```   /FULL
```
Uses the full Tenney weighted Euclidean L2 norm, like the TE_NORM attribute that includes the octaves in the distance. Otherwise factors of 2 (or higher primes if the formal octave is a higher prime) are ignored.

IMPORT

```IMPORT
```
The default qualifier is /ZIP. See LOAD/UNFORMATTED and LOAD/CENTS to import text files with linear factors and cents values respectively. SAVE/CENTS exports to a text file with cents values, SAVE/CSV to a comma separated values file and SAVE/EXCEL to an Excel file. Use LOAD/CENTS to import a CSV file. Qualifiers cannot be combined.
```   /ZIP  filename  [directory]
```
Extracts all files from a zipfile. These can be scale files from the scale archive or other files. Any existing files will be overwritten. If the given filename has no extension, '.zip' will be assumed. If a wildcard is given in the filename then the first zip file that matches the name will be used. If a directory is given and it exists, then the files will be written in that directory. Text files in the archive will be automatically converted to the native format (CR-LF, LF or CR). Names of the extracted files will be shown in the main window. See also LOAD/ALL to load scales from a zip file.

INPUT

```INPUT  [scalenr.]
```
Input a scale by hand. The pitches may be given as a rational or in cents. Those to be given in cents must contain a decimal point. Degree 0 (1/1) is not entered. If this is to be other than 1, use MOVE with the inverse amount afterwards. The default scale is 0 (current scale). See also LOAD.
```   /FACTOR
```
Input a scale by giving relative, linear factors. They can be the frequencies of the notes or factors proportional to them. The numbers do not have to have a decimal point. Degree 0 is also to be entered whereto all subsequent factors are relative. That means if the values represent frequencies, it corresponds to the base frequency. Can only be combined with /INTERVAL.
```   /INTERVAL
```
Input a scale by giving the intervals relative to the previous degree. Can only be combined with /FACTOR and /LINE.
```   /LINE
```
Input a scale by giving all pitches on one line at once. The number of notes does not have to be entered separately. Pitches are separated by spaces. But they can be separated by colons as well. In that case the values with decimal points are read as linear factors instead of cents values, for example: 4:5:6:7:8. Remember to give the scale on the next and not the same line. Can only be combined with /INTERVAL.
```   /NOTATION  [notation-system]  [scalenr.]
```
Input a scale by giving all note names on one line at once. The number of notes does not have to be entered separately. Names are separated by spaces or commas. The first name given will become scale degree 0, so one name more must be given than the scale size, like with INPUT/FACTOR. If no notation system parameter is given, the current notation system will be used, see SHOW NOTATION. A useful notation to use may be LT, see SET LT_PARS, so notes can be entered as numbers which are multiples of an ET step.
Octaves can be appended to the names with a period. For example, the major scale could be entered as: c d e f g a b c.1
And the minor scale as: a b c d e f g a.1

INSERT

```INSERT  position  pitch
```
Insert a new pitch in the current scale at the given position. All pitches at a higher position shift up and the size of the scale increases by one. The position must be a number not higher than the number of notes in the scale plus one. If insertion is done at degree 0, the given pitch must be lower than 1/1 in order for the scale to remain monotonic. See also DELETE and REPLACE. Qualifiers cannot be combined.
```   /INTERVAL  position  interval
```
Split the interval in the current scale between the given and next position by inserting another interval. The position must be not higher than the number of notes in the scale. If the given interval is larger than the interval to the next degree, you can do SORT to restore the order.
```   /INV_INTERVAL  position  interval
```
Insert the given interval downwards from the pitch at the given position.
```   /FREQUENCY  position  frequency
```
Insert a new pitch by specifying the frequency relative to the base frequency (see SET FREQUENCY and SHOW/FREQUENCY).
```   /LARGEST  interval
```
Split the largest interval(s) in the current scale by inserting the given interval. The scale may not be empty.
```   /MEDIANT  interval
```
Split the interval(s) in the current scale which are larger than or equal to the given interval by inserting the mediants at these positions. For intervals which are not rational, nothing will happen. See also DOUBLE/MEDIANT.
```   /NEAREST  pitch  [at-pitch]
```
Insert the given pitch in the current scale before the lowest pitch which is higher than the given pitch (the second if it's given). If the first or second parameter is lower than 1/1, it is indeed inserted before scale degree 0.
```   /SPLIT  interval
```
Insert the given interval at all positions where it "fits", i.e. where the scale interval is larger than it. It will only be inserted once in each interval, so if large enough intervals remain, the command will have to be repeated.
```   /INV_SPLIT  interval
```
Same as /SPLIT, except that the interval is split the inverse way.
```   /RANKING  rank
```
Insert the interval which is the rank number's (second, third, etc.) largest one step interval at all positions where it fits, as with /SPLIT. The parameter is one less, so 1 means second largest, 2 is third, etc. Repeating this command acts like Viggo Brun's algorithm, see EUCLID. If the given rank is too high, nothing will happen. To repeat this command several times use it in combination with ITERATE/REPEAT.
```   /INV_RANKING  rank
```
Same as /RANKING, except that the intervals are split the inverse way.
```   /RATE_EQUAL  position  interval  interval
```
Both intervals given must be rational. Inserts a tempered version of the second given interval such that it divides the first given interval into two equal beating intervals. It's best explained with an example. Suppose the current scale is 12-tET and the parameters are 7 3/2 6/5. Then an interval of 314.664 cents is inserted. The beat frequencies can be shown with SHOW BEATS 6/5 5/4. You will see that the interval 0.0 - 314.664 beats with the same rate as the interval 314.664 - 700.0. The beating sign (identical or opposite) is chosen automatically such that it gives the lowest beat rate. The first interval may also be larger than the second. See also REPLACE/RATE_EQUAL.

INTERSECT

```INTERSECT  scalenr.  [scalenr.]
```
Remove pitches that are not in the first scale from the second scale. The current scale is default for the second parameter. The first parameter may also be a filename. See also DIFFERENCE and MERGE.
```   /ALL  [first-scalenr.]  [last-scalenr.]
```
Intersect all scales in the given scale range with the current scale. If no parameters are given then all working scales from 1 and higher will be used, but not the Undo scales. The last scale number is inclusive.

INVERT

```INVERT  [position]  [position]  [scalenr.]
```
Reverse the order of the intervals in the current or given scale. If one position is given, reverse the order of the intervals between degree 0 and the given position. If two positions are given, reverse the intervals between the two given scale degrees. To view the effect of this command do SHOW/INTERVAL, or SET ATTRIBUTE INTERVAL and then SHOW. Warning: the last pitch is assumed to be the formal octave so it does not change with this operation. If the current scale does not have a formal octave (yet) -which may be the case if a CPS scale has been created- then it must first be added with APPEND or NORMALIZE.
To take the reciprocal of all pitches: do REVERSE after INVERT (with no parameters). Qualifiers cannot be combined.
```   /INTERVAL   position  [scalenr.]
```
Exchange intervals pairwise in the current or given scale. The interval at the given position remains the same. The interval at position-1 is exchanged with the interval at position+1, the one at position-2 with position+2, etc. Positions are modulo the scale size. If the scale is inversionally symmetric in the given interval position, then it remains the same, see also SHOW DATA. To view the effect of this command do SHOW/INTERVAL, or SET ATTRIBUTE INTERVAL and then SHOW.
```   /ARITHMETIC  [scalenr.]
```
Inverts a scale arithmetically, i.e. preserving linear pitch distances instead of logarithmic ones. If P is the pitch and Oct the formal octave, then this pitch will be mapped to Oct + 1/1 - P. The arithmetic mean of a pitch with its arithmetic inverse is constant.
```   /HARMONIC  [scalenr.]
```
Inverts a scale harmonically. If P is the pitch and Oct the formal octave, then this pitch will be mapped to 1 / (1/Oct + 1/1 - 1/P). The harmonic mean of a pitch with its harmonic inverse is constant.
```   /MERGE  [scalenr.]
```
Add the formal octave inversions of the pitches in the current or given scale if not already present.
```   /REPEAT  position  [scalenr.]
```
Inverts a scale blockwise, so blocks with the size of the given position are inverted. If at the end any intervals are left, they are not inverted. If the position is 1 then nothing will change and if the position equals the scale size, it's like a normal inversion.

ITERATE

```ITERATE  command  [file-mask]  [scalenr.]
```
Will load successively scale files with filenames that match the given file mask to a scale memory and execute the given command for each of them. So it visits each scale in a set defined by the file mask and does an operation on it. For each loaded file, the filename and description is shown. The default scale memory where each file is loaded into is number 0 (current scale). Any previous scale in the given scale memory will be lost. Files that are not scale files are silently ignored.
If the command contains more than one word, it must be surrounded by double- quotes ("). Example: ITERATE "SHOW DATA" mean*.scl The command can be an external command, see help for @. ITERATE commands can be nested, but then double quotes must be used, for example: ITERATE "ITERATE/SCALE "CALCULATE \$1" 0" b*.scl
Another example: to compare the current scale against a set of scale files do: ITERATE "SHOW DIFFERENCE 1" *.scl 1. Qualifiers cannot be combined.
```   /NOOUTPUT  command  [file-mask]  [scalenr.]
```
As ITERATE without qualifier. Instead it will not show the filename and scale description for each scale visited.
```   /ATTRIBUTE  command
```
The current attribute will successively be set to all attributes available in Scala and the given command executed once for each. The order is the same as given by SHOW/ALL ATTRIBUTE.
```   /COMBINATION  command  [scalenr.]
```
Will apply the given command to all different combinations of pitches of the current or given scale. The pitch count of the combination is asked for separately. Of course it may not exceed the size of the scale. If the last pitch must be present in each combination, then use /MODE instead. The combinations will be consecutively put in the current scale, overwriting the previous contents. Afterwards, the last combination will remain in the current scale. To get the original scale back use UNDO once. For quoting the command, see above. See also % for using the iteration index.
```   /KEY  command  [scalenr.]
```
Will apply the given command to all the keys (transpositions) of the current or given scale. The original key will be restored afterwards. For quoting the command, see above. See also % for using the iteration index. See also KEY.
```   /INV_KEY  command  [scalenr.]
```
Will apply the given command to all keys of the current or given scale plus the inverted scale and all its keys. So it will perform twice the number of iterations as /KEY. The original key will be restored afterwards. For quoting the command, see above. See also % for using the iteration index. This will go over the scale degrees twice. See also INVERT.
```   /MEMORY  command  [first-scalenr.]
```
Will copy each nonempty scale memory with the given scale number and higher to scale number 0 (current scale) and execute the given command for each of them. The default scale number is 1. The highest scale memories which are used for UNDO will not be visited. See also % for using the iteration index.
```   /MODE  command  [scalenr.]
```
Like /COMBINATION with the difference that the last pitch (formal octave) is always present. It is included in the pitch count of the combination which will be asked for. Warning: even though the default scale parameter is the current scale, it will be overwritten. So use another one if you do not want it affected. Use /ALL_MODE if you want to iterate over all mode sizes.
```   /ALL_MODE  command  [scalenr.]
```
Iterate through all modes of all sizes from 1 to the size of the given scale, in that order. The pitch (formal octave) is always present and the current scale will be overwritten. Use /MODE if you only want a single mode size.
```   /CS_MODE  command  [scalenr.]
```
Iterate through all modes of all sizes from 1 to the size of the given scale which are a Constant Structure, such as is also shown by SHOW DATA. So it depends on both the scale and the mode whether it will be CS or not. It is a weaker property than proper. The pitch (formal octave) is always present and the current scale will be overwritten.
```   /PROPER_MODE  command  [scalenr.]
```
Iterate through all modes of all sizes from 1 to the size of the given scale which are proper or strictly proper, such as is also shown by SHOW DATA. So it depends on both the scale and the mode whether it will be proper or not. The pitch (formal octave) is always present and the current scale will be overwritten. See also DIRECTORY/PROPER.
```   /NOTATION  command  [first-notation]
```
The current notation system will successively be set to all notations available in Scala and the given command executed once for each. If the second parameter is present then the system to start with will be that one. The order is the same as given by SHOW NOTATION.
```   /PERMUTE  command  [count]  [scalenr.]
```
Will apply the given command to all interval permutations of the current or given scale. The original permutation will be restored afterwards. By default it will continue until all permutations are done. You can also stop earlier by giving a count. If this is a negative number, then the permutations will be going in backward order. In order to go through all permutations of a scale, do SORT/INTERVAL first to obtain the first permutation. See also % for using the iteration index. See also PERMUTE.
```   /REPEAT  command  count  [first-index]
```
Will execute the given command a number of times. The second parameter is the number of times. If it is "n" then it equals the number of notes. See also % for using the iteration index. If the first index parameter is not given then the iteration index will start at 1. The iteration index itself will also be copied to pitch memory 1, so that the command can reference it with \$1. For example, you wish to show equal temperament data of all divisions between 200 and 300, then do as follows:
ITERATE/REPEAT "EQUAL/DATA \$1" 101 200
```   /RANDOM  command  max-count  [min-count]
```
As /REPEAT but execute it a random number of times with a uniform distribution from 1 to the given maximum count, or from the given minimum count to the maximum count. Both must be nonnegative numbers. If the minimum count is highest, then a fixed number equal to the maximum count is taken. The iteration index will also be copied to pitch memory 1, so that the command can reference it with \$1. See also SEED.
```   /WHILE  command  [count]  [scalenr.]
```
Will execute the given command until the current or given scale is not changed anymore by the command. The second parameter is the maximum number of times. If it's not given then it's 1000 by default. During iteration, no undo copies will be made when the current scale changes. Instead, one undo copy is made prior to it. So all iterations can be undone with one UNDO command. Afterwards, the number of iterations performed is shown. Note that this is always one more than the number of times that the current scale was changed. See also % for using the iteration index.
```   /SCALE  command  [scalenr.]  [last-position]
```
Will traverse the current or given scale and execute the given command for each degree in it. The degree will be copied to pitch memory 1, so that the command can reference it with \$1. The original contents of pitch memory 1 will be lost. Instead of a scale number, a filename may also be given. See also % for using the iteration index %i, and ECHO for the function %i(). Without the last-position parameter, the last degree to be done is the highest scale degree, or formal octave. A lower or higher position may be used, and values like "n-1" or "n+2" can be given also. Note that you can also use this way to iterate over a predefined list of numbers. For example, you wish to show equal temperament data of all divisions between 200 and 300, then do as follows:
HARMONIC 200 300
MOVE 200
ITERATE/SCALE "EQUAL/DATA \$1"
```   /FLOATS_ONLY  command  [scalenr.]  [last-position]
```
As /SCALE but only visits floating point pitches.
```   /RATIONAL  command  [scalenr.]  [last-position]
```
As /SCALE but only visits rational pitches.

KEY

```KEY  [steps-or-note-name]  [scalenr.]
```
Change the key (tonic) of the current or given scale to the given degree. This cycles the intervals downwards by the given number of positions. The value given will be taken modulo the scale size. Any integer value is allowed, also a negative one. The default value is 1. To transpose a scale by changing all frequencies without changing the interval pattern, use SET FREQUENCY. Instead of a scale degree, the first parameter may also be a note name in the current notation system, see SET NOTATION. If the base frequency needs to be changed to the frequency of the given scale degree as well, then before giving the KEY command, do SET FREQUENCY %1, for example if the number of steps is 1.
Warning: the last pitch is assumed to be the formal octave so it does not change with this operation. If the current scale does not have a formal octave (yet) -which may be the case if a CPS scale has been created- then it must first be added with APPEND or NORMALIZE. Alternatively without adding a formal octave, the command MOVE/KEY can be used to change the key of an octaveless scale. Qualifiers cannot be combined.
```   /ALL  [first-scalenr.]
```
Copy all keys of the current scale to scale memories 1 or the number given and further. The current scale itself remains the same. So the contents of these scale memories will be overwritten. The operation does not check for duplicate results. See also MODE/KEY.
```   /ATTRIBUTE  [scalenr.]
```
Take the key of the current scale or given such that the sum of the absolute attribute values of the pitches for the current attribute is minimized. Only attributes which give a numerical value are allowed, so ones like PRIMES, SEP_PRIMES and VECTOR are not allowed. INTERVAL and OTHER_SCALE are also not allowed. Warning: if more than one key has the smallest sum then either one may be chosen.
```   /MAX_ATTRIB  [scalenr.]
```
As /ATTRIBUTE but does not minimize the sum but the highest absolute attribute value (minimax value) instead.
```   /CENTRE  [ignore-prime]  [scalenr.]
```
If all pitches of the current or given scale are rational: change the key so that 1/1 is as close as possible to the centre of gravity of all points of its lattice. The default prime to be ignored is 2, but another prime can also be specified. If no prime should be ignored, give 1 or any other non-prime number as parameter. Warning: if more than one pitch has the smallest distance to the centre then either one may be chosen. See also PIPEDUM.
If not all pitches are rational and the scale is a Pythagorean scale (formed by a generator): change the key so that 1/1 is in the middle of the cycle of generators, so that the number of generators upwards and downwards are in balance. See also LINEARTEMP.
```   /EGALIZE  [scalenr.]
```
Change the key of the current or given scale so that is it as close as possible to an equal tempered scale. The sum of absolute differences between the pitches and a corresponding equal tempered pitch is minimised.
```   /FREQUENCY
```
As without qualifier and in addition change the base frequency to the current frequency of the given scale degree in the first parameter. The previous base frequency is saved. This function combines the commands KEY, PUSH/FREQUENCY and SET FREQUENCY. To undo it you must do both UNDO and POP/FREQUENCY.
```   /OFFSET
```
As without qualifier and in addition change the notation offset to the given scale degree in the first parameter. The previous offset is saved. The effect is not cumulative. This function combines the commands KEY, PUSH/OFFSET and SET OFFSET. To undo it you must do both UNDO and POP/OFFSET.
```   /LEASTSQUARE  scalenr.  [scalenr.]
```
Change the key of the current or given scale to make it match that of the given first scale parameter as closely as possible as with /MATCH, but instead minimising the least squares difference. Instead of a scale number, a filename may also be given as first parameter.
```   /MATCH  scalenr.  [scalenr.]
```
Change the key of the current or given scale to make it match that of the given first scale parameter as closely as possible. The scales don't need to have the same number of notes. The sum of absolute differences between the nearest degrees of the two scales is minimised. The given first scale must be sorted in ascending order and have at least two notes.
Instead of a scale number, a filename may also be given as first parameter. To see to which key the current scale has been changed, do COMPARE/MEMORY_ONLY which compares it to the first undo-memory (among others), which was the original scale.
```   /MAPPING  signature  [notation-system]  [scalenr.]
```
Create a suitable keyboard mapping to the current or given scale for normal 12-tone music in a given key. The current keyboard mapping will be overwritten. The signature parameter must indicate the number of sharps in the score, so if it's in C it is 0, in G it's 1, etc. Flats must be indicated with a corresponding negative number. The allowed range is -7 .. 7. If the second parameter is omitted, the current notation system will be used, see SET NOTATION. Scale degrees will be mapped on the basis of their note names, so if for example the scale has different tones for F# and Gb, the algorithm will pick the appropriate one. If no scale degree matches a particular note name, then the nearest one to the nominal value for the note name will be taken. For notations whose name begins with an E, the nominal value is defined as the note in the corresponding equal tempered division. Afterwards, do SHOW MAPPING to see the result. The mapping's reference frequency, middle key, etc. will not be changed. Instead of a scale number, a filename may also be given. See also Mappings.
```   /NEAREST  pitch  [scalenr.]
```
Change the key to the pitch in the current or given scale with the smallest absolute difference from the given pitch. The scale may not be empty. Even if 1/1 is closest to the given pitch, the next degree will be taken.
```   /RANDOM  [scalenr.]
```
Change the key of the current or given scale to a random degree with uniform probability. See also SEED and MOS/RANDOM.
```   /ROOT  [scalenr.]
```
Change the key so that the highest sum of numerator and denominator of the rational pitches in the scale is minimised (minimax). You can check it with the command SET ATTRIBUTE MANN. This gives the most compact diamond lattice representation, see LATTICE/DIAMOND. Nonrational pitches will be ignored. Any scales of the Partch diamond or rectangular type will so be put in their "root" transposition, i.e. simplest form. It's the same as SET ATTRIBUTE MANN and then doing KEY/MAX_ATTRIB. See also FAREY/FIND_KEY.

LATTICE

```LATTICE  horizontal-factor  vertical-factor  [depth-prime]
```
Show the lattice (Carthesian model) of a rational scale. All rational pitches in the scale must be a combination of the two given factors for the primes they contain. The optional third parameter must be a prime not being in one of the other two factors. It controls the third dimension which is layed out horizontally, unless the diagram would become too wide in which case the planes are above one another. If there are non-rational pitches (i.e. floating point pitches) in the scale, then the message Floating point pitches not mapped will be given. If the error message No such lattice is given then it means that neither factors given are present in the scale, or that no one- or two-dimensional lattice can be created for the scale with the given factors. So one or more two-dimensional projections will be shown and the ignored primes will be listed. If only a one-dimensional projection is wanted, then a factor of 1/1 can be given. The total number of different primes in the scale must not be more than 12.
The origin (1/1) is indicated with a '0', one pitch with a '*' and if more than one pitch projects on the same place, a 'x' is drawn. If more than one pitch projects on the origin, it is indicated with a 'O'. With a third parameter, the origin in other planes is marked with a dot, unless there's a pitch there in which case it will be a '*'.
Example: LATTICE 3 5 will show fifth-relations horizontally and third-relations vertically, ignoring octaves.
```   /DIAMOND
```
There are no parameters. It shows for the current scale a diagram like a Partch diamond. Horizontally the odd numerators are shown and vertically the odd denominators. Octave relations do not play a role. The positions indicating 1/1 are marked with a '0', a pitch with a '*' or with a '.'. The latter for positions that have a common factor in the numerator and denominator and which are present in the scale. Numbers above 99 are not shown, and only as many that fit on the screen horizontally. A Partch diamond is usually drawn turned 45 degrees clockwise. Can only be combined with /NOTATION.
```   /LOAD  horizontal-factor  vertical-factor  filename
```
Create a scale using a rectangular lattice that is drawn in a text file. The format of the lattice is the same as shown by LATTICE, but can have only two dimensions. This means a lattice picture can be saved using the commands FILE and CLOSE and then be changed with a text editor, or created with a text editor. Each line counts for one vertical factor and two horizontal positions for one horizontal factor. The *'s must be separated by one space on a line. A mandatory '0'-character indicates the origin (1/1). An empty last line is recommended. With this qualifier it is easy to create a multilinear temperament for instance like:
```       * * * * *
* * * 0 * * *
```
The factors can be rational or floating point pitches. Afterwards the scale can be reduced by an octave, sorted and have an octave appended with NORMALIZE. Cannot be combined with other qualifiers. See also PROJECT.
```   /NOTATION
```
Instead of the asterisks, show the note names of the pitches. The shortest name is taken for the current notation system (if there are enharmonic equivalents). If the equivalents have the same length, then names which are closer to C in the cycle of fifths have priority, so Eb comes before D# for example. The current notation system is set with the command SET NOTATION. The nearest scale degree of an ET can also be shown, by using notation system LT, and do SET LT_PARS 1 <division>. Another useful notation here is JI.
If there is no note name for a pitch, a '*' is drawn, and if more than one pitch projects on the same place, a 'x' is drawn. Treated as a special case is when the notation tolerance set with SET TOLERANCE to 0, then the scale degree numbers are shown instead of note names.
```   /TRIANGULAR  horizontal-factor  vertical-factor  [depth-prime]
```
As without qualifiers, but show the lattice (Carthesian model) in a slanted way. The vertical factor will be shifted to the right going upwards. So if the horizontal factor is 3 and the vertical factor 5, then major triads are shown as triangles like:
```  *
0 *```
And minor triads are down pointing triangles. If there is not enough space with three factors for a horizontal arrangement of the layers, then try without this qualifier. Can only be combined with /NOTATION. Also here if SET TOLERANCE 0 is done then scale degree numbers are shown.

LIMIT

```LIMIT  [number]  [scalenr.]
```
Change rational pitches that have a prime limit higher than the given prime number to floating point pitches. If the given number is not prime, the first lower prime is taken. If no parameter is given, the value set with SET LIMIT is taken. To change all rational pitches in the current scale to floating point numbers, do LIMIT 1.
To actually modify pitches to those of a lower limit, use APPROXIMATE. See also PROJECT.
```   /DELETE  [number]  [scalenr.]
```
Remove the pitches from the current or given scale which have a prime limit higher than the number given. See also DELETE/UNDER and DELETE/OVER.
```   /EQUAL  [number]  [scalenr.]
```
Change rational pitches into floating point pitches which contain the given number. It can be a prime or non-prime. Can only be combined with /DELETE. See also DELETE/FACTOR.
```   /ODD  number  [scalenr.]
```
Change rational pitches into floating point pitches that have an odd number limit higher than the number given. If the given number is not odd, the number one less is taken. Can only be combined with /DELETE. See also DELETE/ODD_UNDER and DELETE/ODD_OVER.
```   /MAX_ATTRIB  number  [scalenr.]
```
Delete pitches from the current or given scale which have an attribute value higher than the given number. The attribute is set with SET ATTRIBUTE. Only attributes which give a numerical value are allowed, so attributes like PRIMES, SEP_PRIMES and VECTOR are not allowed and give the message "Invalid attribute for operation". INTERVAL and OTHER_SCALE are also not allowed. The numeric value of TWELVE is the deviation from 12-tET in cents.
Because many attributes can be chosen, and attribute EXPRESSION can represent a user-definable function, this is a powerful operation to select features from a set of pitches. For example, first create a lot of pitches with the EULERFOKKER or RECTANGLE command, and select the most consonant ones with an attribute like MANN, TENNEY, VOGEL, etc.
```   /MIN_ATTRIB  number  [scalenr.]
```
Like above, but pitches with an attribute value lower than the given number will be deleted. To keep pitches with attributes within a given range, combine the LIMIT/MIN_ATTRIB and LIMIT/MAX_ATTRIB commands.
```   /ATTRIBUTE  number  [scalenr.]
```
Like above, but pitches with an attribute value unequal to the given number will be deleted.
```   /NOT_ATTRIB  number  [scalenr.]
```
Like above, but pitches with an attribute value equal to the given number will be deleted.

LINEARTEMP

```LINEARTEMP  [scalenr.]
```
Create a Pythagorean scale or linear temperament in the current or given scale memory. A linear temperament is a cycle or chain of one particular interval, called the generator or formal fifth. Whenever by doing so a pitch originates that is outside the range of one formal octave (interval of equivalence), it is "wrapped" back inside by subtracting the formal octave value. Examples of this kind of scale are the Pythagorean scale generated by a pure fifth, and regular meantone scales.
The program asks first the scale size and then the formal octave. By default it is 2/1, and may also be given as an expression, for example 2\7 is the 7th root of 2/1. Next the position of the formal fifth (generator) in the scale must be given. If instead 0 is entered, the order of pitches is determined by their size (monotonically ascending). This is also default when just the enter key is pressed. Otherwise the range is indicated where the formal fifth must be in, for the resulting scale to be monotonic. Then the formal fifth is entered. The default value for this is pitch memory 0 (\$0) and it may also be entered as an expression. Subsequently the count downwards, i.e. the number of generators that are stacked in the downward direction is entered which is by default 0. This gives a scale in another key. Defining it here can prevent pitches from becoming a floating point value if ratios overflow.
Example: to create a normal 1/4-comma meantone scale, enter: 12, 2, 0, 696.578, 3. Usually the fifth needs to be calculated first with CALCULATE or :=, for example take 3/2-\$k^1/4 for the quarter-comma fifth. Then take the default \$0 for the fifth.
To extend temperaments with periods smaller than an octave, one can do EXTEND/ABSOLUTE 2.
Scales which are created by this command are also called linear or regular temperaments. To create specific temperaments, use /TEMPERAMENT. A simple alternative is offered by the command files comma.cmd and comma3.cmd. In older versions of Scala this command was called PYTHAGOREAN. Qualifiers cannot be combined.
```   /ALL_SHOW  [name-pattern]
```
Show all entries from the file lintemp.par if no parameter is given. If a name pattern is given, show all linear temperaments having a name that matches the given pattern. The order is the same as in lintemp.par, i.e. ordered by generator size. The pattern may contain spaces and wildcards * and ?. See also Patterns. For example see all Meta and Synch entries with the pattern {meta,synch}*
After the name a list of full convergents is given. These numbers are the number of notes per octave for which the temperament will be a maximally even scale. See also SHOW ITEMS.
```   /SORTED_SHOW  [name-pattern]
```
As above, but the entries will be shown in alphabetical name order.
```   /ME_SHOW  [division]  [division]
```
Show the temperaments for which the given division is a full convergent. With that number of notes per octave the temperament will be a maximally even scale. If two divisions are given then temperaments are shown where both are full convergents. The order is the same as in lintemp.par, i.e. ordered by generator size. If no parameter or 0 is given, then it shows all entries sorted by maximally even divisions in ascending order.
```   /NEAREST  generator  [octave]
```
Show the nearest generator from lintemp.par and the nearest octave complement one. The given generator is reduced by the given formal octave (period) or 2/1 by default. Then it shows the temperament with the nearest generator to period ratio from the list, and the complement of that. Next it shows the ones with a maximum difference of 2 cents from the given generator.
```   /PERIOD_SHOW  [octave]
```
Show all entries in lintemp.par which have the given formal octave as the period, or approximately this period. If no parameter or 1/1 is given, then it shows all entries sorted by period in ascending order.
```   /STEPS_SHOW  small-count  large-count
```
Show all entries in lintemp.par with which a temperament can be made which is a maximally even scale and has the given number of small and large step intervals in one octave (or larger). So for example if you want to show temperaments with a half octave as period, then both small and large counts should be divisible by 2. See also MODE/STEPS_SHOW.
```   /EQUALBEATS
```
Create a pseudo-linear temperament where the actual fifths are varied so that they have a calculated equal beat rate for all fifths. The formal fifth to be approximated must be a rational value. The number of notes must not be less than two. If the fifth is not a proper generator for a full cycle of the given number of notes then the resulting scale may not be correct (for example 5/4 and 12). This doesn't mean that an equal beating scale cannot be generated, but that it must be assembled from more than one cycle, or that the number of tones and the octave must be chosen differently. The algorithm may also fail if the average formal fifth is too remote from the just value, in which case wrapping around the octave occurs at wrong places.
If the octave is a rational value, then the pitches are the solution to a set of linear equations with integer coefficients and therefore rational. To try to retrieve the rational values, one can use the command FAREY with a high order, but often the exact numerators will be too high.
It's also possible to calculate a partial cycle. Then the size given must be the number of fifths to be calculated. The formal octave and fifth should be the same as otherwise, and the last pitch given is the pitch at the end of the cycle (octave reduced). Note that the actual scale size will then be one higher, since the formal octave will still be appended. For example to make four equal beating fifths leading to a just major third, enter the following: 4, 2/1, 3/2, 5/4.
Tip: for a different distribution of beat rates, use KEY or KEY/EGALIZE afterwards. See also SHOW BEATS and INSERT/RATE_EQUAL.
```   /GIVENBEATS
```
Create a temperament in the current or given scale memory. For each generator interval, a deviation from the formal fifth (generator) is given in Hertz. This is the beat rate that depends on the numerator and denominator of the generator, so it must be a rational value. The beat rates are relative to the base frequency set with SET FREQUENCY. If it is positive, then the actual fifths will be larger than the formal fifth; for a negative beat frequency they will be smaller. See also SHOW BEATS and the two qualifiers below.
```   /RELBEATS
```
As /GIVENBEATS but instead enter relative and not absolute beat rates. That means if each given value is multiplied by a constant, this does not matter. As above also negative values can be given.
```   /TEMPERAMENT
```
Create a temperament in the current or given scale memory. For each formal fifth, a deviation can be given in terms of a fraction of a given comma. For non 12-tone temperaments, first set the notation system, initially it's E12. It is used for the names whilst querying the temperings. The default comma is the Pythagorean comma, but any other comma or interval can be entered. Comma parts can be entered as a ratio or linear value. A positive value means that the formal fifth will be diminished by that fraction of the comma, so if the given comma is \$k and the part is 1/4, then the fifth will be tempered by a quarter syntonic comma. A zero value leaves the fifth just. Negative parts will augment it. So going around the circle of fifths, the parts must be entered. Also a remainder can be indicated by entering an 'x', then that part will be calculated in closing the circle of fifths, for example for the G#-Eb fifth. More than one remainder can be entered as 'x', so that each remainder will be tempered by the same amount. If no remainder is entered, then it will be assumed that the comma parts add up to close the circle of fifths. But it is not checked and the last comma part simply ignored. For example to get a Vallotti temperament, enter the following parts of a Pythagorean comma: 1/6, 1/6, 1/6, 1/6, 1/6, 0, 0, 0, 0, 0, 0, 1/6.
If you want to enter the temperings in cents, then specify a comma of one cent. To check the result, use SHOW CYCLE.
```   /TWO_SIZE
```
This produces a scale generated by the given formal fifth, but their chain can be shorter than the size of the scale. The size of the remaining fifths will be made equal, so the comma, whether positive or negative, is spread out over more than one "wolf" interval. So if the given fifth is "a", and the wolf fifth "b", then the circular pattern of fifth sizes will be like
```     a   a
a       a
b     b
b```
for seven tones. Not only the count of fifths downwards, but also the count upwards must be given. Their sum will be the number of fifths of the given size. To check the result, use SHOW CYCLE. Some "modified meantone" tunings are defined this way, to avoid having one very bad wolf.
```   /VARIED
```
Create a pseudo-linear temperament with regularly varied fifths. An initial size of fifth is asked and then an accumulating variation which is to be added to each subsequent fifth. For instance suppose the initial size is 698.0 cents and the variation 1.0 cent, then the fifths will be 698, 699, 700, 701, etc. cents. For the fifths in the downward direction the variation is in the opposite direction, so the variation is not monotonic over the cycle of fifths.
```   /WELLFORMED
```
Instead of creating a scale with the given size, it will create one with at least so many tones. Depending on the formal fifth and octave, it will be the minimal size which either has Myhill's property or is equal tempered. The size will then be the denominator of a semi-convergent of the ratio between generator and interval of equivalence. See CONVERGENTS/SEMI. You can use SHOW DATA to verify that the resulting scale has Myhill's property.
```   /FULL
```
Instead of creating a scale with the given size, it will create one with at least so many tones. Depending on the formal fifth and octave, it will be the minimal size which either has the maximally even property or is equal tempered. The size will then be the denominator of a full-convergent of the ratio between generator and interval of equivalence. See CONVERGENTS. You can use SHOW DATA to verify that the resulting scale has Myhill's and the maximally even properties.

```LOAD  filename  [scalenr.]
```
Read a scale from a scale file and store it in the given scale memory. The default scale is 0 (current scale). If the given filename has no extension, the extension '.scl' will be assumed. If a wildcard is given in the filename then the first scale that matches the name will be loaded and the actual name shown. See also IMPORT.
```   /ALL  file-mask  [first-scalenr.]  [scale-size]
```
Interpret the given filename as a file mask and load all the scales that match into available scale memories. If a scale number is given as second parameter then this scale will be the first where a scale is stored, next scales go in subsequent higher memories, default is 0. A list file can also be used, for example if the list filename is dir.lst then do LOAD/ALL @dir . For the file mask parameter, a zip file can also be given. Then all files in the .zip file with a '.scl' extension will be loaded into successive scale memories. The first scalenr. and scale size parameters can also be given then.
If a scale size is given, then only scales with this size will be loaded. The number of available scale memories is set by Scale_Count in file scala.ini. Can be combined with /CHORD and /NOUTPUT.
```   /UNFORMATTED  filename  [first-scalenr.]  [scale-size]
```
Reads a text file with all pitches for a scale on one line. The values are considered to be linear factors. The first number will represent degree 0 and the other factors are relative to that. The number of notes will therefore be one less than the number of factors. If the text file has more than one line then next scales go in subsequent higher memories. If a scale number is given as second parameter then this scale will be the first where a scale is stored, default is 0. If a scale size is given, then only scales with this size will be loaded.
```   /CENTS  filename  [scalenr.]
```
Reads a text file with pitches in cents on separate lines. The first number will represent degree 1. Lines with no readable number will be skipped. All text on a line will be ignored, except the first readable number. A vertical comma separated values (CSV) file can also be read.
This function can be used to write command files for importing scale files from other programs. See also IMPORT.
```   /CHORD  search-pattern
```
Copy the first chord that matches the given name pattern to the first non-empty scale memory. To explore the available chords, use the command CHORDS/ALL_SHOW.
If combined with the qualifier /ALL, then all chords that match the given name pattern will be copied to subsequent scale memories, to begin with the first non-empty one, so possibly overwriting higher scale memories that are not empty. Therefore repeated use of this command will add chords to the memories without overwriting previous ones.
For the syntax of the name pattern, see Patterns.
```   /MAPPING  filename
```
Read a keyboard mapping from a map file. If the given filename has no extension, the extension '.kbm' will be assumed. If a wildcard is given in the filename then the first file that matches will be loaded and the actual name shown. Keyboard mappings can be created by using an external text editor, see Mappings, SHOW MAPPING and CLEAR/MAPPING. See also DIRECTORY/MAPPING and KEY/MAPPING.
```   /NOOUTPUT
```
Do not show the description or filename, only error messages if there are any. This makes loading many scales with /ALL much faster. Can only be combined with /ALL.
```   /PITCH  filename  [first-pitchnr.]
```
Read pitch values from a scale file and store them to the given pitch memory and subsequent ones. The default first pitch memory is 0. They are used to store single pitch values and hold intermediate results of pitch calculations, not in the context of a scale. The scale description is ignored. The number of pitch memories is set by Pitches_Count in file scala.ini. See also SAVE/PITCH.

MERGE

```MERGE  scalenr.  [scalenr.]
```
Merge the first scale into the second scale. All duplicate pitches will be removed. In set-terms: take the union of the first and second scale. The resulting scale (given by the second parameter) will be in ascending order. With no second parameter, it is the current scale. The first parameter may also be a filename. See also DIFFERENCE and INTERSECT. To merge multiple scale files, use ITERATE "MERGE 1 0" *.scl 1. Warning: be careful using a scale number from the undo history. You have to use one number higher because prior to the merge, the current scale will be inserted in the history first.
```   /ALL  [first-scalenr.]  [last-scalenr.]
```
Merge all scales in the given scale range with the current scale. If no parameters are given then all working scales from 1 and higher will be merged, but not the Undo scales. The last scale number is inclusive.

MODE

```MODE  name-pattern-or-mode
```
Selects a mode (subset) from the current scale. If the parameter is a name pattern, the mode is searched from the mode list in file modenam.par, which must be present in order for the command to work. The first occurrence of a match with the given name pattern is taken, unless the number of notes doesn't match with the scale size in which case the search continues. If there are more matches after the first one taken, the user is warned about this. A name pattern can be given as a regular expression, for the syntax see Patterns. If it consists of more than one word, it must be surrounded by double quotes ("). Matching is case-insensitive. A whole word of the name must be matched in order for it to be found. To match part of a word, the pattern may begin and end with a * character.
If the parameter is a literal mode, it must have the same number format as in file modenam.par. That is, a sequence of integer numbers separated by spaces possibly preceded by a starting note enclosed in square brackets. Degree 0 or the formal octave can only be omitted if a starting note in square brackets is given. Instead of this command, SELECT can also be used. Note that pitches will be deleted from the current scale. The scale and mode size must be equal. If the scale size is larger, pitches must be deleted by hand first, or the command SAMPLE may be used.
The word "mode" is sometimes used the key or transposition of a scale. To change this, use the KEY command. Qualifiers cannot be combined except /KEY and /COMPLEMENT.

This is a link to the list of presupplied modes. Append for example #31 (or another number) to the HTML name to go directly to the 31 tone equal modes.

```   /COMPLEMENT
```
As above but selects the complementary mode from the current scale. Can only be combined with /KEY.
```   /CREATE
```
Create a scale with the given mode being interpreted as an interval pattern. A mode name with wildcards is matched as above. For each number of steps that is in the given mode, a corresponding interval must be given as ratio or cents. So for example if the given mode is 1 2 3 2 3 1, then the interval pattern is abcbca. If the scale doesn't come out with the desired octave, then do MULTIPLY/ABSOLUTE afterwards to stretch or shrink it.
You can do FIT/MODE afterwards to check which equal temperament the resulting scale is a subset of.
```   /EQUAL
```
Create an octave-based subset of an equal temperament with the given mode. The division of the equal temperament is equal to the sum of the interval steps in the mode. If the given mode is a non-octave mode, then use MULTIPLY/ABSOLUTE afterwards with the right formal octave. You can do FIT/MODE afterwards to check which equal division the resulting scale is a subset of. Also both a name or a mode pattern in numbers may be given. See also MORPH/MODE.
```   /FACTOR
```
Create a scale with the given mode. First the octave is asked for. Then for each number of steps that is in the given mode, a corresponding factor must be given. These factors are relative to the logarithmic step size and may be given as a ratio or floating point value. So if the same number as the number of steps is given it's the same mode as obtained with MODE/EQUAL. Do FIT/MODE afterwards to see which equal temperament the resulting scale is a subset of. See also BISTEP/FACTOR.
```   /KEY
```
Selects the mode from all keys of the current scale and copies the result to scale memories 1 and further. The current scale itself remains unchanged. The contents of these scale memories will be overwritten. This is not useful to do if the current scale is an equal temperament because then all scales will be identical. The operation does not check for duplicate results. Can only be combined with /COMPLEMENT. See also KEY/ALL.
```   /NOTATION  notename-list
```
Select the notes from the current scale by their note names in the current notation system. Degree 0 is not implicit, so the first name given will become degree 0. Pitches in different octaves can be distinguished with octave notation, for example: MODE/NOTATION D E F G A B C.1 D.1
With octave notation you can also specify names from the octave below and above the scale range.
```   /SCALE  scalenr.  name-pattern-or-mode
```
Same as /CREATE, but uses the pitches in the given scale as intervals to correspond to the mode steps. No intervals are asked interactively. The order in which the intervals are taken from the scale is with increasing mode steps. It's not checked if the size of the given scale is sufficient. If it contains fewer intervals then octave equivalence is assumed. Instead of a scale number, a filename may also be given.
```   /SEQUENCE  size  factor  [add-constant]
```
Create a subset of an equal temperament with 2/1 octave by a mode specified as a spectrum sequence: floor(n * factor + add-constant), n = 1 .. size.
The first parameter is the number of tones. The second and third parameter determine the pattern of steps and may be given as floating point value or ratio. Floor truncates to the nearest integer not exceeding the number. The default value for the additional constant is 0. This function produces scales which are often maximally even. It does not take a subset of the current scale. These sequences are also called Christoffel words.
Example: MODE/SEQUENCE 7 7/4 1/2 will generate the major mode in 12-tET. If you want another formal octave, then do MULTIPLY/ABSOLUTE afterwards to stretch or shrink the scale. See also SAMPLE/SEQUENCE.
```   /SHOW
```
Show the given mode. Only the first occurrence of a match is shown. To show all modes that match the pattern, use /ALL_SHOW instead. Note that a mode or a name-pattern may be given. If a mode is given for which there is no name, then only the same mode is displayed. The sum of the steps is shown in front of it. The current scale remains unaffected. See also FIT/MODE.
```   /ALL_SHOW  [name-pattern-or-number]  [size]
```
Show all modes from the file if no parameter is given. If a name pattern is given, show all modes having a name that matches the pattern. In this case there is only one parameter, the pattern, which may contain spaces. If a number is given, show all modes with the sum of their step count equal to that number, for example to show all 19 tone modes do MODE/ALL 19. This can be restricted further to only give modes with a given number of notes. To show all modes with a certain number of notes, make the first parameter 0, for example to show all modes with 10 notes do MODE/ALL 0 10. If a name pattern is given as first parameter, then the second parameter will indicate a sum of step sizes instead of a number of notes. The sum of the steps is shown in front of the modes. See also Patterns and SHOW ITEMS.
```   /FIND  name-or-number  [size]
```
Performs a fuzzy string comparison with the given name and shows all modes having approximately that name. Wildcards are not permitted. A full name must be given. To match a partial name, use /ALL_SHOW with wildcards * and ?. Lower case letters h are ignored. This function may be used for example to find Indian raga names which have different northern and southern spellings. If a number or size is given, it works the same as with /ALL_SHOW.
```   /SOLVE  scalenr.  name-pattern-or-mode
```
Similar to /CREATE, but uses the pitches in the given scale as intervals to be attained by some combination of mode steps of the given mode. Therefore the size of the given scale must be equal to the number of different step counts in the given mode, otherwise the set of equations cannot be solved. The formal octave of the resulting scale is treated just like any other interval, so it can be put in the given scale. For each of the intervals the multiplicity will be asked for each different step count in the mode. The combination of those will be equal to the interval in the given scale. For example if the mode is 3 4 5 and the interval to attain is 3/2, then the multiplicity of 3 is one, of 4 it's one and 5 is zero, but of course anything is possible.
The order in which the intervals are taken from the scale is with increasing mode steps. Afterwards the current scale will contain a scale with the same pattern of steps as the given mode. Note that the scale will not necessarily contain the intervals in the given scale. That's only the case if the given combinations occur somewhere in the mode. For the step multiplicities non-integer numbers may also be given. This can be used for octave shrinking or stretching. Instead of a scale number, a filename may also be given. If a mode is given as second parameter it must not be enclosed in double quotes.
```   /STEPS_SHOW  small-count  large-count
```
Show all modes which have the given number of small and large steps and not more than two different size of steps. See also LINEARTEMP/STEPS_SHOW and DIRECTORY/STEPS_SHOW.

MODULATE

```MODULATE  [scalenr.]
```
Make a scale containing the frequencies of the spectrum of (a) modulated sine wave(s). In general, the spectra resulting from amplitude or frequency modulation are inharmonic.
The command works by adding sidebands for each pitch in the current or given scale, except degree 0. First the modulation frequency factor will be asked. This must be a positive floating point or rational value, usually smaller than 1. The modulation frequency that this factor represents is the factor multiplied by the base frequency set with SET FREQUENCY, in other words it is relative to the 1/1. Then the number of sidebands is asked. The number below and above the scale frequency are set separately. Let f be the frequency of a scale degree and fm the modulation frequency. If the number of sidebands below is 2 for example, then f - 2 fm and f - fm are added, and if the number above is 1, then f + fm is also added to the scale. Negative frequencies are turned into a positive value.
So if the scale contains only one pitch then the resulting scale will contain the spectral frequencies of a sine wave frequency modulated by another sine wave. Note that the process may be repeated which corresponds to modulating a modulated wave. See also HARMONIC. Qualifiers cannot be combined.
```   /GENERATOR  position  [steps]  [scalenr.]
```
Make a different distribution of the scale intervals by doing an exchange of two intervals in the cycle of a given generating interval. One of them is the interval that has the most extreme size and which is unique in the cycle. This may either be the smallest or the largest, whichever one is unique or has the highest difference from the average interval of the cycle. If there is no such interval then you will be notified. To see if there is one beforehand, use SHOW INTERVALS.
The first parameter is the interval class of the generator. It must be a positive scale degree that has no common factor with the scale size. The second parameter is the number of steps away from the position of the most extreme interval in the cycle. It may be any integer number, and is taken modulo the scale size. The default value is 1.
For example, the scale is 1/1 6/5 4/3 8/5 16/9 2/1. Take degree 2 as generator (fourth 4/3), the successive fourths are 4/3 4/3 27/20 4/3 5/4. The most extreme interval is 5/4. Take 1 for parameter steps, which changes the series of fourths into 5/4 4/3 27/20 4/3 4/3. This makes the scale 1/1 9/8 5/4 3/2 5/3 2/1. If you keep repeating this command with the same parameters then the number of different scales this generates can be quite large. See also PERMUTE/GENERATOR.
```   /INTERVAL  [scalenr.]
```
This changes intervals of the current or given scale according to the sine function. Values of the sine function are added in cents to the intervals. The parameters are given interactively. The order in which degrees are mapped to the angle parameter is determined by the generator. This must be a positive number without common factors with the size of the scale. For example, if the size is 12 and the generator 7, then the order of the degrees is that of the circle of fifths. The next parameter is the count downwards for the generator. It has the same function as with the command LINEARTEMP. Default value is 0. Then the interval class must be given. This determines which interval's size will be modulated. The default value is the same as the generator. Another value may be given, but it may also not have a factor in common with the scale size. Then the amplitude is asked, it may be a ratio or a cents value. Subsequently the relative frequency must be given. This is the angular frequency for the sine function. If the default value one is given, then there is one revolution for the number of notes in the scale. Two will give two revolutions, but any positive ratio or fraction may be given. If it is an integer number then the earlier given count downwards doesn't matter. Then the phase offset must be given. This will be the phase for the interval on degree 0. It must be given in degrees. So if 90.0 is given, then the maximum value is added to the interval at degree 0, or if -90.0 is given then the maximum value will be subtracted from that interval.

MORPH

```MORPH  scalenr.  factor
```
Move the pitches of the current scale towards or away from pitches of another scale. If the factor parameter is zero, the scale will remain unchanged. A factor of 1.0 will make it equal to the given scale. Any other factor will replace each pitch with a logarithmically weighted average of the current value and the value in the same degree of the given scale. The new pitch will be 2^((1-factor)*log P1 + factor*log P2). The scales don't have to have the same size; octave equivalence is assumed.
The given scale may also be a filename and the factor may be given as a floating point value or a ratio. A factor of 1/2 will give the geometric mean. Factors lower than 0 or greater than 1 are also permitted. The factor can also be taken from a pitch memory, see help of \$. See also DOUBLE.
```   /ABSOLUTE  scalenr.  position  pitch
```
Instead of giving a factor, enter a desired pitch for a given position in the current scale. The operation will be the same and the factor will be implicitly calculated from the difference of pitches at the given position in the two scales. These two pitches may not be the same, otherwise the factor would be infinite. The given position may lie outside the scale's range since octave equivalence is assumed. It may not be degree zero.
```   /ARITHMETIC
```
Combine the pitches not logarithmic but linear, thereby taking an arithmetic average. The new pitch will be (1-factor)*P1 + factor*P2. Can only be combined with /ABSOLUTE.
```   /GEOMETRIC
```
This is the default qualifier. Takes the logarithmic mean as described above. Can only be combined with /ABSOLUTE.
```   /SUBC_HARMONIC
```
Takes a weighted subcontrary to harmonic mean. Can only be combined with /ABSOLUTE.
```   /RMS
```
Takes a weighted root mean square. Can only be combined with /ABSOLUTE.
```   /RHSM
```
Takes a weighted root harmonic square mean. Can only be combined with /ABSOLUTE.
```   /EGALIZE  scalenr.
```
As /GEOMETRIC but calculates the factor so that the current scale becomes as close as possible to an equal tempered scale. The least squares difference between the pitches and a corresponding equal tempered pitch is minimised. Cannot be combined with other qualifiers.
```   /RANDOM  scalenr.  lower-bound  higher-bound
```
As /GEOMETRIC but chooses a random factor with uniform distribution in the given range. If the higher bound is lowest then it will be considered as the lower bound. See also SEED. Cannot be combined with other qualifiers.
```   /MODE  scalenr.
```
Both the current and given scale must be subsets of an equal temperament. Then it works as /GEOMETRIC where the factor is determined by both the divisions. If the number of notes in both scales is the same, then the result scale will have step counts which are the sum of step counts of both scales. Use FIT/MODE to check this. If not, or the formal octaves are different, the scale is multiplied to preserve the formal octave of the current scale. The default highest ET that will at least be checked is 2400 and it can be changed by adding a key Max_ET_Mode to file scala.ini. Cannot be combined with other qualifiers. See also MODE/EQUAL and QUANTIZE.
```   /ANTI_MODE  scalenr.
```
As /MODE but instead the result scale will have step counts which are the difference of step counts of both scales. The scales cannot be modes of the same division otherwise invalid argument will be given. Doing MORPH/ANTI_MODE after MORPH/MODE gives back the original scale. Cannot be combined with other qualifiers.

MOS

```MOS  generator  [index]  [scalenr.]
```
Generates a Moment Of Symmetry from the current or given scale, which means it selects pitches from it visited by a generator which is some scale degree. The first parameter is the generating interval, which must be a scale degree number and have no common factor with the scale size. Then the series index can be given which must be a natural number and indicates which scale in the MOS series is desired. The default is the last and longest one. You can use MOS/SHOW or MOS/ALL_SHOW to see the modes and decide which index of the series you want.
Note that this command deletes pitches from the scale. It can also be applied twice to make an interesting category of scales. MOS and Myhill's property are equivalent. Another way to create a scale with this property is with LINEARTEMP. See also FIT/MODE. Qualifiers cannot be combined.
```   /CREATE  [scalenr.]
```
Create a Moment Of Symmetry scale by giving two intervals. The program asks first the scale size and then the generator, which must be a scale degree number and have no common factor with the scale size. Then the first interval is asked which will be the first pitch in the scale and subsequently the second generating interval. Afterwards you can stretch or shrink the current or given scale to give it another formal octave with the command MULTIPLY/ABSOLUTE. See also MODE/CREATE.
```   /RANDOM  [minimum-size]  [scalenr.]
```
Select a random Moment of Symmetry from the current or given scale. One of the series which can be shown with /ALL_SHOW for the scale size will be chosen with uniform probability. Key transpositions of the MOS are not considered distinct. If you wish to randomize this too, use KEY/RANDOM. Only generators smaller than half the scale size will be chosen. If a minimum size parameter is given then this will be the minimum number of tones selected from the scale. Note that it will always be at least 2. If the minimum size given is higher than or equal to the scale's current size, it will be interpreted as any size. See also SEED.
```   /SIZE  size  [index]  [scalenr.]
```
Like MOS without qualifier, but does not use a fixed generator but a fixed resulting scale size. The second parameter is the series index which must be a natural number and indicates which scale in the MOS series is desired. The first generator which is tested is the first one larger than half the size of the current or given scale. Note that this command deletes pitches from the scale.
```   /SHOW  parent-size  generator
```
Show successive members of a MOS series. The first parameter is the number of notes the MOS is taken from and the second the generating scale degree. On each pair of lines, the scale degrees are shown first with the number of large and small intervals. On the second line the numbers are interval sizes in number of steps. The number of notes of the resulting scale is shown between parentheses. Note that any transposition of the shown ones is also a MOS. The current scale is not affected.
```   /ALL_SHOW  parent-size  [size]
```
As /SHOW but show MOS series for all possible generators. If the second parameter is given, only show the MOS with that number of tones, for all possible generators. The current scale is not affected.
```   /FULL_SHOW  parent-size  [size]
```
As /ALL_SHOW but show only MOS series which are maximally even in number of steps. The sizes will then be the denominator of a full-convergent of the ratio between generator and parent size or parent size minus that. If the second parameter is given, only show the MOS with that number of tones.

MOVE

```MOVE  interval  [position]
```
Increase the pitches of the current scale with the given interval. The position parameter is the first degree to be altered, lower degrees will be unchanged. The default is 1 (all pitches). It must be greater than or equal to 0. If it is 0, then a new 1/1 note will be inserted.
```   /ABSOLUTE  pitch  [position]
```
Increase the pitches of the current scale such that the formal octave will become the given pitch value. If the second parameter is specified, only that and higher degrees will be altered. Can only be combined with /LENGTH and /FREQUENCY.
```   /FREQUENCY  part  [first-position]
```
Increase all pitches with the given linear term including degree 0 by default, unless the given position is otherwise. This is done by addition. The parameter may be a rational or floating point number and be positive and negative but not lower than -1.0. It is considered relative to the 1/1 of degree 0. The result is that intervals become smaller when their frequencies are increased with the same value. For example if the scale is 1/1 2/1 and 1 is added then it becomes 2/1 3/1 which is 1/1 3/2 because degree 0 is always 1/1.
Can only be combined with /ABSOLUTE. If combined with /ABSOLUTE, the second parameter is the degree for which the first parameter, the pitch, is specified. The default is the last pitch, the formal octave.
```   /KEY  position-or-note-name
```
Decrease all pitches of the current scale with the pitch at the given position. The resulting 1/1 of that and possibly other degrees will be removed from the scale. The degree parameter may be any integer value. It may also be a note name in the current notation system, see SET NOTATION. Cannot be combined with other qualifiers.
```   /LENGTH  part  [first-position]
```
Increase all reciprocal pitches (cf. string lengths) with the given part, including degree 0 by default, unless the given position is otherwise. The part may be a rational or floating point number and be positive and negative but not less than -1.0. It is considered relative to the 1/1 of degree 0. The effect of this operation is that of moving the bridge on a string instrument.
Can only be combined with /ABSOLUTE. If combined with /ABSOLUTE, the second parameter is the degree for which the first parameter, the pitch, is specified. The default is the last pitch, the formal octave.
```   /MATCH  scalenr.  [position]
```
Increase the pitches of the current scale such that the least-squares difference with the nearest pitches in another scale is minimal. The given scale may have a different size than the current scale. Instead of a scale number, a filename may be given. If a position is given, it must be 1 or higher, then only that and higher degrees will be taken into account and altered. See also MULTIPLY/MATCH. Cannot be combined with other qualifiers.
```   /MINIMAX  scalenr.  [position]
```
Increase the pitches of the current scale such that the maximum absolute difference with the nearest pitches in another scale is minimal. The given scale may have a different size than the current scale. Instead of a scale number, a filename may be given. If a position is given, it must be 1 or higher, then only that and higher degrees will be taken into account and altered. See also MULTIPLY/MINIMAX. Cannot be combined with other qualifiers.

MULTIPLY

```MULTIPLY  factor
```
Change all pitches of the current scale logarithmically by the given factor. The values in cents are multiplied with the factor which may be given as a fraction, a floating point value, or a pitch memory. For example, if the scale in cents is 0-100-300-500, then a multiply with 11/10 makes it 0-110-330-550. Rational values will therefore turn into floating point values if the factor is non-integer. See also EXPONENTIATE and STRETCH.
To increase pitches with a fixed interval, use MOVE. Qualifiers cannot be combined.
```   /ABSOLUTE  pitch
```
Change all pitches of the current scale by a factor that is such that the formal octave will become the given pitch value.
```   /MATCH  scalenr.  [max-difference]
```
Change all pitches of the current scale by a factor that is such that the least-squares difference with the nearest pitches in another scale is minimal. The given scale may have a different size than the current scale. If a second parameter is given, then only pitches in the other scale which are not further removed from a pitch in the current scale than by this difference will be considered. Instead of a scale number, a filename may also be given. See also PROJECT/MATCH and STRETCH/MATCH.
```   /MINIMAX  scalenr.  [max-difference]
```
Change all pitches of the current scale by a factor that is such that the maximum absolute difference with the nearest pitches in another scale is minimal. The rest as with /MATCH. See also PROJECT/MINIMAX and STRETCH/MINIMAX.
```   /RELBEATS  interval  interval  [rel-factor]
```
Change all pitches of the current scale by a factor that is such that the beat frequencies of the given two rational intervals will be equal or if the third parameter is given are proportional with the given factor. The default value is -1 which means that they will have opposite signs as shown with SHOW BEATS. See also LINEARTEMP/RELBEATS and POLYNOMIAL/SOLVE/POWER.

NORMALIZE

```NORMALIZE  [octave]  [scalenr.]
```
Reduce all pitches of the current or given scale with the given octave, sort and take unique values, and append the octave if it's absent. This command is a shortcut for the combination of commands that do the above operations. The default is 2/1. It is useful for doing after CPS, HARMONIC, LATTICE/LOAD, PIPEDUM, etc. See also REDUCE.
```   /EGALIZE  [scalenr.]
```
Reduce and sort the current or given scale by the scale pitch which makes it the most equally divided scale. This can be any scale degree which is larger than 1. Unique values will also be taken. Minimised is the standard deviation from equal tempered expressed in average scale steps, as given by SHOW DATA. Afterward you can restore the original range with EXTEND/ABSOLUTE. Doing both will probably increase the number of tones.

PAUSE

```PAUSE  [duration]
```
When no duration is given, prompts for the enter key to be pressed. Otherwise, waits the given number of seconds. This is useful for in external command files. The current pause setting must be ON, if it's OFF then nothing will happen. See also SET PAUSE.

PERMUTE

```PERMUTE  [count]  [scalenr.]
```
Take the next permutation of the scale intervals for count equals 1 which is default. For -1 the previous permutation is taken, larger values give further permutations. The permutation order is the lexicographic one. If the count is too high or low, the message "no more permutations" will be given and the given scale be left unchanged. In order to go through all permutations of a scale, do SORT/INTERVAL first to obtain the first permutation. See also ITERATE/PERMUTE. Qualifiers cannot be combined.
```   /ATTRIBUTE  [scalenr.]
```
Take a permutation of the scale intervals of the current or given scale such that the sum of the absolute attribute values of the pitches for the current attribute is minimized. Only attributes which give a numerical value are allowed, so attributes like PRIMES, SEP_PRIMES and VECTOR are not allowed. INTERVAL and OTHER_SCALE are also not allowed. If there are many different intervals, this operation will take a long time.
```   /EGALIZE  [scalenr.]
```
Take a permutation of the scale intervals such that the scale has the minimum deviation from equal tempered with the first pitch unchanged. By doing repeatedly KEY and PERMUTE/EGALIZE one may find a permutation with a slightly smaller deviation.
```   /GENERATOR  position  [count]  [scalenr.]
```
Take a permutation of the scale intervals by doing a rotation of a cycle of a given generating interval. The first parameter is the interval class of the generator. It must be a positive scale degree that has no common factor with the scale size. The second parameter is the cycle count for the rotation, which may be any integer number, and is taken modulo the scale size. The default value is 1.
For example, the scale is 1/1 6/5 4/3 8/5 16/9 2/1. Take degree 2 as generator (fourth 4/3), the successive fourths are 4/3 4/3 27/20 4/3 5/4. Take 1 for parameter count, which changes the series of fourths into 4/3 27/20 4/3 5/4 4/3. This makes the scale 1/1 6/5 4/3 3/2 9/5 2/1. So the original intervals 6/5 10/9 6/5 10/9 9/8 are permuted to 6/5 10/9 9/8 6/5 10/9. See also MODULATE/GENERATOR.
```   /INTERVALS  scalenr.  max-difference
```
Takes all permutations of the scale intervals and then checks all intervals for being within the given maximum difference from one of the intervals in the given scale which could contain consonance targets. If so this interval will be counted. Then the permutation with the highest count is kept. In case of equal counts the one with the lowest squared error will be chosen. For large scales this will take a (very) long time. See also APPROXIMATE/INTERVALS.
```   /MATCH  scalenr.  [scalenr.]
```
Take a permutation of the scale intervals in such a way that the least-squares difference with the nearest pitches in another scale is minimal. The given scale may have a different size than the current scale. For scales with many different interval sizes it may take a lot of computing time. Instead of a scale number, a filename may also be given. See also BISTEP/PERMUTATION.
```   /MIN_ABS  scalenr.  [scalenr.]
```
```   /RANDOM  [scalenr.]
```
Take a random permutation of the scale intervals. Each permutation has the same probability. See also SEED. If you want to do a random amount of permutations, use ITERATE/RANDOM.

PIPEDUM

```PIPEDUM  [scalenr.]
```
Create a scale with the lattice having the shape of the inside of a parallelepiped (Fokker periodicity block). A number of rational defining intervals must be given, whose prime number components represent the homophonic vectors (also called unison vectors) that span up the parallelepiped. The number of different primes in the defining intervals must be equal to the given number of intervals, or one prime more that can be ignored (default is 2/1, to have octave equivalence. If this is the case, one would do NORMALIZE 2/1 afterwards). Defining intervals are the intervals considered to vanish in the scale, usually commas or other small intervals. For instance when the syntonic comma (81/80 = 34.5-1) is given, the homophonic vector is (4, -1) with octave equivalence, namely four fifths up and a major third down.
The defining intervals must also be independent, i.e. their vectors must span up a space with dimension equal to their number, or an interval cannot be a linear combination with integer amounts of other intervals. The number of notes that will be in the scale is equal to the absolute value of the determinant that is formed by the homophonic vectors. For example: Type pipedum enter, 2 enter, 2048/2025 enter, 34171875/33554432 enter, 2/1 enter and the scale will be 1/45 1/3 5/1 15/1 75/1 225/1 1125/1 3375/1 50625/1. The vectors are (-4, -2) and (7, 6) resp., so it has 10 pitches which is the value of determinant
 | 7 6 | | -4 -2 |
The resulting scale can be treated with NORMALIZE afterwards, or INVERT, and a (formal) octave appended. To move the tonic more to the middle of the lattice, use KEY/CENTRE or MOVE. Last but not least, it is possible to optimise the scale with APPROXIMATE/MOULD. When this is intended, use the /SCALE qualifier below to reuse the list of defining intervals.
When the number of tones in the periodicity block is even, there are two possible configurations. One contains node (0, 0) which is normally taken, but instead node (1, 1) could be taken as well (as example in the two-dimensional case). So the question will be posed whether to take that configuration. The shape can be further influenced by moving the selection of nodes around in lattice space. For each dimension an amount of shift is asked. Note that this will be interpreted as a coordinate in the normalised square, cube, hypercube etc. space. So values between -1.0 and 1.0 make sense, but it might alter the number of tones in the final scale. Numbers can also be entered as ratio.
```   /SCALE  [scalenr.]
```
Does not ask for the defining intervals, but gets them from the current or given scale. Only asks if there is a prime number to be ignored. The resulting scale will be put in the current scale. Can be combined with /TETRA and /VERTICES.
```   /TETRA
```
Does not get a whole parallelepiped but instead only the notes that represent the lattice points inside the tetrahedron (or triangle, etc.) with the origin 1/1 as a vertex. Cannot be combined with /VERTICES.
```   /VERTICES
```
Also include the other parallelepiped's vertices in the scale, besides 1/1. This gives a choice of equivalent pitches for degree 0. Cannot be combined with /TETRA.

PLAY

```PLAY  filename
```
On Windows and OSX, start playing a MIDI file to the preferred MIDI Music Playback device. If a file is already playing, it will be stopped first. The default file extension is '.mid'. The trackname of the first track of the file, if present, will be shown. Qualifiers cannot be combined.
In Windows the preferred device can be changed in the Control Panel under Sounds and Multimedia Properties:Audio. It's not the same as the output device in the Sound Settings dialog in Scala 2.x. You usually cannot use the same device at the same time to play in other Scala dialogs.
On Linux, this command is not implemented. Use "@play" instead.
```   /SCALE  [scalenr.]  [prognr.]
```
Play the current or given scale to the preferred MIDI output. Instead of a scale number, a filename may also be given. It will be played once ascending and descending. Use the SET FREQUENCY command to change the pitch. By default the grand piano sound or program number 1 is used. That can be changed by giving a program number from 1 to 128 as the second parameter. Playing can be interrupted by the PLAY/STOP command. The tempo depends on the number of tones in the scale.
```   /STOP
```
Stop playing if a MIDI file is playing, otherwise do nothing. The Stop button in the main window of Scala 2.x can also be used.

POLYCHORD

```POLYCHORD  [scalenr.]
```
Create a polychordal scale in the default or given scale memory. This is the general term for tritriadic, tetratriadic, tritetradic, etc. scales. First it asks the chord which is to be chained. The intervals in the chord are to be separated by spaces or by colons. In the latter case the values with decimal points are read as linear factors instead of cents values, for example: 4:5:6:7. Then enter the formal octave, like 2/1, default is no octave wrapping. Next the multiplicity, which is the number of times the chord occurs in the scale. The last parameter is the number of times the chord is to be chained downwards from 1/1. This of course cannot be greater than the multiplicity. If you want disjunct chaining of a chord, append an extra interval to it which is going to be the disjunction interval, and use /DISJUNCT. Qualifiers can be combined.
```   /DISJUNCT
```
Creates a scale with one tone less, omitting the last tone of the chord chain which is the disjunction because there is not another chord to join to it.
```   /SCALE   scalenr.  [scalenr.]
```
Instead of entering a chord, give a scale number or filename and the scale will be used for the chord.

POLYNOMIAL

```POLYNOMIAL  [scalenr.]
```
Create a scale where the pitches are defined by a polynomial of some order. First the size of the scale is asked. Then the order (highest power in a term) of the polynomial is asked, followed by the coefficients of the terms from high to low order. The coefficients may be entered as a fraction or floating point value. A term in the polynomial is the coefficient times the scale degree to some power. Coefficient number 0 is the constant term. For instance a harmonic scale will result if one takes order 1 and coefficient number 1 equal to 1.0. After the coefficients, an operand offset can be given. The default value is 0 which means that the operand for degree 1 is 1, etc. An offset of 5 for example will cause the operand for degree 1 to be 6. When the polynomial evaluates to a negative number, the result is discarded and the operand incremented by one until there is a nonnegative result. If the created scale contains pitches below 1/1, they can be deleted with DELETE/SMALLER. Afterwards, REDUCE or NORMALIZE may be done to bring the pitches within a smaller range.
```   /LOGARITHMIC
```
Same as the above except that the polynomial is not evaluated as being linear, but logarithmical with base 2. For instance an equal tempered scale will result if one takes order 1 and coefficient number 0 equal to 0. For 12-tET, coefficient 1 equals 1/12. Cannot be combined with /CENTS.
```   /CENTS
```
Same as /LOGARITHMIC except that the coefficients will be in cents, e.g. a factor of 1200.0 larger. For 12-tET, the order is 1 and coefficient number 1 equals 100. Cannot be combined with /LOGARITHMIC.
```   /POWER
```
Enables entry of all the powers in the terms. Strictly speaking the expression is not a polynomial anymore, because in a polynomial the powers are non-negative integers. The powers may be entered as a fraction or floating point value. Coefficient number 0 is the constant term. First the number of terms must be entered, which is to say the number of power terms without the constant term. Use this qualifier if negative or fractional exponents are present. For use with /SOLVE see below. Afterwards, FAREY may be done to rationalize pitches that result from integer powers. Cannot be combined with /SERIES.
```   /SERIES
```
Creates a linear recurrence series scale. The coefficients to be entered define the recurrence relationship between successive numbers. The general form is c[n]x[n] = c[n-1]x[n-1] + c[n-2]x[n-2] + .... After giving the scale size and order of the series (number of terms at the right hand side), the coefficient c[n] is asked which is the one in front of the next series number x[n] and by default 1.0 but it may be another nonzero value. After the coefficients the initial values need to be entered, which will also be the first tones in the scale, except when they are 0. Note that they are entered in the opposite order as the coefficients. For example to get the Fibonacci series, enter the number of notes, then 2, then coefficients 1, 1, 1 and then initial values 1, 1. Replace the last 1 with 3 for the Lucas series. The initial values may obviously not be all 0. The size of the scale may not be smaller than the number of terms. If a pitch becomes negative then it will be replaced with 1/1 (in the scale, not the series). Those can be deleted or use higher initial values to prevent it. If Invalid argument for operation is given, then a repeating series of zeroes is encountered. Many example recurrence series are given in the file series.par.
Afterwards one can do DELETE 0 to remove scale degree 0 which is not part of the series. If this is done then the scale size will be as given, otherwise one larger. Subsequently NORMALIZE may be done to bring the pitches within a smaller range and remove duplicates.
To calculate the asymptotic interval between successive notes, use /SOLVE but be aware that the sign for the coefficients c[n-1], c[n-2] etc. needs to be reversed. The asymptotic interval is a real root > 1 of the characteristic polynomial of the recurrence series. For example for the Fibonacci series above, enter 2 and then the coefficients 1, -1, -1 to obtain the equation x2 - x - 1 = 0.
The scales will often be differentially coherent, see also EQUALTEMP/DIFFERENTIAL. If used with /CENTS then the initial values will be given in cents. Can only be combined with /CENTS and /LOGARITHMIC.
```   /SOLVE
```
Does not create a scale but tries to find a nonnegative real root of the polynomial. If one is found, it is stored in pitch memory 0. A second solution will be tried. If found, it is stored in pitch memory 1.
Solving a polynomial equation is sometimes required for calculating the generator of a meantone scale with certain properties (regarding beat rates or otherwise). For other cases, see CALCULATE/LEASTSQUARE. If a root is identical to a generator in the linear temperament list, then the name will be shown.
Can be combined with one of all other qualifiers. Solving with /POWER is useful for calculating non-octave (or near-octave) scales with equal or proportional beat rates. See also MULTIPLY/RELBEATS. Cannot be combined with /SERIES.

POP

```POP
```
Copy scale number 1 to 0, 2 to 1, etc. The current scale will be lost. The highest scale memory is set in scala.ini (default 30). See also COPY and PUSH. Qualifiers cannot be combined. To restore the last directory, use CD -.
```   /PITCH
```
Copy pitch number 1 to 0, 2 to 1, etc. The current pitch will be lost. The highest pitch memory is set in scala.ini (default 10). See also COPY/PITCH.
```   /ATTRIBUTE
```
Restore the attribute to what it was when PUSH/ATTRIBUTE was done. Useful for command files. There is no stack, only one attribute memory. If SET ATTRIBUTE EXPRESSION was done previously then it restores the previous expression.
```   /FREQUENCY
```
Restore the base frequency to what it was when PUSH/FREQUENCY or KEY/FREQUENCY was done. Useful for command files. There is no stack, only one frequency memory. The value is shown by SHOW FREQUENCY.
```   /MAXDIFF
```
Restore the maximum difference for approximated pitches to what it was when PUSH/MAXDIFF was done. Useful for command files. There is no stack, only one memory.
```   /NOTATION
```
Restore the notation system to what it was when PUSH/NOTATION was done. Useful for command files. There is no stack, only one notation memory.
```   /OFFSET
```
Restore the offset for notation to what it was when PUSH/OFFSET was done. Useful for command files. There is no stack, only one memory.
```   /TOLERANCE
```
Restore the tolerance for notation to what it was when PUSH/TOLERANCE was done. Useful for command files. There is no stack, only one memory.

PRODUCT

```PRODUCT  [scalenr.]
```
Calculate the "Carthesian product" of the current scale and the given scale by multiplying each pitch of the current scale with all other pitches from the given scale. This is also called a cross-product set. The result will be sorted and identical pitches removed. If no scale is given, the current scale is multiplied with itself.
To do division of each pitch instead of multiplication, do INVERT and REVERSE first on the other scale. Another possibility is to multiply another scale's intervals with each pitch of the current scale. Do this with COLLAPSE to the other scale first before doing PRODUCT. See also EXTEND/CHORD. Qualifiers cannot be combined.
```   /ADD
```
Instead of multiplying the pitches, take the summation tones.
```   /GOLDEN
```
Take the golden mediant value of the pitches, i.e. (num(a) + phi * num(b)) / (den(a) + phi * den(b)), where phi is the golden ratio: 1.61803398875 approximately. All pitches must be rational.
```   /MEANSQUARE
```
Take the mean of the pitches squares, i.e. (a2 + b2) / 2.
```   /MEDIANT
```
Take the mediant value of the pitches, i.e. (num(a) + num(b)) / (den(a) + den(b)). All pitches must be rational.
```   /POWER
```
Take the pitches of the current scale to the power of all pitches of the given scale, i.e. (ab).

PROJECT

```PROJECT  factor  new-value  [factor  new-value  ...]
```
All instances of the given factor in the rational pitches of the current scale will be replaced by the new value. How much a pitch changes depends on how many multiples it has of the factor. If after division by the given factor still factors with the primes involved remain, then nothing happens, because replacement cannot be done unambiguously.
More than one factor/new-value pair may also be given, eight is the maximum. Then all factor parameters must be prime numbers. Otherwise Illegal parameter will be given, also if the number of command parameters is odd. For example, the fifths in a scale can be tempered by doing PROJECT 3 1900.0. Then for pitches with a factor 9 in the numerator, this is replaced by 3800 cents, and other prime exponents by ratio. Factors of other primes are left the same. See also LATTICE/LOAD.
This command can also be used to "warp" a just scale into an equal temperament (or subset). To do so, replace the prime factors with their corresponding pitches in that equal temperament. An alternative and easier way to do this is with REPLACE/NOTATION.
Another example: if the given factor is 5/3 then 5/3, 6/5, 25/18, etc. will be changed but not 10/9, 25/24, etc. If more than one factor is to be replaced with a non-rational value, it must be done in one evocation of the command because once the pitch has become non-rational, it cannot be split into prime factors anymore. The factors must then be prime, so 3/2 is not allowed but 3/1 is.
A factor can be completely removed from a scale by replacing it with 1/1. The scale lattice can be mirrored in the axis of a prime by replacing the prime with its reciprocal. See also FLIP.
```   /ADD
```
Instead of replacing by new values, they will be added to the current scale. Cannot be combined with other qualifiers.
```   /MATCH  prime  scalenr.
```
All instances of the given prime factor in the rational pitches of the current scale will be replaced by a new value which minimizes the least squares difference with the nearest pitches in the given scale. Pitches without the given prime factor and floating point pitches will not be affected. Any prime may be used, 2 included. This can be used to change rational scales into well temperaments. Instead of a scale number, a filename may also be given. See also APPROXIMATE/LEASTSQUARE, CALCULATE/LEASTSQUARE and MULTIPLY/MATCH. Cannot be combined with other qualifiers.
```   /MINIMAX  prime  scalenr.
```
All instances of the given prime factor in the rational pitches of the current scale will be replaced by a new value which minimizes the maximum absolute difference with the nearest pitches in the given scale. Further as /MATCH. See also MULTIPLY/MINIMAX and STRETCH/MINIMAX. Can only be combined with /TEMPER.
```   /VAL  val  [octave]
```
Enter new values for primes in the form of an equal temperament val. The scaling of primes can be changed by the octave parameter. A val is a list of number of steps for each prime starting with 2 and written like this example: <12 19 28|. This is the patent 5-limit val of 12-tET. A patent val is the best approximation to the primes given the formal octave and number of tones. If the octave is a prime number, then it will be matched to the corresponding element in the val, which may then not be equal to zero. The elements may also be floating point values.
See EQUALTEMP/DATA for the best vals of a given equal temperament. See also QUANTIZE/CONSISTENT which does the same operation with the patent val. Cannot be combined with other qualifiers.
```   /TEMPER  comma-list
```
Temper out one or more commas by distributing the tempering equally over the prime factors in the comma. If the formal octave is not to be tempered as well, then it can be given at the question "Enter ratio not to be tempered". For example if it is 2/1 then prime 2 will not be tempered, but it can be any rational number.
For example if the commas are 81/80 and 2 then the tempering will be 1/5 syntonic comma (same tempering for major thirds and perfect fifths). It will be applied to all rational pitches in the current scale. The purpose is to increase the number of consonant chords in the scale. Any number of commas can be tempered out simultaneously, as long as they are not mutually dependent. Then an "Invalid argument" message will be given. For suggestions which commas to temper out, use SHOW/DIFFERENCE INTERVALS.
This operation could produce identical pitches. To remove those, use UNIQUE. Cannot be combined with /ADD or /MATCH. See also CALCULATE/MINIMAX and see DISCARD/TEMPER to temper out irrational intervals.
```   /TEMPER/LOGARITHMIC
```
The tempering is distributed proportionally to the log of the prime factors in the comma.
```   /TEMPER/MINIMAX
```
The tempering has minimax logarithmic error (i.e. cents deviation) in the primes for the given comma(s). The factor not to be tempered may also be any ratio. When only one comma is to be given and it contains more than one prime, then it's sufficient to use PROJECT/TEMPER, otherwise "No solution" might be the result.
```   /TEMPER/MSR
```
As above, except the tempering has minimax logarithmic error in the superparticular ratios of the primes (2/1, 3/2, 5/4, 7/6, etc.) for the given comma(s), not the primes themselves. MSR stands for Minimax Superparticular Ratios.
```   /TEMPER/FROBENIUS
```
The tempering is called Frobenius because it is the solution to the minimal Euclidean norm of the temperament matrix, also called the Frobenius norm, which is the least squares distance to the identity matrix. It's sometimes also called pseudoinverse temperament. The factor not to be tempered may be any ratio but if used the result will not be the strict Frobenius kind.
```   /TEMPER/RMS_TOP
```
It is like /FROBENIUS, but the primes are weighted proportionally to the inverse of their logarithm, so larger primes are given less weight. It's also called TOP-RMS. The factor not to be tempered may be any ratio but if used the result will not be the strict TOP-RMS kind.
```   /TEMPER/TOP
```
The tempering is "Tenney optimal" or TOP, which means with minimax logarithmic error relative to each prime. So the log of the highest error for each prime divided by the log of the prime will be minimal. The factor not to be tempered may be any ratio but if used the result will not be the strict TOP kind. Therefore if it's 2, so octaves are not tempered, the result will be different from the so-called Kees-optimal tuning, which can be obtained using the MULTIPLY command afterwards. When only one comma is to be given and it contains more than one prime, then it's sufficient to use PROJECT/TEMPER/LOGARITHMIC, otherwise "No solution" might result.
```   /TEMPER/OPT_ET_RMS
```
Calculates the optimal TOP_RMS patent val for the given comma list which is the patent val of the equal temperament with the lowest TOP-RMS error for the primes present in the commas. Then it tempers the current scale according to this val. If there is no patent val that tempers out all the commas then "No solution" will be given. TOP-RMS error is the RMS error with the errors weighted proportionally to the inverse of the prime's logarithm. Any formal octave may be given except 1/1. Use FIT/MODE afterwards to check which equal temperament the scale is now a subset of. A similar tempering was invented by Gene Ward Smith called Optimal patent val. It uses a different error function (TE error) and uses the prime limit of the commas, not just the primes present in the commas.
TOP-RMS errors of equal temperaments for the first 5 prime limits are given by EQUALTEMP/DATA. See also DIVIDE/CONSISTENT and QUANTIZE/CONSISTENT.
```   /TEMPER/OPT_ET_TOP
```
Calculates the optimal TOP patent val for the given comma list which is the patent val of the equal temperament with the lowest TOP error for the primes present in the commas. Then it tempers the current scale according to this val. If there is no patent val that tempers out all the commas then "No solution" will be given. TOP error is the highest error for any prime with the errors weighted proportionally to the inverse of the prime's logarithm. Any formal octave may be given except 1/1. Use FIT/MODE afterwards to check which equal temperament the scale is now a subset of. A similar tempering was invented by Gene Ward Smith called Optimal patent val. It uses a different error function (TE error) and uses the prime limit of the commas, not just the primes present in the commas.
TOP errors of equal temperaments for the first 5 prime limits are given by EQUALTEMP/DATA.
```   /TEMPER/WEIGHTED
```
The tempering is distributed proportionally over the prime factors in the comma using the harmonicity constants as weighting factors. See SET HARMCONST. A clever choice of prime weighting factors can significantly reduce the maximum error of the tempering, but /TOP will be better.
For example if the comma is 81/80 and you want 1/4 comma tempering, set the harmonicity constant of 5 to zero. If more than one comma is given containing the same prime(s), then the combined tempering of the commas prevails over prime weighting however.

PUSH

```PUSH
```
Copy scale number 0 to 1, 1 to 2, etc. The scale with the highest number will be lost. The UNDO scales will not be moved or affected. The current scale will be unchanged. See also COPY and POP. Qualifiers cannot be combined.
```   /PITCH
```
Copy pitch number 0 to 1, 1 to 2, etc. The pitch with the highest number will be lost. The current pitch will be unchanged. See also COPY/PITCH.
```   /ATTRIBUTE
```
Save the current attribute. Then it can be restored with POP/ATTRIBUTE. Useful for command files. There is no stack, only one attribute memory.
```   /FREQUENCY
```
Save the current base frequency. Then it can be restored with POP/FREQUENCY. Useful for command files. There is no stack, only one frequency memory. See also SHOW FREQUENCY.
```   /MAXDIFF
```
Save the current maximum difference for approximated pitches. Then it can be restored with POP/MAXDIFF. Useful for command files. There is no stack, only one memory. See also SET MAXDIFF.
```   /NOTATION
```
Save the current notation system. Then it can be restored with POP/NOTATION. Useful for command files. There is no stack, only one notation memory.
```   /OFFSET
```
Save the current offset for notation. Then it can be restored with POP/OFFSET. Useful for command files. There is no stack, only one memory. See also SET OFFSET.
```   /TOLERANCE
```
Save the current tolerance for notation. Then it can be restored with POP/TOLERANCE. Useful for command files. There is no stack, only one memory. See also SET TOLERANCE.

PYTHAGOREAN

```PYTHAGOREAN  [scalenr.]
```
This is the older name and synonym of the LINEARTEMP command.

QUANTIZE

```QUANTIZE  resolution  [octave]
```
Replace all pitches in the current scale with a near multiple of an interval which is 1200 cents (default) divided by the given logarithmic resolution. If an octave parameter is given, then it's this interval divided by the given resolution. It may be given as a fraction or floating point value. To round off all pitches to the nearest whole cents value one does QUANTIZE 1200. To make the scale a subset of the 31-tone equal division of the octave for instance one does QUANTIZE 31. To quantise without affecting the current formal octave, do QUANTIZE <resolution> %n.
To quantise one step intervals instead of pitches, do COLLAPSE, then QUANTIZE with any qualifier and then COLLAPSE/ERECT.
To calculate quantisation of a single pitch value, see CALCULATE.
```   /PITCH  step
```
As above but provide the quantisation step as a ratio or cents value instead of a division of an interval. So it combines the two parameters above to one. For instance to quantise in schismas one does QUANTIZE/PITCH \$s. This can also be used to quantise to an equal nonoctave temperament. For example to a 41-tone division of the current scale's octave do first CALCULATE %n\41 and then QUANTIZE/PITCH \$0.
This qualifier can be combined with all qualifiers below, except /LINEAR.
```   /LINEAR  step
```
Replace all pitches in the current scale with a near multiple of a small interval which is the given linear step. The default quantisation method is rounding: the nearest step is chosen. For truncation, combine this qualifier with /TRUNCATE. It may not be combined with other qualifiers than /ROUND and /TRUNCATE. The parameter may be a ratio or floating point value. It must be positive. When step is of the form 1/n, then n will be a common denominator of the resulting scale. So a common fundamental is set. To set a common guide tone instead, do INVERT prior to and after QUANTIZE/LINEAR. Quantisation to zero will not take place. See also FIT/HARMONIC. Can only be combined with /ROUND and /TRUNCATE.
```   /ROUND
```
This is the default quantisation method. The nearest interval step is chosen. Can only be combined with /LINEAR and /PITCH.
```   /TRUNCATE
```
The interval step that is lower than or equal to the pitch is chosen. Can only be combined with /LINEAR and /PITCH.
```   /CEILING
```
The interval step that is higher than or equal to the pitch is chosen. Can only be combined with /LINEAR and /PITCH.
```   /BEST
```
The formal octave of the current scale must be a multiple of the step size that belongs to the resolution. It finds the least-squares optimal quantisation. It uses the same algorithm as FIT/MODE that shifts the pitch of degree 0 to find a better fitting for the intervals. Can only be combined with /PITCH.
```   /CONSISTENT
```
For floating point pitches the nearest interval step is chosen. For rational pitches the step will be the sum of the rounded approximations to the constituent primes. If for one of the scale pitches this is not the same step as the nearest rounded step, then a message is given that the quantisation is not consistent, but it is made anyway. This is tuning to the patent val of the equal temperament with the given division and octave. Tuning by specifying a val, so a non-patent val can also be used, can be done with PROJECT/VAL. See also DIVIDE/CONSISTENT. Can only be combined with /PITCH.
```   /MODEL  scalenr.  [scalenr.]
```
Take the nearest pitches in the first scale number to the pitches in the second scale number. This means that each pitch in the second scale (default is the current scale) is replaced with the nearest pitch from the given scale. Instead of a scale number, a filename may also be given as first parameter. See also REPLACE/MODEL to which it is similar. The difference is that REPLACE/MODEL is more restrictive. And see SELECT/MODEL. Can not be combined with other qualifiers.

RATIO

```RATIO  pitch  [highest-prime]
```
Approximate the given pitch with the nearest ratio for successive prime limits starting with 2, and show the results. With the /LIMITED qualifier the search can be limited to a certain range for the prime exponents. If the prime parameter is not a prime number, then the next higher prime will be the limit. The prime count is set by Prime_Count in scala.ini (default 10 which is 29-limit). To see which numbers are prime numbers, use SHOW PRIMES. The last approximation is stored in pitch memory 0 (\$0) and an intermediate one if the command is interrupted. See also APPROXIMATE.
```   /FAREY  pitch  highest-order  [highest-prime]
```
Approximates the pitch with Farey fractions up to the given order. A Farey order is the maximum denominator. Also shown are the differences in cents, the factorisation and the continued fraction representation. The best approximation is stored in pitch memory 0. If the pitch is preceded by an 'f' and contains a dot then it is not considered to be a value in cents but a linear factor.
The beat frequencies are given in Hertz and relative to the base frequency set with SET FREQUENCY.
The values called certainties, indicate likelihood of the interval being heard as such. The first assumes a precision of pitch perception of 0.006 (0.6%, fine), the second of 0.012 (coarse). The likelihood decreases with the difference and with the denominator of the approximation. In order to see the ratio with the highest certainties, be sure to supply a high enough Farey order so that the certainties decrease with increasing denominator after having increased.
If it is combined with /LIMITED, then the prime limit must be given which will restrict the ratios found to the given limit. The same happens if the prime limit is given without the extra /LIMITED qualifier. The computing time will then rise quickly for orders higher than 10000.
If it is combined with /LOGARITHMIC, the nearest Farey fraction of the binary logarithm of the pitch will be found. So the result will be some step of an equal octave division whose cardinality does not exceed the given order.
Can only be combined with /LIMITED, /LOGARITHMIC and /NOOUTPUT. See also CONVERGENTS.
```   /LIMITED  pitch  [highest-prime]
```
Consider only the fractions in which the prime exponents of numerator and denominator are within the range set by SET EXPLIMIT. If the prime parameter is not a prime number, then the next higher prime will be the limit. If combined with /FAREY the parameters are as with /FAREY. Can only be combined with /NOOUTPUT, /FAREY and /SUPER.
```   /LOGARITHMIC  pitch  highest-order
```
See /FAREY. Can only be combined with /FAREY.
```   /NOOUTPUT
```
Stores the last approximation in pitch memory 0 only and does not show the results. Can only be combined with /LIMITED, /FAREY and /SUPER.
```   /SUPER  pitch  [order]
```
Approximates the pitch with a superparticular ratio. Shows the ratio lower than or equal and the one above the given pitch. The best approximation is stored in pitch memory 0. A superparticular ratio is one of the form (n+1)/n with num and den in lowest form. For superbiparticular (superbipartient) approximations specify order 2, etc.
If combined with /LIMITED, superparticular approximations containing successively higher prime factors will be given, until prime number 41. The parameters are as given under /LIMITED and the order can only be 1. If less are desired, a second parameter with a highest prime can be given. Can only be combined with /LIMITED and /NOOUTPUT.
```   /CHILDREN  pitch
```
The given pitch must be rational. Shows the two children of the ratio in the Farey tree, also called Stern-Brocot tree. If combined with /PARENTS, then first the parents and then the children are shown. See also EXTEND/CHILDREN. Can only be combined with /PARENTS.
```   /PARENTS  pitch
```
The given pitch must be rational. Shows the parents of the ratio in the Stern-Brocot tree. If the value is an integer number then there are no parents, otherwise there are two. If combined with /CHILDREN, then first the parents and then the children will be shown. See also EXTEND/PARENTS. Can only be combined with /CHILDREN.
```   /STERN  pitch  [maximum-depth]
```
Shows all the convergents of the given pitch following the Stern-Brocot tree. An 'L' indicates branches to the left, an 'R' to the right. If no maximum depth is given, then the pitch will be approximated until the difference is very small, otherwise no more approximations than the given number will be given. If the given pitch is rational and no maximum depth is given, approximation will continue until the result is exact. If the given pitch is higher than 16, the integer convergents from 1 to the floor of that number will be skipped. The last approximation is stored in pitch memory 0.
Cannot be combined with other qualifiers. See also CONVERGENTS. This command is similar in that not only the full convergents are given, but also the semi-convergents.

RECTANGLE

```RECTANGLE
```
Create a rational scale where numerators and denominators are each within given separate ranges. The parameters are given in the following order: lower bound of numerator, higher bound of numerator, numerator step (default 1), lower bound of denominator, higher bound of denominator, denominator step (default 1). If a step is given, then numbers are skipped if it is higher than 1. This value may also be noninteger, in which case the numerators or denominators will obey this formula : floor(lower-bound + n * step), n >= 0.
For example, if the numerator is in 7 .. 9 and the denominator in 4 .. 6 and the step is 1, then the scale will be 7/4 8/4 9/4 7/5 8/5 9/5 7/6 8/6 9/6.
The pitches can be reduced by an octave with the NORMALIZE command, which also removes duplicate pitches. If the scale is only to be sorted (because 1/1 will be at degree 0), do the following: APPEND 1/1
SORT
DELETE 0
Example: to create a 15-odd limit diamond give the following parameters: 1 15 2 1 15 2 and then do NORMALIZE.
If LATTICE/DIAMOND is done after this command, it will show a rectangular diagram, hence the name of this command. See also HARMONIC and SQUARE.
```   /ADD
```
As above but the denominators will be added to the numerators so the ratio will be (num+den)/den.
```   /SUBTRACT
```
As above but the smaller from the denominators and the numerators will be subtracted from the larger so the ratio will be abs(num-den)/den.

REDUCE

```REDUCE  pitch  [scalenr.]
```
Divide all pitches in the current or given scale by the given pitch as many times as needed to make the resulting pitch lower than the given pitch. Otherwise if a scale pitch is smaller than 1/1, it is multiplied so the result is greater than or equal to 1/1. The given pitch parameter must be greater than 1. See also NORMALIZE.
```   /UPPER
```
Does the above except that pitches below 1/1 are not changed.

REMOVE

```REMOVE  file-mask
```
Remove the file with the given name from disk. There is no default file extension. If wildcards * and ? are given, the first file that matches will be deleted. To remove the last scale file loaded or saved, do REMOVE %scl. You cannot remove a folder with this command.
```   /ALL
```
Instead of deleting only one file, delete all files that match the given filename mask. No messages will be shown.

REPLACE

```REPLACE  position  pitch
```
Replace the pitch in the current scale at the given position with another pitch. The position must be a number not higher than the number of notes in the scale. If degree 0, the 1/1 is changed then all pitches shift by the inverse of the given amount. Qualifiers cannot be combined. See also help of := and INSERT.
```   /EQUAL  interval  new-interval  [interval  new-interval  ...]
```
Replace all instances of the given one step interval in the current scale with the given new interval. The other intervals will remain the same. The scale must be non-empty. More than one interval pair may also be given, eight is the maximum. Note that /INTERVAL is similar, but only one step interval will be changed there and the parameter is the interval position instead of an interval size. To refer with this qualifier to a one step interval by position, the %% notation can be used, for example %%2 is the step interval at the second scale degree. See also EXCHANGE/EQUAL.
```   /FREQUENCY  position  frequency
```
Replace the pitch by specifying the frequency relative to the base frequency (see SET FREQUENCY and SHOW/FREQUENCY).
```   /GIVENBEATS  position  interval  frequency
```
Replace the pitch at the given position by specifying its beat frequency against a given rational interval. The scale degree at the other side of the interval does not have to be inside the scale as octave equivalence is assumed. The beat frequency is relative to the base frequency of 1/1. When a negative beat frequency is given, the resulting pitch will be lower than the given interval, otherwise higher. See also SHOW BEATS, LINEARTEMP/GIVENBEATS and APPEND/GIVENBEATS.
```   /BEATSGIVEN  position  interval  frequency
```
As /GIVENBEATS but works the other way around. Not the position at the upper end of the interval is given and changed, but the pitch at the lower end. Which is the position where SHOW BEATS shows the beat frequency. The given position must be in the scale range, it may also be 0.
```   /INTERVAL  position  new-interval
```
Replace the pitch in the current scale at the given position by specifying a new interval with the previous degree. The position must be greater than 0 and not higher than the number of notes in the scale. To see the current scale intervals, do SHOW/INTERVAL.
```   /LARGEST  new-interval
```
Replace the largest one step interval(s) in the current scale with the given new interval. The other intervals will remain the same. The scale must be non-empty.
```   /NEAREST  pitch  [at-pitch]
```
Replace the pitch in the current scale with the smallest absolute difference from the given pitch (the second if it's given), with the given pitch. The scale may not be empty. Degree 0 will not be replaced even if 1/1 is closest to the given pitch.
```   /SMALLEST  new-interval
```
Replace the smallest one step interval(s) in the current scale with the given new interval. The other intervals will remain the same. The scale must be non-empty.
```   /MODEL  scalenr.
```
Replace the pitches in the current scale with the nearest pitches in the given scale. This means that for each pitch in the given scale, the nearest pitch from the current scale is replaced. This only happens if the pitch in the given scale is also the nearest pitch for the current scale. So there may be pitches in the current scale that remain unchanged. Instead of a scale number, a filename may also be given. The file intnam.par is useful because it contains many rational pitches. See also SELECT/MODEL, QUANTIZE/MODEL and SHOW/NEAREST DIFFERENCE.
```   /NOTATION  source-notation  target-notation
```
Replace the pitches in the current scale with pitches having the same notation in a different notation system. The pitch is replaced with the corresponding nominal value for that name in the target notation system. If the target system does not contain the name, then the pitch is not replaced. If the source system has no name for the pitch, then it is not replaced either. Note that whether a notation system shows a certain name depends on the value set by SET TOLERANCE. For each pitch the shortest name is taken for the given source notation system (if there are enharmonic equivalents). If the equivalents have the same length, then names which are closer to C in the cycle of fifths have priority, so Eb comes before D# for example. At the end the number of changed pitches is shown, which means how many note names have matched, not whether the pitch actually became different.
For a list of notation systems, use SET NOTATION. For equal temperaments the behaviour is similar to, but not the same as QUANTIZE. When the consistency level of either equal temperament is low, the result will be different. For some notation systems this command is not useful because the names are different than in other systems, like P7, I22 and S31 for example. Double pitches resulting from this operation can be removed with UNIQUE. Example: to change pitches to 3-limit Pythagorean (or 5-limit just), use JI as target notation system.
```   /LT_GENS  generator  [octave]
```
Change the pitches according to the LT notation with parameters set with SET LT_PARS where another pair of generators is given as command parameters. The default octave value is 2/1. If a pitch has no note name, because of the tolerance setting, then it's not replaced. For example with the default LT parameters a pitch of 400.0 cents is notated as "4.-2". So if the given generator and octave are 699.0 and 600.0 cents respectively, this pitch will become 4 * 699 - 2 * 600 = 1596 cents. The current notation system does not need to be LT. See EXAMPLE for the similar lt_gens statement.
```   /RATE_EQUAL  position  interval  interval
```
Both intervals given must be rational. Creates a tempered version of the second given interval such that it divides the first given interval into two equal beating intervals. It's best explained with an example. Suppose the current scale is 12-tET and the parameters are 7 3/2 6/5. Then an interval of 314.664 cents will replace the interval nearest to it. The beat frequencies can be shown with SHOW BEATS 6/5 5/4. You will see that the interval 0.0 - 314.664 beats with the same rate as the interval 314.664 - 700.0. The beating sign (identical or opposite) is chosen automatically such that it gives the lowest beat rate. The first interval may also be larger than the second. See also INSERT/RATE_EQUAL.
```   /REPEAT  position  pitch
```
Replace all integer multiples of the given position in the current scale with corresponding multiples of the given pitch. The position cannot be 0. For position 1, an equal temperament will result.

REVERSE

```REVERSE  [scalenr.]
```
Reverse the order of all pitches in the current or given scale. To take the reciprocal of all pitches: do INVERT after REVERSE.

SAMPLE

```SAMPLE  step-pattern
```
Select degrees according to a mode pattern from the current scale and delete the intermediate degrees. Degree 0 and the last degree (formal octave) will not be deleted. For instance if a single number is given it means that every so many pitches are taken from the scale and the rest deleted.
If more than one number is given, this pattern repeats as often as is necessary. Example: with 12-tone equal temperament, doing SAMPLE 2 1 will give the Whole-Half step scale. The size of the scale does not need to be a multiple of the sum of the pattern. But if it is, it has the same effect as using the MODE command with this step pattern. Use SAMPLE 2 to undo a DOUBLE operation. If the amount of steps is too large for the scale size, then ones that fall outside the scale range will be ignored. Qualifiers cannot be combined. See also SELECT and SIEVE.
```   /COMPLEMENT  step-pattern
```
As above but selects the complementary pattern.
```   /RANDOM  count
```
Take a random sample of the scale degrees from the current scale. Each degree has the same probability. If the scale is not in ascending order then the order is not preserved. The last degree may be deleted. Degree 0 will be unaffected and is also not counted. See also DELETE/RANDOM, SIEVE/RANDOM and SEED.
```   /SEQUENCE  factor  [add-constant]
```
Specify a sample pattern as a spectrum sequence: floor(i * factor + add-constant), i = 1 .. scale size.
The parameters may be given as floating point value or ratio. Floor truncates to the nearest integer not exceeding the number. The default value for the additional constant is 0. By using a factor less than 1, the scale size can be made to increase by inserting duplicate pitches, so if for example it's 1/2 then each pitch will be copied once and the scale becomes twice larger. For example to stretch a pentatonic scale to 12 tones, do SAMPLE/SEQUENCE 5/12. See also MODE/SEQUENCE.

SAVE

```SAVE  filename  [scalenr.]
```
Write the given or current scale to a scale file with the given filename. If a filename without extension is given, the extension will be '.scl'. Then a description must be given on a single line. More decription text can be added with an editor if the lines begin with an exclamation mark.
The name of the last scale file loaded or saved is contained in the lexical function %scl(). It can be used to save with the last scale name, see ECHO. When SAVE is done in an ITERATE statement then %i within the file name will be replaced with the iteration index. When used in combination with %scl() put it inside the parentheses. So this can be used to create unique file names.
The number of decimal places in cents values is default 5, but can be changed by adding a key to scala.ini like this: Scl_Decimals 11
The given filename will be put in the first line of the scale file as a comment. If a folder or drive letter was included in the parameter, it will be removed. However in order to keep the whole name, a key can be added to scala.ini like this: Path_In_Scl 1
```   /KEEP_TEXT
```
Save the scale with the description that it got from loading from a file, or the SET DESCRIPTION command, even if it's empty or not previously set. Can only be combined with /CENTS.
```   /CENTS
```
Write the given or current scale to a text file with the given filename. The filename has no default extension. The pitch values are written in cents, one value per line. The first line will contain the description. The file can so be used as input file for spreadsheet or other programs. For rational pitches the value is also written in cents, but followed by the numerator and denominator of the fraction. The numbers are separated by horizontal tabs. In a spreadsheet, this will get the numbers in adjacent columns (if the tab character is selected as separator). Such a file can be loaded again with LOAD/CENTS, but only as floating point values. Can only be combined with /KEEP_TEXT.
```   /CSV
```
Write the given or current scale to a file with the given filename. The default extension is '.csv'. The format is a vertically oriented semicolon-delimited text file which can be read in a spreadsheet like Excel for example. The fields are the description, the scale size, and the pitches in cents. If a file already exists, it will be overwritten. Cannot be combined with other qualifiers.
```   /EXCEL
```
Write the given or current scale to an Excel file with the given filename. The default extension is '.xls'. The worksheet will have one column with the scale description in the first row, and the pitches written in cents in row 3 and down. If a file already exists, it will be overwritten. Cannot be combined with other qualifiers.
```   /PITCH  filename  [first-pitchnr.]
```
Save values from pitch memories to a scale file. The default first pitch memory is 0, which means all pitch memories will be saved. They are used to store single pitch values and hold intermediate results of pitch calculations. The number of pitch memories is set with keyword Pitches_Count in scala.ini. See also LOAD/PITCH. Combined they can be used to easily save and restore the pitch memories.

SEED

```SEED  [number]
```
Gives the random number generator that is used for the aleatoric commands a new seed to prevent always getting the same sequence of results. The number must be integer. If it is omitted, the computer's clock is used to obtain a value. It's also used for the random TIP.

SELECT

```SELECT  [scalenr.]
```
Enter a set of scale degrees to keep for the given or current scale and delete the degrees not entered. The program will prompt for the scale degrees. Then type each degree number followed by a <return>. Continue doing this until all degrees that need to be kept are entered and then enter a zero to stop the program from prompting. Instead of scale degrees, also note names of the current notation system may be entered, see SET NOTATION. This is sometimes a more convenient way of deleting pitches from a scale than with the DELETE command. If you might decide to keep the scale, or in case a wrong note was selected, you can enter -1 instead of 0, which will cancel the command. If some degree is selected twice, it will be included twice. Degree numbers outside the scale can also be chosen, and then octave extended pitches will be included. Note names can only refer to notes inside the scale. If note names outside the scale range are wanted, do EXTEND first.
```   /CONVERGENTS  divisions
```
Select the scale degrees which have one of the given divisions in their convergents as shown when the current attribute is CONVERGENTS. The formal octave will not be deleted. Submultiple divisions will not be automatically considered as they can be included in the list given. If degrees should be selected for a combination of divisions, this command can be repeated.
```   /MAPPING  [scalenr.]
```
Use the current keyboard mapping to alter the given or current scale. Scale degrees can be doubled, deleted, moved to another position, etc. The keyboard mapping may not have unmapped keys. It may have multiple keys mapped to the same scale degree. The size of the mapping does not have to be the same as the scale size. If it is 0, which means a linear mapping, then the scale will remain the same. This command is useful to make scale files for software synthesizers which can load Scala scale files but not keyboard mappings. So after doing this command the scale can be saved as an already mapped scale, with 12 notes for example. Only the scale degrees in the mapping including the formal octave scale degree are considered, so the MIDI note numbers and the reference frequency are ignored. See also Mappings and UNIQUE/MAPPING.
```   /MODEL  scalenr.  [scalenr.]
```
Change the second scale number to the structure of the first scale number. This means that for each pitch in the first scale, the nearest pitch from the current or second scale is taken. So there may be pitches from the current or second scale removed or duplicates inserted. If two pitches are equally distant from a pitch in the first scale, (within half a cent) then the highest one will consistently be selected. After the operation the current or second scale has the same number of notes as the first scale. Instead of a scale number, a filename may also be given as first parameter. See also DELETE/MODEL, REPLACE/MODEL and QUANTIZE/MODEL.
```   /RANGE  from-position  to-position  [scalenr.]
```
Delete all pitches from the current or given scale except 0 and the ones in the given range of positions. See also DELETE/START.

SEND

```SEND  [parameters]
```
Send a tuning to a synthesizer (via MIDI). This command invokes "@send", so the command file send.cmd must be present in the current directory. The contents of send.cmd should be adapted for the computer platform used by invoking an appropriate external MIDI file player program or the internal PLAY command. An exception are software synthesizers or soundcards which are tuned via a text file (see the output of command SHOW SYNTHESIZER). When such is the current synthesizer type, the command file sendtext.cmd will be invoked instead. Any parameters given will be passed to the command file.
```   /FILE  filename  [scalenr.]
```
Write the tuning data as one or more MIDI system exclusive tuning messages to a MIDI file with the given filename, using the current keyboard mapping and according to the currently selected synthesizer type. Warning: the MIDI file will not contain anything audible, just tuning messages. For software synthesizers generally a text file and not a MIDI file will be produced with tuning instructions. The default extension for the output file is '.mid' for MIDI files and something else for text files, depending on the synthesizer type. If the current keyboard mapping is empty then a linear mapping (scale degrees mapped one-to-one to MIDI keys) is used. Instead of a scale number a filename can also be given.
Some synthesizer types only allow 12-note tuning. If you want to tune a scale with less than 12 tones, you should use a keyboard mapping that maps some scale degrees to more than one key. Or if you want to use a linear mapping, extend the scale by duplicating some pitches.
When it allows a (short) description, the current scale description or part of it will be put in, see SET DESCRIPTION. Read synth.par to see how the dump format is adaptable for different synthesizer types, although it is of very limited use since most dumps do not have such a simple form.
The two Reaktor formats 120 and 121 are just a single line with semitones or frequencies. They can be loaded into a Reaktor event table. Then connect the incoming note events to both the RX and R inputs of the event table module.
The name of the last scale file loaded or saved is contained in the lexical function %scl(). It can be used to save with the last scale name plus another extension, like so: %scl(.txt), see ECHO. If no extension is added, the default one for the given synthesizer type will be used.
If a text file format for a software synthesizer is not supported, it might also be possible to create a command file to produce it. The cmd directory contains ones for:
Chuck: chuck-scl.cmd
Csound: cs-demo.cmd
Humdrum hum2mid program: humdrum.cmd (12-tone only)
MicroABC: microabc.cmd
Pd: pd-scales.cmd
So they can be used as examples.
```   /HEXADECIMAL  filename  [scalenr.]
```
Write the tuning data to a text file with the given filename, using the current keyboard mapping and according to the currently set synthesizer type. The synthesizer type can only be one defined in synth.par, see SET SYNTHESIZER. This is used to create tuning dumps for unsupported synthesizer types. Only the MIDI tuning numbers will be written to the file, in hexadecimal format. MIDI codes in synth.par for prefix and suffix are ignored. The file written can then be included in another file containing a text representation of surrounding MIDI system exclusive codes. Then it can be transformed into a MIDI file with the program T2MF (text to MIDI file).
If the current keyboard mapping is empty then a linear mapping is produced. Instead of a scale number a filename can be given. The default file extension is '.txt'.
```   /SCREEN  [scalenr.]
```
Write the scale data in numbers to the screen so putting them in the synthesizer can be done by hand. If a tuning number is inappropriate (i.e. too high, too low, or too far from the equal tempered value for the synthesizer) then it is marked with a '*' and a greater or smaller than sign. The keyboard map determines which note numbers will be shown among other things. In order to write the lines shown to a file, for example to print them, use command FILE first. The frequency corresponding to the tuning number may be different in reality because it may also depend on the usual master frequency setting of the instrument. And it depends on the instrument's tuning resolution which is not taken into account in the value shown. Behind the frequency is the 12-tone equal temperament note name and offset in cents in standard tuning with A4 of 440 Hz.
The scale pitch and notation in the current notation system are then shown for valid tuning numbers. Instead of a scale number a filename can also be given.
```   /FREQUENCY  [scalenr.]
```
As /SCREEN but only writes the frequencies mapped to the MIDI note numbers to the screen. Therefore the output does not depend on the synthesizer type but only on the scale and keyboard mapping. This can be useful to tune software synthesizers whose table or script format is not (yet) supported by Scala. Instead of a scale number a filename can also be given.
```   /HERTZ  [scalenr.]
```
As /FREQUENCY except the note name and cents value is not given, so just the MIDI key and frequency in Hertz.

SET

```SET (ATTRIBUTE | ADJUSTMENT | CALC_OUTPUT | COMPDIFF | CONTROLLER | DEFAULT |
DESCRIPTION | DEVICE_ID | DIFF_DEGREE | ELLIS | EXCLUDE | EXPLIMIT |
FIFTH | FIRST | FREQUENCY | HARMCONST | INDEX | INT_FILE | INT_STEPS |
LIMIT | LT_PARS | MAP_FREQ | MAXDIFF | MIDDLE | NAME | NOTATION |
OFFSET | ONERROR | PAUSE | PITCH_BEND | PRESET | PROGRAM | RECIPROCAL |
SAGITTAL | SEPARATOR | STEP_UNIT | SYNTHESIZER | TOLERANCE | UNIT |
WAVEFILE | WEIGHTING)```
```SET ATTRIBUTE  attribute  [parameter]
```
Change the pitch attribute shown with SHOW SCALE, SHOW/INTERVAL SCALE or SHOW/ATTRIBUTE INTERVALS. The attribute value can also used by other commands like APPROXIMATE and ones with a /ATTRIBUTE qualifier.
Many attributes apply only to rational pitches and will be shown empty for floating point pitches. The possible attributes are:
 BP : the Bohlen-Pierce complexity value num*den (without 2's and 3's) CENTS : the cents value CONVERGENTS : the denominators of successive convergents  DENOMINATOR : the denominator DEPTH : the length of the continued fraction expansion  DIFF_ET : the difference in cents with the equal tempered value  DISSONANCE : the sensory dissonance of the dyad with 1/1  DOREMI : the DoReMi comma quality value  ENTROPY : the Erlich harmonic entropy value  EPIDEN : the Epimoric Denominator 1/(num/den-1)  EPIMERICITY : the comma complexity log(|num-den|)/log(den) ET_STEP : the number of consistent steps of an equal temperament  EXPONENTS : the harmonic vector of primes including 2 EXPRESSION : the result of a definable pitch expression  FACTOR : the frequency ratio as a linear decimal factor  FM_CAR : the frequency modulation carrier frequency  FM_MOD : the frequency modulation modulator frequency  FRACTION : the continued fraction expansion of the linear value FREQUENCY : the frequency according to the base frequency in Hz FUSC : the sum of Dijkstra's fusc function for num and den  GRADUS : the Gradus Suavitatis of Euler  HARMON : the Barlow harmonicity value  HEIGHT : the Tenney (log prime) weighted L1 norm  HMEAN : the harmonic mean of numerator and den 2*num*den/(num+den) INTERVAL : the interval with previous or other position in cents  INV_HARMON : the absolute reciprocal of Barlow's harmonicity value LENGTH : the length of unweighted harmonic vector (L2 norm)(without 2's) LIMIT : the prime limit LIM_ODD : the odd limit max(num,den without prime 2) LOG_FRACT : the number of octaves as a ratio  MANN : the arithmetic mean of numerator and denominator (num+den)/2 MAX : the maximum of numerator and denominator max(num,den) MEAN : the geometric mean of numerator and denominator sqrt(num*den) MIN : the reciprocal of the minimum of num and den: 1/min(num,den) MULTIPLE : the integer multiple (all values under denominator 1) NONE : no attribute NOTATION : name and accidentals according to a given system  OCTAVE : the number of octaves (oct value of Csound and SAOL)  ODD : the odd complexity value num*den (without 2's) OTHER_SCALE : the same degree of another scale  PERRY : the Perry harmonic complexity value  PITCH_BEND : semitone roundoff and pitch bend values (-2048..2047)  PRIMES : the prime factorisation PROOIJEN : the Kees van Prooijen harmonic expressibility value  RECIPROCAL : the reciprocal ratio with degree 0, (rel. string length)  RECTANGULAR : the rectangular distance in lattice space (without 2's)  REDUCED : the 2/1 octave reduced pitch RHSM : the root harmonic square mean of numerator and denominator SEMITONE : the semitone roundoff value and remainder (-50..49 c.) SEP_PRIMES : the prime factors except 2 separately (i.e. 3.3.5.7) STEP_DIFF : the difference in cents with the nearest e.t. step  STERN : the length of the path in the Stern-Brocot tree SUBMULTIPLE : the inverse multiple (all values under numerator 1)  SULLIVAN : the O'Sullivan harmonicity value  TENNEY : the Tenney harmonic distance value: log(num*den)  TE_NORM : the Tenney weighted Euclidean L2 norm  T3_NORM : the Tenney (log prime) weighted L3 norm  TRIANGLE : the distance in triangular lattice space (less factor 2)  TR_LOG : the triangular logarithmic complexity (less factor 2) TWELVE : the nearest semitone name and difference (-50..49 c.) VECTOR : the harmonic vector of primes other than 2 VOGEL : the Vogel harmonic complexity value  WEIL : the Weil height log(max(num*den)) WILSON : the Wilson harmonic complexity value (sum of primes except 2) number : the interval size in per octave units 

Remarks:

1. An extra parameter can be given for another octave value than 2, for example: SET ATTRIBUTE CONVERGENTS 3/1. This parameter is shared with attributes LOG_FRACT and OCTAVE. It shows the denominators of the full convergents of the logarithmic pitch divided by the log of the given octave, reduced to the range 0..1. The first value 1 is skipped, unless it's the only value. See also CONVERGENTS.
2. See also the FRACTION attribute and the STERN attribute. For rational pitches only. It's the length of the continued fraction expansion of the linear value.
3. DIFF_ET is different from STEP_DIFF in that it doesn't refer to the nearest equal tempered step but to the equal tempered value for the same pitch class (scale degree). The values given depend on the setting of SET DIFF_DEGREE. But an extra parameter may be given to change the reference class with the same command. See also SHOW ET_DIFF if you want to compare to other equal temperaments than the current scale size.
4. An extra parameter is used to set the scale number which contains the frequencies of the partials to calculate the Plomp-Levelt dissonance with. The initial scale number is 1. The next scale, one number higher, is used as an array of amplitudes of the corresponding partials. Degree 0 in these scales is not used. For example to use scales 1 and 2, suppose the partial frequencies are: 500, 1000, 1500, 2000 Hz. Then do INPUT 1, 4 (number of notes), 1/1, 2/1, 3/1, 4/1 (or 1, 2, 3, 4). Then do SET FREQUENCY 500. Then do INPUT 2, 4 (number of notes), 10.0, 8.8, 7.7, 6.6 (the cents will be interpreted as amplitudes; don't forget the decimal point). Then do SET ATTRIBUTE DISSONANCE 1 and then SHOW. For each note in the current scale the dissonance value is given. To get an impression of the dissonance curve of the given timbre, make an equal tempered scale with many notes and do SHOW. The values depend on the base frequency. If the partials and amplitudes scales don't have the same size, only the smallest number is taken.
5. This is log(num)/log((num-den)*radical(num*den)), where radical(num*den) is the product of the primes dividing num*den. Invented by Gene Smith and related to the mathematical ABC conjecture. If a comma has a value higher than 1.0 it may be called a DoReMi comma.
6. The order may be set with an extra parameter. A positive value sets the Tenney version of harmonic entropy, which is also default. The order is the highest product of numerator and denominator of ratios in a set which forms the "alphabet" for the entropy calculation. Default is a Tenney order of 1500. For a negative value, it is the Farey version of harmonic entropy. The Farey order is the highest numerator and denominator of the ratios in the set. A useful Farey order is 80 (so the parameter is -80).
The default hearing resolution sigma (standard deviation) for the entropy formula is 1%. It can be altered by adding the key Entropy_Sigma to scala.ini with the desired percentage. A fine perception precision would be 0.6%, a coarse one 1.2%.
7. This is 1/(F-1) where F is the linear factor. It shows how close the pitch is to 1/1. For superparticular (epimoric) ratios it's equal to the denominator. Also at which frequency the difference is 1 Hz. The term's name is by Petr Parízek.
8. An extra parameter must be given to set the number of steps per octave. This doesn't need to be an integer number. If the pitch is a rational value, the integer number of steps in this equal temperament is given which is consistent with the prime factorisation of the ratio and based on the nearest steps for the primes, see also DIVIDE/CONSISTENT. If the pitch is a cents value, the nearest number of steps is given. The given parameter also inversely influences the STEP_DIFF attribute, or can be set with SET STEP_UNIT (as ratio or cents, not as octave division). The parameter can also be "n", which means the current scale size. This value is also known as "val". The counterpart attribute which gives the non-integer number of steps is OCTAVE.
9. The extra parameter must be an expression that the CALCULATE command must be able to evaluate. Each pitch in the scale will first be copied to pitch memory number 1, so that it can be referred to in the expression with \$1. This can make it a user-definable function of the scales pitches. The initial value in pitch memory 1 will be lost. The linear value of the result will be shown. If no extra parameter is given, the last expression will be used. The expression is initially empty. If there's a syntax error in it, or the result or arguments are out of range, then nothing will be shown. It best to check them with CALCULATE first. The previous expression can be restored by doing POP/ATTRIBUTE. See also Expressions.
10. The value for FACTOR depends on the setting of SET FACTOR. But an extra parameter may be given to change the multiplication factor with the same command. The initial value is 1.0. Being a linear value, it represents relative frequency. See also SET FREQUENCY and SET ATTRIBUTE MULTIPLE.
11. This represents the FM carrier frequency for FM_CAR, (F+1)/(F-1) where F is the linear value of the pitch, and the FM modulator frequency (F-1)/(F+1) for FM_MOD. It's multiplied by the value given as the second parameter or as set with SET FACTOR. That value then represents the modulator frequency for FM_CAR or the carrier frequency for FM_MOD. For example if the modulator frequency is 100 Hz, then the carrier frequency will be 500 Hz for a 3/2 interval, because the sum and difference frequencies will be 600 and 400 Hz, making this interval.
12. Edsger Dijkstra's fusc function is also known as Stern's diatomic series. The value for a rational given here is fusc(num)+fusc(den)-1.
13. It is the sum of 1 and the constituent primes minus 1. Prime 2 included. Since this value increases with interval complexity, a better name would be Gradus Dissuavitatis.
14. The value for HARMON depends on the setting of SET HARMCONST. See also SHOW HARMCONST.
15. Tenney weighting means that each exponent of the harmonic vector is multiplied by the binary log of the corresponding prime. Tenney height is the sum of absolute values of the weighted exponents and the Tenney Euclidean norm is the square root of the sum of the weighted exponents squared. The counterpart of this attribute which is unweighted is the LENGTH attribute so it gives the normal Euclidean norm.
16. The value for INTERVAL depends on the setting of SET INT_STEPS. This sets the number of steps for the interval, default is -1. However an extra parameter may be given to set it with the attribute, for example: SET ATTRIBUTE INTERVAL 4.
17. The values of LOG_FRACT have a maximum denominator of 999. If there is no near ratio, then nothing is shown. The numerator can be interpreted as degree number and the denominator as number of equal tempered tones per octave. An extra parameter can be given for another octave value, for example: SET ATTRIBUTE LOG_FRACT 3. The values are proportional to those of ET_STEP and OCTAVE.
18. An extra parameter must be given to change the current system for NOTATION. To see the legal values do SHOW NOTATION. The initial value is E12. The pitch must not be further removed from a degree than the part of the corresponding step size set with SET TOLERANCE. Otherwise no name will be given. For the JI, JI2 and SAJI* notations where the pitch must be rational, there is no range of tolerance. See SET NOTATION for the meaning of the symbols. See SET OFFSET how to change the name for degree 0.
19. An extra parameter can be given which will be multiplied to the number of octaves. Such value can also be set directly as attribute, like this: SET ATTRIBUTE 31. This will show the pitches in terms of real number of steps in 31-tone equal temperament. This parameter is shared with attributes CONVERGENTS and LOG_FRACT. The counterpart which gives the nearest integer number of steps is ET_STEP.
20. An extra parameter must be given to select which other scale to show. The initial value is 1.
21. Robin Perry's harmonic complexity is defined as follows: PC(1) = 0, for primes p, PC(p) = PC(p - 1) + 1 and for composite positive numbers n, PC(n) is the sum of PC(p) of the constituent prime factors times their exponents. For ratios, PC(num/den) = PC(num) + PC(den).
22. An extra parameter can be given for the pitch bend resolution, which must be greater than or equal 0. If not, then the default pitch bend resolution is used, which is from -8192 to 8191 for -/+ 2 semitones, so 4096 steps per 100 cents. The value given is rounded off to the nearest semitone however. The default pitch bend resolution can be changed in scala.ini:
MIDI_Pb_Resolution 4096.0
Note that the coefficient is a floating point value per 100 cents.
23. This is the base-10 log of the maximum of numerator and denominator with factors of 2 removed. Kees van Prooijen proposed this harmonic complexity value. It's also called Kees Expressibility. Without applying the logarithm it's called Kees Height.
A similar attribute is WEIL which is the same except it takes factors of 2 into account.
24. This is also known as the Minkowski, "city block" or "taxicab" distance; the shortest distance along lattice lines between two points in an Euclidean lattice being like city blocks. See also SET ATTRIBUTE TRIANGLE.
25. The value for RECIPROCAL depends on the setting of SET RECIPROCAL. But an extra parameter may be given to change the multiplication factor with the same command. The initial value is 1.0. Being the inverse of frequency, it represents relative string lengths. More accurate values for some strings can be obtained with SHOW STRINGLEN. The multiplication factor used is the same as for SET ATTRIBUTE FACTOR.
26. The value for STEP_DIFF depends on the setting of SET STEP_UNIT. But an extra parameter with ratio or cents may be given to change the unit with the same command. The parameter also inversely influences the ET_STEP attribute. See SHOW ET_DIFF for a similar operation.
27. For the value of SUBMULTIPLE, one needs to imagine "one divided by" in front of the value, i.e. the real value is the reciprocal of the number shown.
28. This is John O'Sullivan's formula: (2+1/num+1/den-den/num)/2 for intervals greater than or equal to 16/15 and (2+1/num+1/den-15*(1-den/num))/2 for narrower intervals. num must be greater than den.
29. The Benedetti height is defined as the product num*den. It's not implemented as an attribute because the Tenney height or norm which is the base-10 logarithm of it gives the same ordering.
30. This is the shortest distance along lattice lines between two points in a triangular lattice. This means that p, q and p/q all have distance 1 to 1/1 if p and q are prime. See also SET ATTRIBUTE RECTANGULAR.
31. Vogel's harmonic complexity is the sum of prime factors except 2, plus the number of factors of 2. Or one can say the sum of all prime factors where prime 2 is substituted by 1. It is similar to GRADUS (Euler's Gradus Suavitatis).
32. A number can be given instead of one of the above options. This will show the interval size in units of the given number per octave. It may be a floating point value. For example, the tuning resolution of a certain synthesizer could be taken to show the pitch in terms of that unit, or for millioctave units do SET ATTRIBUTE 1000. An interval value that begins with a \$ or a % can also be given. For instance to specify schisma-units do SET ATTRIBUTE \$s. The option SET ATTRIBUTE OCTAVE is the same as this one, with a default unit of 1. If you want values shown rounded to the nearest integer, then use SET ATTRIBUTE ET_STEP instead.

```SET ADJUSTMENT
```
Change the reference frequency of the current keyboard mapping to the value which minimises the deviation from 12-tone equal temperament. Influences the SEND command. See the current value with SHOW MAPPING. This is intended for instruments with a tuning restriction, for example the Yamaha XG series, where each key can be detuned only -64..+63 cents. This changes the pitch of all keyboard keys, depending on the current scale, to get as many tones as possible within the restricted detuning range. It can be done for any middle key, see SET MIDDLE. To check whether it succeeded and how much shift was applied, do SEND/SCREEN. Repeat this command after changing the scale or middle key. See also SET MAP_FREQ. Look at SAMPLE to duplicate pitches if the scale's 12th degree is not approximately 2/1, because for example the scale has less than 12 tones.

```SET CALC_OUTPUT  (NONE | SHORT | LONG | ALL | NAMES)
```
Modify the amount of values given by the CALCULATE command. The default option at startup is LONG. SHORT only gives the linear and log values of the result and the interval name, if any. With NONE it gives no output, like when the /NOOUTPUT qualifier is used. With ALL it is like LONG plus all pitch attribute values. With NAMES note names are given instead of values, for all notation systems. The setting made with SET TOLERANCE applies, so if no name is given, then the value is outside the tolerance multiplied by the notation's nominal step size. The parameter cannot be abbreviated. See also SET NOTATION and SHOW/NOTATION PITCH.

```SET COMPDIFF  max-difference
```
Change the maximum difference for the COMPARE command. The value can be given as ratio or in cents (or with \$ or %). The value of 0.0 means that no approximate comparisons will be done, only exact ones.
This value and other settings can be viewed with SHOW SETTINGS.

```SET CONTROLLER  (ON | OFF)
```
Influences the commands EXAMPLE/MIDI and EXAMPLE/CREATE. If it is OFF, then no MIDI parameter (control) messages will be put in the output file. The initial setting is ON.

```SET DEFAULT  directory
```
Set the current or default directory path. This can also be done with CD. See also SHOW DEFAULT.

```SET DESCRIPTION  [scalenr.]
```
Change the description line for the current or given scale. This line is shown with SHOW SCALE and CATALOGUE amongst others and replaced when LOAD is done. Enter the description as a single line after giving the command. It can be saved with the scale by using SAVE/KEEP_TEXT. Instead of a scale number, a filename can also be given. Then it first shows the current description before you can change it. See also SHOW DESCRIPTION. In Scala 2.x the description can be changed in the Edit:Edit scale dialog.

```SET DEVICE_ID  number
```
Some synthesizer types have a device ID number in the MIDI tuning dump format. For example the MIDI Tuning Standard has a number from 0 to 127, where 127 means all devices. The Yamaha XG format has a number from 0 to 15. The Roland GS format calls it a Part number, which starts at 1, so the number 0 will correspond to part 1, and so on. The initial value is 0.
Use this command to set this number prior to using the SEND command. The current value is shown with SHOW SETTINGS. No checking is done whether the number is in the supported range for the synthesizer type. If the synthesizer does not have a device ID then this setting is ignored. See also SET PRESET and SET SYNTHESIZER.

```SET DIFF_DEGREE  position
```
Change the base class for the comparison of the scale with an equal tempered scale. The initial setting is 0, which means that for degree 0 a zero difference will be shown. For example, with a twelve tone scale when the differences are to be shown with respect to A instead of C, do SET DIFF_DEGREE 9. Remember to do SET ATTRIBUTE DIFF_ET after this for SHOW SCALE.

```SET ELLIS  octave  [cents]
```
An alternative way to do SET FREQUENCY and enter it in Ellis. Ellis is the number of cents and octaves relative to the 64-foot C (16.3516 Hz). If no number of cents is given, it will be 0. So SET ELLIS 4 will set the base frequency to 261.625565 Hertz and SET ELLIS 4 900 to 440.0 Hertz. Both numbers may be positive and negative. See also SHOW FREQUENCY and SHOW/FREQUENCY SCALE.

```SET EXCLUDE  [midi-channel-list]
```
Influences the command EXAMPLE/MIDI. Enter the MIDI channel numbers (between 1 and 16) that are not to be used by this command. Initially no channels are excluded. If you have a soundcard with a standard channel for drum sounds, usually 10, but sometimes 16 (on Soundblaster cards), then use this command to exclude it before doing EXAMPLE/MIDI. Put this command in the startup command file startup.cmd if you usually need to exclude the same channels. To view the excluded channels do SHOW SETTINGS. It has no influence on the command EXAMPLE, where excluded channels are declared in the input sequence file.

```SET EXPLIMIT  [prime  max-exponent]  [min-exponent]
```
Modify any exponent limit(s) per prime for rational approximation. Without parameters, a list of prime and exponent limit pairs can be given, ended by entering a zero. Otherwise a range for one prime pair can be given on the command line. If the minimum exponent is omitted, it will be set to the negative value of the maximum. The current limits can be shown with SHOW EXPLIMIT. See also APPROXIMATE and SHOW PRIMES.

```SET FACTOR  factor
```
This is a multiplication factor for the factor shown with SET ATTRIBUTE FACTOR. The initial value is 1.0. The given factors represent relative frequencies. It's necessary to do SET ATTRIBUTE FACTOR after this. The value set is the same as used for SET ATTRIBUTE RECIPROCAL, so this command is synonymous with SET RECIPROCAL. It's also used with the attributes FM_CAR and FM_MOD.

```SET FIFTH  position  [notation-system]
```
Set the scale degree for 'G' in the current or given notation system. Only notations for equal temperaments which are diatonic can be used. Also not supported for Sagittal notations. When 0 is given for the position, the regular degree is restored. It must be a generator for the division of the notation, i.e. have no factors in common. Can also be used to set the generator only for notation LT, without the other parameters. See also SET NOTATION and SET LT_PARS.

```SET FIRST  position
```
Set the lowest scale degree that will be shown with the SHOW SCALE command. It can be any integer. This overrides the default value in scala.ini with key Show_First.

```SET FREQUENCY  frequency  [position-or-note-name]
```
Change the base frequency. The frequency is to be entered in Hertz, as a floating point value or ratio. This value influences the result of various commands, such as SHOW/FREQUENCY, SHOW BEATS, SHOW DISTANCE, APPEND/FREQUENCY, INSERT/FREQUENCY, CATALOGUE/PITCH, the beat frequencies calculated with CALCULATE, etc. This and other settings can be viewed with SHOW SETTINGS.
The parameter can also be a pitch memory or scale degree (see help items of \$ and %). Then the value is interpreted as a change relative to the current value, so for instance if pitch memory 0 contains 3/2 and \$0 is given, the frequency will become a just fifth higher. If you intend it to be an absolute value then do SET FREQ 1 first.
If a second parameter is given, the frequency will be set such that the given scale degree in the current scale will correspond to that frequency. So the given frequency will be lowered by the interval at the given position in the scale. If this parameter is not a number, it will be interpreted as a note name in the current notation system, and the degree the first scale degree with this note name, or the nearest degree to the nominal value of the given name, if it's within the current tolerance range. If there are no pitches fulfilling this then "parameter error" will be given.
The initial base frequency can be set by adding key C_Freq to scala.ini. If not it's 261.6255653 Hertz which is the frequency of middle C corresponding to an equal tempered A of 440 Hz. A special value for the frequency is "-" which sets it back to the initial base frequency. See also PUSH/FREQUENCY and SET ELLIS.
Warning: it does not influence the EXAMPLE/MIDI and SEND commands. Instead, to change the reference frequency of the keyboard mapping, use SET MAP_FREQ or COPY/FREQ_MAP.

```SET HARMCONST  [prime  coefficient]
```
Modify any coefficient(s) of the harmonicity function. This influences the harmonicity values shown when SET ATTRIBUTE HARMON or SET ATTRIBUTE INV_HARMON are done, and also the harmonicity values shown by SHOW DATA. The harmonicity function is also used in some other commands, like APPROXIMATE and DISCARD. The initial values are 2*(p-1)2/p, where p is a prime number. This is Barlow's Indigestibility function.
If the coefficients are set to be equal to the prime number, the Gamma-prime function, a modified version of Euler's function is obtained. With no parameters, the coefficients are set interactively.
The prime count is set by Prime_Count in scala.ini (default 10 which is 29-limit). See also SHOW HARMCONST, SHOW PRIMES, APPROXIMATE/WEIGHTED and PROJECT/WEIGHTED.

```SET INDEX  (ON | OFF)
```
Enable or disable showing the scale degree index with the SHOW SCALE commands. The initial setting is ON.

```SET INT_FILE  filename
```
Change the parameter file which contains the names of rational intervals. This can be used to change the language of the names. The file initially read at program startup is specified by key Int_File in file scala.ini. See file intnam.par for an example and the other presupplied files int*.par.

```SET INT_STEPS  number
```
Change the relative position of the scale degree with which the interval is shown with SHOW SCALE, SHOW/INTERVAL SCALE and SHOW/INTERVAL DIFFERENCE. The initial setting is -1, which means the previous degree. Remember to do SET ATTRIBUTE INTERVAL after this for SHOW SCALE; it's not necessary for SHOW/INTERVAL SCALE or SHOW/INTERVAL DIFFERENCE.

```SET LIMIT  highest-prime
```
Change the default prime limit for the commands APPROXIMATE, CHORDS and LIMIT. If 0 is given, the highest prime which is set in scala.ini is taken.

```SET LT_PARS  generator  division  [lower-bound]  [octave]  [white-keys]
```
Change the parameters for notation system LT, see SET NOTATION. By default, they are 7, 12, 0 and 2/1 respectively. Division is the number of notes in one formal octave, also called period. The generator is given as a number of steps in the division, so that its logarithmic value is generator*octave/division. It may also be given as a pitch (ratio or cents), in which case the nearest step in the given division will be taken. The generator and division must be mutually prime, otherwise the message "Illegal generator value" will appear. The optional lower bound is for the range of number of generators given by the notation. So for example if the parameters are set to 7, 12, -3 and 2/1, then the gamut of generators is -3 .. 8, therefore corresponding to Eb .. G#. For convenience, using this command will also change the notation system to LT, and the current attribute to notation. The white keys parameter only influences the Chromatic Clavier in the 2.x version. Default value is 7, the range is 1 .. 12.
To automatically match the parameters to the current scale, using a lower bound of 0, enter the following command: SET LT_PARS %g n 0 %n. This only works if the current scale is a linear or equal temperament though.
There are two counterpart statements in EXAMPLE files: lt_pars and lt_gens, see EXAMPLE. They determine the actual pitch values that note names in the LT notation represent in these files. See also REPLACE/LT_GENS.

```SET MAP_FREQ  frequency  [note-number]
```
Change the reference frequency of the current keyboard mapping. Influences the EXAMPLE/MIDI and SEND commands. See the current value with SHOW MAPPING. The initial value is 261.6256 Hz. The frequency parameter can also be a pitch memory or scale degree (see help items of \$ and %). Then the value is interpreted as a change from the current value, so for instance if pitch memory 0 contains 3/2 and \$0 is given, the frequency will become a fifth higher. With the optional second parameter, the MIDI note number to which the reference frequency is mapped, can be changed. The initial value is 60 (C). Use 69 for mapping to A. If "%" is given for the frequency then the value of the key Standard_Pitch is taken if you added it to scala.ini, otherwise it is 440 Hz. For example: SET MAP_FREQ % 69
This command does not change the base frequency from SET FREQUENCY. See also COPY/FREQ_MAP, COPY/MAP_FREQ, SET ADJUSTMENT and SET MIDDLE.

```SET MAXDIFF  max-difference
```
Change the maximum difference for approximation of pitches. The value can be given as ratio or cents value (or with \$ or %). The value of 0.0 means no maximum for the command APPROXIMATE, except APPROXIMATE/INSERT. A maximum of 0.0 means to other commands like CHORDS and SHOW LOCATIONS that no approximate comparisons will be done, only exact ones.
Example: to set the schisma as maximum do SET MAXDIFF \$s, but depending on the accuracy of the scale, a slightly higher value may be required. This value and other settings can be viewed with SHOW SETTINGS. See also APPROXIMATE, CHORDS, EQUALTEMP/VANISH, PUSH/MAXDIFF, POP/MAXDIFF and SHOW/PRESENT SHIFTS.

```SET MIDDLE  note-number
```
Change the middle key of the current keyboard mapping where the first entry of the mapping is mapped to. The parameter is a MIDI note number. The initial value is 60 (middle C). It influences the EXAMPLE/MIDI and SEND commands. See the current value with SHOW MAPPING. It doesn't change the mapping's reference frequency or its key, for this use SET MAP_FREQ. It's not related to frequencies shown in Scala.

```SET NAME  (ON | OFF)
```
Choose whether an interval name will be given with SHOW SCALE for rational intervals. The initial setting is ON.

```SET NOTATION  notation-system
```
This is an abbrevation for SET ATTRIBUTE NOTATION. It sets the notation system for the note names shown with SHOW SCALE. Possible values are:
Octave based equal temperaments: E5, E7, P8, E9, W9, E10, S10, M11, A12, C12, D12, E12, F12, I12, N12, P12, S12, SA12R, SE12, E13, R13, W13, E14, L14, S14, D15, E15, P15, P15A, SE15, A16, E16, M16, W16, A17, E17, P17, SE17, T17, E18, W18, E19, N19, SE19, Y19, E20, R20, Z20, E21, AB22, C22, E22, L22, N22, P22, E23, M23, P23, W23, A24, E24, P24, A25, C25, D25, E25, E26, AB26, A27, E27, P27, E28, E29, M29, P29, E30, E31, F31, O31, P31, S31, E32 .. E36U, P36, Q36, E37, M37, E38, A30, E39, P39, D40, E40, E41, L41, P41, E42, P42, E43, P43, S43, E44, E45, P45, E46, P46, E47, A48, E48 .. E50, E50U, P50, E51 .. E53, L53, O53, P53, E54, E55, P55, T55, E56 .. E59, E59A, E60 .. E64, E64A, L65, E65 .. E71, E71A, E72, B72, EL72, M72, R72, E73 .. E77, L77, E78 .. E84, O84, E85 .. E95, E95A, E96 .. E99, EL99, E100 .. E144, R144, E145 .. E172, E72A, E173 .. E184, E184A, E185 .. E206, E206A, E207 .. E218, E218A, E219 .. E222, E222B, E223 .. E225, E225A, E226 .. E230, E230A, E231 .. E237, E237A, E238 .. E253, E253B, E254, E254A, E255 .. E259, E259A, E260 .. E266, E266A, E267 .. E271, E271A, E272, E273A, E274 .. E292, E292A, E293 .. E295, E295A, E296, E296B, E297 .. E308, E310, E311, E312A, E313 .. E317, E318A, E319 .. E323, E324A, E325, E326A, E327 .. E329, E330B, E331A, E332 .. E335, E336A, E338A, E339, E340A, E341, E342, E343A, E344, E345A, E346, E347, E350A, E351, E352A, E353, E354, E355A, E356, E357A, E358 .. E361, E360A, E362A, E364A, E365A, E366, E366A, E367A, E368B, E369A, E370, E371A, E372A, E373, E375, E376A, E377A, E378, E379A, E380, E381A, E383A, E385, E388A, E391A, E395A, E400, E410A, E412A, E414, E422, E441, EL441, E444, E494, C1200, C1200Q, LT, SA<n> and SA<n>N for many divisions depending on the contents of sag_et.par.
Fifth (3/2) based equal temperaments: Q9, Q11, Q18, Q20, Q22
Twelfth or tritave (3/1) based equal temperaments: BP, KL, KD, KG, PBP.
Non-equal temperaments: S5, P7, P5, A17, P17, T17, I22, T24, V31, YA31, A34, A34N, YA36, T48N, EITZ, JI, JI2, SAJI1, SAJI2, SAJI3, SAJI4, SAHTT.

Names beginning with an E are for equal temperaments with that number of notes per octave and give the note name (C, D, etc.) followed by accidentals. The meaning of the accidentals is explained below. Rapoport's notation system is used which is consistent with Fokker's for 31-tET and Blackwood's for 15-tET. For 16-tET Blackwood's notation is used. For 9-tET and 20-tET a notation of the author is used. Names beginning with an E and ending with an A have an alternative fifth of one step smaller than the best fifth (so second best fifth), to avoid a very large syntonic comma.
For some missing equal temperament notations, one with a double or triple number can be used, for example for 8-tET, use E24 and for 11-tET, use E22 or L22.
In E10 the # and b are not the Pythagorean semitone (apotome) but the chromatic semitone of 1 step. Another unusual notation is E14 with its negative syntonic comma, but alternatives exist in L14 and E28.
Names beginning with SA are notations in the general-purpose Sagittal notation system created by George Secor and Dave an with help from many others on the Yahoo groups "tuning" and "tuning-math". For proper functioning of these systems, some parameter files with names sag*.par have to be installed in the Scala directory. The latest versions of these were included with Scala at the time of release, however these files are maintained independently of Scala and any updated versions of them can be obtained from the authors of the Sagittal website http://www.sagittal.org. See also SET SAGITTAL and SET LT_PARS.
Names beginning with a W are Wilson's note names for equal temperaments. Its Greek letters are written out or abbreviated with two letters.

 S5 gives the Central-Javanese note names for slendro. P7 gives Central-Javanese note names for pelog. P5 gives West-Javanese note names for pelog. P8 gives Pseudo-diatonic note names for 8-tET. Q9 gives names for 9-tone equal division of pure fifth (Carlos alpha). W9 gives Wilson's 9-tET names. S10 gives Sethares' 10-tET names. M11 gives Machine 11-tET names. Q11 gives names for 11-tone equal division of pure fifth (Carlos beta). A12 gives anhemitonic hexatonic note names for 12-tET. C12 gives Carnatic note names for the 12-tone mela system. D12 gives German note names for 12-tET. F12 gives numerical names for 12-tET. I12 gives Hindustani Indian note names for 12-tET. N12 gives Dutch note names for 12-tET. P12 gives pentatonic note names by Bernet-Kempers. S12 gives Dutch solmisation names for 12-tET. SE12 gives English solmisation names for 12-tET. R13 gives Rapoport's 13-tET names. W13 gives Wilson's 13-tET names. L14 gives note names for 14-tET where # and b are a major limma. S14 gives note names for 14-tET where one step is a septimal comma. D15 gives decimal names for 15-tET and Blackwood temperament. P15 gives Caratolozzo's Pentadecaphonic 15-tET names. P15A gives Pentadecaphonic 15-tET names, alternative Porcupine version. SE15 gives English solmisation names for 15-tET. A16 gives Armodue 16-tET names. M16 gives Miller's 16-tET names. O16 gives octatonic note names for 16-tET. W16 gives Wilson's 16-tET names. A17 gives Arabic note names for al-Urmawi's Arabic 17-tone scale. M17 gives Machine 17-tET names. P17 gives Persian note names for the Persian 17-tone scale. SE17 gives English solmisation names for 17-tET. T17 gives Turkish THM note names for 17-tone folk music scale. E18U gives alternative note names for 18-tET. W18 gives Wilson's 18-tET names. N19 gives Negri's 19-tET names. SE19 gives English solmisation names for 19-tET. T19 gives Breed's Tripod note names for Magic temperaments. Y19 gives Yasser's 19-tET names. O20 gives octatonic note names for 20-tET. Q20 gives names for 20-tone equal division of pure fifth (Carlos gamma). R20 gives names for Rothenberg's pseudo-diatonic 20-tET mode. Z20 gives Zweifel's 20-tET names. E21C gives names for 21-tET with chromatic semitones. AB22 gives Miller's alphabetic names A to V for 22-tET. C22 gives Op de Coul's 22-tET names. I22 gives the Indian sargam sruti names. IN22 gives Tamer Erdogan's sruti solmisation names. L22 gives note names for 22-tET where # and b are a major limma. N22 gives numerical names for 22-tET by Paul Erlich. P22 gives Paul Erlich's note names for 22-tET. M23 gives Miller's 23-tET names. P23 gives Pythagorean names for 23-tET. W23 gives Wilson's 23-tET names. A24 gives anhemitonic hexatonic note names for 24-tET. P24 gives Persian note names for 24-tET. T24 gives Turkish names of the Arel-Ezgi-Uzdilek system. A25 gives Armodue 25-tET names. C25 gives Op de Coul's note names for 25-tET. D25 gives decimal names for 25-tET and Blackwood temperament. AB26 gives alphabetic names A to Z for 26-tET. A27 gives Armodue 27-tET names. O27 gives Octacot-Tetracot 27-tET names. P27 gives Pythagorean names for 27-tET. E28C gives names for 28-tET with chromatic semitones. O28 gives octatonic note names for 28-tET. M29 gives Miller's 29-tET Porcupine notation, also for 22-tET. P29 gives Pythagorean names for 29-tET. T29 gives Breed's Tripod note names for Magic temperaments. F31 gives Fokker's names for 31-tET notes. O31 gives names for the Orwell 31-tET mode. P31 gives Pythagorean names for 31-tET. S31 gives Suppig's names for 31-tET notes. V31 gives note names for 31-tET with 1/4-comma alterations. YA31 gives Yarman's note names for Yarman-24 and Yarman-31 tunings. O32 gives octatonic note names for 32-tET. A34 gives the Abjad system for two octaves of the Arabic 17-tone scale. A34N gives the Abjad notes names of Nasir Dede for the Arabic 17-tone scale. T34 gives Tetracot-Quatracot 34-tET names. E35C gives names for 35-tET with chromatic semitones. E35U gives alternative note names for 35-tET. E36U gives alternative note names for 36-tET. O36 gives octatonic note names for 36-tET. P36 gives quasi-Persian note names for 36-tET. Q36 gives a quasi-Pythagorean system for 36-tET. S36 gives Vines's Slendric 36-tET names. S36U gives alternative Slendric 36-tET names. YA36 gives Yarman's note names for Yarman-36 tunings. M37 gives Miller's 37-tET Porcupine notation, also for 15 and 22-tET. A39 gives Armodue 39-tET names. P39 gives Pythagorean names for 39-tET, also for 22-tET. D40 gives decimal names for 40-tET and Blackwood temperament. O40 gives octatonic note names for 40-tET. A41 gives Armodue 41-tET names. L41 gives names for 41-tET where # and b are a major limma. O41 gives Octacot-Tetracot 41-tET names. P41 gives Pythagorean names for 41-tET. T41 gives Breed's Tripod note names for Magic temperaments. E42AC gives names for 42-tET with second-best fifth and chromatic semitones. P42 gives Pythagorean names for 42-tET. P43 gives Pythagorean names for 43-tET. S43 gives Sauveur's names for 43-tET notes. O44 gives octatonic note names for 44-tET. P45 gives Pythagorean names for 45-tET. P46 gives Pythagorean names for 46-tET. A48 gives anhemitonic hexatonic note names for 48-tET. O48 gives octatonic note names for 48-tET. T48N gives Turkish note names of Arel-Ezgi for two octaves. E49AC gives names for 49-tET with second-best fifth and chromatic semitones. P49 gives Pythagorean names for 49-tET. P50 gives Pythagorean names for 50-tET. O52 gives octatonic note names for 52-tET. L53 gives names for 53-tET where # and b are a major limma. O53 gives names for the Orwell 53-tET mode. P53 gives Pythagorean names for 53-tET. A55 gives Armodue 55-tET names. O55 gives Octacot 55-tET names. P55 gives Pythagorean names for 55-tET. T55 gives Telemann's names for 55-tET notes. E56AC gives names for 56-tET with second-best fifth and chromatic semitones. O56 gives octatonic note names for 56-tET. A57 gives Armodue 57-tET names. M59 gives Miller's 59-tET Porcupine notation, also for 51 and 52-tET. T60 gives Breed's Tripod note names for Magic temperaments. T61 gives Tetracot 61-tET names. A62 gives Armodue 62-tET names. E63AC gives names for 63-tET with second-best fifth and chromatic semitones. T63 gives Breed's Tripod note names for Magic temperaments. L65 gives names for 65-tET where # and b are a major limma. P65 gives Pythagorean names for 65-tET. A66 gives Armodue 66-tET names. O68 gives Octacot 68-tET names. B72 gives Breed's decimal names for the Miracle-Ampersand temperament, also for 31, 41 and 52-tET. EL72 gives ennealimmal names for 72-tET. M72 gives Op de Coul's alphabetic names for the Miracle-Ampersand temperament, also for 31, 41 and 52-tET. R72 gives Richter Herf's 72-tET names. T72 gives Breed's Tripod note names for Magic temperaments. O75 gives names for the Orwell 75-tET mode. T75 gives Tetracot 75-tET names. L77 gives names for 77-tET where # and b are a major limma. M81 gives Miller's 81-tET Porcupine notation, also for 65-tET. O84 gives names for the Orwell 84-tET mode. E96S gives names for 96-tET with second-best seventh. EL99 gives ennealimmal names for 99-tET. L111 gives names for 111-tET where # and b are a major limma. R144 gives Richter Herf's names adapted to 144-tET. E156B gives names for for 156-tET with second-best syntonic comma. E160AB gives names for for 160-tET with second-best fifth and syntonic comma. EL171 gives ennealimmal names for 171-tET. E205B gives names for for 205-tET with second-best syntonic comma, also for 41-tET. E212B gives names for for 212-tET with second-best syntonic comma. E309AB gives names for for 309-tET with second-best fifth and syntonic comma. E318B gives names for for 318-tET with second-best syntonic comma. E330B gives names for for 330-tET with second-best syntonic comma. E337B gives names for for 337-tET with second-best syntonic comma. E349B gives names for for 349-tET with second-best syntonic comma. E368B gives names for for 368-tET with second-best syntonic comma. EL441 gives ennealimmal names for 441-tET. C1200 gives a cents notation for 1200-tET (fifth = 702). C1200Q gives a cents notation for 1200-tET based on quarter-tones. LT gives generator.oct pairs for linear temperaments (SET LT_PARS). BP gives Bohlen's new names for the Bohlen-Pierce scale. KL gives Bohlen's names based on the Lambda mode of the Bohlen-Pierce scale. KD gives Bohlen's names based on the Delta mode of the Bohlen-Pierce scale. KG gives Bohlen's names based on the Gamma mode of the Bohlen-Pierce scale. PBP gives Kees van Prooijen's names for the Bohlen-Pierce scale. EITZ gives Carl Eitz's notation with fractional comma alterations. EITZ7 gives Carl Eitz's notation with syntonic and septimal comma alterations. JI gives a commatic notation for rational pitches. JI2 gives a commatic notation for rational pitches with other commas. SAJI1 gives the Athenian (medium precision) Sagittal notation for scales with mostly rational pitches. SAJI2 gives the Promethean (high precision) Sagittal notation for scales with mostly rational pitches. SAJI3 gives the Herculean (very high precision) Sagittal notation for scales with mostly rational pitches. SAJI4 gives the Olympian (extreme precision) Sagittal notation for scales with mostly rational pitches. SA12R gives the Trojan (medium precision) Sagittal notation relative to 12-tET sized fifths. SAHTT gives the Sagittal high-tolerance temperament notation. SA give the Sagittal system equal temperament notations (sometimes using non-native fifth). SAN give the Sagittal system equal temperament notations (using native fifth).

A scale pitch must not be further removed from an equal tempered step than the relative value set with SET TOLERANCE. Otherwise no name will be given. To increase from its default value of 1/3, do for example SET TOLERANCE 1/2.
In order to obtain names that make sense, it's important to choose a system which has pitches in the neighbourhood of all pitches of the scale. To find out for which equal temperaments that is, you can use FIT/MODE.
The name for scale degree 0 or 1/1 may be changed after doing this command. For example to start at D instead of C, do SET OFFSET D. When the notation system is changed after having changed the offset, remember that the pitch equivalent of the name remains the offset for the new system, unless SET OFFSET is done again, or POP/OFFSET.

The number of steps for the fifth in equal temperament based notations, but not the Sagittal ones, can be changed with the SET FIFTH command. It can also be changed in scala.ini if this key is put in first: ET_Notation_Use_Alt 1 And then for example like these: ET_Alt_C1200 696 ET_Alt_E64 38 To view all the note names in one of these systems, use this command to select the system, then get the corresponding equal tempered scale with the EQUALTEMP command (except for the Indian names) and do SHOW. For the Bohlen-Pierce scale do EQUAL 13 3. For the Indian names use LOAD to obtain one from file, or you can do EQUAL 53. For the Persian names do LOAD persian, or do EQUAL 36.

For most names, one enharmonic equivalent is given too. The absence of graphic symbols poses restrictions, so the following equivalents were chosen for the notations whose name begins with an E:

 # semitone sharp (Pythagorean semitone) b semitone flat (Pythagorean semitone) x two semitones sharp bb two semitones flat | semitone fraction sharp (1/n semitone = one step) ; semitone fraction flat (1/n semitone = one step) #| 1+1/n semitone sharp b; 1+1/n semitone flat / comma sharp \ comma flat > comma fraction sharp (1/n comma = one step) < comma fraction flat (1/n comma = one step) ) diesis sharp ( diesis flat -) diesis fraction sharp (1/n diesis = one step) (- diesis fraction flat (1/n diesis = one step) ^ diaschisma sharp v diaschisma flat 7 septimal comma sharp L septimal comma flat ] undecimal comma sharp [ undecimal comma flat \$ kleisma sharp s kleisma flat

In Scala version 2.2 and higher, the equivalence of the above and graphic symbols is listed for several different notations in Help:Legend: accidentals. For the Carnatic system C12 the uppercase characters represent the natural (suddha) tones. In Hindustanic notation often the lowercase m represents suddha Ma (perfect fourth) and an uppercase M tivra Ma (augmented fourth). With notation I12 it was chosen to have both the perfect fifth and perfect fourth to be uppercase and the augmented fourth be written as M+.

For the Persian system P17 Vaziri's notation is used:

The same symbols are used for P24, only > and p are then a quartertone.

For the Turkish system T24 the Arel-Ezgi-Uzdilek notation is used. These are the chosen equivalents for the graphic symbols:

 | one comma sharp (about 23 cents), a vertical line with two horizontal lines through d one comma flat (about -23 cents), a reversed flat sign # small semitone sharp (4 commas, 90 cents) b- small semitone flat (-4 commas), a flat sign with one horizontal line through #| large semitone sharp (5 commas, 114 cents), a vertical line with three horizontal lines b large semitone flat (-5 commas) ## small whole tone sharp (8 commas, 180 cents), two vertical lines with three horizontal lines b= small whole tone flat (-8 commas), a flat sign with two horizontal lines x large whole tone sharp (9 commas, 204 cents) bb large whole tone flat (-9 commas)
The same symbols are used for the Turkish makam notation YA31 by Ozan Yarman. It is necessary to use SET OFFSET to change the first tone to the finalis.

For the notation system V31 these extra accidentals are used:

 ' 1/4 comma sharp (about +5.4 cents) ` 1/4 comma flat (about -5.4 cents)
This notation system is dedicated to Margo Schulter and Nicola Vicentino.

The notation YA36 by Ozan Yarman for Turkish makam music has the following symbols:

 | quartertone sharp d one comma flat < bakiye (limma) sharp b- quartertone flat # mücenneb-i sagir (apotome or minor semitone) sharp b mücenneb-i sagir (apotome or minor semitone) flat > mücenneb-i vusta (middle second) sharp b+ mücenneb-i karin (major semitone) flat ## mücenneb-i kebir (minor tone) sharp b= mücenneb-i vusta (middle second) flat x double sharp bb double flat

In the Richter Herf-system R72 (and R144) the meanings are:

 / 1/12 tone sharp (+16.7 cents) \ 1/12 tone flat (-16.7 cents) 7 1/6 tone sharp (+33.3 cents) L 1/6 tone flat (-33.3 cents) ^ 1/4 tone sharp (+50 cents) v 1/4 tone flat (-50 cents)

The notation system M72 was made by Manuel Op de Coul and is also a partial notation for 31-, 41-, 51-, 72- and 103-tone equal temperament and 11-limit just scales or 11-limit based temperaments. It has 11 naturals in the octave. Similar is Graham Breed's decimal notation system which uses 0 .. 9 as names and the comma and diaschisma accidentals. The diaschisma happens to have the same number of steps as Breed's 'q'.

The notation systems JI and JI2 give names for exact rational pitches with primes not higher than 31. There is no range of tolerance. The 3-limit names are Pythagorean. The accidentals following represent higher limit commas. It's similar to Eitz's notation system. The following symbols were chosen; the '7' is not to be put in a context where it could be confused with an octave number or seventh chord. For primes 13 and higher, the system JI2 uses different commas than system JI:

 / comma sharp, 81/80 \ comma flat, 80/81 ) diesis sharp, 128/125 ( diesis flat, 125/128 7 septimal comma sharp, 64/63 L septimal comma flat, 63/64 ] 33/32 [ 32/33 JI2: | 27/26 1053/1024 ; 26/27 1024/1053 #' 17/16 2187/2176 b' 16/17 2176/2187 % 19/18 513/512 d 18/19 512/513 @ 24/23 736/729 * 23/24 729/736 #! 29/27 261/256 b! 27/29 256/261 |' 32/31 248/243 ;' 31/32 243/248

The EITZ notation system gives names to rational pitches and to pitches which are close to a low denominator fraction of a syntonic or Pythagorean comma different from just. In the EITZ7 notation the syntonic and septimal commas are used. The 3-limit names are Pythagorean and they are followed by the number of syntonic commas. If this is zero, it's normally written in the EITZ notation, but omitted here. Fractions of a Pythagorean comma are indicated with a 'p' and the fractions of the septimal comma with an 'a'. This notation system is useful for meantone and circulating temperaments and 5 or 7-limit just tunings.
The Sagittal accidentals are too numerous to be explained here. See the Sagittal website for more information.

Setting notation also influences output of the command CHORDS.

```SET OFFSET  [notename-or-pitch]
```
Specify the note name to use for scale degree 0 or 1/1. The notation system must be set first with SET NOTATION. The notename parameter must be a name in the current notation system. The pitch belonging to the name will subsequently be used as offset wherever a note name is displayed. Instead of a name, a ratio or value in cents may also be given. Without parameter, the offset is reset to 1/1 which is C in notation systems beginning with an E. When changing notation systems with SET NOTATION, you should do SET OFFSET again, although this is not always required. If the notation system is JI, a rational offset value must be given, otherwise no names will be displayed. To see the current offset, use SHOW NOTATION or SHOW SETTINGS.
This command does not influence the commands ECHO (output of the lexical functions), EXAMPLE and REPLACE/NOTATION.
```SET ONERROR  (STOP | CONT)
```
Specify to stop or to continue in case of an error while executing an external command file (see @) or ITERATE command. The initial setting is STOP.

```SET PAUSE  (ON | OFF)
```
Enable or disable the pause during scrolling. The initial setting is ON.

```SET PITCH_BEND  (ON | OFF)
```
For the EXAMPLE command. If it is OFF, then no MIDI pitch bend messages from the input file will influence the output file. Otherwise they will be added to the pitch bends for the tuning when EXAMPLE/MIDI or EXAMPLE/MIDI/MTS is used. If an already retuned MIDI file is going to be retuned, then it should be set to OFF. It can also be useful for complex MIDI files (not when /MTS is used). The initial setting is ON.
With EXAMPLE/CREATE pitch bend messages are translated to transpose statements with cents parameter where the pitch bend sensitivity is the MIDI standard default value, or it can be changed by setting MIDI_Pb_Resolution in scala.ini which by default is 4096 per 100 cents. When set OFF, pitch bends will be written to the output file as comments which do not affect the tuning.

```SET PRESET  number
```
The MIDI Tuning Standard dump format contains a program/preset number with a range from 0 to 127. The initial value is 0. Instruments sometimes support a number other than 0, for example the MOTM-650 MIDI-CV converter can store 11 tunings. The only synthesizer types for which it has effect are numbers 107, 113, 116, 131, 132, 137, 142 and 143. It also stores this setting when creating MIDI files with EXAMPLE/MTS.
Set it before using the SEND command. The current value is shown with SHOW SETTINGS. No checking is done whether the number is in the supported range for the instrument type. See also SET DEVICE_ID and SET SYNTHESIZER.

```SET PROGRAM  (ON | OFF)
```
For the commands EXAMPLE/MIDI and EXAMPLE/CREATE. If it is OFF, then no MIDI program change messages will be put in the output file. This can be useful for instruments that have a slow response to these messages which causes notes to be lost. The initial setting is ON.

```SET RECIPROCAL  factor
```
This is a multiplication factor for the factor shown with SET ATTRIBUTE RECIPROCAL. The initial value is 1.0. If it is set to the string length for degree 0 of 1/1, then the given factors represent absolute string lengths. Remember to do SET ATTRIBUTE RECIPROCAL after this. Remark: string lengths may be calculated more accurately with SHOW STRINGLEN. For lengths of organ pipes, the values are inadequate since they require an end correction. However if the pipes have the same width and shape, a constant end correction can be subtracted from the reciprocal values.
This value is the same as used for SET ATTRIBUTE FACTOR, so this command is synonymous with SET FACTOR.

```SET SAGITTAL  (PURE | MIXED | LONG | SHORT)
```
Switches the graphical (PURE | MIXED) and ASCII (LONG | SHORT) forms of the Sagittal notations. PURE means that the sharps and flats are also Sagittal symbols and combinations with them are always a single symbol. MIXED means that the sharps and flats have the regular symbol and may appear next to a single-shaft Sagittal symbol. In PURE mode, LONG means that multiple shafts are shown in ASCII as multiple copies of the characters "|" (up) or "!" (down), while SHORT shows double shafts as the single character "N" (up) or "U" (down) and triple shafts as "M" (up) or "W" (down). In MIXED mode, only the single-shaft sagittal symbols are used, so in this case SHORT means that the most common single-shaft sagittal symbols are shown using a single ASCII character, e.g. C/|\ becomes C^. Two keywords may be given at the same time and they cannot be abbreviated. The initial settings are PURE and LONG.
See also SET NOTATION. To retain this setting, put this command in startup.cmd.

```SET SEPARATOR  [string]
```
Set a string to be used as separator between output of subsequent commands. Initial value is a vertical bar '|'. Default value is an empty string, which gives no separation.

```SET STEP_UNIT  interval
```
This is the equal tempered step size for the difference shown with SET ATTRIBUTE STEP_DIFF. The initial value is 100 cents. Remember to do SET ATTRIB STEP after this. Is also used with the ET_STEP attribute. See SHOW ET_DIFF for a similar operation without this attribute setting.

```SET SYNTHESIZER  type-number-or-name
```
Set the current synthesizer type. Use SHOW SYNTHESIZER to get a list of the supported types and their numbers. The parameter is the type number it has in this program, but a name string may also be given. That will then be searched in the list of names and the first match returned. If you give multiple words, they must be surrounded by double quotes. The initial type number is 0, unless another is set in file scala.ini. Type numbers 1 .. 100 can be defined in parameter file synth.par. The rest are hardcoded in the program, and among them are many softsynth formats which use a text file instead of a MIDI file. For software synthesizers which can read Scala's .scl files this command is irrelevant since you can use the SAVE command for those. If they don't support .kbm keyboard mappings, then see SELECT/MAPPING. See also SEND and SET DEVICE_ID. If you have a MIDI or software synthesizer that is not yet supported in Scala, then please send the technical tuning details to the author at coul@huygens-fokker.org, who can then add support. If it concerns a softsynth with text based tuning, see if you can create a command file with FILE and ECHO statements.

```SET TOLERANCE  factor
```
Set the tolerance value for notation. The value is relative to the corresponding equal tempered step size of the selected notation system. The initial value is 1/3. It means that the absolute logarithmic difference between a pitch and the nearest pitch in the notation system may not exceed the given factor times the step size, or no name will be given. So for an exact match use 0. This value has no effect for notation systems not for equal temperaments which are S5, P7, P17, I22, JI, JI2, SAJI1 .. SAHTT and EITZ. Otherwise this value affects all situations where a notation system is used. To see the current tolerance value, use SHOW NOTATION or SHOW SETTINGS. See also SET NOTATION and REPLACE/NOTATION.
Secondly, this value is used to determine the allowable range for chords to be found with the SHOW LOCATIONS command. To calculate the factor from a given maximum deviation while taking the current scale into account, use the following command for a deviation of 5.0 cents for example: CALCULATE 5.0 div (%ai\2). Then do SET TOLERANCE \$0.

```SET UNIT  (ON | OFF)
```
Enable or disable displaying a unit name after a value, like "cents" or "Hertz" for the commands SHOW SCALE, SHOW BESTCYCLE, SHOW CYCLE and SHOW INTERVALS. The initial setting is ON.

```SET WAVEFILE  sample-freq  [channels]  [bits-per-sample]
```
Change the number of samples per second for example wave files. Common values are: 11025, 16000, 22050, 44100, 48000, 88200, 96000 and higher multiples. The default value is 48000. Other values might not be supported by all playback programs. Higher values produce a higher sound quality, unless of course they exceed the highest supported sample rate of the sound card.
The default number of channels is 1 (mono) but it can also be set to 2 (stereo). In that case the scale degrees are spread from the left to the right channel in ascending order. If the number of channels is between 3 and 6, they all get the same signal. The default sample size is 16 bits and it can be either 16 or 32 bits if you specify this as third parameter.

```SET WEIGHTING  factor
```
Change the weighting factor used in the commands APPROXIMATE/WEIGHTED and APPROXIMATE/CONSISTENT. The optimality criterion (which is minimised) is the sum of the absolute pitch difference and the weighting factor multiplied with the attribute value of the tested ratio. So if the weighting factor is higher, then the harmonicity value weighs more and the pitch difference less. It's also used by APPROXIMATE/MOULD. This value and other settings can be viewed with SHOW SETTINGS.

SHOW

```SHOW (SCALE | ANGLE | ATTRIBUTE | BEATS | BESTCYCLE | COMBINATION | CYCLE |
DATA | DEFAULT | DESCRIPTION | DIFFERENCE | DISTANCE | ET_DIFF |
EXPLIMIT | HARMCONST | INTERVALS | ITEMS | LOCATIONS | MAPPING |
NEAREST | NOTATION | PITCH | SETTINGS | SHIFTS | STATISTICS |
STRINGLEN | SYNTHESIZER | TEMPERINGS | TIME | TRANSPOSE | VERSION)```
```SHOW SCALE  [scalenr.]
```
Show the pitches of the given or current scale with the attribute that was set with the command SET ATTRIBUTE and interval name if rational. Instead of a scale number a filename can be given which then shows the scale in the file, without affecting the current scale. The SCALE keyword is default so SHOW or SH is enough to show the current scale or a scale memory, but not a file. The first degree to be shown can be set with SET FIRST or given in scala.ini. See also SET INDEX, SET NAME and SET UNIT. Pitches can be left-justified or centred, see scala.ini: Show_Centered. If a filename is given with wildcards, then all matching scales will be shown, by implicitly converting the command to an ITERATE command and using the highest scale memory as storage. So these commands are equivalent: SHOW SCALE *.scl, and ITERATE * SHOW.
```   /CENTS
```
Show the pitches in cents with the interval name if rational. Can be used in combination with /LINE and /INTERVAL.
```   /INTERVAL
```
Show the intervals between two scale degrees with a constant number of steps in between. The initial setting is between a degree and the previous one. This can be changed by doing SET INT_STEPS. See also SET ATTRIBUTE INTERVAL. The values of attributes shown correspond to the displayed interval sizes. Can be used in combination with /ATTRIBUTE, /CENTS, /ET_DIFF, /LINE and /NOTATION. See also SHOW/LINE INTERVALS to see intervals grouped by scale degree.
```   /ET_DIFF
```
Show the pitches with deviation in cents from the equal tempered values which are derived from the current scale size. It works the same as doing SET ATTRIBUTE DIFF_ET and then SHOW SCALE, but the current attribute is not changed. Can be used in combination with /INTERVAL.
```   /FREQUENCY
```
Show the absolute frequency of the pitches in Hertz and in number of octaves above 1.021975 Hertz. The latter is the same as the oct value of Csound and SAOL, also given with /OCTCPS. The third column is a fictive fractional MIDI note number where Middle C is 60. The fourth column contains the absolute frequencies expressed in Ellis, which is the number of cents relative to the 64-foot C (16.3516 Hz), with the number of octaves written (as a subscript) in front of the number of cents. For example the A at 440 Hz is shown as 4 900 El.
The base frequency used is the one set with SET FREQUENCY. The initial base frequency is set by key C_Freq in scala.ini (default 261.6255653 Hertz). Note that frequency can also be shown as an attribute with SET ATTRIBUTE FREQUENCY. A fixed value independent of SET FREQUENCY can be also used with for example: SET ATTRIBUTE FACTOR 261.6256. Can only be combined with /LINE.
```   /HERTZ
```
As with /FREQUENCY but shows only the value in Hertz plus the shortest note name in the current notation system. See also SET NOTATION. Cannot be combined with other qualifiers.
```   /MIDI
```
Shows the frequencies in MIDI fractional note numbers where 69 corresponds to 440.0 Hz. Note that frequencies depending on the base frequency are converted to fractional note numbers. These numbers can be used with the play statement in Sonic Pi, see https://sonic-pi.net. Cannot be combined with other qualifiers.
```   /MTS
```
Shows the frequencies in MIDI Tuning Standard units. Cannot be combined with other qualifiers.
```   /OCTCPS
```
As with /FREQUENCY but shows only the Csound cpsoct value. Cannot be combined with other qualifiers.
```   /CHORD
```
If the scale is rational, it will show the frequency multiples like 4:5:6 for example. Otherwise an empty line is shown. Then it compares the scale with the chords in chordnam.par and shows the name if there is an exact match. For this match the scale does not need to be rational. Cannot be combined with other qualifiers.
```   /LINE
```
Show pitches or intervals consecutively on one or more text lines. Can be used in combination with /ATTRIBUTE, /CENTS, /FREQUENCY and /INTERVAL. To see the pitches expressed as factors consecutively, use ECHO listfactor(0)
```   /ATTRIBUTE
```
Does not show the pitches but only the attribute value for each degree. Afterwards it shows arithmetical averages of the attribute values. If the attribute is not numerical then no averages are given. Can only be combined with /INTERVAL and /LINE.
```   /NOTATION
```
Does not show the pitches but only the note name for each degree according to the current notation system. They are shown consecutively on one or more text lines. If there is no note name, a double underscore (__) is shown. See also SET NOTATION. Can only be combined with /INTERVAL.

```SHOW ANGLE  pitch  pitch  [ignore-prime]
```
Show the angle between the harmonic vectors of two rational pitches (in Euclidean geometry). By default, prime 2 is ignored, but another prime can be specified. If no primes are to be ignored, use 1. The angle is given in degrees and always between 0 and 180 degrees. The cosine of the angle is given as well, as a kind of similarity measure.

```SHOW ATTRIBUTE  [attribute]
```
Show the current attribute, together with its secondary parameter, if applicable. If an attribute is given, then show its description instead. See also SET ATTRIBUTE and SHOW SETTINGS.

```   /ALL
```
Show the descriptions of all attributes. The current attribute is marked with an arrow.

```SHOW BEATS  interval-list
```
Show the beat frequencies on each tone of the current scale for the given interval(s). The intervals in the list with a maximum of 12 are separated by spaces and only ratios are allowed. But they can be separated by colons as well. In that case the values are read as linear factors, for example: 4:5:6:7. See also CHORDS. If the interval list is enclosed in parentheses, then this means the inversion, for example (4:5:6) means 10:12:15.
The frequencies are given in Hertz and relative to the base frequency set with SET FREQUENCY. The beats are given for the nearest pitch in the scale that is the given interval away from each degree. If it's lower, then the frequency has a minus sign. Example: to show the beat frequencies of fifths, fourths and major thirds type: SHOW BEATS 3/2 4/3 5/4. To see the beats of more octaves, use SHOW/MAPPING BEATS with a linear keyboard mapping. Warning: for sounds with an inharmonic spectrum, perceived beat frequencies may be different. See also SHOW TEMPERINGS and REPLACE/GIVENBEATS.
```   /RELATIVE
```
Instead of frequencies in Hz, show the beat frequencies relative to the base frequency, so if one multiplies them with the base frequency, the absolute frequencies are obtained. If the interval list has two intervals, then the ratio between the first and second beat frequencies will also be given. The fourth column then contains the ratio between the beat frequency of the intermediate interval and the beat frequency of the first interval. And the fifth column the ratio between the beat frequency of the intermediate interval and the beat frequency of the second interval.
For example if 5/4 and 3/2 are given, the latter two are the ratios of beat frequencies of 6/5 and 5/4, and 6/5 and 3/2 in the triad. See also brats.cmd. Can only be combined with /SCALE.
```   /PBP
```
Instead of frequencies in Hz, show the beat frequencies relative to the scale pitches themselves, in terms of percentage. Can only be combined with /SCALE.
```   /MAPPING
```
Show the beat frequencies on each keyboard key for the current scale and the current keyboard mapping. The base frequency is determined by the keyboard mapping. If the nearest scale degree for a given interval is not mapped to a key, then "--" is displayed. See also Mappings and SHOW/MAPPING LOCATIONS. Can only be combined with /SCALE.
```   /METRONOME
```
Show metronome markings in cycles per minute, for cycles of 1 to 5 beats. Minus signs will not be shown. For each interval five colums will be given, so with more than one interval you'll get quite wide output. With this method a simple metronome is sufficient to get very accurate temperings. Can only be combined with /SCALE.
```   /SCALE  scalenr.
```
Instead of an interval list, give a scale number or filename and show the beats for the intervals from that scale.
```   /TEST
```
Show pairs of intervals which have an equal beating frequency for intervals in the given interval list. After tuning an instrument, the tuning can be checked for accuracy by comparing the beating frequencies of intervals which should beat in the same tempo. This command will find such possible tests like the Nix tuning test, which compares a major sixth which encloses a major third in equal temperament, for example D-F# inside C-A. For harpsichords, use the following command: SHOW/TEST BEATS 6/5 5/4 4/3 3/2 5/3.
If the beat rates are within 2% of each other, they will be shown. Intervals in the range of one octave below to one octave beyond will be compared. Trivial octave inverse results will not be shown. The frequencies are given in Hertz and relative to the base frequency set with SET FREQUENCY. Only beat frequencies in the range of 0.1 to 16 Hz will be given. The intervals are indicated by the scale degree numbers of the two tones, and their note names in the current notation system. Can only be combined with /SCALE.

```SHOW BESTCYCLE  position  [scalenr.]
```
Show the difference of the fifths in the current scale from a least-squares optimal fifth. The first parameter is the formal fifth (generator) degree. It may not have factors in common with the number of notes in the scale. The difference between each formal fifth and the least squares optimal one is given in cents. Also given is the best starting point for the cycle of fifths in terms of minimal deviation and the resulting standard deviation. See also SHOW CYCLE.
```   /INTERVAL
```
Show the difference between each formal fifth and the least-squares fifth instead of the cumulative fifth.

```SHOW COMBINATION  interval  [scalenr.]
```
Show all pairs of pitches in the current or given scale whose sums or differences are equal to the given interval or integer multiples of them. This can also be done for pairs of intervals in file intnam.par. Instead of a scale number a filename can be given. You can first do LOAD intnam.par but this is not necessary. For example: SHOW COMBINATION 25/24 intnam.par. The interval may also be given as a floating point value. The results shown may then be slightly inexact. The quotient of the logarithmic interval sizes is also shown.
```   /SMALLER  interval  [rel-size]
```
Show all combinations of two both simpler and smaller intervals than the one given, whose sum is equal to it. The interval must be given as a ratio. Simpler means with smaller prime exponents. At least one interval of the pair has to be smaller. If there are no such combinations, nothing will be shown. Then, the simplest pair of intervals whose difference is the given interval will be shown. If the given interval is a prime number then nothing can be shown.
The threshold for the logarithmic size of the shown intervals can be set with the second parameter whose default value is 1, which means one times the given interval. It can be any positive number and is ignored for the difference.
```   /BRIDGE  interval  [rel-size]
```
Same as /SMALLER, except that the intervals shown on the left will be so-called bridge commas, i.e. the highest prime exponent is either 1 or -1, but they are not necessarily small intervals.
```   /INTERVAL  interval  [scalenr.]
```
Test if the given interval is a sum of multiples of one step intervals in the current or given scale and show the result. If it's not, then a No solution message will be given. Intervals below 0 cents will not be counted as negative. If the scale has many intervals then this command may take a long time. The interval may be a ratio or floating point value. Note that solutions given may not be unique.
```   /SUBSET  interval  [scalenr.]
```
Show all subsets of one step intervals in the current or given scale whose sum is the given interval. Each interval can be selected once or not. So if the given interval is not in the range of the scale there will be no result.
This is known as the knapsack problem and has an exponential runtime complexity same as the function above. However the best known algorithm is used. For scales which are too large you will get an out of memory error. All possible solutions will be shown. The scale must have at least two tones and can not have more than 60, but in practice the upper limit will be less.

```SHOW CYCLE  [scalenr.]
```
Show the difference of the fifths in the current scale from a given fifth. Enter the formal fifth to compare against and the fifth degree. The default value is 3/2. The default fifth degree is the nearest degree to the given fifth. The difference between each fifth and the cumulative fifth is given in cents. Next to that, the difference is given in Temperament Units. One TU is 1/720 part of a Pythagorean comma. A cycle closing at the octave will therefore have to distribute -720 TU over the complete cycle. A syntonic comma is 660 TU. Also if there is a name for the difference interval, it will be shown. If the fifth degree does not make a complete cycle in the scale then this will be indicated. However the program will try to continue by skipping one scale degree backward or forward, whichever will be nearest to the given formal fifth.
```   /CENTS
```
Show the fifths of the scale in cents instead of as ratio.
```   /INTERVAL
```
Show the difference between each fifth and the given fifth instead of the cumulative fifth.
```   /COMMAPARTS
```
Will show the difference between each fifth and the given fifth expressed as rational parts of either the syntonic comma (shown as a plain ratio or integer), the Pythagorean comma (indicated by 'P'), or the schisma (indicated by 's'). If there is no rational approximation with a denominator smaller than or equal to 36, the difference is displayed in cents. The tones are shown by their note names in the current notation system, but the tolerance setting is ignored.

```SHOW DATA  [scalenr.]
```
Show a list of properties and quantities of the given or current scale. Which properties are presented on the screen depends on the number of notes and whether the scale is rational or partly rational or not. Below is the complete list of it. At the left is the condition where n is the number of notes and "rat" means that the scale must be rational. The trivial condition n>0 is not indicated.

 Number of notes (and number if not all unique) Smallest interval Average interval Average / smallest interval Largest interval Largest / average interval Largest / smallest interval Least-squares average interval Number of different interval sizes Number of one step interval sizes Median interval of one step n>1 Most common interval of one step Highest interval variety Mean interval variety Median interval variety Lowest interval variety Whether scale has Rothenberg's propriety: strictly proper, proper or not n>1 Whether scale has Myhill's or Generated property and which are possible generators n>1 Whether scale has trivalence property (three interval sizes per interval class) n>1 Whether scale has maximal evenness, distributional evenness or 3-distributional evenness Whether scale consists of repeating interval blocks or is equal tempered n>1 Whether scale is a mode of an equal temperament not above 2400 or set by Max_ET_Mode in scala.ini n>1 Whether scale is a Winograd/Gamer deep scale n>=1 Whether scale is a Constant Structure n>1 Whether scale is an Agmon diatonic system n>1 Whether scale has Balzano's property n=2..150 Scale diversity n=2..150 Rothenberg stability (if proper) n=2..150 Lumma stability n=2..150 Lumma impropriety factor n>1 Rothenberg efficiency (if computing time not prohibitive) Interruptable by Ctrl+C. n>1 Whether scale is an addition chord n>1 Whether scale is an arithmetic sequence n>2 Whether scale is sum-free n=2..72 Interval pattern ordered alphabetically n=2..72 Interval pattern ordered by size (A = smallest, or SML = Small, Medium, Large) n=7 Whether scale is an octave species of an abstract tetrachord and which one(s) n>=7 Whether scale contains two identical tetrachords n=12 Whether scale is well-tempered and how many different fifths it has. It means no fifths larger than and major thirds smaller than pure. n=12 Whether scale is a tempérament ordinaire (certain modified meantone). n=12 Whether scale has a monotonous distribution of thirds proceeding over the circle of fifths, i.e. growing and shrinking only once n=2..150 Whether scale is a Constant Structure (Wilson) and by which interval margin n=2..150 Number of different intervals and ratio to n-1 Interruptable by Ctrl+C. n=2..150 Interval vector (if scale is mode of ET but not ET) n=2..150 Smallest interval difference (if not equal temperament) n=2..150 Most common interval and amount (its inverse is equally common) n=2..150 Number of recognisable fifths (between 4/7 and 3/5 octave) and their average size n=2..150 Number of recognisable fourths (between 2/5 and 3/7 octave) and their average size, if octave is not 2/1 n=4..150 Whether scale is a chain of identical triads n=4..150 Most common triad and amount n=2..150 Whether scale is differentially coherent and for which interval classes Limited transpositions Limited inverse transpositions Inversional symmetry on degrees Inversional symmetry on intervals Number of pitches' octave complements present rat Prime number limit rat Odd number limit, otonal and utonal odd limit rat Highest odd numerator or denominator rat Barlow's harmonicity rat Barlow's average harmonicity rat Barlow's specific harmonicity rat Common denominator and fundamental frequency rat Common multiple and guide tone frequency rat Exponens Consonantiae rat Euler's gradus suavitatis rat Sum of Mann's harmonic distance rat Mersenne's number of equal string divisions rat Sum of van Prooijen's harmonic expressibility rat Sum of Tenney's harmonic distance rat Vogel's harmonic complexity rat Wille's k value rat Wilson's harmonic complexity rat Rectangular lattice dimensions rat Triangular lattice dimensions rat Lattice compactness rat Lattice compactness (without prime 2) rat Whether scale is fully connected 5-limit major-minor triadic Whether scale is fully connected major-minor triadic in an ET mode rat Whether scale is a complete genus musicum and which one rat Whether scale is or has a complete diamond rat Whether all steps are superparticular, superbiparticular, supertriparticular or superquadriparticular rat Longest harmonic series fragment and where rat Longest subharmonic series fragment and where rat Whether scale is (weakly) JI-epimorphic with which val rat Prime exponents' range, average, count and number of tones at limit
Instead of a scale number a filename can be given which then shows data of the scale in the file.
Note that for large scales or scales with very high prime numbers, this command may run for a while. When it takes too long it can be interrupted by clicking on the Stop button or pressing F5. It will then proceed to another calculation, so it may be necessary to repeat pressing F5 a few times. See Help:Show data info or the file tips.par for explanations of these properties and quantities. See also SHOW STATISTICS.

```SHOW DEFAULT
```
Show the current or default directory path. This can also be done with CD without parameter, or with SHOW SETTINGS.

```SHOW DESCRIPTION  [scalenr.]
```
Show the description of the current or given scale. A filename can also be given as parameter. To show descriptions of multiple saved scales, use the DIRECTORY command. To search for a phrase in the descriptions use DIRECTORY/DESCRIPTION. See also SET DESCRIPTION.

```SHOW DIFFERENCE  scalenr.  [max-difference]
```
Show the differences of the pitches in the current scale with those of the given scale. If the scales do not have the same number of notes, then the smaller scale is implicitly octave-extended to the size of the larger scale. So the number of notes compared equals the size of the largest scale. Average values are also given. The differences shown are those that would result from a SUBTRACT operation. If a second parameter is given, then only the pitches with difference less than that will be shown. Instead of a scale number a filename can be given. If it contains wildcards, then all matching scales will be shown, with all qualifiers.
```   /FREQUENCY  scalenr.  [max-frequency]
```
Show the differences of the pitches in terms of beat frequencies (of the tones themselves, not their partials). These are calculated relative to the value given with SET FREQUENCY. Shown are the number of cycles per second, per minute and the beat frequency as percentage of the scale tones frequencies. If a second parameter is given, then only the pitches with beat frequency less than that will be shown. Can only be combined with /LARGEST.
```   /NEAREST  scalenr.  [max-difference]
```
Show the differences not between corresponding scale degrees but between each pitch of the current scale and its nearest counterpart in the given scale. The degree numbers of both scales are shown. The beat frequencies are also shown. At the end the number of pitches which are different is given and the mode is displayed which forms the selection of nearest pitches from the given scale. If a second parameter is given, then only the pitches with difference less than that will be shown. See also MODE.
The given scale may not be empty. If combined with /FREQUENCY the output is the same.
```   /LARGEST  scalenr.
```
As above, but only show the pitch(es) with the largest deviation from their counterpart in the given scale. If combined with /FREQUENCY only shows the pitch(es) with the largest beat frequency. Can only be combined with /FREQUENCY.
```   /INTERVAL  scalenr.  [interval-class]
```
Show the differences of the intervals in the current scale with those of the given scale. The default interval class is the one set with SET INT_STEPS. So if this is not changed, they are the one step intervals. Cannot be combined with other qualifiers.

```SHOW DISTANCE  pitch  [position]
```
Show the distance of the given pitch to the nearest pitches and intervals in the current scale and the beat frequencies. The given pitch may be in octaves higher than the scale, but below 1/1 no near degrees will be found unless the scale contains them. This is in case no position parameter is given, the default is degree zero and the pitch is relative to 1/1. Another position can be given to find the degree of the nearest interval starting on that position, which can also be negative. The distance will be displayed in cents, Tuning Units, which is 1/720 part of the Pythagorean comma and MIDI Tuning Units, which are 1/196608 octave. The distance to intervals will not be given if the scale has more than 100 tones.
The beat frequencies are calculated relative to the value given with SET FREQUENCY. If the given pitch is rational, then the beat frequencies between the corresponding partials will be given. If the nearest scale pitch is rational, then the beat frequencies for those partials will be given too. See also SHOW/NEAREST DIFFERENCE and SHOW TEMPERINGS.

```SHOW ET_DIFF  division  [octave]
```
Show for each pitch in the current scale the nearest step of the given equal temperament. This ET is the given formal octave (also called modulus or interval of equivalence) divided into the given number of steps (division). The division may be either a positive integer or floating point number. If the octave parameter is not given, 2/1 is assumed. The differences are given in cents and number of steps. Average values are also given. See also SHOW DIFFERENCE, SHOW/ET_DIFF INTERVALS, SHOW/ET_DIFF SCALE and DIVIDE/FIND.
```   /CONSISTENT
```
Instead of the nearest steps, show the consistent steps for all rational pitches. For nonrational pitches, the nearest steps are shown. See also DIVIDE/CONSISTENT and QUANTIZE/CONSISTENT.

```SHOW EXPLIMIT
```
Show the exponent limit(s) of the primes used for rational approximation. The initial limits are 31 for all primes. Note that the practical limits are lower for each prime other than 2 because the highest integer is 231 - 1. Also the default prime limit is given, see SET LIMIT. The prime count is set by Prime_Count in scala.ini (default 10 which is 29-limit). See also SET EXPLIMIT and APPROXIMATE.

```SHOW FREQUENCY
```
Show the current base frequency and the one which can be obtained with POP/FREQUENCY. See also SET FREQUENCY and PUSH/FREQUENCY.

```SHOW GENERATORS  division  [octave]
```
Show all possible generators in the equal temperament with the given division and octave. They are sorted by the minimal chain size (number of notes) that is needed to visit the nearest ET steps of all tones in the current scale. If no octave parameter is given, the formal octave of the current scale will be assumed. Pitches in the scale may be outside the octave range. Calculations are done modulo the given division and octave. The complexity number, called Graham complexity, is the number of periods per octave times the difference between the maximum and minimum number of generators required to reach each pitch class. Also the minimax generator is shown for the same shortest mapping with its highest and root mean square errors, see also CALCULATE/MINIMAX.
SHOW ET_DIFF can be used to show the differences with the current scale. See also MOS/ALL_SHOW.
```   /BEST
```
Instead of showing all possible generators, only show the ones which have the shortest minimal chain size. See also MOS/SHOW.
```   /CONSISTENT
```
For floating point pitches the nearest ET steps are chosen. For rational pitches the steps will be the sum of the rounded approximations to the constituent primes. SHOW/CONSISTENT ET_DIFF can be used to show the differences with the current scale.

```SHOW HARMCONST
```
Show the harmonicity coefficient(s) of the primes used. See also SET HARMCONST.

```SHOW INTERVALS  [scalenr.]
```
Show all interval sizes in the given or current scale. They are grouped by interval class (distance in position). For each interval class, all the intervals are shown, assuming octave equivalence. To only show the intervals within the formal octave range, use the /CHORD qualifier. Instead of a scale number a filename can be given which then shows the intervals of the scale in the file.
```   /ATTRIBUTE
```
Also shows the attribute of each interval, see SET ATTRIBUTE. If the current attribute is INTERVAL, MULTIPLE, OTHER_SCALE or SUBMULTIPLE, it cannot be shown. If it is CENTS or NONE then the output will not be different. For each interval class, the average of the attribute values (taking the number of occurrences into account) will also be shown. Can only be combined with /DIFFERENCE and /LINE.
```   /LINE
```
Show the intervals grouped by scale degree consecutively on lines. First given is the pitch of the starting degree followed by all the intervals relative to that degree. This is also called the interval matrix of a scale. The number of decimal places in cents values is default 1, but can be changed by adding a key to scala.ini like this: Matrix_Decimals 3 If it is combined with /ATTRIBUTE, then the current attribute for all the intervals will be shown. Can only be combined with /ATTRIBUTE and /CENTS.
```   /CENTS
```
In combination with /LINE, show the intervals in cents. Cannot be combined with other qualifiers. Alone the qualifier has no effect.
```   /CHORD
```
Only shows the intervals contained within the span of the scale, so no formal octave crossing intervals are given. Can only be combined with /TOTAL.
```   /DIFFERENCE
```
Show the differences in interval size for intervals of the same interval class (distance in position). Only differences between adjacent interval sizes in their sorted order as shown by SHOW INTERVALS is shown. If there's only one size for an interval class, nothing is shown. Then they're all shown again but in sorted order and not per interval class. Lastly all the essential tempering commas of the scale are shown if it's rational. These commas are candidates to be tempered out. A rational interval is an essential tempering comma if it's smaller than the smallest interval in the scale and if there are three pitches i, j and k in the scale such that the comma equals i*j/k.
This function is useful for finding defining intervals for periodicity blocks, see PIPEDUM. See also COLLAPSE/COMMAS. Can only be combined with /ATTRIBUTE and /TOTAL, see below.
```   /DIFFERENCE/TOTAL  [scalenr.]  [maximum-count]
```
Show all differences in interval size for intervals of the same interval class as above, but grouped together instead of per interval class. If a maximum count parameter is given, then only the smallest differences in that amount will be shown. If scale number 1 is empty, then this list of differences will be copied to it. If not, it will be copied to scale number 2 if that scale is empty.
```   /ET_DIFF  [division]  [scalenr.]
```
Show the difference in cents of the intervals with the equal tempered interval consecutively on lines, grouped by scale degree. First given is the pitch of the starting degree followed by all the intervals relative to that degree. The default division equals the size of the scale. See also SHOW ET_DIFF. Cannot be combined with other qualifiers.
```   /RANKING
```
Show the size ranking of the intervals grouped by scale degree consecutively on lines. Shown first is the pitch of the starting degree followed by all the ranking numbers of intervals relative to that degree. This is also called the interval rank order matrix of a scale. Cannot be combined with other qualifiers.
```   /SPAN
```
Show the smallest and largest interval in cents for each interval class. In the next column, their difference which is the size of the span is shown. And the last column is the "gap" between the interval class ranges. If it overlaps with the previous class, then this value is smaller than 1/1. Cannot be combined with other qualifiers.
```   /TOTAL
```
Show all interval sizes in the given or current scale but instead of grouped by interval class by interval size. If an interval size is unique to one interval class, then the class number is also shown and an asterisk if it is not (then it's called ambiguous). The total number of incidences of each interval is given with it. If there are ambiguous intervals, the number of different ones, and the total number of them is shown. Can only be combined with /CHORD and /DIFFERENCE. In the latter case it shows all the interval differences instead, see above. See also COLLAPSE/ALL.
```   /TRANSPOSE
```
Show the difference in cents of the pitches after transposition by consecutive interval classes. Another command which shows the same but with more digits is SHOW/SCALE TEMPERINGS 0. Or try also SHOW/COMMAPARTS/SCALE TEMPERINGS 0. Can only be combined with /FREQUENCY.
```   /TRANSPOSE/FREQUENCY
```
Show the difference tones in Hertz of the pitches after transposition by consecutive interval classes. If you copy the scale to another memory and do SHOW/FREQUENCY DIFFERENCE after executing consecutively the KEY command you get the same result with more digits.

```SHOW ITEMS  search-pattern
```
This is a convenience function to search for a name or name pattern in multiple places at the same time. Matching is case-insensitive. See also Patterns. So if you are looking for the first part of a word, then append a '*' wildcard.
It searches in this order: the list of chords, list of linear temperaments, list of rank-n temperaments, list of modes, the notations, list of intervals, list of linear recurrent series, list of string tunings and list of commands. Or as filenames: chordnam.par lintemp.par rankntemp.par modenam.par intnam.par series.par fretstr.par commands.txt. If you want a list of everything then do SHOW ITEMS * . Uses the command DIRECTORY/FIND internally among others.

```SHOW LOCATIONS  interval-list
```
Show the degree(s) where the given interval combination (chord) is present in the current scale. For each occurrence the number of steps and the begin and end degree is shown. If one of the intervals only approximates an interval in the scale, the difference(s) are also given. The maximum width of the range is determined by the SET TOLERANCE command, so if the tolerance factor is set to 1/3, then the maximum difference is one sixth of the average one-step interval in the scale.
The intervals in the list are separated by spaces or colons. In the latter case the values with decimal points will be read as linear factors instead of cents values, for example 4:5:6:7. If the interval list is enclosed in parentheses, then this means the inversion, for example (4:5:6) means 10:12:15.
If the current attribute is NOTATION then an extra line is shown with the note names of the chord position. See also SET NOTATION. Then the number of chords found is displayed, followed by "covered degrees" which is the number of scale degrees present in any of the chords, followed by the number of degrees present in more than one chord, and the highest coverage (amount of times present). Octave equivalence is assumed here. The interval class pattern (number of steps for each chord interval) doesn't need to be the same for each chord occurrence, so the number of different patterns is displayed. Then the total, average and highest differences are given which is the sum over one chord.
If the current scale is a linear temperament (has Generated and/or Myhill's property) or an equal temperament, then the size of the minimal covered scale for the given chord will also be given. This means that the occurrences of the chord in a scale with the same generator of that size will cover all pitches in the scale. See also CHORDS to search for multiple chords simultaneously.
```   /DIFFERENCE  [interval-class-list]
```
Show the locations of the difference tones on each scale degree of the current scale for the given interval classes. The default is an interval class of 1, which means one scale step. If a location is shown for each degree, then the scale is differentially coherent, see SHOW DATA. The maximum difference is determined by SET MAXDIFF and not with SET TOLERANCE. Because difference tones (beats) will be much lower than scale tones, the shown locations will usually be below degree 0. Shown are the locations of the difference tone between the next (i + class) and the current (i) scale degree. An interval class may be outside the range of notes. The scale must be in ascending order.
```   /MAPPING  interval-list
```
Show the MIDI keys where the given interval combination (chord) is present in the current scale and with the current keyboard mapping. Unmapped scale degrees will be skipped in the search. If one of the given intervals only approximates an interval in the scale, the difference(s) are also given. The range is determined by SET TOLERANCE, see above.
See also Mappings and SHOW/MAPPING BEATS. Can only be combined with /SCALE and /SUBSET.
```   /MODE  name-pattern-or-mode
```
Instead of an interval list, give a mode pattern as used in the MODE command. A mode name can also be given. The given mode selects the intervals from the current scale, and that interval pattern will be searched. The combination at degree 0 will therefore always be found. So be aware the mode is not from an equal temperament (if the scale isn't), for that purpose use the qualifier below. Cannot be combined with other qualifiers.
```   /EQUALMODE  name-pattern-or-mode
```
Instead of an interval list, give a mode pattern of an equal temperament. The current scale must be a mode of an equal temperament. To see if it is, use FIT/MODE and look if the last scale given has a SD of 0.00 cents. This will also indicate the division selected for this command. The default highest ET that will at least be checked is 2400 and it can be changed by adding a key Max_ET_Mode to file scala.ini. A mode name or pattern with wildcards can also be given as parameter. Example: check the positions of tetrads with relative interval sizes: SHOW/EQUALMODE LOCATION 2 2 1.
Be careful if you give a mode name that's not a mode of the same division as the scale or a submultiple of it, because then the located intervals may be different from what you expect. A warning message is given then.
If the standard deviation shown with FIT/MODE is not zero, then QUANTIZE can be done first. Cannot be combined with other qualifiers.
```   /RANGE  low-interval  high-interval
```
Show all occurrences of single intervals which are in the given size range. The SET TOLERANCE setting does not apply here. Cannot be combined with other qualifiers. See also DIVIDE/RANGE.
```   /SCALE  scalenr.
```
Instead of an interval list, give a scale number or filename and use the intervals from that scale to search in the current scale. Cannot be combined with /MODE, /EQUALMODE or /RANGE.
```   /SUBSET  interval-list
```
Also shows partial matches with the interval list. See also SHOW/PRESENT SHIFTS. Can only be combined with /MAPPING and /SCALE.
```   /TOTAL  interval-list
```
Only shows the total number of matches, not the occurrences themselves. Can only be combined with /SCALE.

```SHOW MAPPING  [filename-or-first-note]  [last-note]
```
Show the current keyboard mapping if no filename is given, otherwise show the mapping in the file without affecting the current mapping. Middle indicates the MIDI note number to which the first entry in the mapping is mapped. The initial value is 60. Reference indicates the master frequency and the note number which will receive this frequency. The initial values are 261.6256 Hertz to note number 60. Octave degree is the degree which is considered to be the formal octave. This formal octave is the difference in pitch between two adjacent instances of the mapping pattern. A value of 0 means that the last pitch of the current scale is considered to be the formal octave. The initial value is 0. If the current mapping is not linear, you will see in the left column a list of scale degrees for each MIDI key. An unused key is indicated with two hyphens. The second column contains a list of keys for each mapped scale degree. And if the current scale is not empty, the corresponding scale pitches in the third column. A linear mapping means that successive scale degrees are mapped to successive keys. If the first parameter is a number, then it will be the note number of the first MIDI key shown. A second parameter for the last note can also be given.

```SHOW NEAREST  interval-list
```
Show the nearest pitches in the current scale to scale pitches incremented by the given intervals. For the format of the interval list, see SHOW LOCATIONS.
If the current attribute is NOTATION then an extra line is shown with the note names of the chord position. See also SET NOTATION and SHOW SHIFTS.
```   /REDUCED
```
If nearest pitches exceed the scale's formal octave or are lower than 0 cents, they are shown reduced to within the range of one formal octave.

```SHOW NOTATION  [notation-system-or-division-or-search-pattern]
```
Show the names and descriptions of all notation systems or, with a notation system parameter, the description of the given system. The order is octave based systems first, from small to large and then non-octave based systems. It also shows the current active system, even if the attribute is not set to notation. See also SET NOTATION.
The parameter may contain the * and ? wildcards, which makes all system names corresponding to the given pattern to be shown. See also Patterns. If the parameter is an integer number instead of a notation system, then all notation systems being based on that equal division will be given. If there are none, then ones which are a multiple will tried to be found. If the parameter is 0 then only the current system is shown. Note that notation LT can be used for any equal temperament, if the division is set accordingly with SET LT_PARS. Lastly, the parameter can be a string that is searched for in the descriptions of all notation systems. Wildcards cannot be used then. For example to see all notations with Pythagorean note names, do SHOW NOTATION Pythagorean.
To view all the note names in one of these systems, use SET NOTATION to select the system, then get the corresponding equal tempered scale with the EQUALTEMP command (except for the Indian names) and do SHOW. For the Bohlen-Pierce scale do EQUAL 13 3. For the Indian names use LOAD to obtain one from file (indian.scl), or you can do EQUAL 53. For the Persian names do LOAD persian, or do EQUAL 36.
The notation offset and tolerance are also shown, see SET OFFSET and SET TOLERANCE. The tolerance is the maximum allowed deviation for the name to be given. It is shown here in cents, not relative to the step size in which it is set.

```SHOW PITCH  [pitch]
```
Show the value of the given pitch in cents, as a linear value and in Hertz relative to the base frequency. Default is the value in pitch memory 0. See also CATALOGUE to show the values of all used pitch memories.
```   /ATTRIBUTE
```
Show the value of all attributes which are independent of a scale for the given or default pitch. At the end the name in the current notation system is given. To show the attributes for pitch memory 1 for example, do SHOW/ATTRIBUTE PITCH \$1.
```   /CENTS
```
Show the value in cents only.
```   /EXPONENTS
```
Show the prime exponents vector if the pitch is rational. It will be in the notation that begins with '|' and ends with '>'. The highest prime in the vector is the one set in scala.ini.
```   /NOTATION
```
Show the note name of the given pitch for all notation systems. The setting made with SET TOLERANCE applies, so if no name is given, then the value is outside the tolerance multiplied by the notation's nominal step size.
```   /UNITS
```
Show the value expressed in various units plus its interval name in case it has one and it's rational. The unit names and conversion factors are stored in parameter file calcval.par and may be altered as wished.

```SHOW PRIMES  [first-prime]  [last-prime]
```
Show the list of consecutive prime numbers in the given range. If no last prime is given, all primes until 2_147_483_647 will be shown. For each prime, the binary logarithmic value is also given, which equals the size expressed in number of octaves. In the third column is the number of primes since the first one of the list.
If the second parameter is 1, then only one prime will be shown, which is the one equal to or larger than the given first parameter. If the second parameter is 0, also one prime will be shown and the first parameter the ordinal number of the given prime. For example SHOW PRIME 5 0 will show the fifth prime number.

```SHOW SETTINGS
```
Show the current values and settings of most of the changeable parameters. To make different settings at startup, the files scala.ini and startup.cmd can be edited. Not shown are the coefficients shown with SHOW EXPLIMIT and SHOW HARMCONST. See also SET.

```SHOW SHIFTS  interval-list
```
Show the pitches of the current scale incremented by the given intervals. For the format of the interval list, see SHOW LOCATIONS.
With this command one can see which tones exist on a string instrument with straight frets, if the interval list gives the intervals between the tunings of the open strings.
If the current attribute is NOTATION then an extra line is shown with the note names of the chord position. See also SET NOTATION and SHOW TEMPERINGS.
```   /BEATS  frequency  interval-list
```
Show pitches which beat with the given frequency against pitches of the current scale incremented by the given rational intervals. If the given frequency is negative, the results will be lower than the scale pitches incremented by the intervals, otherwise above them. All intervals in the list must be rational. If the current attribute is NOTATION then an extra line is shown with the note names of the resulting pitches. See also APPEND/GIVENBEATS and SHOW BEATS. Cannot be combined with /PRESENT.
```   /PRESENT
```
Show only shifted pitches whose distance to the nearest scale tone is not greater than the difference set with SET MAXDIFF. See also SHOW/SUBSET LOCATIONS. Cannot be combined with /BEATS.
```   /REDUCED
```
If shifted values exceed the scale's formal octave or are lower than 0 cents, they are shown reduced to within the range of one formal octave.

```SHOW STATISTICS  [scalenr.]
```
Below is the list of statistics shown. At the left is the condition where n is the number of notes. The trivial condition n>0 is not indicated.

 Interval standard deviation Interval skew (= third moment of mean) Average distance from equal tempered Standard deviation from equal tempered Maximum distance from equal tempered Geometric average of pitches 0..n Arithmetic average of pitches 0..n Harmonic average of pitches 0..n Geometric average of pitches 1..n Arithmetic average of pitches 1..n Harmonic average of pitches 1..n n>1 Geometric average of pitches 1..n-1 n>1 Arithmetic average of pitches 1..n-1 n>1 Harmonic average of pitches 1..n-1 n>1 Centre of gravity off-centre
You can obtain the angle where the centre of gravity is from the geometric average of pitches 1..n. An equal temperament is of course always perfectly balanced. Instead of a scale number a filename can also be given. See also SHOW DATA.

```SHOW STRINGLEN  [string-file]  [last-position]
```
Show the positions where frets are to be placed for the degrees of the current scale with high precision, which is achieved by calculation and compensation of string stretch (length and tension). Therefore this command needs to read the string length and other parameters of the string and the instrument from a file. The default name of this file can be set in scala.ini with key String_File. It can also be given as parameter.
The pitch of the open string must correspond to scale degree 0. If this is not the case, i.e. degree 0 is also at a fret, then first insert the pitch of the open string (relative to the the current 1/1) to degree 0, see INSERT. If more frets than scale degrees are to be shown, enter the count as second parameter (in this case the filename must be given too).
In the first column are the distances relative to the nut, in the plane of the fingerboard towards the bridge. The second column has the distance of the point where the string starts to vibrate at the bridge to the fret position. Accurate results are only obtained for metal strings, or strings of a material with a fixed spring constant. Unattainable pitches will be indicated with dashes. If the string is not pressed down, use /MONOCHORD.
```   /MONOCHORD  string-length  [last-position]
```
If the string is not pressed down, so if bridge, nut and fret are in the same plane, then the only relevant parameter is the string length. Then you can use this option. It also shows both distances to bridge and nut. If more distances than scale degrees are to be shown, enter the count as second parameter. Another possibility is to use SET ATTRIBUTE RECIPROCAL followed by the string length. See also SET RECIPROCAL.

```SHOW SYNTHESIZER
```
Show the synthesizer models defined in parameter file synth.par and the built-in ones. The currently selected model is indicated with an arrow. The MIDI Tuning Standard types are the best option, but not many synths support it: a list is shown. Also shown are lists of softsynths that can read Scala scale files and TUN standard .tun files, the latter which is selected with SET SYNTHESIZER 112.

```SHOW TEMPERINGS  interval-list
```
Show the differences for the nearest interval on each tone of the current scale with the given interval(s). The intervals in the parameter list are separated by spaces. There can be 12 at most. Colons also act as separator in which case any values with decimal points are read as linear factors, for example: 4:5:6:7. See also CHORDS.
The differences are shown in cents and are relative to the nearest pitch in the scale that is the given interval away from each degree. Note that if you want to see the differences for intervals in the scale, you can use the percent sign with the degree number, for example SHOW TEMPERINGS %4 %5.
If only one interval is given, then three statistics are given which are indications of the relative "strength" of the temperament with respect to this interval. The most important for 12-tone temperaments is the degree of contrast between consonance and dissonance in their major thirds. So if the given interval is 5/4, then the first is the range of narrowest and widest major third. Next the total amount by which the major thirds that are narrower than in ET deviate from the ET major third. And last the average of deviation of the major thirds that are narrower than in ET, the average of those that are larger and the difference between both.
```   /SCALE  scalenr.
```
Instead of an interval list, give a scale number or filename and show the differences for the intervals from that scale.
```   /TOTAL
```
Instead of showing the differences for each interval, show the sum of the absolute differences for each scale degree, and the average (sum divided by the number of intervals given).
```   /COMMAPARTS
```
Instead of showing temperings in cents, they are expressed as simple fractions of the syntonic or Pythagorean comma. In the latter case a 'p' is appended to the fraction. The same is used in the EITZ notation system. If there is no simple fraction, cents are shown. Cannot be combined with /UNITS.
```   /UNITS
```
Instead of showing temperings in cents, they are expressed in John Brombaugh's Temperament Units, 1/720th of a Pythagorean comma. This is almost exactly 1/660 syntonic comma and 1/60 schisma. Cannot be combined with /COMMAPARTS. See also SHOW CYCLE.

```SHOW TIME
```
Show the current date and time.
```   /MSECS
```
```   /INTERVAL
```
Show the lapsed time in milliseconds since the last invocation of SHOW TIME. When done for the first time after startup, show the lapsed time since the program was started.

```SHOW TRANSPOSE  [scalenr.]
```
Show how many pitches of the given or current scale are different resp. identical for the same scale in different keys. The count in the second column is the number of pitches different resp. identical in degree order, and in the third column the number that is different in any order. It then shows the largest deviation, and next the average of deviation for the degrees that are different in order, counting only the different keys and the average deviation counting all keys. Lastly, the normalised autocorrelation values for the logarithmic intervals between consecutive pitches (logarithmic scale steps). It is a measure how similar the interval sequence is when the scale is transposed to the given key. A value of 1.0 means identical, a value of 0.0 means no similarity. If a notation attribute was set, the note names are given too.
For equal tempered scales, obvious values are not given. Instead of a scale number a filename can be given. See also SHOW/TRANSPOSE INTERVALS.
```   /DIFFERENCE
```
Show the results sorted by key in order of ascending average deviation, the second one averaged over all keys.
```   /SORTED
```
Show the results sorted by key in order of ascending number of pitches different.

```SHOW VERSION
```
Show the program version.

SIEVE

```SIEVE  pattern
```
Select pitches from the current scale and delete the intermediate pitches. The numbers in the given pattern come in pairs. The first one is the number of steps to proceed upwards with each selected degree. The second one is the degree to start on, which has 0 as default value (may also be negative). For more than one given pair, the union is taken. Degree 0 and the last degree (formal octave) will not be deleted. For instance if a single number is given it means that every so many pitches are taken from the scale and the rest deleted (then it does the same as SAMPLE).
Example: with 12-tone equal temperament, doing SIEVE 2 1 will give the degrees 1 3 5 7 9 11 12. Or SIEVE 3 0 4 0 will give 3 4 6 8 9 12. See also MODE and SAMPLE. Qualifiers cannot be combined.
```   /COMPLEMENT
```
As above but instead the selected pitches are not kept but deleted.
```   /RANDOM  probability
```
Take a random selection of the scale degrees from the current scale. Each degree has the given probability of being selected (kept). So the number of notes is not known in advance.
The parameter must be a floating point number or ratio between 0 and 1 inclusive. The last degree may also be deleted. Cannot be combined with /COMPLEMENT. See also SAMPLE/RANDOM and SEED.

SORT

```SORT  [scalenr.]
```
Sort the pitches in the given or current scale in ascending order. For descending order, do REVERSE afterwards. Qualifiers cannot be combined.
```   /ATTRIBUTE
```
Sort the pitches according to the current attribute value in ascending order. Only attributes which give a numerical value are allowed, so the attributes PRIMES, SEP_PRIMES and VECTOR are not allowed and give the message "Invalid attribute for operation". INTERVAL and OTHER_SCALE are also not allowed. EXPONENTS can be used however, which gives a partial ordering based on the sum of absolute exponents and the prime limit, which makes it a ratio complexity function. For descending order, do REVERSE afterwards. See also LIMIT/MAX_ATTRIB.
```   /INTERVAL
```
Sort the consecutive intervals in the given or current scale in ascending order. For descending order, do INVERT afterwards.

SPAWN

```SPAWN  command
```
Execute an operating system (shell) command and return to the program after it has been completed. To work interactively with the operating system enter
 on Linux/Unix/MacOSX : spawn sh (or any other shell name) on Windows XP/7/8 : spawn cmd
After logging out or exiting control is returned to Scala. For Scala version 2.0 and higher, it's easier if you open another window like this on Linux: spawn xterm
With SPAWN, operating system commands and Scala commands can be mixed in Scala command files. See also @.
```   /DETACHED
```
Execute the operating system command in the background (as a separate process) and/or run it concurrently in a separate window. Control is returned to Scala before the system command has been completed. The command can be a program executable name if it's in the current path, some examples are:
 on Linux/Unix/MacOSX : spawn/detached xmms on Windows XP/7/8 : spawn/detached notepad on Windows XP/7/8 : spawn/detached cmd /c start http://www.huygens-fokker.org
```   /QUIET
```
As without qualifier, except it does not show an error message if the command could not be executed.

SQUARE

```SQUARE
```
Create a scale like a Novaro-Partch tonality diamond. This is the Carthesian product of a set of factors with their reciprocals. The diagonal of the diamond consists of only 1/1's. These redundant notes will not be included in the scale. Scales like this are self-inverse.
First is asked Enter number of factors:, which is the number of generating numbers that represent harmonics and subharmonics. Subsequently they must be entered as any ratio or cents value. A tonality diamond has integer factors, but non-integer values may be used here. It makes a difference whether 1 is one of the factors or not. The pitches can be reduced by an octave with the NORMALIZE command, which also removes duplicate pitches. See also RECTANGLE, this is a generalisation of the SQUARE command with integer factors. If you want to create a diamond for a given odd limit then it's easier with that function. See also PRODUCT.
```   /SCALE  [scalenr.]
```
Instead of entering the factors one by one, the current or given scale is used. If the current scale is used, it will be replaced with the result. Degree 0 with 1/1 is not used, so if a factor of 1/1 is desired, there needs to be an extra one in the scale besides degree 0. Instead of a scale number, you can also give a filename.
```   /UPPER
```
Only create the pitches above the diagonal of 1/1's, i.e. the upper triangular part. If you want the opposite part, do INVERT and REVERSE afterwards.

STRETCH

```STRETCH  interval
```
Increase the formal octave of the current scale with the given interval and other pitches with a smaller logarithmic proportional part of it with respect to their scale degree. If the number of notes in the current scale is n, then the first degree will be incremented with the 1/n part of the given interval, the second degree with the 2/n part, etc. For example, if the scale in cents is 0-100-300-500, then a stretch with 90 cents makes it 0-130-360-590. The given interval may also be smaller than 1/1.
This shouldn't be confused with the more normal scale stretching or shrinking where pitches are changed proportionally to their size. This is done with the MULTIPLY command. See also EXPONENTIATE. Qualifiers cannot be combined.
```   /ABSOLUTE  pitch
```
Change the formal octave of the current scale to the given pitch and increase all other pitches with a logarithmic proportional part of the increment to the formal octave. If the formal octave is 1/1 then this command can be used where MULTIPLY cannot.
```   /MATCH  scalenr.  [max-difference]
```
Stretch the current scale by an interval such that the least-squares difference with the corresponding degrees in another scale is minimal. The given scale may have a different size than the current scale. If a second parameter is given, then only pitches in the other scale which are not further removed from a pitch in the current scale than by this difference will be considered. Instead of a scale number, a filename may also be given. See also MULTIPLY/MATCH and MOVE/MATCH.
```   /MINIMAX  scalenr.  [max-difference]
```
Stretch the current scale by an interval such that the maximum absolute difference with the corresponding degrees in another scale is minimal. The rest as with /MATCH. If a computation error results, this means there is no solution. If the current scale is an equal temperament, use MULTIPLY/MINIMAX to obtain a result. See also PROJECT/MINIMAX.
```   /RELBEATS  interval  interval  [rel-factor]
```
Stretch the current scale by an interval such that the beat frequencies of the given two rational intervals will be equal or if the third parameter is given are proportional with the given factor. The default value is -1 which means that they will have opposite signs as shown with SHOW BEATS. See also LINEARTEMP/RELBEATS and MULTIPLY/RELBEATS.

SUBTRACT

```SUBTRACT  scalenr.
```
Divide the pitches of the current scale by the corresponding scale degrees of the given scale. Instead of a scale number, a filename may also be given. If the scales have different size then octave equivalence is used and the current scale will keep its size.
For subtracting a constant term from all pitches use MOVE/FREQUENCY with a negative parameter. See also ADD. Qualifiers cannot be combined.
```   /SUBTRACT
```
Instead of dividing the pitches, take the difference tones.
```   /MEANSQUARE
```
Take the subtractive mean of their squares, i.e. sqrt(2a - b2).
```   /MEDIANT
```
Take the subtractive mediant value, i.e. the absolute value of (num(a) - num(b)) / (den(a) - den(b)). All pitches must be rational. If either the numerator or denominator becomes zero, then a 1/1 is inserted. If this has happened, you can do UNIQUE to delete them.
```   /POWER
```
Take the pitches of the current scale to the power of the inverse pitches of the given scale, i.e. (a1 / b).
```   /DIFFERENCE  [scalenr.]
```
The current scale is replaced by a scale with all difference tones of the current or given scale, using octave equivalence. The size of the new scale will be at most the square of the number of notes in the given scale, and less if there are duplicate difference tones. Warning: the original 1/1 remains in the scale. To remove it, do DELETE 0. See also ADD/SUMMATION.

SWAP

```SWAP  scalenr.  [scalenr.]
```
Interchange the first with the second given scale. To select another scale as the current scale, use only one parameter with the other scale's number. The command to interchange notes inside a scale is EXCHANGE.
```   /PITCH  pitchnr.  [pitchnr.]
```
Interchange the first with the second given pitch memory. Pitch number 0 is the default.

SYMMETRIZE

```SYMMETRIZE  position
```
Make the current scale symmetrical in some way around the given position. The qualifiers determine in which way. It can be done by replacing pitch pairs around the given position so that their average distance to the pitch at the given position is the same. Or one can be replaced by the other or pitches can be copied to the other side. /GEOMETRIC is default by absence. Qualifiers cannot be combined.
```   /GEOMETRIC
```
Uses the geometric mean, i.e. sqrt(a * b). When this is used, then the symmetry is recognised by the SHOW DATA command. This is the default qualifier.
```   /ARITHMETIC
```
Uses the arithmetic mean, i.e. (a + b) / 2.
```   /HARMONIC
```
Uses the harmonic mean, i.e. 2 * a * b / (a + b).
```   /SUBC_HARMONIC
```
Uses the subcontrary to harmonic mean, i.e. (a2 + b2) / (a + b).
```   /LOGARITHMIC
```
Uses the logarithmic mean, i.e. log(mean) = (b * log(a) + a * log(b)) / (a + b).
```   /COUNTER_LOG
```
Uses the counterlogarithmic mean, i.e. log(mean) = (a * log(a) + b * log(b)) / (a + b).
```   /RHSM
```
Uses the root harmonic square mean, i.e. sqrt(2 * a2 * b2 / (a2 + b2)).
```   /RMS
```
Uses the root mean square, i.e. sqrt((a2 + b2) / 2).
```   /SUB1_GEOMETRIC
```
Uses the first subcontrary to geometric mean, i.e. ((b - a) + sqrt((a - b)2 + 4a2)) / 2.
```   /SUB2_GEOMETRIC
```
Uses the second subcontrary to geometric mean, i.e. ((a - b) + sqrt((a - b)2 + 4b2)) / 2.
```   /MEDIANT
```
Uses the mediant, i.e. (num(a) + num(b)) / (den(a) + den(b)). All pitches must be rational.
```   /FIRST
```
Does not average two pitches but just replaces the second by the first. When this is used the symmetry is recognised by the SHOW DATA command.
```   /SECOND
```
Does not average two pitches but just replaces the first by the second. When this is used the symmetry is recognised by the SHOW DATA command.
```   /INSERT
```
Does not average two pitches but inserts all the octave inversions. Afterwards the command UNIQUE can be used to delete eventual double pitches. However this may change the position of symmetry. When this is used the inversional symmetry is recognised by the SHOW DATA command.
You can use this qualifier when entering a scale that is symmetrical so that only half the values have to be typed. Input the first half, append the octave, and then do SYMMETRIZE/INSERT 0.
```   /GOLDEN
```
Uses the golden mediant, i.e. (num(a) + phi * num(b)) / (den(a) + phi * den(b)), where phi is the golden ratio: 1.61803398875. All pitches must be rational.
```   /EPIDEN
```
Uses the epimoric mean, i.e. (2 * a * b - a - b) / (a + b - 2). See also SET ATTRIBUTE EPIDEN and DOUBLE/EPIDEN. If both pithes are superparticular (epimoric), then this mean equals the mediant.

TIP

```TIP  [tipnr.]
```
Provide a tip-of-the-day. Without parameter, a tip will be chosen at random. Tips are written in the file tips.par, which can be read and printed as a text file.
In the GUI-version you can browse the tips in a dialog window or send them to the browser, do Help:Tip!

TYPE

```TYPE  file-mask
```
Show the contents of a text file. It can be useful to read a command file or keyboard mapping file or something else before executing or loading it. If the file parameter contains wildcard(s), all the matching files will be shown.
To show the last scale file which was loaded or saved, do TYPE %scl.
If you want to check instead whether one or more particular files contain some text or text pattern, use DIRECTORY/FIND. It will show all the lines containing the given text.

UNCYCLE

```UNCYCLE  position  [down-count]  [scalenr.]
```
Reorder the pitches by putting them in "fifths-order" by considering the current or given scale to be a cycle of fifths. The given position is the degree of the formal fifth and may have no common factor with the scale size. The down-count is the number of formal fifths in the downward direction with default value 0.
It can be useful to do certain operations on a cycle of fifths when it is in "straight" form. Afterwards the pitches can be reduced again by octaves using REDUCE and SORT or NORMALIZE.
```   /NEAREST  interval  [down-count]  [scalenr.]
```
Instead of using a fixed interval specified by a scale degree, stack the intervals nearest to the given one.

UNDO

```UNDO  [count]
```
After any command that changes the current scale (scale number 0), this can be used to get the scale back as it was before the last command. Copies are kept in the Undo scale memories, except when the current scale is empty. The number of undo-memories is set by key Undo_Slots in file scala.ini, default is 1. If it's greater than one (see SHOW SETTINGS), then UNDO can be invoked repeatedly to get earlier states of the current scale back. Use the CATALOGUE or SHOW SCALE command to examine the contents of the undo-memories. The command works cyclically so the state before UNDO is not lost.
If a count is given, it repeats undoing a number of times. The special value -1 will save an extra copy of the current scale, even if it's empty. The count may not be greater than the number of undo-memories. See also PUSH which is different.
Warning: commands operating on scales other than the current scale cannot be undone, nor can operations on pitch memories and the keyboard mapping. Other commands that cannot be undone are CLEAR/ALL, COPY, PUSH, POP and SWAP. Because command files usually contain more than one command, the whole action of a command file can usually not be undone with a single UNDO. But you can of course make a copy first with COPY.

UNIQUE

```UNIQUE  [scalenr.]
```
Deduplicates pitches in the current or given scale and sorts it in ascending order. Pitches are considered equivalent if their difference is less than approximately the numerical accuracy of floating point numbers in the computer, so it does not matter whether it is a rational pitch or not. If this margin is too narrow, use DISCARD instead.
```   /MAPPING  [scalenr.]
```
Modify the keyboard mapping such that the current or given scale will be mapped with the same pitches to the same keys as when UNIQUE is done to it afterwards. The scale size may not be greater than 128. Afterwards, do SHOW MAPPING to see the result. The mapping's reference frequency, middle key, etc. will not be changed, only the map itself will be overwritten. So if you do UNIQUE/MAPPING and then UNIQUE, the mapping is such as it would have been with a linear mapping and the original scale. Instead of a scale number, a filename may also be given. See also Mappings and SELECT/MAPPING.

UNRAT

```UNRAT  position  [scalenr.]
```
Change the pitch at the given position (degree) in the current or given scale from a rational to a floating point value. This cannot be done for degree 0. To do this to all pitches, use VARY 0.0 or LIMIT 1.
To change a pitch memory to a floating point value, give as parameter a dollar-sign before a pitch number, like \$0 for instance. See also ASSUME, for doing the opposite.

VARY

```VARY  deviation  [scalenr.]
```
Adds a random value with an absolute maximum of the given value to all pitches in the current or given scale except the last one (formal octave). The random values are distributed uniformly between minus and plus the deviation logarithmically. If the last degree is to be changed too, then append an extra temporary degree with 1/1 for example before doing this command.
If the deviation is 0.0 then all rational pitches in the scale will be made floating point numbers. The deviation may be given as a rational or floating point value. See also SEED.
```   /INTERVAL
```
Adds a random value to each interval instead of each pitch. The last degree (formal octave) will be affected too. Can only be combined with /EXPONENTIAL and /GAUSSIAN.
```   /LINEAR
```
Adds a random frequency value with an absolute maximum of the given value to all pitches in the current or given scale except the last one (formal octave). The random values are distributed uniformly between minus and plus the deviation linearly. The given frequency is relative to the base frequency of SET FREQUENCY. Can only be combined with /EXPONENTIAL and /GAUSSIAN.
```   /EXPONENTIAL
```
Instead of a uniform statistical distribution, use the exponential distribution, which describes a Poisson process. The parameter is the mean deviation instead of the maximum deviation. Because this distribution is one-sided, this function uses a second uniform random variable to decide if the deviation is to increase or decrease the pitch or interval. Note that because of this, the standard deviation is not equal to the mean deviation but to the mean deviation times two. Can only be combined with /INTERVAL and /LINEAR.
```   /GAUSSIAN
```
Instead of a uniform statistical distribution, use the normal, also called Gaussian distribution. The parameter is the standard deviation instead of the maximum deviation. Can only be combined with /INTERVAL and /LINEAR.

@

```@<command-file>  [parameters]
```
An @ preceding a filename executes commands in an external text file called a command file (or "script"). The command file must have one command per line. Execution stops when an empty line is encountered or an error occurs. The default extension for command files is '.cmd'. Lines beginning with an exclamation mark (!) are ignored and can be used for comments. If the command file is not found in the current directory (set with CD), then it is searched in the main Scala directory, the one which contains scala.exe. A command file example:
```! Average the pitches of scale 0 with those of scale 1
multiply 1/2```

With commands like INPUT or LINEARTEMP which prompt for values, the values must be put separately on lines following the command or alternatively command lines with question marks ('?') will cause prompting for user input, once for each question mark causing each one to be replaced by the response given. Prompting can also be done for parameters that are normally taken from the command line.
A line with two question marks ('??') will cause prompting for user input for all the rest of the parameters. See also help ?. Command files can be used to store scales by definition, versus by value.

It is possible to pass parameters from the invoking command line to the command file. Parameters on the command line are separated by spaces and assigned to symbols p1, p2, .., p9. To translate these symbols inside the command file, surround them by single quote characters. An example: spawn grep 'p1' *.scl. However this translation can only be done in lines with commands, not in lines containing input data to commands which ask for values. If a parameter being passed from the command line contains spaces, then it must be surrounded by double quotes ("), also if it's a filename that contains forward slashes (/). If the parameter contains double quotes itself, they must be doubled, but this will occur rarely. It's possible if a whole Scala command is passed as a parameter.

Warnings: Do not invoke command files from other people without checking them first, they could contain malicious code. You can read them with the TYPE command. Remember that command files have the same control over the operating system as the user.
Also do not invoke command files from within themselves or create endless loops otherwise, because the program will then consume all available memory and stop, losing any unsaved scales. Nesting invocations of other command files inside command files can be done to a maximum depth of 10.

If ECHO is the first command in a command file, then the echo text will be displayed as the description with the command DIR *.cmd.

This is a link to the list of presupplied command files.

```   @list-file
```
An @ can also be used in front of a filename, where a file mask can be given. The given name must be the name of a file with a list of filenames inside, one on every line. The default extension of such a list file is '.lst'. The default extension for filenames in a list file is '.scl'. The commands for which it can be used as parameter are COMPARE, DIRECTORY, ITERATE and LOAD/ALL. A set of scales can be defined this way, for instance you could make list files with scales of different categories. Use any text editor, or the Scala commands COMPARE/SAVE_LIST or DIRECTORY/SAVE_LIST.

\$

A \$ preceding a natural number smaller than or equal to the number of pitch memories can be used wherever the user enters a pitch. It means that the value of the corresponding pitch memory will be taken instead of a literal value. The highest pitch memory is set in scala.ini (default 10). A \$ preceding any of the following letters can be used as a synonym wherever a pitch is entered.

 a : apotome 113.69 cents b : breedsma 0.7212 cents c : major diesis 62.57 cents d : minor diesis 41.06 cents e : base of natural logarithm (e) 1731.23 cents f : golden section (phi) 833.09 cents g : gamelan residu 8.43 cents h : Harrison's comma 50.72 cents i : silver ratio 1525.86 cents j : bronze ratio 2068.41 cents k : syntonic comma 21.51 cents l : limma 90.22 cents m : MIDI Tuning Unit 0.0061 cents n : Pythagorean-19 comma 137.15 cents o : Fokker's semicomma 10.06 cents p : Pythagorean (ditonic) comma 23.46 cents q : diaschisma 19.55 cents r : ragisma 0.40 cents s : schisma 1.95 cents t : Temperament Unit 0.0326 cents u : undecimal kleisma 4.50 cents v : septimal schisma 3.80 cents w : Würschmidt's comma 11.45 cents x : major chroma 92.18 cents y : kleisma 8.11 cents z : pi 1981.80 cents

See also % for symbols beginning with a %-character and help for expressions.

%

A % preceding an integer number can be used wherever the user enters a pitch. It means that the value of the corresponding degree in the current scale will be taken instead of a literal value. The degree may be outside the scale, a negative value is also allowed, which will give a value properly offset by a number of formal octaves. One step interval values from the current scale can be obtained by using %% followed by an integer.
For pitches or intervals from other scale memories, append another %. For example degree 3 of scale 1 will be: %3%1. Interval 3 from the current scale is %%3 or %%3%0. Other symbols are:

 %n : the formal octave (pitch of highest degree) of the current scale, or of another scale if written like %n%1. %%n : the last one step interval. %g : the formal fifth or generator of the current scale if it has Myhill's property, or of another scale if written like %g%1. The generator with the lowest scale degree will always be given. If the current scale is an equal temperament, then its step size is returned. In all other cases the result is 1/1. %c : the chroma of the current scale if it has Myhill's property, or of another scale if written like %c%1. The chroma is the difference between any pair of intervals of the same interval class. In all other cases the result is 1/1. %i : scale degree i of the current scale where i is the i-th iteration while executing ITERATE/KEY, ITERATE/INV_KEY, ITERATE/FLOATS_ONLY, ITERATE/RATIONAL, ITERATE/REPEAT or ITERATE/SCALE. It can be from another scale if written like %i%1. If you want to use %i for a number sequence, use the HARMONIC command to create such a scale. When executing ITERATE/REPEAT then %i is the i-th iteration but a start value other than 1 can also be given. Remember in this case it still represents a scale degree i. %i can also be used as a scale number for example with the COPY command, or as input for a scale degree number. %%i : one step interval i of the current or other scale. %si : the smallest interval between consecutive pitches of the scale. %li : the largest interval between consecutive pitches of the scale. %ai : the average interval between consecutive pitches of the scale.

The symbol n or N can be used to get the number of notes which can be entered where a scale degree or an amount of notes is the parameter. Also an integer can be subtracted or added (without spaces in between), like n-2 or n+1, but the result should of course be in the allowed range for the parameter.
See ECHO for a list of lexical functions which can be evaluated in ECHO text output.
See FILE for functions useable for the output filename. See \$ for symbols beginning with a \$-character and help for expressions.

[ ]

A pitch expression surrounded by square brackets gets the value of the nearest pitch in the current scale. It can be used wherever the user enters a pitch. The range of the scale is octave extended, so for equal temperaments the number of notes is irrelevant. Warning: if the current scale is not in ascending order then a wrong value may result for degrees outside the scale range. See also help for Expressions.

:=

Assign the result of an arithmetical pitch expression to a pitch memory or scale degree. The left hand side must be a number preceded by a \$ or a % for a pitch memory or scale degree respectively. The right hand size can be a pitch expression or arithmetical expression as described under CALCULATE. See help of \$, %, Expressions. It does not provide extra functionality but is there for syntactic convenience.
The command CALCULATE/NOOUT 3/2+5/4 is equivalent to \$0 := 3/2+5/4.
The command COPY/PITCH \$0 1 is equivalent to \$1 := \$0.
With REPLACE there are two differences. One is that when := is used, this cannot be undone with UNDO. The second is with the latter, the position may be one higher than the number of notes, so := can also be used instead of APPEND. REPLACE 7 3/2 is equivalent to %7 := 3/2.
REPLACE/INTERVAL 7 25/24 is equivalent to %%7 := 25/24. It can also be used to replace pitches in other scales, as such: %7%1 := 3/2.

!

A ! at the beginning of a command line from user input or a command file or parameter file will cause the line to be ignored.

?

A line with only a question mark in a command file will cause the input of a parameter or part of a command line to be input from the keyboard instead of the command file itself. See @.

If two question marks are put inside a command file at the beginning of a line following a command requiring user input, this will cause the rest of the user input for this command to be queried directly, instead of read from the command file. Commands like INPUT and CPS for example have a variable amount of input lines. In these cases ?? can be used because with a single question mark the amount of input would have to be known in advance.

Scala is the word for scale in Italian (scalae is Latin for ladder). In Dutch it stands for "a wide range" of things, usually possibilities. This is what the program hopes to offer, a large amount of functions to suit most needs of both beginners and experts, being useful for composers, musicians, researchers, instrument makers, etc.

Scala was written in the programming language Ada. It makes the code very readable and maintainable with very few bugs. Which saves me lots of precious time. If you find a bug nonetheless, please report this with an accurate description of what you were doing and which type of computer you are using to the author (Manuel Op de Coul) via e-mail at coul@huygens-fokker.org.
If the program ends with an exception (error message), then please e-mail the whole text of the exception message. Suggestions for improvements are also welcome.

The first GUI-version was 2.0 and it is made with the Gtk+ toolkit.

Currently there are versions of Scala for Microsoft Windows, GNU/Linux and Mac OS X.

Disclaimer: Scala is freeware without warranty and may not be sold, modified or distributed for sale or in combination with commercial products.

Commands

Commands are entered as follows. First comes the command verb, which may be abbreviated to the smallest unambiguous length. Then zero or more qualifiers follow which must each be preceded with a slash (/) and may also be abbreviated. Then zero or more parameters follow to be separated by at least one space. Any nonoptional parameters which are omitted are prompted for. The maximum length of the parameters combined is 1024 characters. Qualifiers always precede parameters. See also Qualifiers.

The cursor up and down keys can be used to cycle through the previously entered commands. Size of the history is 50 commands. It can be cleared with CLEAR/COMMANDS. Invalid commands are not stored in the history.

This is a link to the list of all commands.

Errors

When a wrong parameter value is entered by the user, this is indicated with the message Illegal parameter. Sometimes a more specific message is given, like Illegal generator value or Illegal directory etc.

When an operation inserts more notes in a scale than the maximum size in file scala.ini allows, then the message Overflow in scale size is given. When a scale is empty, and an operation expects a non-empty scale, then Scale is empty is given.

Numeric overflows abort the running operation and produce the message Computation error. These will never produce wrong or meaningless results. Nor will they abort the program, unless there is a bug (thanks, lady Ada).

Bugs may cause the program to abort with an exception. If this happens, please e-mail the whole text of the exception message and which operating system you are using to the author at coul@huygens-fokker.org.
The current scale will then be saved in the directory where Scala was installed, with name saved.scl.

Expressions

Pitch expressions can be:

• A literal value, see help of Pitches.
• A value that begins with \$: a pitch memory, see help of \$.
• A value that begins with %: a scale degree, see help of %.
• A value that begins with %%: a scale interval, see help of %.
• A value inside square brackets: the nearest scale degree if in ascending order, see help of [. This value can itself be an expression so for instance this is allowed: [\$0].

Functions for converting values into text output are available for the command ECHO.

For regular search expressions, see Patterns.

Interruption

The execution of a command can be interrupted by clicking the Stop button or pressing F5 (GUI-version) or pressing Ctrl+C (console version, pre 2.0). This does not end the program, only the last command. It may take a short while before the actual interruption occurs.
To cancel a long output, either click the Stop button or press F5 or type 'q' followed by enter when the program asks to hit the enter key when it is pausing to scroll.

Introduction

Recipe for new users to retune their synthesizer or sampler. For synthesizers or samplers without tuning table and soundcards, see below.

• Connect the MIDI-input of the synthesizer to the MIDI-output of the computer.
• Allow the synthesizer to be retuned (i.e. set microtuning on, set memory protection off, or things like that).
• Set the MIDI receive channel of the synthesizer on 1 or omni.
• Run Scala.
• On Windows, try if Megamid runs by typing the command "spawn megamid". Then click the Settings button in Megamid and set its output device to the computer's external midi-port. On other systems, or if you prefer letting Scala send MIDI files, edit the send.cmd file, or go to Edit: Options:MIDI:MIDI Player.
• Type "show synth".
• Look which is the number for your synthesizer. If it's not listed, you are out of luck unless it supports the MIDI Tuning Standard, or unless you are able to add the proper system exclusive codes to the file synth.par.
• Type "set synth <number>" where <number> is the above number.
• We are going to create the so called Bohlen-Pierce scale, type: "equal 13 3". This means divide the interval 3 (or 3/1 or 1902 cents which is a perfect twelfth) into 13 equal sized steps.
• We can look at the pitch values in cents of the scale notes, type: "show", or "sh" is enough. Commands can be abbreviated.
• To verify if you can successfully tune your synth into the scale we just created, do SEND/SCREEN. If none of the lines are marked with a star, then it is okay.
• Type "@send". It may take a few seconds to transfer the scale to the synthesizer.
• Play the synthesizer to check if the scale was successfully transferred.

What if it didn't work?

• Scala said Current synthesizer type undefined.
You forgot to do the SET SYNTH command.
There needs to be a file send.cmd in the current directory. Either Scala was not invoked from the working directory, or the file is missing.
• There was a message on the screen that went away quickly. It may have been something like Bad command or filename.
Then the MIDI file player can't be found in the working directory or along the directory path.
• The synthesizer indicates a buffer overflow.
Edit the file send.cmd and change the player to another one which can slow down the MIDI transfer rate.

With a PC soundcard or softsynth:

• First determine if the soundcard or softsynth supports the MIDI Tuning Standard. Most likely however it won't.
• Run Scala.
• Type "show synth".
• Look which is the number for your soundcard or softsynth. If the MIDI Tuning Standard is supported then type "set synth 107".
• If you have a Korg OASYS card for example, type "set synth 110".
• We are going to create the so called Bohlen-Pierce scale, type: "equal 13 3". This means divide the interval 3 (or 3/1 or 1902 cents which is a perfect twelfth) into 13 equal sized steps.
• We can look at the pitch values in cents of the scale notes, type: "show", or "sh" is enough. Commands can be abbreviated.
• Type "send/file bohlen". This creates a tuning file bohlen.mid, or in case of Korg OASYS, a file bohlen.txt.
• If you have a Korg OASYS card, tune it by using bohlen.txt, otherwise play the file bohlen.mid with a sequencer (Cubase for instance) or a MIDI file player (Megamid, Winamp) or MIDI file renderer like Timidity.
• Now play music via the soundcard.

For soundcards and synthesizers without a tuning table:

• The option that remains is to use MIDI pitch bend commands in the MIDI file. To produce such a MIDI file from a score file, read the instructions in the help file. Start Scala and type HELP EXAMPLE. Then use the command EXAMPLE. Another possibility is to retune an existing MIDI file. For this to be possible, the MIDI file should not use too many different voices (program numbers) at one time. Exactly how many also depends on the number of simultaneous notes. Start Scala and type HELP EXAMPLE. Then use the command EXAMPLE/MIDI.

Playing directly from Scala to a MIDI device can also be done since version 2.03 with virtual keyboards on the screen. This is useful for experimentation, not so much for actual playing. Very useful is the possibility to relay MIDI messages from input to output while Scala retunes them in real-time via pitch bends or MIDI Tuning Standard messages.

Mappings

Keyboard mappings determine the allocation of scale degrees to keys on a MIDI keyboard, or MIDI note numbers in general. They are automatically used when you tune a synthesizer with the SEND command, retune a MIDI file with the EXAMPLE/MIDI command or create a sequence file with the EXAMPLE/CREATE command. They can also be created by using an external text editor, and the file type should be '.kbm'. They are activated by the command LOAD/MAPPING. An example template file is example.kbm. It contains various parameters on the first few lines and then the mapping defined by scale degrees for consecutive keys. For instance if it is 0, 1, 2, 3, etc., then it will be an ordinary linear mapping. 0, 2, 3 would mean degree 0 will be on the first key (which is the given middle note), degree 2 will be on the second key, degree 3 on the third, etc. Scale degrees may be assigned to more than one key or to no key at all. This is useful for octave-based scales with less than 12 notes so gaps in the key row can be filled with duplicate notes. With scales containing notes that are alternatives for each other, unused alternatives can be left unmapped. When not all scale degrees need to be mapped, the size of the map can be smaller than the size of the scale. Otherwise it would of course need to be at least the same size as the scale, or zero for a linear mapping.
With nonstandard keyboards, mappings can be made that do not repeat, so all keys can be assigned individually, see example file 128.kbm. If a certain key is not to be tuned, an 'x' must be placed instead of a number. See also SHOW MAPPING, CLEAR/MAPPING, DIRECTORY/MAPPING, KEY/MAPPING and SELECT/MAPPING. This is an example mapping:

```! Template for a keyboard mapping
!
! Size of map. The pattern repeats every so many keys:
12
! First MIDI note number to retune:
0
! Last MIDI note number to retune:
127
! Middle note where the first entry of the mapping is mapped to:
60
! Reference note for which frequency is given:
69
! Frequency to tune the above note to (floating point e.g. 440.0):
440.0
! Scale degree to consider as formal octave (determines difference in pitch
12
! Mapping.
! The numbers represent scale degrees mapped to keys. The first entry is for
! the given middle note, the next for subsequent higher keys.
! For an unmapped key, put in an "x". At the end, unmapped keys may be left out.
0
1
2
3
4
5
6
7
8
9
10
11
```
In Scala version 2.0 and higher, mappings can also be created and edited using the Edit:Edit mapping menu. The middle MIDI note (see SET MIDDLE) and the reference pitch (see SET MAP_FREQ) can also be set in the Edit:Options dialog in the MIDI tab. Furthermore the mapping is also used for real-time MIDI relaying (Tools:Microtuning MIDI Relay). There there are two ways to use them. Normally, with a single mapping to be used for one input channel or all (Omni). Or, with a multichannel mapping which consists of a set of single mapping files with the same name followed by an underscore and a MIDI channel number from 1 .. 16. For example, if map_1.kbm, map_2.kbm and map_3.kbm are present in the same directory as the filename given (either one of those) then they function independently for MIDI input channels 1, 2 and 3 and messages from other channels will not be mapped, therefore ignored. This is useful if you stack multiple keyboards or have a microtonal keyboard which uses multiple channels to overcome the 128 note number limitation.

Patterns

Regular expression patterns can be used to match names or text with the following commands: CHORDS/ALL_SHOW, CHORDS/MATCH, DIRECTORY/DESCRIPTION, DIRECTORY/FIND, FRETBOARD/CHORD, FRETBOARD/MODE, LOAD/CHORD, MODE, SHOW ITEMS and SHOW NOTATION.
Matching is case-insensitive. If patterns consist of more than one word, they must be surrounded by double quotes ("). The following special characters are recognised in the pattern:

 * : matches any string of 0 or more characters. ? : matches exactly one of any character. [char char ...] : matches any character listed. [^char char ...] : matches any character not listed. [char-char] : matches any character in given range. {str, str, ...} : alternation (matches any of str). Some example search patterns: meantone : the literal string "meantone" [dh]e[kx]any : a string beginning with a d or h followed by an e followed by a k or x followed by "any". [^aeiou]??????ing : a ten-character word starting with anything but a vowel and ending in "ing". [1-9] : characters in the range from "1" to "9". \? : the literal string "?"
Literal characters which must be preceded by a \ are \()[].*+?^ .
Filenames are matched by the operating system and may have different pattern matching rules.

Pitches

The representation of a pitch can be either a floating point value (shown in cents or as a factor) or a ratio. The program uses composite arithmetic, which means that rational values are tried to be kept in rational form. If not, when an operation gives a numerator or denominator that is too large, then the representation is switched to floating point. This also happens with operations acting on combinations of rational and floating point pitches. There is no automatic switching back from floating point pitches to rationals, but there are commands to achieve this. Operations will never produce junk numbers. Negative pitch values (frequencies of antimatter instruments) are not supported.
Important: where a pitch is entered by the user it may be given as a rational or in cents. If a value entered contains a decimal point, it is interpreted as a value in cents, otherwise not (even if it's zero), unless explicitly stated in the help text. Floating point values may not start with a decimal point, i.e. there is no implicit leading zero. They may however end with one. Rational values can also be given in prime-vector notation, a list of exponents of the primes (2, 3, 5, 7, 11, etc.). This notation must begin with '|' and end with '>'. This for example represents 81/80: |-4 4 -1> but fractional exponents may also be used: |1/2> is 600.0 cents.
This prime-vector notation cannot be used in the CALCULATE and := operations since '|' has another meaning there. It can be used in sequence files (EXAMPLE input files).

There is a number of pitch memories to hold values outside a scale. They are numbered 0 and higher, and are referred to with the \$-sign (see help of \$). Their amount is set in file scala.ini (default 10), and can be shown with SHOW SETTINGS. They can be assigned with the := operator. The contents can be examined by CATALOGUE/PITCH. The program stores results of calculations in pitch memory 0 and sometimes 1. The initial value of memory 0 is 3/2 and 1/1 of the others.

Qualifiers

Qualifiers alter the action of a particular command. They are preceded by a slash (/) and may be abbreviated like commands. On the command line they immediately follow the command verb and precede the parameters, if any. Commands with qualifiers may have different parameters than the command without them. If so, this is indicated. If a parameter contains slashes, because it is a filename for instance, then it must be surrounded by double quotes ("). Qualifiers can often be combined if their meaning is independent. Three is the highest amount.

Scales

A scale consists of zero or more pitches. The terms pitch, note, tone and scale degree are being used interchangeably here.
The value of the first note (degree 0) is always 1/1 or 0 cents. The last note (with the highest degree number) of a scale serves as the formal octave. The terms octave, formal octave, period and interval of equivalence are also used interchangeably. IMPORTANT: Scala never assumes you are using the value 2/1 or 1200 cents as the period or interval of equivalence. Never omit this value from the scale if you intend to have it as the octave. Of course you can use any other value too. This value is so important because notes can be used outside the range of degrees from 0 to the last degree. Octave equivalence is always assumed but it's up to you to use it or not as scales can be made arbitrarily large.

The size of scales (number of notes) is bounded, but the maximum size is configurable. The same goes for the number of scales. Both values Max_Scale_Size and Scale_Count are set in file scala.ini, and can be shown with SHOW SETTINGS.

Scale memories are numbered starting with 0 which one is called the current scale. It is always the default scale upon which commands act. Most commands can also act on other scales than the current one. Commands that don't change scales can take scale filenames as well as scale numbers as parameter when the parameter is "scalenr." Then the given file in the current directory will be used for the command, or if it does not exist there Scala tries to find it in the install directory. SET DESCRIPTION can also change the description inside a file if a filename is given to it.

Concerning scales which are generated by a fifth, we use the terms fifth, formal fifth and generator interchangeably.