// Arup Guha
// 1/9/2014
// For a single value n, this program prints out a chart of all the
// ratios achieved of the intervals in a scale that contains n notes.
// The goal is to look for numbers close to 4/3 and 3/2.

#include <stdio.h>
#include <math.h>


int main() {

    // Get the number of notes.
    int numNotes;
    printf("How many notes do you want in your scale?\n");
    scanf("%d", &numNotes);

    // Set up our geometric series.
    double multiplier = pow(2, 1.0/numNotes);
    double ratio = 1;

    printf("Interval\tRatio\n");

    // Print out each term.
    int i;
    for (i=0; i<=numNotes; i++) {
        printf("%d\t%lf\n", i, ratio);

        // Figure out the relative frequency of the next note.
        ratio = ratio*multiplier;
    }

    return 0;
}
