Modulus Major Scale
eharetea

Use the power of modulus to convert any notes into a perfect Major Scale.

Quantizing notes can assist the composition of computer-generated, artificially-intelligent music.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Wednesday July 30th, 2008 01:29 AM


/*
* Author: Dan Lynch
*/

#pragma choice mscale "0" "direct"
#pragma choice mscale "1" "modulus"
 
chop
m_scalefloat amp 12;
        string mscale "0"ramp "0"; )
{
        if (!isconnected(0)) {
                float fI I;
                fI/L;
                V*=amp;
        }
 
        rint(V);
 
        if (mscale == "0") {
                if (== 11;
                else if (== 2V+1;
                else if (== 33;
                else if (== 4V+1;
                else if (== 55;
                else if (== 66;
                else if (== 7V+1;
                else if (== 88;
                else if (== 9V+1;
                else if (== 1010;
                else if (== 11V+1;
                else if (== 1212;
        }
 
        if (mscale == "1") {

                if (V%12 == 0V;
                else if (V%12 == 1V;
                else if (V%12 == 2V+1;
                else if (V%12 == 3V;
                else if (V%12 == 4V+1;
                else if (V%12 == 5V;
                else if (V%12 == 6V;
                else if (V%12 == 7V+1;
                else if (V%12 == 8V;
                else if (V%12 == 9V+1;
                else if (V%12 == 10V;
                else if (V%12 == 11V+1;
        }
 
 
}



Downloads:
Download: major_scale.vfl 1 KB

Please login or Click Here to register for downloads
Creative Commons License
Modulus Major Scale by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com