frequence.py

Created by mael57703

Created on January 06, 2026

510 Bytes

Transforme une note de musique(do,ré,mi,..), sa valeur de temps(noires=1, blanche=2, ronde=4,.. ), et son tempo(tps/min)

en fréquence(Hz) et en une durée(s).


from time import *
from ion import *
from math import *

def note_f(o,n,vt,t) :
  f=55*2**(int(o)-1)
  f=int(f)*(1.059463**int(n))
  d=1/(int(t)/60*int(vt))
  return f,d
  
while True :
  print("Note -> Frequence\nLes octaves sont basees\nsur le La.\nEx:oct2=La1;Sol#2\nNote:\nla=0 la#=1 si=2\ndo=3 do#=4 re=5\nre#=6 mi=7 fa=8\nfa#=9 sol=10 sol#=11")
  o=input("Octave ? ")
  n=input("Note ? " )
  vt=input("Valeur du temps ? ")
  t=input("Tempo ? ")
  print(str(note_f(o,n,vt,t)))
  sleep(3) 

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.