Sound programming: Tone production in Python?

Joseph Blaylock blaylock at indiana.edu
Thu Jan 23 09:42:46 EST 2003


On Thu, 23 Jan 2003, Andrew McGregor wrote:

> sndarray just gives you a way to access raw sample data.  If you want to
> make tones, calculate a sine wave with the right period, amplitude and
> zero-offset (which will depend on the output format and sample rate), and
> use sndarray to play it.

    Could you give me an example, perhaps, of how this might be accomplished?

> It would help to know better what you want to do, as messing with audio can
> pretty quickly get out of python's performance envelope.  As such, you
> might be better sticking to controlling something external (like a
> softsynth).

    Specifically what I want to do is emulate the behavior of BeOS's
    SineClock, the homepage for which (and a description of which) can be
    found at: http://music.calarts.edu/~glmrboy/SineClock.html

    It plays six channels, three of which are at 200, 300, and 450 hertz, and
    the other three of which are detuned slightly (between 0 and 5 hertz)
    based on the time.

        Joe

-- 
Joseph Blaylock, UITS SC SysAdmin
blaylock at indiana.edu     855-5772






More information about the Python-list mailing list