tkSnack or other sound tool

J

jmdeschamps

I'm trying to play programmed music by iteratively applying filter
changes to a playing Sound object.

It almost seem to work but i can't control duration of sounds???

Using tkSnack 2.2.4 for Python (naturlïch!)
with python 2.3.some

Thanks,
Jean-Marc
(maybe I should investigate other tool for my synthesizing
experiments?, - which one then???)

PS my code:
from Tkinter import *
from tkSnack import *
import time
root = Tkinter.Tk()

initializeSnack(root)

s = Sound()

filt = Filter('generator', 440.0)
filt.configure(440, 1000, 00.7, "rectangle", 5000)

def play():
s.play(filter=filt)
for i in range(100):
filt.configure(i+440)

def stop():
s.stop()

f = Frame(root)
f.pack()

fb = Frame(root)
fb.pack(side='bottom')
Button(fb, bitmap='snackPlay', command=play).pack(side='left')
Button(fb, bitmap='snackStop', command=stop).pack(side='left')

root.mainloop()
 
R

Russell E. Owen

I'm not sure exactly what you mean by "can't control the duration...".
If you just want to call s.stop() at some specified time after starting
the sound, then use "after", as in:

def play():
s.play
...
root.after(1000, stop)

If it's something more complicated, please explain.

I'll be curious to see how this discussion goes. I'm using snack to play
simple sound files. On the whole it works, but sometimes I get snaps,
pops and other oddities.

-- Russell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top