[Scala logo]

Scala help

This help file belongs to Scala version 1.7.

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.

If you are looking for an operation that is not described in this file then look in the list of supplied command files.

To navigate through this page, there is a list of help items.


ADD

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 params.par (default 10), and shown with SHOW SETTINGS. Instead of a scale number, a filename may also be given.
   /ADD
Instead of multiplying the pitches, take the summation tones.
   /MEDIANT
Instead of multiplying the pitches, take their mediant value, i.e. (num(a) + num(b)) / (den(a) + den(b)). All pitches must be rational.
   /SUMMATION
The current scale is replaced by a scale with all sum tones of the current or given scale. If the number of notes in the given scale is n, then the size of the new scale will be n * (n + 1) / 2 - 1, but less if there are duplicate sum tones. For example, if the given scale has pitch factors 10:12:15:20 (or 1/1 6/5 3/2 2/1), then the new scale will be 22:25:27:30:32:35. 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 params.par (default 100). See INSERT to insert a new pitch at another degree than after the last one.
   /FACTOR  factor  [scalenr.]
Interpret the pitch parameter as a linear factor and not as cents when it has a decimal point.
   /INTERVAL  interval  [scalenr.]
Specify the interval with the last degree instead of the absolute pitch.
   /SCALE   scalenr.
Multiply the pitches of the given scale by the formal octave of the current scale and add them to the current scale. Instead of a scale number, a file name may also be given. 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 used in harmonicity calculations. If the given parameter is not a prime number, then the next higher prime will be the limit. If no parameter is given, then the prime limit set with SET LIMIT is effective.
The prime count is set up in params.par (default 8 which is 19-limit). You can combine all of the following qualifiers.
   /CONSTRAINED
Replace only when there exists a fraction whose
   /FLOATS_ONLY
Replace only the floating point pitches (those given in cents) in the current scale.
   /WEIGHTED
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, ERLICH, EUCLID, GRADUS, HARMON, MANN, TENNEY, TRIANGLE, TR_LOG, VOGEL, WILSON) and not CENTS for example. If HARMON is chosen, the absolute inverse of it is taken into the weighed sum. If the weighting factor is higher, then the attribute value weighs more and the pitch difference less. The absolute pitch difference is weighed in cents.
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 /CONSTRAINED, otherwise the computation time will be too long.
   /INSERT  pitch  [highest-prime]
Insert all approximations to the given pitch in the current scale. All the same constraints of /CONSTRAINED apply here. SET MAXDIFF must be done because the initial value of 0.0 does not mean no maximum difference here, but literally 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. If more approximations are found than the maximum scale size, then "Overflow in scale size" will occur.


ASSUME

ASSUME  scalenr.
Make floating point pitches of the current scale into rational ones if the same pitch is present in the given scale as a rational value. This only happens if the values are exactly the same.
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 APPROXIMATE and UNRAT.
   /COMBINATION
Also compare the combinations (product and quotient) of the pitches in the given scale. Many more rational values can be found this way. Note that this may also find extra rational values if applied to the current scale itself (scalenumber 0) if it is partially rational.


AVERAGE

AVERAGE  pattern
Replace each pitch in the current scale with the geometric mean of that pitch with the pitches given by the relative offsets in the given interval pattern. 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 meantone scales, AVERAGE 7 may be a useful operation.


BISTEP

BISTEP  scalenr.
Modify a scale in such a way that the least-squares difference with the nearest pitches in another scale is minimised. The current scale to be modified must have exactly two different interval sizes between consecutive pitches. 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.
If the scale structure is Pythagorean, 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.
   /UNIQUE
As above but if the given scale has less pitches than the current scale, or if it has pitches that are closest to more than one pitch in the current scale, 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.
   /MATCH  pitch
Instead of a scale to approximate, give one pitch that must be matched in the scale. This is the same as using BISTEP/UNIQUE with the given 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.


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
* : power (right operand is pitch)
^ : power (right operand is linear value)
\ : root
| : reduction (divide the left by the right operand until the result is smaller than the right operand)
plus : summation
div : logarithmic ratio (left and right operand must have the same sign)
abs : if the right operand is smaller than 1/1, take the reciprocal
lin : specify that right operand is linear value
min : subtraction (see below)

Furthermore parentheses may be given to influence the order of evaluation. It calculates the result and shows it in various units. The result is stored in pitch memory 0. The order of precedence of operations is first 'lin', then ^, then * and \, then |, then +, -, 'plus' and 'abs'. 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.
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 must not be negative.
A special operation is:
min : subtraction
When not between parentheses, it can be used only once in an expression and has lowest precedence. The result is given as a frequency difference. The given frequency is relative to the base frequency of SET FREQUENCY. Example: 3/2 min 700.0. To use subtraction in an expression, put it between parentheses.
Extra units in which the result is expressed are stored in parameter file calcval.par and may be altered as wished. Note names can be given at the end but it is not default. See also SET CALC_OUTPUT.

   /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.
   /NOOUTPUT
Store the result in pitch memory 0 only and do not show the result. 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 for attaining one exactly just interval. 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, some value can be entered like 1 or 12. Then the formal octave is asked, usually this is 2/1. Then the degree for the fifth is asked, again for hinting the number of fifth steps. Hit return for taking the nearest equal tempered degree. 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. Subsequently for each one the pitch is entered, the number of steps to approximate it (for the fifth this is one) and 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. For downwardly stacked fifths, enter a negative value for the number of steps. The result is shown plus the difference with the given formal fifth.
The result is also stored in pitch memory 0, so it can be used with the PYTHAGOREAN 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
This qualifier cannot be combined with /FACTOR.
See also EGALIZE/MODEL.
   /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


CATALOGUE

CATALOGUE  [start]
Show size (number of notes) and formal octave of all nonempty working scales and the pitch memories. If the start parameter is given, then 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 scale copies and pitch memories is set in the file params.par.
   /PITCH
Show all the values in the pitch memories.
   /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. With no parameter, the current directory path appears on the screen.


CHORDS

CHORDS  first-number  last-number  [size]
Shows the approximations in the current scale to all just chords between the given two harmonic numbers. The size parameter is the number of notes in the chords. The default value is 3. The minimum value is 2. 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 inverted chord is given too. For example if first-number is 3, last-number is 6 and size is 3, then the chords 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. So 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.
   /MATCH  [position-or-name-pattern]  [chord-size]
Show occurrences of chords in the current scale. The chords searched are from the chord list in file chordnam.par, which must be present in order for this command to work. If the chord-size parameter is given, only chords of chord-size tones will be matched, otherwise chords of any size will be matched. If the parameter is negative, then it means that chords with at least that positive size will be matched.
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, this will result in a repeated matching of the same list of chords. In that case, use CHORDS/MATCH 0 to only match chords starting from the first tone of the scale, 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. If the name pattern consists of more than one word, it must be surrounded by double-quotes ("). The following special characters are recognised in the pattern:
* : matches zero or more of any character.
% : matches exactly one of any character.
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.
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. 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. See also SHOW LOCATIONS.
   /ALL_SHOW  [name-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. Can not be combined with other qualifiers.
   /CENTS_SHOW  [name-pattern]  [chord-size]
As above, but shows the intervals of the chords in cents, relative to the first note. Can not be combined with other qualifiers.


CLEAR

CLEAR  [scalenr.]
Empty the given scale. Default is 0 (current scale).
   /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 scales). Warning: This cannot be undone with UNDO.
   /MAP
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 just before EXIT.


CLS

CLS
Clear the screen.


COLLAPSE

COLLAPSE  [interval-class]  [scalenr.]
Replace the current or given scale with its set of unique 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. This reduces an equal tempered scale to one note because it only has one unique interval size for an interval class. This command can among others be useful prior to FIT. If this command is repeated, it gives an effect similar as EUCLID does.
   /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.


COMPARE

COMPARE  [file-mask]
Compare the current scale with all scales in memory and subsequently with files in the current directory that satisfy the file mask. For a match the scales must have equal size, and their successive intervals must be equal, but the key does not have to be equal. The key for which the scales match is displayed. See also KEY. Also if the successive intervals in reverse order are equal 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 so, if this is a known mode, then its name is given.
If instead of a file mask, the size of the current scale is given, there will be no check for subsets.
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. Often they will belong to the same scale file. Then 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 of the two scales will be considered. If all comparisons were equal for scales with any size, then "idem" will be written.
See also SHOW DIFFERENCE.
   /MEMORY_ONLY
Compare the current scale only with all scales in memory.
   /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.
   /SUPERSET
Also indicate the cases when the current scale is a superset of the scales it is compared with.
   /PITCH  pitch  [file-mask]
Search for the given pitch in the files that satisfy the file mask. The scale degree where the pitch was found is given and the size of the scale. Can only be combined with /SAVE_LIST in which case the list file is named search.lst. Use this list file with '@search'.


CONVERGENTS

CONVERGENTS  factor
Show the convergents (continued fraction) of a nonnegative linear factor. 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.
If you want the parameter to represent a pitch value, use CONVERGENTS/CENTS or CONVERGENTS/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 %). 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 semiconvergents in the second column.
   /CENTS
Show the convergents and interpret the factor as being a cents value. A rational number will also be taken as a cents value.
   /LOGARITHMIC
Take first the binary logarithm of the given factor and then show the convergents. It must be 1.0 or larger. For a pitch memory or scale degree it is the same as /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 scale copies is set in params.par. 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 params.par (default 10). See also help of :=.


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. 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. This qualifier can not be combined with /FACTOR and /PRIMES.
   /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 not be combined with /EXPANDED, /STELLATED and /SUPERSTELLATED.
   /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. Cannot be combined with /CORNER, /STELLATED and /SUPERSTELLATED. 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 a tetrahedron, 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 oneself afterwards. The tonic by default is 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.
Cannot be combined with /CORNER, /EXPANDED and /SUPERSTELLATED.
   /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.
Cannot be combined with /CORNER, /EXPANDED and /STELLATED.
   /FACTOR
Create a Combination Product Set by giving the generating intervals as linear factors which need not have a period. This qualifier is not allowed in combination with /PRIMES and /SCALE.
   /PRIMES
Create a Combination Product Set from a set of prime numbers. First is asked Enter number of factors to select from: and Enter combination count:. Subsequently the first factor must be entered which must be an integer number and then the number of primes to be skipped each time for the next prime to be taken. For instance if the first is 3 and then 2 are skipped the next prime will be 7. With 0 the same prime is used again, and with 1 the next prime is taken. Can not be combined with /SCALE and /FACTOR. <


DELETE

DELETE  position  [scalenr.]
Delete the pitch 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. If degree 0 with the value 1/1 is deleted, then all pitches shift downward by the amount of degree 1. See also INSERT.
   /START  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.
   /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.
   /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.
   /SMALLER  pitch  [scalenr.]
Delete all pitches from the current or given scale that are smaller than the given pitch.
   /FLOATS
Delete all floating point pitches from the current scale. There is no parameter.
   /MODEL  scalenr.
For each pitch in the given scale, the nearest pitch from the current scale will be deleted. The formal octave will not be deleted. Instead of a scale number, a filename may also be given. See also SELECT/MODEL.
   /EGALIZE
There is no parameter. Deletes one pitch from the current 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 not be deleted.


DIFFERENCE

DIFFERENCE  scalenr.  [scalenr.]
Remove pitches that are both in the first scale and the second scale from the second scale. If no second parameter is given, it will be the current scale. 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.


DIRECTORY

DIRECTORY  [file-mask]  [scale-size]
Present a directory of the files that satisfy the given filename pattern. If it is omitted, the file mask will be *.scl. It will show the scale size and first part of the description with the name. 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 given. The scale size 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 are given.
   /NAME_ONLY  [file-mask]
This will only display the filenames, which is quicker. Scales cannot be selected by size, only file mask.
   /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 given instead of a filename mask. For instance to do a much quicker compare against these files, or to load them all into memory, or to invoke an operation on all of them using ITERATE.


DISCARD

DISCARD  margin
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 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
   /SMALLEST
Use as margin the smallest interval of the scale. There is no parameter. This is equivalent to doing DISCARD %si. To see what is the smallest interval SHOW DATA can be done. Cannot be combined with /EQUAL.
   /EQUAL  interval
Delete from all intervals in the current 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. Cannot be combined with /SMALLEST.


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 given as a ratio. Only one permutation of each division is given; the interval sizes are in descending order.
If a lower bound is given, divisions containing intervals smaller than that are not shown. It may only be given as a ratio.
   /FIND  interval  [octave]  [maximum-difference]
Show the equal tempered divisions of the given octave wherein a scale degree approximates the given interval. If the octave parameter is not given, 2/1 is the default. 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 in cents or as a ratio, then all divisions will be given with a deviation less than the one given.
Note that 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 intervals with a division, use the command FIT/MODE. The octave needs to be present in the scale then. To create a given equal temperament use the command EQUALTEMP. To find a least-squares approximation of more than one pitch, use the command FIT.
   /ALLFIND  interval  [octave]
As above, but show all successive equal tempered divisions.
   /CONSISTENT  interval  [octave]  [maximum-difference] 
As /FIND, but instead of the best direct approximation, the best consistent approximation is given. The given interval must be rational. 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 usually gives a different result than the direct approximation.
If no maximum difference parameter is given, then all divisions will be shown. Example: to see in which equal temperaments the syntonic comma vanishes, do DIVIDE/CONSISTENT $k, and see for which ones it has zero steps. See also QUANTIZE/CONSISTENT and EQUALTEMP/DATA.


DOUBLE

DOUBLE  [interval-class]  [expansion]
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.
The qualifiers select the pitch-averaging operation. Geometric mean is the default. Qualifiers cannot be combined. See also SAMPLE.
   /GEOMETRIC
Uses the geometric mean, i.e. sqrt(a * b). This divides an interval equally.
   /HARMONIC
Uses the harmonic mean, i.e. 2 * a * b / (a + b). Densifying a scale by inserting harmonic or arithmetic means is also known as katapyknosis.
   /ARITHMETIC
Uses the arithmetic mean, i.e. (a + b) / 2. Densifying a scale by inserting harmonic or arithmetic means is also known as katapyknosis.
   /SUBC_HARMONIC
Uses the subcontrary to harmonic mean, i.e. (a^2 + b^2) / (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).
   /RMS  [interval-class]
Uses the root mean square, i.e. sqrt((a^2 + b^2) / 2). Specifying another expansion factor is not allowed.
   /MEDIANT  [interval-class]
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.


ECHO

ECHO  [text]
Writes the given text to the screen. This is useful for displaying text in external command files. 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. 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, MULTIPLE, NOTATION, etc. See also SET ATTRIBUTE.
%bpm(pitch)
Gives the frequency in beats per minute relative to the base frequency.
%cents(pitch)
Gives the cents value.
%factor(pitch)
Gives the linear value.
%hertz(pitch)
Gives the frequency in Hertz relative to the base frequency.
%image(pitch)
Gives the ratio of a rational pitch or cents value of a floating pitch.
%log_fract(pitch)
Gives the number of octaves as a fraction with maximum denominator 999.
%n(scalenr.)
Gives the number of notes in a scale memory.
%name(pitch)
Gives the interval name of a rational pitch.
%note(pitch,notation_system)
Gives the note name according to the given notation system. See help of SET NOTATION for the list of notation systems.
%noteval(note-name,notation_system)
Gives the equal tempered note value according to the given notation system. For systems JI and JI2 it gives the corresponding just value. For notation systems whose name begins with an E and which are diatonic, all accidentals may be used in any combination. See help of EXAMPLE.
%octcps(pitch)
Gives the Csound 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.
%sep_primes(pitch)
Gives the prime factorisation of a rational pitch, not using exponents and excluding prime number 2 (i.e. 3.3.5.7).
%units(pitch,units_per_octave)
Gives the logarithmic value in terms of the given unit.
"pitch" represents a pitch expression, see help of Expressions. To get values from the current scale (number 0), 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 can be employed to write input files for other programs or be used to output user calculated data.


EGALIZE

EGALIZE  factor
Move the pitches of the current 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.
   /MODEL  [scalenr.]  [maximum-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 current scale is just, then the maximum difference should not be less than the comma one wishes to spread out. 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 wise to also include the octave inversions.
A list of the used approximants will be given with the number of times each one was used to be approximated. They may also be floating point values.
Without a given scale, the current scale will be taken. Instead of a scale number, a filename may also be given. If no maximum difference is given, then the value set with SET MAXDIFF will be taken.
Note: it's useful to do this command a second time 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: EGALIZE/MODEL cons_7 225/224.


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. So to create a scale by giving a step size rather than dividing an octave, enter 1 for division, the step size for octave and the scale size as the last parameter.
   /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 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 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.
"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.
See also DIVIDE/CONSISTENT.
If the current scale is an equal temperament, then view its data with the command EQUALTEMP/DATA n %n. See also tips.par with tips about this command.
   /SHORTDATA  division  [octave]  [alternative-fifth]
As above, with the difference that possible diatonic and other subscales are not shown.


EUCLID

EUCLID  iterations
Performs the Euclidean algorithm on the current scale with the given number of iterations and shows the results. 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 scale must have at least 2 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. See also CONVERGENTS.


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. 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 (return for none): for an eventual separate last degree as interval of equivalence. For example to create a genus [33355] enter: 2, 3/1, 3, 5/1, 2, 2/1 and then do NORMALIZE. See also CPS.


EXAMPLE

EXAMPLE  input-file  [output-file]
Create a MIDI-file with a piece of music using the current scale as default scale. The MIDI-file makes use of pitch bend messages for tuning. 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 specified in the input file. If the amount of channels (16 or less) is not sufficient, i.e. there are too many simultaneous notes, then no output file will be generated. The algorithm tries to minimise the number of pitch bend messages in the output file. The instrument to be used must be tuned to 12-tone equal temperament and be using the default standard pitch bend range of +/- 2 semitones.
In the input file you can specify notes, ladders and chords where the degrees of the current scale will be chosen as the nearest representation of 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.
The format of the input file is as follows, see also pbexampl.seq. 0 exclude <channel no. (1..16)> 0 frequency <frequency for degree> [<degree>] 0 division <units per quarter note> 0 velocity <default onset key velocity (0..127)> 0 timesig <num/den> [<MIDI clocks>] [<32nd-notes>] 0 notation <notation system> [<formal octave>] 0 default <filename> 0 load <filename> 0 outfile <filename> 0 equal <division> [<formal octave>] 0 key <degree/pitch/name> 0 transpose <degree/pitch/name> <time> relative <time> track <track no. (1..16)> <time> tempo <microseconds per quarter note/q.n. per minute> [pm] <time> program <program no. (0..127)> <time> parameter <parameter no. (0..127)> [<value>] <time> note <degree/pitch/name> <duration> [<velocity>] <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>] If a zero is indicated as time parameter this means that this field is ignored, it does not mean that the statement must appear at the beginning, except for "exclude", "frequency" and "division". Such a statement may appear anywhere and more than once and its scope is everything that is below until an eventual new statement of the same kind. The zero may not be omitted and is reserved for future use.
The default file extension for scale files in the input file is '.scl' and for the output file parameter it's '.mid'. The input file needs a full name.
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.
   /MIDI  input-file  output-file
Use a MIDI-file as input file. It will be translated into another MIDI-file with an extra track containing pitch bend messages, using the current scale. 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 semitones. 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).
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 (which is likely if two channels use the same program number). 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. For mapping of note numbers to scale degrees the current keyboard mapping is used (see LOAD/MAP and SHOW MAPPING). Only the keyboard mapping's range is ignored, the whole MIDI range is useable. To have a standard mapping, do CLEAR/MAP first (which is the initial situation). The mapping's reference frequency also has influence (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 the middle note in the keyboard mapping).
Two other settings apart from 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 PROGRAM OFF is done first, 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.
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.


EXCHANGE

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


EXIT

EXIT
Leave the program. Under Unix or Linux it can also be left by pressing Ctrl/D when prompted for input.


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. Both power and base may be a fraction or a floating point 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/1. See also MULTIPLY and STRETCH.


EXTEND

EXTEND  size  [scalenr.]
Change the number of notes in the current or given scale to the given size. If the size is smaller than the current size, the degrees above the size are removed. If the size is greater, extra notes are added with respect to the formal octave (equivalence interval) of the scale. If the scale is equal tempered, it will remain so with the same step size.
   /CHORD  interval  add-interval
Checks in the current scale on each degree if the first given interval exists on that degree and then adds the second given interval there if the second interval is absent. The command does only one run, so if the added pitch(es) create new instances of the first given interval, then those will not be considered. This command therefore completes partial triads. The intervals must match within 0.5 cent. Comparisons are made up and down to twice the number of notes in the scale.
For example to complete major triads for each fifth do EXTEND/CHORD 3/2 5/4. To do this for each major third do EXTEND/CHORD 5/4 3/2. See also SHOW LOCATIONS and PRODUCT.
   /CHILDREN
There is no parameter. Adds the Farey child fractions of all rational pitches in the current scale to the current scale. To get the child fractions of the next level, repeat this command.
   /PARENTS
There is no parameter. Adds the Farey parent fractions of all rational pitches in the current scale to the current scale. 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. 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.


FAREY

FAREY  order
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. This is a rational approximation that is different from the method used with APPROXIMATE. See also ASSUME and FIT/HARMONIC. Warning: if the order is high then this takes a lot of 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.
   /FLOATS_ONLY
Replace only the floating point pitches (those shown in cents) in the current scale.
   /MINIMAX
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. Cannot be combined with other qualifiers. See also FIT/HARMONIC.


FILE

FILE  filename
Creates a text file with the given name. Then subsequent program output will be written to the file as well as to the screen. To end this use command CLOSE.


FIT

FIT  [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. 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. See also CALCULATE/LEASTSQUARE.
   /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.
   /MODE  [division]  [scalenr.]
Show the best least-squares fittings of modes of increasingly larger equal tempered scales compared to the current scale, where the octaves are the same. Displayed are: 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. Give a 0 for any division in this case.
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. For any negative value of division, all successive divisions will be shown, instead of only increasingly better approximations. See also MODE.
To fit all modes of the current scale do ITERATE/KEY FIT/MODE. To change the scale into a given mode, use QUANTIZE.
   /HARMONIC  [first-harmonic]  [scalenr.]
Show the best least-squares 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. 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. 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.


FLIP

FLIP  first-prime  second-prime
Exchange for all rational pitches in the current 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.


HARMONIC

HARMONIC  first-harmonic  last-harmonic  [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 it is higher than 1. This value may also be noninteger (>= 1.0), in which case the harmonics will obey this formula : first-harmonic + floor(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 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 MODULATE, FIT/HARMONIC and DOUBLE.


HELP

HELP  [subject]
Give information on the subject. If no subject is given, all help topics will be displayed. Subjects may be abbreviated, like commands and qualifiers. Square brackets indicate an optional parameter. Often the number and meaning of parameters depend on the command qualifier (see help items Commands and Qualifiers). This is the case if in the help texts there are parameters on the same line after the qualifier. If not, then the parameters are the same as for the command without a qualifier, unless explicitly stated that there are no parameters.
The letter H is an abbreviation for this command.


IMPORT

IMPORT  filename
The default qualifier is /JICALC. See also LOAD/UNFORMATTED and LOAD/CENTS which can read text files with linear factors and cents values respectively. SAVE/CENTS does the opposite.
   /JICALC
Converts a JI Calc text file to a set of Scala scale files. For each scale in the file, the description will be displayed and the number of notes. Then a filename will be prompted for to store the scale in. If a file with the same name already exists, then it will be asked if it is to be replaced or another name is wanted. The description of the scale can be changed. To do so, enter an empty filename. Then a new description can be entered, and then the filename again. To skip one scale, enter an empty description and then again an empty filename. To stop converting the input file, press Control-C and the return key.
Lines at the beginning of the JI Calc file will be ignored until a '#' character is encountered at the first line. The lines with key names will be ignored too. If the base frequency is different from 261.625 Hz, then it will be appended to the description when the file is written.


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.
   /INTERVAL
Input a scale by giving the intervals relative to the previous degree. Can be combined with /FACTOR.
   /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. Can be combined with /INTERVAL but not with /FACTOR.


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.
   /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.
   /FREQUENCY  position  frequency
Insert a new pitch by specifying the frequency relative to the base frequency (see SET FREQUENCY and SHOW/FREQUENCY).
   /NEAREST  pitch
Insert a new pitch in the current scale after the highest pitch smaller than the given pitch.
   /LARGEST  interval
Split the largest interval(s) in the current scale by inserting the given interval. The scale may not be empty.


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 MERGE and DIFFERENCE.


INVERT

INVERT  [position]  [position]
Reverse the order of the intervals in the current 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).
   /INTERVAL   position
Exchange intervals pairwise in the current 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.


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. Another example: to compare the current scale against a set of scale files do: ITERATE "SHOW DIFFERENCE 1" *.scl 1.
   /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. The combinations will be consecutively put in the current scale, which will lose its previous contents, and then the command applied. The "parent" scale, if it is another one than number 0, will not be affected. Afterwards, the last combination will remain in the current scale. For quoting the command, see above.
   /KEY  command  [scalenr.]
Will apply the given command to all different keys of the current or given scale. The original key will be restored afterwards. For quoting the command, see above.
   /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.
   /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 is asked for.
   /REPEAT  command  count
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.
   /SCALE  command  [scalenr.]
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.


KEY

KEY  [steps]
Change the key (tonic) of the current 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. 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.
   /ALL
Copy all keys of the current scale to scale memories 1 and further. The current scale itself remains the same. There is no parameter. Warning: all scale memories from 1 until the scale size minus one will be overwritten.
   /EGALIZE
Change the key of the current 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. A parameter may not be given. For rational scales, this operation tends to move the tonic towards the centre of the lattice, depending on the actual primes.
   /MATCH  scalenr.
Change the key of the current scale to make it match that of the given scale as closely as possible. Both scales must have the same number of notes. The sum of absolute differences between the degrees of the two scales is minimised. Instead of a scale number, a filename may also be given.


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 Not all pitches 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 '*' and with a '.' the positions that have a common factor in numerator and denominator and which are present in the scale. Numbers above 75 are not shown. A Partch diamond is usually drawn turned 45 degrees clockwise.
   /LOAD  horizontal-factor  vertical-factor  filename
Create a scale using a 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 zero character must indicate 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  horizontal-factor  vertical-factor  [depth-prime]
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. Any notation system may be chosen, but because the scale has to be rational for the LATTICE command, a useful one 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.
   /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 this:
  * 
 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. Cannot be combined with other qualifiers.


LIMIT

LIMIT  [number]
Change rational pitches into floating point pitches that have a prime limit higher than the prime number given. If the number is 1 then all rational pitches in the current scale will be made floating point numbers. 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 actually change pitches to those of a lower limit, use APPROXIMATE. See also PROJECT.
   /DELETE
Remove the pitches from the current scale that have a limit higher than the number given.
   /ODD
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.
   /MAX_ATTRIB
Delete pitches from the current scale which have an attribute value higher than the given number. The attribute is set with SET ATTRIBUTE. From attribute values which can also be negative, the absolute value will be taken for the comparison. Only attributes which give a numerical value are allowed, so attributes like FRACTION or VECTOR are not allowed and give the message "Invalid argument for operation". INTERVAL and OTHER_SCALE are also not allowed.
Because many attributes can be chosen, 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.
Cannot be combined with other qualifiers.
   /MIN_ATTRIB
Like above, but pitches with an attribute value lower than the given number will be deleted.


LOAD

LOAD  filename  [scalenr.]
Read a scale from a scale file on disk and store it to the given scale number. 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. This works only for scale files. See also IMPORT.
   /ALL  filename  [first-scalenr.]
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 this scale will be the first where a scale is stored, next scales go in subsequent higher memories. A list file can also be used, for example if the list filename is dir.lst then do LOAD/ALL @dir .
The number of available scale memories is set in file params.par. Can only be combined with /CHORD.
   /UNFORMATTED  filename  [first-scalenr.]
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.
   /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. This can be used to write command files for converting tuning files from other programs. See also IMPORT.
   /CHORD  name-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 SHOW MAPPING and CLEAR/MAP. This is an example mapping:
! Template for a keyboard mapping
!
! Size of map (greater than or equal to the number of notes in the scale 
! to be mapped). 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 scale degree 0 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 
! between adjacent mapping patterns):
12
! Mapping.
! The numbers represent scale degrees mapped to keys. The first degree 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
   /PITCH  filename  [first-pitchnr.]
Read one or more pitch values from a text file on disk and store them to the given pitch memory and beyond. The default pitch memory is 0. Pitch memories are used to store single pitch values and hold intermediate results of pitch calculations, not in the context of a scale.
Each line in the file should contain one value. Values with a period are interpreted as cents, other values as a linear ratio. Lines with something else are ignored. The number of pitch memories is set in file params.par.


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.


MODE

MODE  name-pattern-or-mode
Selects a mode 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 then 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. The following special characters are recognised:
* : matches zero or more of any character.
% : matches exactly one of any character.
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.
Example: MODE M.Dorian (after loading or creating a 12-note scale.)

This is a link to the list of presupplied modes.

   /COMPLEMENT
As above but selects the complementary mode from the current scale.
   /CREATE
Create a scale with the given mode. The pattern is matched as above. For each number of steps that is in the given mode, a corresponding interval must be given, as a ratio or in cents. If the scale doesn't come out with the right 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. You can do FIT/MODE afterwards to check which equal division the resulting scale is a subset of. Also both a name and a mode pattern in numbers may be given.
   /FACTOR
Create a scale with the given mode. For each number of steps that is in the given mode, a corresponding factor must be given. These factors are relative and may be given as a ratio or floating point value. To obtain the same mode equal tempered, the same number as the number of steps can be given. Then the octave is asked for. You can do FIT/MODE afterwards to check which equal temperament the resulting scale is a subset of.
   /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 current scale remains unaffected. See also FIT/MODE.
   /ALL_SHOW  [name-pattern-or-number]  [number-of-notes]
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.


MODULATE

MODULATE
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 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. Let f be the frequency of a scale degree and fm the modulation frequency. If the number of sidebands is 2 for example, then f - 2 fm, f - fm, f + fm, f + 2 fm will be added to the scale. Negative frequencies are also added with a positive sign. So if the current 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.
   /GENERATOR  position  [steps]
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
This changes intervals of the current 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 which has no 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 from the circle of fifths. The next parameter is the count downwards for the generator. It has the same function as with the command PYTHAGOREAN. 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 vector orientation of the current scale towards or away from 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 weighted average of the current value and the value in the same degree of the given scale. The scales don't have to have the same size; octave extension is assumed.
The given scale may also be a filename and the factor may be given as a float 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 $.
   /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 extension is assumed. It may not be degree zero.


MOS

MOS
Generates a Moment Of Symmetry from the current scale. The program asks first the generating interval, which must be a scale degree number and have no common factor with the scale size. Then the series index is asked which must be a natural number and indicates which scale in the MOS series is desired. You can do MOS/SHOW or MOS/ALL_SHOW first to see the modes, and decide which index of the series you want. Note that this command deletes pitches from the current scale. See also MODE. MOS and Myhill's property are equivalent. Another way to create a scale with this property is using PYTHAGOREAN. See also FIT/MODE.
   /CREATE
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 scale to give it another formal octave with the command MULTIPLY/ABSOLUTE. See also MODE/CREATE.
   /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. The numbers shown are interval sizes in number of steps. The number of notes of the resulting scale is shown between parentheses. The current scale is not affected.
   /ALL_SHOW  parent-size  [number-of-notes]
As above but show MOS series for all possible generators. If the second parameter is given, only show the MOS with the given number of tones, for all possible generators. The current scale is not affected.


MOVE

MOVE  interval  [first-degree]
Increase the pitches of the current scale with the given interval. The default first degree is 1 (all pitches). If another first degree is specified, only that and subsequent degrees will be altered. It must be greater than or equal to 0. If it is 0, then a new 1/1 note will be inserted. The second parameter can also be combined with /ABSOLUTE, but not with other qualifiers.
   /ABSOLUTE  pitch  [first-degree]
Increase the pitches of the current scale such that the formal octave will become the given pitch value. If another first degree is specified, only that and subsequent degrees will be altered.
   /KEY  degree
Decrease all pitches of the current scale with the pitch of the given degree. The resulting 1/1 of that and possibly other degrees will be removed from the scale. The degree parameter may be any integer value. Cannot be combined with other qualifiers.
   /LENGTH  part
Increase all reciprocal pitches (cf. string lengths) with the given part, including degree 0. 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 be combined with /ABSOLUTE.
   /FREQUENCY  part
Increase all frequencies with the given part including degree 0. This is done by addition. 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 is that intervals become smaller when their frequencies are increased with the same value. Can be combined with /ABSOLUTE.


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.
   /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. The parameter must have the same sign as the formal octave of the current scale, i.e. both larger or both smaller than 1/1.
   /MATCH  scalenr.
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. Instead of a scale number, a filename may also be given. See also PROJECT/MATCH.


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.


PAUSE

PAUSE  [duration]
When no duration is given, prompts for the return key to be pressed. Otherwise, waits the given number of seconds. This is useful for in external command files.


PERMUTE

PERMUTE  [count]
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 scale be left unchanged.
   /EGALIZE
Take a permutation of the scale intervals such that the scale has the minimum deviation from equal tempered with the first pitch unchanged. There is no parameter. By doing repeatedly KEY and PERMUTE/EGALIZE one may find a permutation with a slightly less deviation.
   /GENERATOR  position  [count]
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.
   /MATCH  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.
   /RANDOM
Take a random permutation of the scale intervals. There is no parameter. Each permutation has the same probability. See also SEED.


PIPEDUM

PIPEDUM  [scalenr.]
Create a scale with the lattice in the form of the inside of a parallelepiped (Fokker periodicity block). A number of rational defining intervals must be given, whose prime components represent the homophonic 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 = 3^4.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: enter 2, 2048/2025, 34171875/33554432, 2/1 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 or MOVE.
   /SCALE  [scalenr.]
Does not ask for the defining intervals, but gets them from the current or given scale. Prime number 2 will 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.


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. If the created scale contains pitches below 1/1, they can be deleted with DELETE/SMALLER.
   /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.
   /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 a constant term. Use this qualifier if negative exponents are present. Can be combined with /LOGARITHMIC and /SOLVE.
   /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 fifth of a meantone scale with certain properties (regarding beat rates or otherwise). For other cases, see CALCULATE/LEASTSQUARE. Can be combined with /LOGARITHMIC and with /POWER but not with both. Solving with /POWER is sometimes needed for calculating non-octave equal temperaments with certain beat rate properties.


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 params.par (default 10). See also COPY.
   /PITCH
Copy pitch number 1 to 0, 2 to 1, etc. The current pitch will be lost. The highest pitch memory is set in params.par (default 10). See also COPY/PITCH.


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.
   /ADD
Instead of multiplying the pitches, take the summation tones.
   /MEDIANT
Instead of multiplying the pitches, take their mediant value, i.e. (num(a) + num(b)) / (den(a) + den(b)). All pitches must be rational.
   /POWER
Instead of multiplying the pitches, take the pitches of the current scale to the power of all pitches of the given scale.


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.
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.
   /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 CALCULATE/LEASTSQUARE and MULTIPLY/MATCH.


PUSH

PUSH
Copy scale number 0 to 1, 1 to 2, etc. The scale with the highest number will be lost. The current scale will be unchanged. See also COPY.
   /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.


PYTHAGOREAN

PYTHAGOREAN  [scalenr.]
Create a Pythagorean scale in the current or given scale. The program asks first the scale size and then the formal octave. Next the position of the formal fifth 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 return 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. Subsequently the count downwards, i.e. the number of fifths 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.
Scales which are created by this command are also called linear temperaments. A useful alternative for creating 12-tone temperaments is offered by the command files comma.cmd and comma3.cmd.
   /GIVENBEATS
Like above, but the actual fifths are varied so that they exhibit a constant beat rate, except for the "wolf" fifth at the end of the cycle. The formal fifth must be a rational value. The beat rate to be entered is given in Hertz and 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.
   /EQUALBEATS
Like above, but there is no "wolf" fifth that is different. Instead, the beat rate is calculated to be equal 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.
See also SHOW BEATS. Tip: for a different distribution of beat rates, use KEY or KEY/EGALIZE afterwards.
   /VARIED
Create a Pythagorean scale with regularly varied fifths. It works like above except that an initial fifth size is asked and then an accumulating variation which is added to each subsequent fifth. For instance suppose the initial value 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.


QUANTIZE

QUANTIZE  resolution
Replace all pitches in the current scale with a near multiple of a small interval which is 1200 cents divided by the given logarithmic resolution. The resolution 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.
   /PITCH  step
Provide the step size as a ratio or in cents instead of as an octave division. For instance to quantise in schismas one does QUANTIZE/PITCH $s. This qualifier can be combined with all qualifiers below, except /LINEAR.
   /ROUND
This is the default quantisation method. The nearest interval step is chosen.
   /TRUNCATE
The interval step that is lower than or equal to the pitch is chosen.
   /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.
   /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. See also DIVIDE/CONSISTENT.
   /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.


RATIO

RATIO  pitch  [highest-prime]
Approximate the given pitch with the closest fraction for successive prime limits and show the results. The first fraction is the best 3-limit approximation, the next the best 5-limit, and so on. With the /CONTRAINED qualifier one can limit the search 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 up in params.par. The last approximation is stored in pitch memory 0 and an intermediate one if the command is interrupted. See also APPROXIMATE.
   /CONSTRAINED
Consider only the fractions in which the prime exponents of numerator and denominator do not exceed the limits set by SET EXPLIMIT.
   /NOOUTPUT
Stores the last approximation in pitch memory 0 only and does not show the results.
   /SUPER  pitch
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. Cannot be combined with /CONSTRAINED and /FAREY.
   /CHILDREN  pitch
The given pitch must be rational. Shows the two children of the ratio in the Farey tree, also called Stern-Brocot tree. Can only be combined with /PARENTS. If combined with /PARENTS, then first the parents and then the children are shown.
   /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. Can only be combined with /CHILDREN. If combined with /CHILDREN, then first the parents and then the children will be shown.
   /FAREY  pitch  highest-order  [prime-limit]
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.
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 /CONSTRAINED, then the third parameter must be given which will restrict the ratios found to the given prime limit. Then the Farey order is limited to 5000 and the product of the pitch and order to 20000.
This qualifier cannot be combined with /SUPER. See also CONVERGENTS.
   /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. 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 with combinations of numerators and denominators which are in a given range. The parameters are given in the following order: lower bound numerator, higher bound numerator, numerator step (default 1), lower bound denominator, higher bound denominator, denominator step (default 1). If a step is given, then numbers are skipped if it is higher than 1. For example: If the numerator is in 7 .. 9 and the denominator in 4 .. 6 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 LATTICE/DIAMOND is done after this command, it will show a rectangular diagram, hence the name of this command. See also HARMONIC and SQUARE.


REDUCE

REDUCE  pitch
Divide all pitches in the current scale with 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  filename
Remove the file with the given name from disk. There is no default file extension.


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. See also help of :=.
   /INTERVAL
Replace the interval in the current scale at the given position with another interval. 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.
   /FREQUENCY  position  frequency
Replace the pitch by specifying the frequency relative to the base frequency (see SET FREQUENCY and SHOW/FREQUENCY).
   /NEAREST  pitch
Replace the pitch in the current scale with the smallest absolute difference from the given pitch, 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.
   /LARGEST  new-interval
Replace the largest interval(s) in the current scale with the given new interval. The scale must be non-empty.
   /SMALLEST  new-interval
Replace the smallest interval(s) in the current scale with the given new interval. The scale must be non-empty.
   /EQUAL  interval  new-interval
Replace the given interval(s) in the current scale with the given new interval. The scale must be non-empty. See also EXCHANGE/EQUAL.
   /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 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 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 contains a certain name can depend 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.
For the list of notation systems, see 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.


REVERSE

REVERSE
Reverse the order of all pitches in the current scale. To take the reciprocal of all pitches: do INVERT after REVERSE.


SAMPLE

SAMPLE  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. Use SAMPLE 2 to undo a DOUBLE operation. See also MODE, SIEVE and SELECT.
   /COMPLEMENT
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 SIEVE/RANDOM and SEED.


SAVE

SAVE  filename  [scalenr.]
Write the given or current scale to a file on disk with the given filename. If a filename without extension is given, the extension will be '.scl'. A description no longer than 80 characters must be given. A longer decription can be added with an editor if the lines begin with an exclamation mark.
   /KEEP_TEXT
If the scale has been loaded from disk, retain the description that it had, unless the description is empty.
   /CENTS
Write the given or current scale to a text file on disk 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.


SEED

SEED  [number]
Gives the random number generator that is used for the aleatoric commands a new seed to prevent getting the same sequence of results each time the program is started. The number must be an integer number. If it is omitted, the computer's clock is used to obtain a value. It's also used for TIP. See also PERMUTE/RANDOM, SAMPLE/RANDOM, SIEVE/RANDOM and VARY.


SELECT

SELECT  [scalenr.]
Enter a set of scale degrees to keep for the given or current scale and delete the degrees not entered. This is sometimes a more convenient way of deleting pitches from a scale than with the DELETE command. Modes can also be selected with the MODE command. See also SAMPLE and SIEVE.
   /MODEL  scalenr.
Change the current scale to the structure of the given scale. This means that for each pitch in the given scale, the nearest pitch from the current scale is taken. So there may be pitches from the current scale removed or duplicates inserted. If two pitches are equally distant from a pitch in the given scale, (within half a cent) then the highest one will consistently be selected. After the operation the current scale has the amount of notes of the given scale. Instead of a scale number, a filename may also be given. See also REPLACE/MODEL.


SEND

SEND  [parameters]
Send a tuning over MIDI to a synthesizer. This command is equivalent to @SEND, so the command file send.cmd must be present in the current directory. The contents of send.cmd will be different depending on the computer type used. Any parameters given will be passed to the command file.
See also CLEAR/MAP, LOAD/MAP, SET SYNTHESIZER and SET MAP_FREQ.
   /FILE  filename  [scalenr.]
Write the tuning data as one or more system 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.
If the current keyboard mapping is empty then a linear mapping is produced. Instead of a scale number a filename can be given which then sends the scale in the file, without affecting the current scale. The default file extension is '.mid'.
Read synth.par to see how the dump format is adaptable for different synthesizer types.
   /CPS_FILE  filename  [scalenr.]
Write the tuning data to a CPS-file useable by MIDI2CS, a program to convert a MIDI-file to a Csound score file. The current keyboard mapping is used. The file contains a list of MIDI note numbers and frequencies. The default file extension is '.cps'.
   /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 which then sends the scale in the file, without affecting the current scale. 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 an asterisk. The keyboard map determines which note numbers will be shown. In order to write the data to a file, for example to print, use command FILE first. Instead of a scale number a filename can also be given.


SET

SET (ATTRIBUTE | CALC_OUTPUT | CONTROLLER | DESCRIPTION | DIFF_DEGREE |
     EXCLUDE | EXPLIMIT | FIRST | FREQUENCY | HARMCONST | INDEX | INT_STEPS |
     LIMIT | MAP_FREQ | MAXDIFF | MIDDLE | NAME | NOTATION | OFFSET | 
     ONERROR | PAUSE | PROGRAM | RECIPROCAL | SEPARATOR | STEP_UNIT |
     SYNTHESIZER | TOLERANCE | UNIT | WEIGHTING)
SET ATTRIBUTE  option
Change the pitch attribute shown with
SHOW SCALE or SHOW/INTERVAL SCALE.
The options are:
CENTS : show the cents value
DEPTH : show the length of the continued fraction expansion [1]
DIFF_ET : show the difference in cents with the equal tempered value [2]
DISSONANCE : show the sensory dissonance of the dyad with 1/1 [3]
ENTROPY : show the Erlich harmonic entropy value [4]
ERLICH : show the Erlich harmonic distance value
EUCLID : show the rectangular distance in lattice space (less factor 2)
FRACTION : show the continued fraction expansion
FACTOR : show the frequency ratio as a linear decimal factor [5]
GRADUS : show the Gradus Suavitatis of Euler
HARMON : show the Barlow harmonicity value [6]
INTERVAL : show the interval with previous or other position in cents [7]
INV_HARMON : show the absolute reciprocal of Barlow's harmonicity value
LIMIT : show the prime limit
LOG_FRACT : show the number of octaves as a ratio [8]
MANN : show the average of numerator and denominator
MULTIPLE : show the integer multiple (all values under denominator 1)
NONE : show no attribute
NOTATION : show name and accidentals according to a given system [9]
OCTAVE : show the number of octaves (oct value of Csound)
OTHER_SCALE : show the same degree of another scale [10]
PITCH_BEND : show the semitone roundoff and pitch bend value (-2048..2047) [11]
PRIMES : show the prime factorisation
RECIPROCAL : show the reciprocal ratio with degree 0, (rel. string length) [12]
SEMITONE : show the semitone roundoff value and remainder (-50..49 c.)
SEP_PRIMES : show the prime factors except 2 all separately (i.e. 3.3.5.7)
STEP_DIFF : show the difference in cents with the nearest e.t. step [13]
STERN : show the length of the path in the Stern-Brocot tree
SUBMULTIPLE : show the inverse multiple (all values under numerator 1) [14]
TENNEY : show the Tenney harmonic distance value: log(num*den)
TRIANGLE : show the distance in triangular lattice space (less factor 2)
TR_LOG : show the triangular logarithmic complexity (less factor 2)
TWELVE : show the nearest semitone name and difference (-50..49 c.)
VECTOR : show the harmonic vector of primes other than 2
VOGEL : show the Vogel harmonic complexity value: num+den
WILSON : show the Wilson harmonic complexity value
<number> : show the interval size in number per octave units [15]

Remarks:

  1. See also the FRACTION attribute and the STERN attribute.
  2. 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.
  3. 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.
  4. This is the Farey version of harmonic entropy, with a default Farey order of 80. The Farey order may be set with an extra parameter, but not higher than 160. If the extra parameter is given, there will be a small delay for calculating the set of Farey fractions.
  5. 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.
  6. The value for HARMON depends on the setting of SET HARMCONST. See also SHOW HARMCONST.
  7. 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.
  8. 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.
  9. An extra parameter must be given to change the current system for NOTATION. Legal values are E5, E7, E9, W9, E10, S10, E11, C12, D12, E12, N12, S12, R13, W13, E14, E15, E16, M16, W16, E17, W18, E19, Y19, E20, Z20, E21, C22, E22, P22, E23, W23, E24, E25, E26, E27, E28, E29, E30, E31, F31, S31, E32, E33, E34, E35, E36, E37, E38, E39, E40, E41, E42, E43, S43, E44, E45, E46, E47, E48, A48, E49, E50, E51, E52, E53, E54A, E55, E56, E57, E58, E59A, E60, E61, E62, E63, E64, E65, E66A, E67, E68, E69, E70, E71A, E72, R72, E73, E74, E75, E76, E77, E78A, E79, E80, E81, E82, E84, E85A, E87, E88, E89, E91, E94, E96, E98, E103, S5, P7, A17, P17, I22, P24, T24, JI, JI2, BP, KD, KG and KL.
    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 and JI2 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.
  10. An extra parameter must be given to select which other scale to show. The initial value is 1.
  11. The pitch bend value is supported for the default range only, which is from -8192 to 8191 for -/+ 2 semitones. The value given is rounded off to the nearest semitone however.
  12. 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.
  13. The value for STEP_DIFF depends on the setting of SET STEP_UNIT. But an extra parameter may be given to change the unit with the same command. See also SHOW ET_DIFF for a similar operation.
  14. 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.
  15. 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 ATTRIB 1000. An interval value that begins with a $ or a % can also be given. For instance to specify schisma-units do SET ATTRIB $s. The option SET ATTRIBUTE OCTAVE is the same as this one, with a number of 1.

SET CALC_OUTPUT  (ALL | LONG | SHORT | NONE)
Modify the amount of values given by the CALCULATE command. 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 the note names of all implemented notation systems. 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. See also SET NOTATION. The parameter cannot be abbreviated.

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

SET DESCRIPTION  [scalenr.]
Change the description line for the current or given scale. This line is shown with SHOW SCALE and CATALOGUE among others and replaced when LOAD is done. It can be saved with the scale, see SAVE/KEEP_TEXT.

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 if the differences are to be shown with respect to A instead of C, then do SET DIFF_DEGREE 9. Remember to do SET ATTRIB DIFF_ET after this for SHOW SCALE.

SET EXCLUDE  [list-of-midi-channels]
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. Or put it in the startup command file. To view the excluded channels do SHOW SETTINGS. It does not influence the command EXAMPLE, since with that excluded channels are set in the input file.

SET EXPLIMIT  [prime  exponent-limit]
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 one pair is given on the command line. See APPROXIMATE.

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. Remember to do SET ATTRIB FACTOR after this. The value set is the same as used for SET ATTRIBUTE RECIPROCAL so this command is synonymous with SET RECIPROCAL.

SET FIRST  degree
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 params.par.

SET FREQUENCY  frequency
Change the base frequency. The frequency is entered in Hertz. This influences the SHOW/FREQUENCY commands, SHOW BEATS, SHOW DISTANCE, CATALOGUE/PITCH and the beat frequencies calculated with CALCULATE. This value 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 from the current value, so for instance if pitch memory nr.0 contains 3/2 and $0 is given, the frequency will become a fifth higher. The frequency of middle C corresponding to an A of 440 Hz is 261.6255653 Hz.
To change the reference frequency of the keyboard mapping, see SET MAP_FREQ.

SET HARMCONST  [prime  coefficient]
Modify any coefficient(s) of the harmonicity function. This influences among other things the harmonicity values shown when SET ATTRIBUTE HARMON is done, or SET ATTRIBUTE INV_HARMON. Also the harmonicity values of SHOW DATA. 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. See also SHOW HARMCONST and APPROXIMATE/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_STEPS  number
Change the relative position of the scale degree with which the interval is shown with SHOW SCALE and SHOW/INTERVAL SCALE. The initial setting is -1, which means the previous degree. Remember to do SET ATTRIB INTERVAL after this for SHOW SCALE; it's not necessary for SHOW/INTERVAL SCALE.

SET LIMIT  prime-limit
Change the default prime limit for the commands APPROXIMATE, CHORDS and LIMIT. If 0 is given, the highest prime is taken (set in params.par).

SET MAP_FREQ  frequency  [note_number]
Change the reference frequency of the current keyboard mapping. Influences the SEND command. 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 nr.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. Don't type something like "69.A", but only the number, for example: SET MAP_FREQ 440.0 69
This command does not change the frequency alterable by SET FREQUENCY. See also SET MIDDLE.

SET MAXDIFF  difference
Change the maximum difference for approximated pitches. The value can be given as ratio or in cents (or with $ or %). To set no maximum, give 0.0 as the value. 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 and EGALIZE/MODEL.

SET MIDDLE  note_number
Change the middle key of the current keyboard mapping where scale degree 0 is mapped to. The parameter is a MIDI note number. The initial value is 60 (middle C). It influences the SEND command. See the current value with SHOW MAPPING. See also SET MAP_FREQ.

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. Legal values are:
Octave based equal temperaments: E5, E7, E9, W9, E10, S10, E11, C12, D12, E12, N12, S12, R13, W13, E14, E15, E16, M16, W16, E17, W18, E19, Y19, E20, Z20, E21, C22, E22, P22, E23, W23, E24, P24, E25, E26, E27, E28, E29, E30, E31, F31, S31, E32, E33, E34, E35, E36, E37, E38, E39, E40, E41, E42, E43, S43, E44, E45, E46, E47, E48, A48, E49, E50, E51, E52, E53, E54A, E55, E56, E57, E58, E59A, E60, E61, E62, E63, E64, E65, E66A, E67, E68, E69, E70, E71A, E72, R72, E73, E74, E75, E76, E77, E78A, E79, E80, E81, E82, E84, E85A, E87, E88, E89, E91, E94, E96, E98, E103.
Tritave (3/1) based equal temperaments: BP, KL, KD, KG.
Not equal temperaments: S5, P7, A17, P17, I22, T24, JI, JI2.

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. 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 20-tET and 25-tET a notation of mine is used. Names beginning with an E and ending with an A have for G one step lower than the best fifth, to avoid a very large syntonic comma.
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 the Central-Javanese note names for pelog.
S10 gives Sethares' 10-tET names.
C12 gives Carnatic note names for the 12-tone mela system.
D12 gives the German note names for 12-tET.
N12 gives the Dutch note names for 12-tET.
S12 gives solmisation names for 12-tET (Dutch).
R13 gives Rapoport's 13-tET names.
M16 gives Miller's 16-tET names.
A17 gives the Arabic note names for the Arabic 17-tone scale.
P17 gives the Persian note names for the Persian 17-tone scale.
Y19 gives Yasser's 19-tET names.
Z20 gives Zweifel's 20-tET names.
C22 gives Op de Coul's note names for 22-tET.
I22 gives the Indian sruti names.
P22 gives Paul Erlich's note names for 22-tET.
P24 gives the Persian note names for 24-tET.
T24 gives Turkish names of the Arel-Ezgi system.
F31 gives Fokker's names for 31-tET notes.
S31 gives Suppig's names for 31-tET notes.
S43 gives Sauveur's names for 43-tET notes.
A48 gives another 48-tET name system.
R72 gives Richter Herf's 72-tET names.
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.
JI gives a commatic notation for just intervals. The pitch must be rational.
JI2 gives a commatic notation for just intervals with other commas.

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
) diesis sharp
( diesis flat
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.
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. In order to obtain names that make sense, it is important to choose a system that has pitches in the neighbourhood of all pitches of the scale. To find out for which systems that is, use FIT/MODE.
The name for scale degree 0 of 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.

For the Persian system P17 Vaziri's notation is used:
# sharp (about +100 cents)
b flat (about -100 cents)
> sori (about +70 cents)
p koron (about -70 cents)
The same symbols are used for P24, only > and p are then a quartertone.

For the Turkish system T24 the Arel-Ezgi 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)
It is necessary to use SET OFFSET to change the first tone to the finalis.

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. These symbols were chosen; for primes 17 and higher, system JI2 uses different comma's 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
v 32/33
| 27/26
; 26/27 JI2:
#' 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
Setting notation also influences output of the command CHORDS.
See also REPLACE/NOTATION.

SET OFFSET  [notename-or-pitch]
Specify the note name to use for scale degree 0 of 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, it is wise to 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.
This command does not influence the commands ECHO, EXAMPLE, 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 PROGRAM  (ON | OFF)
For the command EXAMPLE/MIDI. 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 ATTRIB RECIPROCAL after this. Remark: more accurate string lengths may be obtained 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 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  pitch
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. See also SHOW ET_DIFF for a similar operation without this attribute setting.

SET SYNTHESIZER  synthesizer-number
Set the current synthesizer type. It must be either 0 or a number which is defined in parameter file synth.par. These definitions are called external. There are also internal definitions in the program and their number is 101 or higher. The default type can be set in file params.par, otherwise it is 0. See also SHOW SYNTHESIZER and SEND.

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 and JI2. Otherwise this value affects all situations where a notation system is used. See also SET NOTATION, SHOW NOTATION and REPLACE/NOTATION.
SET UNIT  (ON | OFF)
Enable or disable displaying a unit name after a value, like "cents" or "Hertz" for the commands SHOW SCALE, SHOW CYCLE and SHOW BESTCYCLE. The initial setting is ON.

SET WEIGHTING  factor
Change the weighting factor used in the command APPROXIMATE/WEIGHTED. If the weighting factor is higher, then the harmonicity value weighs more and the pitch difference less. This value and other settings can be viewed with SHOW SETTINGS.


SHOW

SHOW (SCALE | BEATS | BESTCYCLE | COMBINATION | CYCLE | DATA | DIFFERENCE |
      DISTANCE | ET_DIFF | EXPLIMIT | HARMCONST | INTERVALS | LOCATIONS |
      MAPPING | NOTATION | PITCH | SETTINGS | STRINGLEN | SYNTHESIZER |
      TEMPERINGS | TRANSPOSE)
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. The option SCALE is default so a SHOW or SH command is enough to show the current scale or a scale memory. Instead of a scale number a filename can be given which then shows the scale in the file, without affecting the current scale. The first degree to be shown can be set with SET FIRST or given in params.par. See also SET INDEX, SET NAME and SET UNIT. Pitches can be left-justified or centred, see params.par.
   /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 /CENTS, /LINE and /INTERVAL. See also SHOW/LINE INTERVALS to see intervals grouped by scale degree.
   /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. The base frequency used is the one set with SET FREQUENCY. The default base frequency is set in params.par (default 261.6255653 Hertz). Cannot be combined with other qualifiers.
   /HERTZ
As with /FREQUENCY but shows only the value in Hertz. Cannot be combined with other qualifiers.
   /OCTCPS
As with /FREQUENCY but shows only the Csound cpsoct value. Cannot be combined with other qualifiers.
   /CHORD
The scale must be rational. Shows the frequency multiples like 4:5:6. Cannot be combined with other qualifiers.
   /LINE
Show pitches or intervals consecutively on one or more text lines. Can be used in combination with /CENTS and /INTERVAL.
   /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 the averages are zero and can be ignored. Can only be combined with /INTERVAL.

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, do EXTEND first with a multiple of the current scale size. Warning: for sounds with an inharmonic spectrum, perceived beat frequencies may be different. See also SHOW TEMPERINGS.

SHOW BESTCYCLE  [scalenr.]
Show the difference of the fifths in the current scale from a least-squares optimal fifth. Enter the fifth degree. The difference between each fifth and the optimal fifth is given in cents. Also given is the best starting point for the cycle of fifths and the resulting standard deviation which was optimised.

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. 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 do first LOAD intnam.par but this is not necessary. For example: SHOW COMBINATION 25/24 intnam.par

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 difference between each fifth and the cumulative fifth is given in cents. 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.
   /CENTS
Show the fifths of the scale in cents.
   /INTERVAL
Show the difference between each fifth and the given fifth instead of the cumulative fifth.

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
Smallest interval
Average interval
Average / smallest interval
Largest interval
Largest / average interval
Largest / smallest interval
Least-squares average interval
Median interval of one step
n>1 Most common interval of one step
Interval standard deviation
Interval skew
Whether scale has Rothenberg's propriety: strictly proper, proper or not
n>1 Whether scale has Myhill's property and which are possible generators
n>1 Whether scale has maximal or distributional evenness
Whether scale consists of repeating interval blocks or is equal tempered
n>1 Whether scale is a mode of an equal temperament
n>1 Whether scale is a Winograd deep scale
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 has a monotonous distribution of thirds proceeding over the circle of fifths, i.e. growing and shrinking only once
n>2 Whether scale is sum-free
n>1 Whether scale is an addition chord
n=2..120 Whether scale is a Constant Structure (Wilson)
n=2..120 Number of different intervals and ratio to n-1 Abortable by Control-C.
n=2..120 Smallest interval difference (if not equal temperament)
n=2..120 Most common interval and amount (its inverse is equally common)
n=2..120 Number of recognisable fifths (between 4/7 and 3/5 octave) and their average size
n=4..120 Whether scale is a chain of identical triads
n=4..120 Most common triad and amount
n=2..120 Rothenberg stability (if proper)
n>1 Lumma instability
n>1 Impropriety factor (if not proper)
n>1 Rothenberg efficiency (if computing time not prohibitive) Abortable by Control-C.
rat Prime number limit
rat Odd number limit, otonal and utonal odd limit
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 Wille's k value
rat Vogel's harmonic complexity
rat Wilson's harmonic complexity
rat Rectangular lattice dimensions
rat Triangular lattice dimensions
rat Whether scale is a complete genus musicum and which one
rat Whether scale is superparticular
rat Prime exponents range and averages
Limited transpositions
Inversional symmetry on degrees
Inversional symmetry on intervals
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
Instead of a scale number a filename can be given which then shows data of the scale in the file, without affecting the current scale. See the file
tips.par for explanation of some of these quantities.

SHOW DIFFERENCE  scalenr.
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, the amount compared is the maximum of the two scale sizes. Average values are also given. The differences shown are those that would result from a SUBTRACT operation. Instead of a scale number a filename can be given.
   /FREQUENCY
Show the differences of the pitches in terms of beat frequencies. These are calculated relative to the value given with
SET FREQUENCY.
   /NEAREST
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. See also MODE.
The given scale may not be empty. Cannot be combined with /FREQUENCY.

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 beat frequency is calculated relative to the value given with SET FREQUENCY. If the given pitch is rational, then the beat frequencies between the corresponding partials will also be given.

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 and DIVIDE/FIND.

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 2^31 - 1. Also the default prime limit is given, see SET LIMIT. See also APPROXIMATE.

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

SHOW INTERVALS  [scalenr.]
Show all intervals between all pairs of pitches in the given or current scale. They are grouped by interval class (distance in position). Instead of a scale number a filename can be given which then shows the intervals of the scale in the file, without affecting the current scale.
   /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. Cannot be combined with /TOTAL.
   /CENTS
In combination with /LINE, show the intervals in cents.
   /TOTAL
Shows all intervals between all pairs of pitches in the given or current scale but they are not grouped by interval class but by interval size. If an interval size is unique to one interval class, then the class number is also given 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 given. Cannot be combined with /LINE.

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. A comparison is made up and down to twice the number of notes in the scale. If one of the intervals only approximates an interval in the scale, the difference(s) are also given, with a maximum of 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 CHORDS. 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 total, average and highest differences are given which is the sum over one chord.
   /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 intervals which are selected from the current scale by the mode will be looked for. The combination at degree 0 will therefore always be found.
   /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. A mode name can also be given. Example: check the positions of tetrads with relative interval sizes: SHOW/EQUALMODE LOCATION 2 2 1.
If the standard deviation shown with FIT/MODE is not zero, then QUANTIZE can be done first.
   /SCALE  scalenr.
Instead of an interval list, give a scale number or filename.

SHOW MAPPING  [filename]
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 scale degree 0 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 key. An unused key is indicated with two hyphens. The right column contains a list of keys for each mapped scale degree. A linear mapping means that successive scale degrees are mapped to successive keys.
See also
LOAD/MAP, SET MIDDLE.

SHOW NOTATION
Show the names of all notation systems. Also show the current active system, even if the attribute is not set to notation. See also SET NOTATION. 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, 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  [pitchnr.]
Show the value in the given or default pitch memory both in cents and in Hertz relative to the base frequency. See also CATALOGUE to show the values of all used pitch memories.
   /CENTS
Show the value in cents only.

SHOW SETTINGS
Show the current values and settings of changeable parameters. To make different settings at startup, the files params.par and startup.cmd can be edited.

SHOW STRINGLEN  [string-file]  [last-degree]
Show the positions where frets are to be placed for the degrees of the current scale with high precision. 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 params.par. The name 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.

SHOW SYNTHESIZER
Show the names of the synthesizer types defined in parameter file synth.par and the ones defined internally. The current synthesizer type is indicated with an arrow.

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 list with a maximum of 12 are separated by spaces. But they can be separated by colons as well. In that 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. See also SHOW BEATS.

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 the average deviation for the degrees that are different in order. Lastly, the normalised autocorrelation values for the logarithmic intervals between consecutive pitches. 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.
   /SORTED
Show the results sorted by key in order of ascending number of pitches different.


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.
   /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. 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 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.
   /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
for MS-DOS : spawn command
for Unix : spawn sh (or any other shell name)
for VMS : spawn spawn
for Windows 9x/NT : spawn command
After logging out or exiting control is returned to Scala. With SPAWN, operating system commands and Scala commands can be combined in 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. Not possible under MS-DOS.


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.


STRETCH

STRETCH  interval
Increase the formal octave of the current scale with the given interval and all other pitches with a 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. See also EXPONENTIATE and MULTIPLY.
   /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.
   /MATCH  scalenr.
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. Instead of a scale number, a filename may also be given. See also MULTIPLY/MATCH.


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.
   /SUBTRACT
Instead of dividing the pitches, take the difference tones.
   /MEDIANT
Instead of dividing the pitches, 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.
   /DIFFERENCE  [scalenr.]
The current scale is replaced by a scale with all difference tones of the current or given scale. If the number of notes in the given scale is n, then the size of the new scale will be n * (n + 1) / 2 - 1, but less if there are duplicate difference tones. For example, if the given scale has pitch factors 10:12:15:20 (or 1/1 6/5 3/2 2/1), then the new scale will be 2:3:5:8:10 (or 1/1 3/2 5/2 4/1 5/1). 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 the symmetry is recognised by the SHOW DATA command.
   /HARMONIC
Uses the harmonic mean, i.e. 2 * a * b / (a + b).
   /ARITHMETIC
Uses the arithmetic mean, i.e. (a + b) / 2.
   /SUBC_HARMONIC
Uses the subcontrary to harmonic mean, i.e. (a^2 + b^2) / (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).
   /RMS
Uses the root mean square, i.e. sqrt((a^2 + b^2) / 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.


TIP

TIP  [tipnr.]
Provide a tip-of-the-day. With no parameter given, a random tip is provided. Tips are written in the file tips.par.


TYPE

TYPE  file-mask
Read 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 a wildcard, all the matching files will be typed. If the file does not exist, then no error message will be given.


UNCYCLE

UNCYCLE  position  [down-count]
The position must be a scale degree that has no common factor with the scale size. This command reorders the pitches by putting them in "fifths-order" by considering the current scale to be a cycle of fifths. The given position is the degree of the formal fifth. The down-count is the number of 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.


UNDO

UNDO
After doing a command that changes the current scale, this command can be invoked to get back the scale as it was before the last command. Each time when a command is used that changes the current scale, it is first copied to the first UNDO scale memory. The number of UNDO scale copies is set in file params.par, default is 1. If it's more 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.
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 than cannot be undone are CLEAR/ALL, COPY, PUSH, POP and SWAP. Because a command file can contain more than one command, the whole action of a command file can usually not be undone with a single UNDO.


UNIQUE

UNIQUE  [scalenr.]
Deletes all double pitches from the current or given scale and sorts the scale in ascending order. Pitches are considered equivalent if their difference is less than approximately the numerical accuracy of floating point numbers in the computer.


UNRAT

UNRAT  position
Change the pitch at the given position (degree) in the current scale from a rational to a floating point value. This cannot be done for degree 0. To do this with 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 the inverse operation.


VARY

VARY  deviation
Adds a random value with an absolute maximum of the given value to all pitches in the current 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 before doing this command.
If the deviation is 0.0 then all rational pitches in the current scale will be made floating point numbers. The deviation may be given as a rational or floating point value. See also SEED.
   /INTERVAL
As above but adds a random value to each interval instead of each pitch. The last degree will be affected too.
   /LINEAR
Adds a random frequency value with an absolute maximum of the given value to all pitches in the current 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.


@

@<filespec>  [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. Do not execute 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. The default extension for command files is '.cmd'. Lines beginning with an exclamation mark (!) are ignored and can be used for comments. An example:
! Average the pitches of scale 0 with those of scale 1
add 1
multiply 1/2

With commands like INPUT or PYTHAGOREAN that ask 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 search *.scl 'p1'. However this translation can only be done in lines with commands, not in lines containing input data to commands which ask for values. The example will do a text search in scale files, searching for the text of the given parameter, provided the operating system knows the command "search". Another useful command file to make, for instance to edit keyboard mappings is spawn edit 'p1'.kbm

Nesting invocations of other command files inside command files can be done to a maximum depth of 10.

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

This is a link to the list of presupplied command files.
See the directory with the 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 commands to which this can be used as file parameter are COMPARE, DIRECTORY, ITERATE and LOAD/ALL. A set of scale files can be defined this way. A list file can be created with a text editor, with 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 params.par (default 10). A $ preceding any of the following letters can be used as a synonym wherever a pitch is entered.

p : Pythagorean (ditonic) comma 23.46 cents
k : syntonic comma 21.51 cents
s : schisma 1.95 cents
q : diaschisma 19.55 cents
c : major diesis 62.57 cents
d : minor diesis 41.06 cents
w : Würschmidt's comma 11.45 cents
y : kleisma 8.11 cents
f : golden section (phi) 833.09 cents
e : base of natural logarithm (e) 1731.23 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.
Other symbols are:
%n : the formal octave (pitch of highest degree) of the current scale.
%si: the smallest interval between consecutive pitches of the current scale.
%li: the largest interval between consecutive pitches of the current scale.
%ai: the average interval between consecutive pitches of the current 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. See also ECHO for the lexical functions with %-character useable in ECHO output. And 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.


!
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 below a command requiring user input, this will cause the rest of the user input to be queried directly, instead of read from the command file. For example, commands like INPUT and CPS ask for a variable amount of pitches. In these cases ?? can be used because with single question marks the amount required cannot be known beforehand.


About...

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 useful functions to suit most needs of both beginners and experts.

Scala was written in the programming language Ada. This makes the code very readable, maintainable, bugs very scarce and 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) at e-mail address coul@computer.org. If the program ends with an exception (error code), then please mail which one it was and include any text that is in the exception message. Suggestions for improvements are also welcome.
As an engineer, the author is unable to place appearance above function, so that's the reason for the absence of a more fancy user interface, however he thinks it's quite adequate and works much faster after a while than a GUI.

Currently there are versions of Scala for MS-DOS, Windows 9x/NT, Unix, Linux and VAX/VMS.

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


Commands

Commands must be entered as follows. First comes the command verb which may be abbreviated to the smallest unambiguous length. Then any desired qualifiers follow which must be preceded with a slash (/) and may also be abbreviated. Then parameters follow to be separated by at least one space. Nonoptional parameters not given on the command line are prompted for. Qualifiers must always precede and not follow the parameters.

This is a link to the list of all commands.


Errors

If the program ends with exception Storage_Error raised, it means there is insufficient memory. To decrease memory consumption, change file params.par to have fewer or smaller scales in memory (or both). If that doesn't help, rename the help file help.htm to another name. This disables the HELP command but saves memory. Under Windows 9x, check the memory options from the DOS-icon properties.

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

When an operation inserts more notes in a scale than the maximum value in file params.par 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 give the message Computation error. They will never produce meaningless results. They will neither abort the program, unless there is a bug.


Expressions

Pitch expressions can be:


Interruption

The execution of a command can be interrupted by pressing Ctrl/C. This does not end the program, only the last command. It may take a short while before the actual interruption occurs. If Ctrl/C is pressed when the program is waiting for user input, this will not be noticed by the program until a return is given. Under Windows NT and most Unix versions pressing Ctrl/C does not end the command, but the whole program. Under Windows 9x it works ok.

To cancel a long output, either press Ctrl/C or type 'q' followed by return when the program asks to hit the return key when it is pausing to scroll.

If an end-of-file character like Ctrl/Z is typed when the program is waiting for user input, the program stops (not for MS-DOS). Be sure not to have unsaved scales.


Introduction

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

What if it didn't work?

With a PC soundcard:

For soundcards and synthesizers without a tuning table:


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 does composite arithmetic which means that rational values are kept in rational form whenever possible. If not, for example when an operation gives a numerator or denominator that is too large, then the representation is automatically switched to floating point. This also happens with operations acting on both a rational and floating point pitch. Operations will never produce junk numbers.
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. See also Scales, $, % and CALCULATE.


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.


Scales

A scale consists of zero or more pitches. The terms pitch, note, tone and scale degree are being used interchangeably here. The size of scales (number of notes) is bounded, but the maximum size is configurable. The same goes for the amount of scales. Both values are set in file params.par, and can be shown with SHOW SETTINGS.

Each scale memory has a number, and scale number 0 is called the current scale. This is always the default scale upon which commands act. Some, not all commands can also act on other scales than the current one. Also some commands can take scale filenames as parameter, as well as scale numbers.

The last note (with the highest degree number) of a scale serves as the formal octave. The terms octave, formal octave and interval of equivalence are also used interchangeably. This can be value 2/1 but also any other value. This value is important when the scale is extended and when notes are used outside the range of degrees from 0 to the last degree.

The value of the first note (degree 0) is always 1/1 or 0 cents.

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

This is a link to download a large archive of scales.


Screen dimensions

The number of lines and columns of the screen that the program works with is
for MS-DOS : 25 x 80
for Linux : set automatically at startup
for Unix : defined in parameter file termsize.par, default 24 x 80
for VMS : set automatically at startup
for Windows 9x/NT : set automatically at startup
Under Windows 9x/NT the number of lines can be changed by resizing the window or giving the command SPAWN MODE CON LINES=50 (one of 25, 43, 50). Then do CLS afterwards.
Some Unix versions automatically recognize the size of an xterm window. Otherwise file termsize.par must have two lines. The number of lines first and then the number of columns, like this:

24
80


Startup

At program startup, command line parameters can be given. By invocation with no parameters, an external command file startup.cmd is searched in the current directory and if it is found, the commands in it are executed, prior to giving control to the user. In it, you can put commands to CD to a scale directory, do SET ATTRIBUTE, give a TIP, or whatever more.
One or more parameters can be given which must be names of existing files. The filename's extension must be .scl, .kbm or .cmd. Depending on the extension a scale is loaded, a keyboard mapping is loaded or an external command file executed. The extension cannot be left away like with the LOAD command. The command line is read from left to right.