Skip to content

Latest commit

 

History

History
89 lines (58 loc) · 3.78 KB

CHANGESCALES.md

File metadata and controls

89 lines (58 loc) · 3.78 KB

Changing Dual Quantizer scales

If you want to create your own scales or scale sets here is how.

Go into the software directory and create a text file containing a description of your scale set. You can use common_scales.txt or esoteric_scales.txt as a starting point if you want. The syntax is as follows.

Each command or scale description is on a new line. Things in <anglebrackets> are to be replaced with whatever value you want. Things in [square brackets] are optional.

Each scale can be given a description, which can be any text you want; it appears only in comments in the table_builder output.

Commands

In the absence of commands to the contrary each scale is assigned to be the next scale in the same bank as the previous; first scale is bank 1 (index 0), scale 1 (index 0)

Use commands to change this sequence:

+b <bank> [#<description>]
Append next scale to bank #<bank> (index <bank>-1) with given description. Description overwrites previous description if given.
+s <scale>
Assign next scale to scale number <scale> (index <scale>-1) in the current bank.
+d <bank1> <scale1> <bank2> <scale2>
Duplicate scale at bank <bank1>, scale <scale1> to bank <bank2>, scale <scale2>. (Dupicate entries are made in the bank/scale table, but the scale data itself is not duplicated.)

Scale descriptors

A scale descriptor can be one of:

<path to scl file> [#<description>]
Scale is described in Scala format file. Description if present overrides the description in the file.
+g <n> <generator> [<period>] [<firstnote>] [#<description>]
Generate a scale with <n> notes using generator <generator> and period <period> starting from first note <firstnote>. Parameters can be ratios or cents. E.g.:
+g 12 3/2 2/1 500
for a 12-tone Pythagorean scale starting at 500 cents above the 0 volt note. If the period is omitted, 2/1 is the default. If first note is omitted, 0 is the default.
+e <n> [list of numbers] [#<description>]
Generate a scale using the listed entries (indexed from 0) from an <n>-equal division of the octave. E.g.:
+e 12 0 2 4 5 7 9 11
for a 12-equal major scale. If the list is omitted, the scale contains all n notes.
+q <n> <period> [list of numbers] [#<description>]
Same as +e except a period to be equally divided is given. E.g.:
+q 13 3/1
for Bohlen-Pierce equal temperament.

Table generation

Once you have your description file, feed it to table_builder.py:

./table_builder -i <path>;

where <path> is the file path to your description file. Assuming there are no errors, the script will create an output file with the same name but file extension .cpp, containing some c++ code.

Back up your copies of Quantizer/Quantizer.cpp and Quantizer/Quantizer.h. In a text editor, open Quantizer/Quantizer.cpp. Find the line

// INSERT AUTOGENERATED SCALE CLASS DATA HERE

and delete everything after that and before

// END AUTOGENERATED SCALE CLASS DATA

and replace it with the lines from your .cpp output file from the beginning to before

// for protected header

and save.

Then in a text editor, open Quantizer/Quantizer.h. Find the line

// INSERT AUTOGENERATED SCALE HEADER DATA HERE

and delete everything after that and before

// END AUTOGENERATED SCALE HEADER DATA

and replace it with the lines from your .cpp output file from after

// for protected header

to the end and save.

You now have a customized version of the Quantizer library with your scales. Use it instead of the original version.