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_scale( float amp = 12;
string mscale = "0", ramp = "0"; )
{
if (!isconnected(0)) {
float fI = I;
V = fI/L;
V*=amp;
}
V = rint(V);
if (mscale == "0") {
if (V == 1) V = 1;
else if (V == 2) V = V+1;
else if (V == 3) V = 3;
else if (V == 4) V = V+1;
else if (V == 5) V = 5;
else if (V == 6) V = 6;
else if (V == 7) V = V+1;
else if (V == 8) V = 8;
else if (V == 9) V = V+1;
else if (V == 10) V = 10;
else if (V == 11) V = V+1;
else if (V == 12) V = 12;
}
if (mscale == "1") {
if (V%12 == 0) V = V;
else if (V%12 == 1) V = V;
else if (V%12 == 2) V = V+1;
else if (V%12 == 3) V = V;
else if (V%12 == 4) V = V+1;
else if (V%12 == 5) V = V;
else if (V%12 == 6) V = V;
else if (V%12 == 7) V = V+1;
else if (V%12 == 8) V = V;
else if (V%12 == 9) V = V+1;
else if (V%12 == 10) V = V;
else if (V%12 == 11) V = V+1;
}
}
Downloads:
Download: major_scale.vfl 1 KB
Please login or Click Here to register for downloads
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
