Phase 2: Create the data

In order to stretch equidistant the Fibonacci sequences modulo m (m=2,…,12) to fit the same space, I just modified the previous Python script:

def my_zeros(n):
        result = []
        for i in range(n):
                result.append(0)
        return result

# print the numbers for the respective
# subdividion of the octave
def divide_oct(modulo):
        f = open('mod_'+str(modulo)+'.data', 'w')
        max = modulo**2
        fibonacci = my_zeros(max)
        fibonacci[0] = 0
        fibonacci[1] = 1
        j = 2
        for j in range(2, max):
                fibonacci[j] = (fibonacci[j-1] + fibonacci[j-2]) % modulo
                # the 2 last numbers x=F_(n-1) y=F_n of the period
                # must satisfy the following (for modulo m):
                # x + y = 0 mod m
                # y + 0 = 1 mod m
                # because 0 and 1 should be the next numbers.
                # Thus (x,y) = (m-1, 1).
                if fibonacci[j] == 1:
                        if fibonacci[j-1] == modulo - 1:
                                per = j + 1
                                break
        for i in range(per):
                #print float(i)/per, "\t", fibonacci[i]*1200/modulo
                f.write(str(float(i)/per)+"\t"+str(fibonacci[i]*1200/modulo)+'\n')
        f.close()

for i in range(2, 13):
        divide_oct(i)

The output is 11 data files: mod_2.data,…, mod_12.data (here are all). Then I wrote a gnuplot script, in order to visualise the results:

set terminal png
set grid
set yrange [0:1700]
set ytics ('c' 0, 'c#' 100, 'd' 200, 'd#' 300, 'e' 400, 'f' 500, \
        'f#' 600, 'g' 700, 'g#' 800, 'a' 900, 'ais' 1000, 'b' 1100, \
        'c' 1200);
set xlabel 'Duration'
set ylabel 'Pitch for c := 0'

set output "periods.png"

plot    'mod_2.data' u 1:2 w lp t 'mod  2', \
        'mod_3.data' u 1:2 w lp t 'mod  3', \
        'mod_4.data' u 1:2 w lp t 'mod  4', \
        'mod_5.data' u 1:2 w lp t 'mod  5', \
        'mod_6.data' u 1:2 w lp t 'mod  6', \
        'mod_7.data' u 1:2 w lp t 'mod  7', \
        'mod_8.data' u 1:2 w lp t 'mod  8', \
        'mod_9.data' u 1:2 w lp t 'mod  9', \
        'mod_10.data' u 1:2 w lp t 'mod 10', \
        'mod_11.data' u 1:2 w lp t 'mod 11', \
        'mod_12.data' u 1:2 w lp t 'mod 12'

And the output is:
periods

We see here some very interesting properties, which I will not analyse, because of lack of time. I just note, that it is not necessary, that all voices start at the same pitch, but I will adopt this idea, because it reminds me the beginning of some choir works of Josquin. But maybe I will change it later (however with small probability…).

As this graph contains rhythmical and pitch information, I would like to visualize only the rhythmical aspect, in order to have an overview of the resulting rhythmical grid. The new gnuplot script is:

set terminal png
set grid
set yrange [1:13]
set xlabel 'Duration'
set ylabel 'Modulo'

flat(a,x)=a

set output "periods_flat.png"

plot    'mod_2.data' u 1:(flat(2, $2)) w lp t '', \
        'mod_3.data' u 1:(flat(3, $2)) w lp t '', \
        'mod_4.data' u 1:(flat(4, $2)) w lp t '', \
        'mod_5.data' u 1:(flat(5, $2)) w lp t '', \
        'mod_6.data' u 1:(flat(6, $2)) w lp t '', \
        'mod_7.data' u 1:(flat(7, $2)) w lp t '', \
        'mod_8.data' u 1:(flat(8, $2)) w lp t '', \
        'mod_9.data' u 1:(flat(9, $2)) w lp t '', \
        'mod_10.data' u 1:(flat(10, $2)) w lp t '', \
        'mod_11.data' u 1:(flat(11, $2)) w lp t '', \
        'mod_12.data' u 1:(flat(12, $2)) w lp t ''

and the result:
periods

Now, the next step is: select 5 voices out of the grid.

Comments are closed.