User:Ganaram inukshuk/Code: Difference between revisions
Added the moscalc program I made some time back |
Added the moscalc and modecalc program |
||
| Line 2,142: | Line 2,142: | ||
LLLLLLsLLLLLs - 11L 2s | LLLLLLsLLLLLs - 11L 2s | ||
LLLLLLLLLLLLs - 12L 1s | LLLLLLLLLLLLs - 12L 1s | ||
== Moscalc and Modecalc (as a Jupyter notebook) == | |||
This is a Python port of the aforementioned Moscalc program written in C++. This is accompanied by a Modecalc program that finds a scale's modes, the intervals for those modes, and the scale degrees for those modes. | |||
Source code: https://gist.github.com/GanaramInukshuk/3b09f806573ecd90745d1d7fad11abdc | |||
Example output for 3L 4s: | |||
Scale modes sorted by modal brightness: | |||
---------- --- ------ ------ ------ ------ ------ ------ ------ ------ | |||
Modestring UDP 0-step 1-step 2-step 3-step 4-step 5-step 6-step 7-step | |||
LsLsLss 0|6 0 L L+s 2L+s 2L+2s 3L+2s 3L+3s 3L+4s | |||
LsLssLs 1|5 0 L L+s 2L+s 2L+2s 2L+3s 3L+3s 3L+4s | |||
LssLsLs 2|4 0 L L+s L+2s 2L+2s 2L+3s 3L+3s 3L+4s | |||
sLsLsLs 3|3 0 s L+s L+2s 2L+2s 2L+3s 3L+3s 3L+4s | |||
sLsLssL 4|2 0 s L+s L+2s 2L+2s 2L+3s 2L+4s 3L+4s | |||
sLssLsL 5|1 0 s L+s L+2s L+3s 2L+3s 2L+4s 3L+4s | |||
ssLsLsL 6|0 0 s 2s L+2s L+3s 2L+3s 2L+4s 3L+4s | |||
---------- --- ------ ------ ------ ------ ------ ------ ------ ------ | |||
Scale modes sorted by cyclic permutational order (starting at brightest mode): | |||
---------- --- ------ ------ ------ ------ ------ ------ ------ ------ | |||
Modestring CPO 0-step 1-step 2-step 3-step 4-step 5-step 6-step 7-step | |||
LsLsLss 0 0 L L+s 2L+s 2L+2s 3L+2s 3L+3s 3L+4s | |||
sLsLssL 1 0 s L+s L+2s 2L+2s 2L+3s 2L+4s 3L+4s | |||
LsLssLs 2 0 L L+s 2L+s 2L+2s 2L+3s 3L+3s 3L+4s | |||
sLssLsL 3 0 s L+s L+2s L+3s 2L+3s 2L+4s 3L+4s | |||
LssLsLs 4 0 L L+s L+2s 2L+2s 2L+3s 3L+3s 3L+4s | |||
ssLsLsL 5 0 s 2s L+2s L+3s 2L+3s 2L+4s 3L+4s | |||
sLsLsLs 6 0 s L+s L+2s 2L+2s 2L+3s 3L+3s 3L+4s | |||
---------- --- ------ ------ ------ ------ ------ ------ ------ ------ | |||
Scale degrees for each mode (modes sorted by modal brightness): | |||
---------- --- ----- ----- ----- ----- ----- ----- ----- ----- | |||
Modestring UDP 0-deg 1-deg 2-deg 3-deg 4-deg 5-deg 6-deg 7-deg | |||
LsLsLss 0|6 0 1 1 1 1 1 1 0 | |||
LsLssLs 1|5 0 1 1 1 1 0 1 0 | |||
LssLsLs 2|4 0 1 1 0 1 0 1 0 | |||
sLsLsLs 3|3 0 0 1 0 1 0 1 0 | |||
sLsLssL 4|2 0 0 1 0 1 0 0 0 | |||
sLssLsL 5|1 0 0 1 0 0 0 0 0 | |||
ssLsLsL 6|0 0 0 0 0 0 0 0 0 | |||
---------- --- ----- ----- ----- ----- ----- ----- ----- ----- | |||
Scale degrees for each mode (modes sorted by cyclic permutational order): | |||
---------- --- ----- ----- ----- ----- ----- ----- ----- ----- | |||
Modestring CPO 0-deg 1-deg 2-deg 3-deg 4-deg 5-deg 6-deg 7-deg | |||
LsLsLss 0 0 1 1 1 1 1 1 0 | |||
sLsLssL 1 0 0 1 0 1 0 0 0 | |||
LsLssLs 2 0 1 1 1 1 0 1 0 | |||
sLssLsL 3 0 0 1 0 0 0 0 0 | |||
LssLsLs 4 0 1 1 0 1 0 1 0 | |||
ssLsLsL 5 0 0 0 0 0 0 0 0 | |||
sLsLsLs 6 0 0 1 0 1 0 1 0 | |||
---------- --- ----- ----- ----- ----- ----- ----- ----- ----- | |||
Instructions for how to read the output: | |||
* A scale's modes are rotations of a scale, represented as a string. These are sorted in two different ways: modal brightness and cyclic permutational order. | |||
* A scale's intervals are a substring of a mode's scalestring. Since the order of steps doesn't matter in an interval, the sum of steps is shown in the table instead. | |||
* Scale degrees are generally described with terms such as major, minor, augmented, diminished, and perfect. Here, they're enumerated in decreasing order based on size, where larger enumerations denote larger intervals (and therefore larger scale degrees). Perfect intervals, such as the unison and octave, always appear as one size each, and so their scale degrees are always perfect. The other scale degrees that are described as perfect come from the generating intervals (such as the perfect 5th and perfect 4th); these usually apply for moment-of-symmetry scales. A perfect 5th is described as perfect because it appears as that size in all but one mode (the locrian mode, where it's a diminished 5th instead), and a perfect 4th is described as perfect because it appears as that size in all but one mode (then lydian mode, where it's an augmented 4th instead). | |||
* Intervals and scale degrees are enumerated starting at 0 rather than 1. | |||