kostacivos/Armonia.py

26 lines
631 B
Python

#!/usr/bin/env python3
#contiene una classe che contiene i metodi per trovare tutte
#le armoniche data una frequenza
# E` necessaria una classe? Non ha neanche attributi...
def armonica(f, typeOf):
types = {"8_inf" : 1/2,
"2_maj" : 9/8,
"2_min" : 16/15,
"3_maj" : 5/4,
"3_min" : 6/5,
"4" : 4/3,
"4_rai" : 3/2,
"4_dec" : 64/45,
"5" : 3/2,
"6_maj" : 5/3,
"6_min" : 8/5,
"7_maj" : 15/8,
"7_min" : 9/5,
"8" : 2,
}
return f*types.get(typeOf)