473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

tkSnack or other sound tool

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()
Jul 18 '05 #1
1 2690
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

In article <3d**************************@posting.google.com >,
jm*********@cvm.qc.ca (jmdeschamps) wrote:
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???

...
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()
...

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael Peuser | last post by:
There is not so much multimedia for Python. So I became quite excited about this nice sound output and manipulation tool. The DLL is not small but it can do a lot of things. Seems that it is in...
0
by: Justin Shaw | last post by:
I am using the tkSnack library to estimate the frequency from a sound file. The pitch seems to drop down an octave at 400 Hertz. For example A~440 Hertz comes out at 220 Hertz. When I use the...
0
by: didifouke | last post by:
Hi, I try to sample and playback speech using snack. My idea is to have a socket based server that plays back the sound and a client that samples the input from the sound card and sends it to...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
2
by: dunderhead | last post by:
Hello, I would like to use tkSnack through python to manipulate sounds on my fedora 4 system, but I am unable to get the following basic script to run: #!/usr/bin/env python from Tkinter...
3
by: larry | last post by:
Hi, my friends, My boss asked me to use sound card to do analog to digital conversion for my application. I know when we record sound, sound card changes anolog signal to digital file. I have no...
1
by: jamieboy | last post by:
I am trying to find out a possible resolution for my and my colleagues' common issue. we have a tool at office which we monitor the transport facilities. whenever there is an update this tool will...
0
by: rbann11 | last post by:
Thanks in advance, Hi, I am trying to put tkSnack's Minwave.py demo into Pmw Scrollcanvas, without success. I have included the sample, the error message and the documentation tkSnack says should...
0
by: Karthik | last post by:
Hi, I want to record a sound wave from a mic and at the same time invert it and play the inverted wave.My code goes as follows, however nothing is written into the E:\inverted.wav file.Thanks in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.