pyao makes the right sound but why?

2

'2+

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?
 
A

Anssi Saari

'2+ said:
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

'2+

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/tit01.wav
http://sarigama.namaste.jp/oil/tit02.wav
http://sarigama.namaste.jp/oil/tit03.wav
http://sarigama.namaste.jp/oil/tit04.wav
http://sarigama.namaste.jp/oil/tit05.wav
http://sarigama.namaste.jp/oil/tit06.wav
http://sarigama.namaste.jp/oil/tit07.wav

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)?
 
2

'2+

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

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/tit01.wav
http://sarigama.namaste.jp/oil/tit02.wav
http://sarigama.namaste.jp/oil/tit03.wav
http://sarigama.namaste.jp/oil/tit04.wav
http://sarigama.namaste.jp/oil/tit05.wav
http://sarigama.namaste.jp/oil/tit06.wav
http://sarigama.namaste.jp/oil/tit07.wav

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)?
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top