Mathematically moves any notes into a scale.
Quantize notes into a scale.
Date Created:Sunday March 04th, 2007 04:45 PM
Date Modified:Saturday August 02nd, 2008 02:37 PM
#include <stdio.h>
int scale();
int main()
{
int i;
int V;
int thescale;
printf("Pick a scale: Major (0), Minor (1):\n");
scanf("%d",&thescale);
while ( thescale != 0 && thescale != 1 )
{
printf("Your entry was not valid. Enter 0 or 1.\n");
scanf("%d",&thescale);
}
for (i=1;i<89;i++)
{
V = i;
V = scale(V,thescale);
printf("V = scale[%d%%12] = %d\n",i,V);
}
return 0;
}
int scale(int V, int type)
{
int majorscale[12] = {0,0,1,0,1,0,0,1,0,1,0,1};
int minorscale[12] = {0,0,1,0,0,1,0,1,0,1,0,1};
if ( type == 0 ) V += majorscale[V%12];
if ( type == 1 ) V += minorscale[V%12];
return V;
}
Downloads:
Download: newscale.c 664 B
Please login or Click Here to register for downloads
Notes in a 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
