tkinter optionmenu 28root 2c var 2c 22sine 22 2c 22noise 22 29

Solutions on MaxInterview for tkinter optionmenu 28root 2c var 2c 22sine 22 2c 22noise 22 29 by the best coders in the world

showing results for - "tkinter optionmenu 28root 2c var 2c 22sine 22 2c 22noise 22 29"
Sofia
05 Feb 2019
1            1  +#! /usr/bin/env python
2            2  +
3            3  +from Tkinter import *
4            4  +from tkSnack import *
5            5  +
6            6  +root = Tkinter.Tk()
7            7  +
8            8  +initializeSnack(root)
9            9  +"""AudioControllerSingleton().playLatency(100)"""
10           10  +
11           11  +def playbeep(freq):
12           12  +   s.stop()
13           13  +   filt.configure(freq)
14           14  +   s.play(filter=filt)
15           15  +
16           16  +def beepC4():
17           17  +   playbeep(261.6)
18           18  +
19           19  +def beepD4():
20           20  +   playbeep(293.7)
21           21  +
22           22  +def beepE4():
23           23  +   playbeep(329.7)
24           24  +
25           25  +def beepF4():
26           26  +   playbeep(349.3)
27           27  +
28           28  +def beepG4():
29           29  +   playbeep(392.1)
30           30  +
31           31  +def beepA4():
32           32  +   playbeep(440.0)
33           33  +
34           34  +def beepB4():
35           35  +   playbeep(493.9)
36           36  +
37           37  +def beepC5():
38           38  +   playbeep(523.3)
39           39  +
40           40  +s = Sound()
41           41  +
42           42  +filt = Filter('generator', 440.0, 30000, 0.0, 'sine', 8000)
43           43  +        
44           44  +Button(root, text='C4', command=beepC4).pack(side='left')
45           45  +Button(root, text='D4', command=beepD4).pack(side='left')
46           46  +Button(root, text='E4', command=beepE4).pack(side='left')
47           47  +Button(root, text='F4', command=beepF4).pack(side='left')
48           48  +Button(root, text='G4', command=beepG4).pack(side='left')
49           49  +Button(root, text='A4', command=beepA4).pack(side='left')
50           50  +Button(root, text='B4', command=beepB4).pack(side='left')
51           51  +Button(root, text='C5', command=beepC5).pack(side='left')
52           52  +
53           53  +root.mainloop()
54
55
similar questions