[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

pyao makes the right sound but why?

'2+

3/3/2010 2:50:00 PM

with my soy.py

tofu = soy.Bean()
x = tofu.pattern(44100 * 3)

creates x which is an array('h') and len(x) = 44100 * 6
this x is a stereo groove pattern that lasts 3 sec if samplerate is set to 44100
and since wave.py could save it to a_file.wav
i was wondering if

dev = ao.AudioDevice('alsa')
dev.play(x)

could launch me a semi realtime dj kinda sys
luckily .. it does seem to be making the right sound
but why?
the default of the samplerate and that 16bit happened to match with my thing x?
o but if i do

dev.play(x, len(x))

it only plays the half of the pattern
and

dev.play(x, 2 * len(x))

does the right thing

and the 2nd 4th 6th .. play gives me

ALSA underrun, at least 0ms

3rd, 5th, 7th does it fine

/usr/share/doc/python-pyao
doesn't teach me the answer
does somebody know more about pyao?

--
SaRiGaMa's Oil Vending Orchestra
is podcasting:
http://sarigama.namaste.jp/podca...
3 Answers

Anssi Saari

3/4/2010 6:43:00 PM

0

"'2+" <electriclightheads@gmail.com> writes:

> dev = ao.AudioDevice('alsa')
> dev.play(x)
>
> could launch me a semi realtime dj kinda sys
> luckily .. it does seem to be making the right sound
> but why?
> the default of the samplerate and that 16bit happened to match with my thing x?

Yes, that seems to be the case from help(ao). But I couldn't run
tofu = soy.Bean() since it seems to want tit01.wav. Do you make that
available somewhere?

'2+

3/5/2010 12:48:00 AM

0

omg! u r actually testin my dirty code?!
tnx that's great!
to create an instance
soy.py depends on(needs all of em):

http://sarigama.namaste.jp/oil...
http://sarigama.namaste.jp/oil...
http://sarigama.namaste.jp/oil...
http://sarigama.namaste.jp/oil...
http://sarigama.namaste.jp/oil...
http://sarigama.namaste.jp/oil...
http://sarigama.namaste.jp/oil...

and the easiest way to get the pattern is instance.pattern(howmanyframes)
the object updates itself with .sing()
and can affect each other with .jam_with(other_instance)

this design is to (in the future) create somethang together
with someone who would upload a short.wav on his site (to contrubute
... or maybe without willin to ;))
have to study urllib(?) for things to come
have to experiment more with picklin aspects too
but this is my attempt to beat the
"listenin to mp3s" culture

btw. where's that help(ao)?

On Fri, Mar 5, 2010 at 3:43 AM, Anssi Saari <as@sci.fi> wrote:
> "'2+" <electriclightheads@gmail.com> writes:
>
>> dev = ao.AudioDevice('alsa')
>> dev.play(x)
>>
>> could launch me a semi realtime dj kinda sys
>> luckily .. it does seem to be making the right sound
>> but why?
>> the default of the samplerate and that 16bit happened to match with my thing x?
>
> Yes, that seems to be the case from help(ao). But I couldn't run
> tofu = soy.Bean() since it seems to want tit01.wav. Do you make that
> available somewhere?
> --
> http://mail.python.org/mailman/listinfo/p...
>



--
SaRiGaMa's Oil Vending Orchestra
is podcasting:
http://sarigama.namaste.jp/podca...

'2+

3/5/2010 12:58:00 AM

0

o .. but u can use ur own tits.wav
if it is 44100 mono 16bit
and picklin n uploading the tofu
n having lots of those on the net
2 increase vegetrians is what soy.py wanted to mean

On Fri, Mar 5, 2010 at 9:48 AM, '2+ <electriclightheads@gmail.com> wrote:
> omg! u r actually testin my dirty code?!
> tnx that's great!
> to create an instance
> soy.py depends on(needs all of em):
>
> http://sarigama.namaste.jp/oil...
> http://sarigama.namaste.jp/oil...
> http://sarigama.namaste.jp/oil...
> http://sarigama.namaste.jp/oil...
> http://sarigama.namaste.jp/oil...
> http://sarigama.namaste.jp/oil...
> http://sarigama.namaste.jp/oil...
>
> and the easiest way to get the pattern is instance.pattern(howmanyframes)
> the object updates itself with .sing()
> and can affect each other with .jam_with(other_instance)
>
> this design is to (in the future) create somethang together
> with someone who would upload a short.wav on his site (to contrubute
> .. or maybe without willin to ;))
> have to study urllib(?) for things to come
> have to experiment more with picklin aspects too
> but this is my attempt to beat the
> "listenin to mp3s" culture
>
> btw. where's that help(ao)?
>
> On Fri, Mar 5, 2010 at 3:43 AM, Anssi Saari <as@sci.fi> wrote:
>> "'2+" <electriclightheads@gmail.com> writes:
>>
>>> dev = ao.AudioDevice('alsa')
>>> dev.play(x)
>>>
>>> could launch me a semi realtime dj kinda sys
>>> luckily .. it does seem to be making the right sound
>>> but why?
>>> the default of the samplerate and that 16bit happened to match with my thing x?
>>
>> Yes, that seems to be the case from help(ao). But I couldn't run
>> tofu = soy.Bean() since it seems to want tit01.wav. Do you make that
>> available somewhere?
>> --
>> http://mail.python.org/mailman/listinfo/p...
>>
>
>
>
> --
> SaRiGaMa's Oil Vending Orchestra
> is podcasting:
> http://sarigama.namaste.jp/podca...
>



--
SaRiGaMa's Oil Vending Orchestra
is podcasting:
http://sarigama.namaste.jp/podca...