Re: [Tutor] Musical note on python

2012-09-16 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
winsound.Beep() takes only integral values for frequency. Therefore you cannot use it if you want either just intonation or equal temperment scales exactly. -- regards, Sarma. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Musical note on python

2012-09-14 Thread eryksun
On Thu, Sep 13, 2012 at 8:37 PM, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > > Error: "name data undefined" > >> import wave >> import winsound >> from cStringIO import StringIO >> >> def get_wave(data): >> f = StringIO() >> w = wave.open(f, 'w') >> w.setnchannels(1

Re: [Tutor] Musical note on python

2012-09-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
This worked on my computor. Thank you. It will take me sometime to digest the program. -- regards, Sarma. On Fri, Sep 14, 2012 at 12:33 AM, eryksun wrote: > > I've modified my previous script to add simple polyphonic sound. I > included a basic square wave and a sawtooth wave, plus a random >

Re: [Tutor] Musical note on python

2012-09-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Error: "name data undefined" On Fri, Sep 14, 2012 at 12:33 AM, eryksun wrote: > On Thu, Sep 13, 2012 at 11:48 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ > wrote: > > > > As far as programming volume is concerned winsound.Beep has only > frequency > > and duration. pyaudio module appears to have provision

Re: [Tutor] Musical note on python

2012-09-13 Thread eryksun
On Thu, Sep 13, 2012 at 11:48 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > > As far as programming volume is concerned winsound.Beep has only frequency > and duration. pyaudio module appears to have provision for volume control. You should be able to add a wave header to a raw byte string. For example

Re: [Tutor] Musical note on python

2012-09-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
As far as programming volume is concerned winsound.Beep has only frequency and duration. pyaudio module appears to have provision for volume control. Please refer to eryksun's post. -- regards, Sarma. On Thu, Sep 13, 2012 at 8:42 PM, Mark Lawrence wrote: > On 13/09/2012 13:29, D.V.N.Sarma డి.వి

Re: [Tutor] Musical note on python

2012-09-13 Thread Mark Lawrence
On 13/09/2012 13:29, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: I want to thank all of you who have come forward to help me. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Musical note on python

2012-09-13 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
I want to thank all of you who have come forward to help me. -- regards, Sarma. On Thu, Sep 13, 2012 at 10:46 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ < dvnsa...@gmail.com> wrote: > Yes. As far as I can see it does not contain any thing which > concerns the volume of sound. > > > -- > regards, > Sarma.

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
Yes. As far as I can see it does not contain any thing which concerns the volume of sound. -- regards, Sarma. On Thu, Sep 13, 2012 at 5:42 AM, Mark Lawrence wrote: > On 13/09/2012 00:57, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > >> The Beep attribute of winsound module is useful. But the volume is f

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 13/09/2012 00:57, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: The Beep attribute of winsound module is useful. But the volume is feeble. Is there anyway to control the loudness. Have you read http://docs.python.org/library/winsound.html ? -- Cheers. Mark Lawrence. _

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
One can ofcourse increase the volume by adjusting master volume. But one needs ability to program volume level in order to produce sounds of different volume levels in a piece of music. -- regards, Sarma. On Thu, Sep 13, 2012 at 5:27 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ < dvnsa...@gmail.com> wrote: >

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
The Beep attribute of winsound module is useful. But the volume is feeble. Is there anyway to control the loudness. -- regards, Sarma. On Thu, Sep 13, 2012 at 4:45 AM, Alan Gauld wrote: > On 12/09/12 14:53, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > >> My OS is Windows XP. I have Python 2.7.3(32 bit).

Re: [Tutor] Musical note on python

2012-09-12 Thread Alan Gauld
On 12/09/12 17:01, Dwight Hutto wrote: If you have Windows, then you should be on the pywin32 list, I usually assume linux on this list, but both get answered. Just to be clear the tutor list is not OS biased. Windows, MacOS or Linux are all equally welcome (and indeed MVS or OpenVMS if neces

Re: [Tutor] Musical note on python

2012-09-12 Thread Alan Gauld
On 12/09/12 14:53, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: My OS is Windows XP. I have Python 2.7.3(32 bit). My question is are there any commands in Python which directly allow me to produce a pure note Have a look at the audioop, wave and winsound modules. Also PyGame has some tools that try to do

Re: [Tutor] Musical note on python

2012-09-12 Thread Jerry Hill
On Wed, Sep 12, 2012 at 8:38 AM, Dwight Hutto wrote: > If you have Windows, then you should be on the pywin32 list, I usually > assume linux on this list, but both get answered. If you're having a problem with either the specific pywin32 module[1], or have questions about accessing the deep dark

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
> You have again snipped the entire context so nobody has a clue what you're > replying to. > > Cheers. > > Mark Lawrence. My last post refers to a previous post by eryksun. If you can't look up and read it, that's cool, because you're the only one complaining. And to put it into context that yo

Re: [Tutor] Musical note on python

2012-09-12 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
My OS is Windows XP. I have Python 2.7.3(32 bit). My question is are there any commands in Python which directly allow me to produce a pure note of a given frequency, given volume and given duration. Further can we access the different sound channels(sound card) available through Python. -- regar

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 12/09/2012 13:43, Dwight Hutto wrote: Also, you try eryksun's solution/example, pyaudio, as well, since it's a mpdule, using different forms for cross compatibility. You have again snipped the entire context so nobody has a clue what you're replying to. -- Cheers. Mark Lawrence. __

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
Also, you try eryksun's solution/example, pyaudio, as well, since it's a mpdule, using different forms for cross compatibility. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com ___ Tutor maillist - Tutor@python.org To unsubscribe or c

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
Please hit reply to all when responding. You should be able to type in 'sudo apt-get install speaker-test' or 'yum speaker-test' wrote: > This is what I got > import os os.system("speaker-test"+"--frequency 2000"+"--period 5000"+"--test sine") It should look like this: import

Re: [Tutor] Musical note on python

2012-09-12 Thread eryksun
On Wed, Sep 12, 2012 at 4:49 AM, Dwight Hutto wrote: > > pyaudio is compatible with python 3.0(just in case the OP has that > version, and it doesn't look like on the main site it has it listed, > nor if it's 64 bit, etc. I'm surprised they don't have an official Python 3 port yet. I see now the

Re: [Tutor] Musical note on python

2012-09-12 Thread Joel Goldstick
On Wed, Sep 12, 2012 at 2:47 AM, Mark Lawrence wrote: > On 12/09/2012 06:17, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: >> >> How to produce a musical note of given frequency,volume and duration in >> Python. I've not tried it, but I have seen several references to a game making framework called pygame.

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
On Wed, Sep 12, 2012 at 4:04 AM, Mark Lawrence wrote: > On 12/09/2012 08:47, Dwight Hutto wrote: >> >> So the following would be the script, except the ability to change >> specific values such as frequency with a scroll widget. >> >> import os >> >> #Variables for system call >> >> command_line_a

Re: [Tutor] Musical note on python

2012-09-12 Thread eryksun
On Wed, Sep 12, 2012 at 1:17 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > How to produce a musical note of given frequency,volume and duration in > Python. Do you just want a sinusoidal, pure tone, or do you need a more complex waveform? For a pure tone you can use math.sin(2 * math.pi * f * dt * n)

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 12/09/2012 08:47, Dwight Hutto wrote: So the following would be the script, except the ability to change specific values such as frequency with a scroll widget. import os #Variables for system call command_line_app_for sound = "speaker-test" frequency = " --frequency 2000" length_of_sound_

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 12/09/2012 08:41, Dwight Hutto wrote: Where have you forgotten to mention Ubuntu? "I'm sure...", the OP has specifically said "in Python", which implies to me using a Python package or module, hence my question above. Well, I was assuming he would write a command line app like so: Python

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
So the following would be the script, except the ability to change specific values such as frequency with a scroll widget. import os #Variables for system call command_line_app_for sound = "speaker-test" frequency = " --frequency 2000" length_of_sound_ms = " --period 5000" test_type = " --test

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
> Where have you forgotten to mention Ubuntu? "I'm sure...", the OP has > specifically said "in Python", which implies to me using a Python package or > module, hence my question above. > Well, I was assuming he would write a command line app like so: Python 2.7.3 (default, Aug 1 2012, 05:16:0

Re: [Tutor] Musical note on python

2012-09-12 Thread Mark Lawrence
On 12/09/2012 07:57, Dwight Hutto wrote: On Wed, Sep 12, 2012 at 2:47 AM, Mark Lawrence wrote: On 12/09/2012 06:17, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: How to produce a musical note of given frequency,volume and duration in Python. __**_ Tutor mail

Re: [Tutor] Musical note on python

2012-09-11 Thread Dwight Hutto
On Wed, Sep 12, 2012 at 2:47 AM, Mark Lawrence wrote: > On 12/09/2012 06:17, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > >> How to produce a musical note of given frequency,volume and duration in >> Python. >> >> >> __**_ >> Tutor maillist - Tutor@python.org

Re: [Tutor] Musical note on python

2012-09-11 Thread Dwight Hutto
On Wed, Sep 12, 2012 at 2:46 AM, Dwight Hutto wrote: > Python 2.7.3 (default, Aug 1 2012, 05:16:07) > [GCC 4.6.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import os > >>> os.system("speaker-test" + " --frequency 2000" + " --period 5000" + " > >>> -

Re: [Tutor] Musical note on python

2012-09-11 Thread Mark Lawrence
On 12/09/2012 06:17, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: How to produce a musical note of given frequency,volume and duration in Python. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailm

Re: [Tutor] Musical note on python

2012-09-11 Thread Dwight Hutto
Python 2.7.3 (default, Aug 1 2012, 05:16:07) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.system("speaker-test" + " --frequency 2000" + " --period 5000" + " >>> --test sine") -- Best Regards, David Hutto *CEO:* *http://www.

[Tutor] Musical note on python

2012-09-11 Thread D . V . N . Sarma డి . వి . ఎన్ . శర్మ
How to produce a musical note of given frequency,volume and duration in Python. -- regards, Sarma. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor