import string # print_saw_table() # prints a Csound ftable with saw harmonics thru numpartials def print_saw_table(fn, numpartials, size = 16384): print "f",`fn`,"0",`size`,"10", for y in range(1,numpartials+1): print `1.0 / y`, print return # print_square_table() # prints a Csound ftable with square harmonics thru numpartials def print_square_table(fn, numpartials, size = 16384): print "f",`fn`,"0",`size`,"10", for y in range(1,numpartials+1): if (y%2==0): print "0.0", else: print `1.0 / y`, print return # print_squarish_saw_table() # prints a Csound ftable with saw harmonics thru numpartials # but ignores the even harmonics above ignoreabove def print_squarish_saw_table(fn, numpartials, ignoreabove, size = 16384): print "f",`fn`,"0",`size`,"10", for y in range(1,numpartials+1): if (y%2==0) and (y>ignoreabove): print "0.0", else: print `1.0 / y`, print return # print_ftables() # prints a series of tables for wavesequencing def print_ftables(num, start = 1, size = 16384): for x in range(num): print_saw_table(start+x,x+1,size) for y in range(num): print_squarish_saw_table(num+start+y,num,num-y,size) for z in range(num): print_square_table(2*num+start+z,num-z,size) print_ftables(16)