How can I stop my variables working, and make them work only when I want them to?

35 views Asked by At
import winsound
# ok1 = oktav 1
# ok2 = oktav 2

ok2C = winsound.Beep(65,500)
ok2c0 = winsound.Beep(69,500)
ok2D = winsound.Beep(73,500)
ok2d0 = winsound.Beep(77,500)
ok2E = winsound.Beep(82,500)
ok2F = winsound.Beep(87,500)
ok2f0 = winsound.Beep(92,500)
ok2G = winsound.Beep(98,500)
ok2g0 = winsound.Beep(103,500)
ok2A = winsound.Beep(110,500)
ok2a0 = winsound.Beep(116,500)
ok2B = winsound.Beep(123,500)

I was trying to make a piano-like program with the hz frequencys. When I ran the code it started to give me every hz frequency written. What I was aiming for was only using the frequencys I want with using the variables. I tried using the while loop to cancel the program from giving all values but it won't work. Can anyone help me?

0

There are 0 answers