File: playnotes.py

package info (click to toggle)
snack 2.2.10.20090624%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,868 kB
  • sloc: ansic: 32,602; sh: 8,558; tcl: 1,086; python: 761; makefile: 578
file content (24 lines) | stat: -rwxr-xr-x 383 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /usr/bin/env python

import sys
if sys.version_info[0] == 2:
    from Tkinter import *
else:
    from tkinter import *

from tkSnack import *

root = Tkinter.Tk()
initializeSnack(root)

s = Sound()
filt = Filter('generator', 440, 30000, 0.0, 'sine', 8000)

def beep(freq):
   filt.configure(freq)
   s.play(filter=filt,blocking=1)

beep(261.6)
beep(293.7)
beep(329.7)
beep(349.3)