Csound Csound-dev Csound-tekno Search About

[Csnd] Re: pulseaudio IO module

Date2008-03-28 23:16
Fromvictor
Subject[Csnd] Re: pulseaudio IO module
A small update:
 
a) sink names: it's possible to use a number instead of the full name, so
                         -odac:1  would select your second device (count starts at 0).
                       Much simpler (but note the colon, it's important)
 
b) server name: it's possible to connect to a specific server by using
                       -+server=<server_string>
                      where server_string is a name of a server or a more
                      complex server selection string (see pulseaudio.org on
                      server strings)
                      I have not tested, but the idea is that this is network
                      transparent, so you can connect to remote machines
                     as well.
 
c) stream names: it is possible to label the streams generated by csound, by
                      using
                      -+output_stream=<stream-name>
                       and
                      -+input_stream=<stream-name>
 
Full example
 
csound -odac:1 examples/trapped.csd -+rtaudio=pulse -+server=unix:/tmp/pulse-victor/native -+output_stream=trapped
 
 
Regards
 
Victor
 
 
 
                      
 
 
----- Original Message -----
From: victor
Sent: Thursday, March 27, 2008 11:16 PM
Subject: [Csnd] pulseaudio IO module

Hi all,
 
I just wanted to let you know that I have added an experimental
pulseaudio IO module for Csound. It's a work in progress, but
I have tested playback (and I have no reason to think input does not
work). Might require some fine tuning and some extras (such as
server selection) and I have only built and tested on Linux.
 
If you have pulseaudio libraries and headers (linux) scons will
build the module for you. Then you can do something like
 
csound -odac:<your_sink_name_here> examples/trapped.csd -+rtaudio=pulse
 
If you don't give a sink name, then the default is used (but in my case
the default is the modem...:(  ). The awkward thing is that the sink name
can be quite long, eg. alsa_output.pci_8086_24c5_alsa_playback_0
(they should have learned from jack...)
 
I'll see if I can have a way of simplifying this. But in the meantime, it's
there and you can try it out.
 
I suppose the code will build on other platforms supported by pulseaudio,
but I have not tried it yet.
 
Code is in CVS now. Enjoy (if you can...)
 
Regards
 
Victor 

Date2008-03-29 06:48
FromDiego Saá
Subject[Csnd] Just wondering
Hi,
I'd like to know which opcodes could I use to create a sound which is constantly going higher in pitch and uses its own output signal as an input in a recursive manner, so that each grain would be a sound with a low pitch at the start, and a high pitch at the end. A good limit for pitch, of course, could be 20Hz on the low end, and 22000 Hz in the high end. This sound would have self similarity, so I guess one could call it a sound fractal. Hope this made some sense.
Best regards,
Diego Saa


Kostenlos bloggen + eigene Homepage + Fotospeicher = MSN Spaces Kostenlos!

Date2008-03-29 09:10
FromUğur Güney
Subject[Csnd] Re: Just wondering
AttachmentsNone  

Date2008-03-29 09:20
FromUğur Güney
Subject[Csnd] Re: Just wondering
AttachmentsNone  

Date2008-03-29 13:41
FromIain McCurdy
Subject[Csnd] RE: Re: Just wondering
Where Diego talks about "uses its own output signal as an input in a recursive manner" I am put in mind of pitch shifting procedures with feedback loops. Is this what you have in mind Diego?
Iain

> Date: Sat, 29 Mar 2008 11:10:55 +0200
> From: ugurguney@gmail.com
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Re: Just wondering
>
> # Hi Diego,
> # I did not understand what you mean by "uses its own output signal as
> an input in a recursive manner" and its fractal structure. But if you
> want to have a sound of which pitch goes constantly higher or lower
> you must look at Shephard tones.
> http://en.wikipedia.org/wiki/Shepard_tone There is a sound example in
> Wikipedia for constanly lowering pitch.
> -ugur guney-
>
> On Sat, Mar 29, 2008 at 8:48 AM, Diego Saá <diegueins680@hotmail.com> wrote:
> >
> > Hi,
> > I'd like to know which opcodes could I use to create a sound which is
> > constantly going higher in pitch and uses its own output signal as an input
> > in a recursive manner, so that each grain would be a sound with a low pitch
> > at the start, and a high pitch at the end. A good limit for pitch, of
> > course, could be 20Hz on the low end, and 22000 Hz in the high end. This
> > sound would have self similarity, so I guess one could call it a sound
> > fractal. Hope this made some sense.
> > Best regards,
> > Diego Saa
> >
> > ________________________________
> > Kostenlos bloggen + eigene Homepage + Fotospeicher = MSN Spaces Kostenlos!
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Windows Live Hotmail is giving away Zunes. Enter for your chance to win.

Date2008-03-29 14:28
From"Chuckk Hubbard"
Subject[Csnd] Re: RE: Re: Just wondering
AttachmentsNone  

Date2008-03-30 18:38
FromDiego Saá
Subject[Csnd] RE: Re: RE: Re: Just wondering
Yes, that is exactly what I am thinking about! Gonna try using partikkel. Can't wait to hear what this sounds like!

Diego



> Date: Sat, 29 Mar 2008 16:28:04 +0200
> From: badmuthahubbard@gmail.com
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Re: RE: Re: Just wondering
>
> Perhaps so that, as the base frequency gets higher, it becomes the
> "xtrans" frequency. Grains of grains of grains...?
> The grains within the grains would be above 22k and so would perhaps
> just kind of disappear. As the pitch gets higher, the primary output
> becomes the grain. I can't imagine what it would sound like, perhaps
> like Shepherd tones, and I don't know the easiest way to do it. The
> granular opcodes I've worked with only take ftables as input. I
> haven't figured out partikkel yet, though.
>
> -Chuckk
>
> On Sat, Mar 29, 2008 at 3:41 PM, Iain McCurdy <i_mccurdy@hotmail.com> wrote:
> >
> > Where Diego talks about "uses its own output signal as an input in a
> > recursive manner" I am put in mind of pitch shifting procedures with
> > feedback loops. Is this what you have in mind Diego?
> > Iain
> >
> > > Date: Sat, 29 Mar 2008 11:10:55 +0200
> > > From: ugurguney@gmail.com
> > > To: csound@lists.bath.ac.uk
> > > Subject: [Csnd] Re: Just wondering
> >
> >
> > >
> > > # Hi Diego,
> > > # I did not understand what you mean by "uses its own output signal as
> > > an input in a recursive manner" and its fractal structure. But if you
> > > want to have a sound of which pitch goes constantly higher or lower
> > > you must look at Shephard tones.
> > > http://en.wikipedia.org/wiki/Shepard_tone There is a sound example in
> > > Wikipedia for constanly lowering pitch.
> > > -ugur guney-
> > >
> > > On Sat, Mar 29, 2008 at 8:48 AM, Diego Saá <diegueins680@hotmail.com>
> > wrote:
> > > >
> > > > Hi,
> > > > I'd like to know which opcodes could I use to create a sound which is
> > > > constantly going higher in pitch and uses its own output signal as an
> > input
> > > > in a recursive manner, so that each grain would be a sound with a low
> > pitch
> > > > at the start, and a high pitch at the end. A good limit for pitch, of
> > > > course, could be 20Hz on the low end, and 22000 Hz in the high end. This
> > > > sound would have self similarity, so I guess one could call it a sound
> > > > fractal. Hope this made some sense.
> > > > Best regards,
> > > > Diego Saa
> > > >
> > > > ________________________________
> > > > Kostenlos bloggen + eigene Homepage + Fotospeicher = MSN Spaces
> > Kostenlos!
> > >
> > > Send bugs reports to this list.
> > > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> > csound"
> >
> > ________________________________
> > Windows Live Hotmail is giving away Zunes. Enter for your chance to win.
>
>
>
> --
> http://www.badmuthahubbard.com
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Windows Live Messenger - Schreiben. Sehen. Hören. Wie im echten Leben. Windows Live Messenger!

Date2008-03-30 20:02
FromRory Walsh
Subject[Csnd] Re: RE: Re: RE: Re: Just wondering
Please post an example if you do get something interesting going. Good luck.

Rory.


Diego Saá wrote:
> Yes, that is exactly what I am thinking about! Gonna try using 
> partikkel. Can't wait to hear what this sounds like!
> 
> Diego
> 
> 
> ------------------------------------------------------------------------
>  > Date: Sat, 29 Mar 2008 16:28:04 +0200
>  > From: badmuthahubbard@gmail.com
>  > To: csound@lists.bath.ac.uk
>  > Subject: [Csnd] Re: RE: Re: Just wondering
>  >
>  > Perhaps so that, as the base frequency gets higher, it becomes the
>  > "xtrans" frequency. Grains of grains of grains...?
>  > The grains within the grains would be above 22k and so would perhaps
>  > just kind of disappear. As the pitch gets higher, the primary output
>  > becomes the grain. I can't imagine what it would sound like, perhaps
>  > like Shepherd tones, and I don't know the easiest way to do it. The
>  > granular opcodes I've worked with only take ftables as input. I
>  > haven't figured out partikkel yet, though.
>  >
>  > -Chuckk
>  >
>  > On Sat, Mar 29, 2008 at 3:41 PM, Iain McCurdy  
> wrote:
>  > >
>  > > Where Diego talks about "uses its own output signal as an input in a
>  > > recursive manner" I am put in mind of pitch shifting procedures with
>  > > feedback loops. Is this what you have in mind Diego?
>  > > Iain
>  > >
>  > > > Date: Sat, 29 Mar 2008 11:10:55 +0200
>  > > > From: ugurguney@gmail.com
>  > > > To: csound@lists.bath.ac.uk
>  > > > Subject: [Csnd] Re: Just wondering
>  > >
>  > >
>  > > >
>  > > > # Hi Diego,
>  > > > # I did not understand what you mean by "uses its own output 
> signal as
>  > > > an input in a recursive manner" and its fractal structure. But if you
>  > > > want to have a sound of which pitch goes constantly higher or lower
>  > > > you must look at Shephard tones.
>  > > > http://en.wikipedia.org/wiki/Shepard_tone There is a sound example in
>  > > > Wikipedia for constanly lowering pitch.
>  > > > -ugur guney-
>  > > >
>  > > > On Sat, Mar 29, 2008 at 8:48 AM, Diego Saá 
>  > > wrote:
>  > > > >
>  > > > > Hi,
>  > > > > I'd like to know which opcodes could I use to create a sound 
> which is
>  > > > > constantly going higher in pitch and uses its own output signal 
> as an
>  > > input
>  > > > > in a recursive manner, so that each grain would be a sound with 
> a low
>  > > pitch
>  > > > > at the start, and a high pitch at the end. A good limit for 
> pitch, of
>  > > > > course, could be 20Hz on the low end, and 22000 Hz in the high 
> end. This
>  > > > > sound would have self similarity, so I guess one could call it 
> a sound
>  > > > > fractal. Hope this made some sense.
>  > > > > Best regards,
>  > > > > Diego Saa
>  > > > >
>  > > > > ________________________________
>  > > > > Kostenlos bloggen + eigene Homepage + Fotospeicher = MSN Spaces
>  > > Kostenlos!
>  > > >
>  > > > Send bugs reports to this list.
>  > > > To unsubscribe, send email sympa@lists.bath.ac.uk with body 
> "unsubscribe
>  > > csound"
>  > >
>  > > ________________________________
>  > > Windows Live Hotmail is giving away Zunes. Enter for your chance to 
> win.
>  >
>  >
>  >
>  > --
>  > http://www.badmuthahubbard.com
>  >
>  > Send bugs reports to this list.
>  > To unsubscribe, send email sympa@lists.bath.ac.uk with body 
> "unsubscribe csound"
> 
> ------------------------------------------------------------------------
> Windows Live Messenger - Schreiben. Sehen. Hören. Wie im echten Leben. 
> Windows Live Messenger! 
> 

Date2008-03-31 08:30
FromDiego Saá
Subject[Csnd] RE: Re: RE: Re: RE: Re: Just wondering
Sure I will... I only have to be clearer about what I want to do lol. Thinking about it more carefully, the child grains within the parent grains are just like the parent grains... that is what I mean by self similarity... The child grains within the parent grains should be a sweep too. A good length for the sound (or composition, or whatever you want to call it) would be 3 minutes long. As I am almost  obsessed with the golden ratio, the two first child "grains" would be sweeps of 180 x 0.618 and 180s x 0.382 seconds long respectively. Both these grains would be constituted by two grains with the same proportion of length each of which would be constituted by two grains with the same proportion of length each of which would be constituted by two grains with the same proportion of length... well, you get the idea. Anyway, if anyone is interested in doing the csound code for this, it would be cool, because I am not so great with coding.

Diego



> Date: Sun, 30 Mar 2008 20:02:55 +0100
> From: rorywalsh@ear.ie
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Re: RE: Re: RE: Re: Just wondering
>
> Please post an example if you do get something interesting going. Good luck.
>
> Rory.
>
>
> Diego Saá wrote:
> > Yes, that is exactly what I am thinking about! Gonna try using
> > partikkel. Can't wait to hear what this sounds like!
> >
> > Diego
> >
> >
> > ------------------------------------------------------------------------
> > > Date: Sat, 29 Mar 2008 16:28:04 +0200
> > > From: badmuthahubbard@gmail.com
> > > To: csound@lists.bath.ac.uk
> > > Subject: [Csnd] Re: RE: Re: Just wondering
> > >
> > > Perhaps so that, as the base frequency gets higher, it becomes the
> > > "xtrans" frequency. Grains of grains of grains...?
> > > The grains within the grains would be above 22k and so would perhaps
> > > just kind of disappear. As the pitch gets higher, the primary output
> > > becomes the grain. I can't imagine what it would sound like, perhaps
> > > like Shepherd tones, and I don't know the easiest way to do it. The
> > > granular opcodes I've worked with only take ftables as input. I
> > > haven't figured out partikkel yet, though.
> > >
> > > -Chuckk
> > >
> > > On Sat, Mar 29, 2008 at 3:41 PM, Iain McCurdy <i_mccurdy@hotmail.com>
> > wrote:
> > > >
> > > > Where Diego talks about "uses its own output signal as an input in a
> > > > recursive manner" I am put in mind of pitch shifting procedures with
> > > > feedback loops. Is this what you have in mind Diego?
> > > > Iain
> > > >
> > > > > Date: Sat, 29 Mar 2008 11:10:55 +0200
> > > > > From: ugurguney@gmail.com
> > > > > To: csound@lists.bath.ac.uk
> > > > > Subject: [Csnd] Re: Just wondering
> > > >
> > > >
> > > > >
> > > > > # Hi Diego,
> > > > > # I did not understand what you mean by "uses its own output
> > signal as
> > > > > an input in a recursive manner" and its fractal structure. But if you
> > > > > want to have a sound of which pitch goes constantly higher or lower
> > > > > you must look at Shephard tones.
> > > > > http://en.wikipedia.org/wiki/Shepard_tone There is a sound example in
> > > > > Wikipedia for constanly lowering pitch.
> > > > > -ugur guney-
> > > > >
> > > > > On Sat, Mar 29, 2008 at 8:48 AM, Diego Saá <diegueins680@hotmail.com>
> > > > wrote:
> > > > > >
> > > > > > Hi,
> > > > > > I'd like to know which opcodes could I use to create a sound
> > which is
> > > > > > constantly going higher in pitch and uses its own output signal
> > as an
> > > > input
> > > > > > in a recursive manner, so that each grain would be a sound with
> > a low
> > > > pitch
> > > > > > at the start, and a high pitch at the end. A good limit for
> > pitch, of
> > > > > > course, could be 20Hz on the low end, and 22000 Hz in the high
> > end. This
> > > > > > sound would have self similarity, so I guess one could call it
> > a sound
> > > > > > fractal. Hope this made some sense.
> > > > > > Best regards,
> > > > > > Diego Saa
> > > > > >
> > > > > > ________________________________
> > > > > > Kostenlos bloggen + eigene Homepage + Fotospeicher = MSN Spaces
> > > > Kostenlos!
> > > > >
> > > > > Send bugs reports to this list.
> > > > > To unsubscribe, send email sympa@lists.bath.ac.uk with body
> > "unsubscribe
> > > > csound"
> > > >
> > > > ________________________________
> > > > Windows Live Hotmail is giving away Zunes. Enter for your chance to
> > win.
> > >
> > >
> > >
> > > --
> > > http://www.badmuthahubbard.com
> > >
> > > Send bugs reports to this list.
> > > To unsubscribe, send email sympa@lists.bath.ac.uk with body
> > "unsubscribe csound"
> >
> > ------------------------------------------------------------------------
> > Windows Live Messenger - Schreiben. Sehen. Hören. Wie im echten Leben.
> > Windows Live Messenger!
> > <http://imagine-msn.com/messenger/launch80/default.aspx?locale=de-de&source=joinmsncom/messenger>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Testen Sie Live.com - die schnelle, personalisierte Homepage, über die Sie auf alle für Sie relevanten Inhalte zentral zugreifen können. Hier klicken!

Date2008-03-31 09:18
FromRory Walsh
Subject[Csnd] Re: RE: Re: RE: Re: RE: Re: Just wondering
> anyone is interested in doing the csound code for this, it would be 
> cool, because I am not so great with coding.

Have a crack at it, it shouldn't take too long to figure it out. You can 
ask as many questions as you like on the list, people are generally very 
helpful. Best of luck.

Rory.





Date2008-11-01 17:00
Fromcochedelaferte
Subject[Csnd] Re: pulseaudio IO module
Hi Victor,



First, great thank's for vour rtpulse module : it's for Solaris/Sparc the
best way to get realtime audio output. 

For the moment i have some difficulties to perform that fully, but i think
that they should really solvable.


1) I launch Pulseaudio :

bash-3.00# /usr/local/bin/64/pulseaudio/pulseaudio -vv
W: This program is not intended to be run as root (unless --system is
specified).
I: device opened in O_RDWR mode.
I: created 0 "solaris_input" with sample spec "s16be 2ch 44100Hz"
I: created 0 "solaris_output" with sample spec "s16be 2ch 44100Hz"
I: created 1 "solaris_output.monitor" with sample spec "s16be 2ch 44100Hz"
I: Loaded "module-solaris" (index: #0; argument: "device=/dev/audio").
I: loaded 1 modules.
I: Loaded "module-detect" (index: #1; argument: "").
I: Loaded "module-esound-protocol-unix" (index: #2; argument: "").
I: loading cookie from disk.
I: Loaded "module-native-protocol-unix" (index: #3; argument: "").
I: starting with empty ruleset.
I: Loaded "module-volume-restore" (index: #4; argument: "").
I: Loaded "module-rescue-streams" (index: #5; argument: "").
I: Loaded "module-gconf" (index: #6; argument: "").
I: Daemon startup complete.
I: Unloading "module-detect" (index: #1).
I: Unloaded "module-detect" (index: #1).


I changeded nothing in any of the three Pulsaudio config files, but it
appears clearly that, from the build itself and also from the module-detect
action my config is fully recognized. But something can be missing without i
know if yes or not...
Also, at this point i'm able to play immediately with Paplay any .wav file i
have, by example any provided after a compilation by Orch.



2) I launch Csound :

bash-3.00# ./csound -o dac examples/trapped.csd -+rtaudio=pulse
0dBFS level = 32768,0
Csound version 5.09 (float samples) Oct 28 2008
libsndfile-1.0.17
UnifiedCSD:  examples/trapped.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
orchname:  /var/tmp/aaaDpaq1c.orc
scorename: /var/tmp/baaEpaq1c.sco
rtaudio: pulseaudio module enabled
orch compiler:
397 lines read
        instr   1
        instr   2
        instr   3
        instr   4
        instr   5
        instr   6
        instr   7
        instr   8
        instr   9
        instr   10
        instr   11
        instr   12
        instr   13
        instr   98
        instr   99
Elapsed time at end of orchestra compile: real: 0.108s, CPU: 0.020s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.112s, CPU: 0.020s
Csound version 5.09 (float samples) Oct 28 2008
displays suppressed
0dBFS level = 32768.0
orch now loaded
audio buffered in 256 sample-frame blocks
PulseAudio output server: default
writing 1024-byte blks of shorts to dac
SECTION 1:
ftable 1:
ftable 2:
ftable 3:
ftable 4:
ftable 5:
ftable 6:
ftable 7:
ftable 8:
ftable 9:
ftable 10:
ftable 11:
ftable 12:
ftable 13:
ftable 14:
ftable 15:
ftable 16:
ftable 17:
ftable 18:
ftable 19:
ftable 20:
ftable 21:
ftable 22:
new alloc for instr 1:


And at this point, it stops. I omitted to tell that, no invoking the
realtime output, trapped.csd compiles as well and provides the .wav file. 


Here the output from Pulseaudio :

I: created 0 "Native client (UNIX socket client)"
I: client 0 changed name from "Native client (UNIX socket client)" to
"csound"
I: created 0 "csound-out" on solaris_output with sample spec float32le 2ch
44100Hz
D: Memory block too large for pool: 1048576 > 16368
D: memblockq requested: maxlength=264600, tlength=176400, base=8,
prebuf=174636, minreq=1764
D: memblockq sanitized: maxlength=264600, tlength=176400, base=8,
prebuf=174640, minreq=1760
I: Creating new entry for 
D: Solaris buffer underflow!


- as you can see, i launched just with "-o dac" because for me /dev/audio is
the standard Pulseaudio output. I can also specify "-o dac:0", that gives
the same thing.

- the problem of "Memory block too large for pool: 1048576 > 16368" : i have
that with, apparently, any example files. For the moment i have no solution
for that, even wusing -b -B which works fine for all eventuals memory block
warnings i can get after. Other hand, it seems that here isn't the problem,
because just playing by example Xanadu.wav i get also this kind of warning
without that affects a really good musical output.



3) Launching xanadu with realtime output :

It starts, prints the graphic, and stops at :

new alloc for instr 1:
new alloc for instr 3:
new alloc for instr 3:
new alloc for instr 3:
new alloc for instr 3:
new alloc for instr 3:
new alloc for instr 3:
B  0.000 ..  0.100 T  0.100 TT  0.100 M:   1997.6   1999.2
new alloc for instr 1:
B  0.100 ..  0.200 T  0.200 TT  0.200 M:   5810.3   3944.8
new alloc for instr 1:



Here the Pulseaudio output :

I: created 5 "Native client (UNIX socket client)"
I: client 5 changed name from "Native client (UNIX socket client)" to
"csound"
I: Restoring volume for 
I: Restoring sink for 
I: created 5 "csound-out" on solaris_output with sample spec float32le 2ch
44100Hz
D: Memory block too large for pool: 1048576 > 16368
D: memblockq requested: maxlength=264600, tlength=176400, base=8,
prebuf=174636, minreq=1764
D: memblockq sanitized: maxlength=264600, tlength=176400, base=8,
prebuf=174640, minreq=1760


As you see, this time no question of "buffer underflow". Just it stops.


- trying several experiences with -b -B, i some cases i get some parasit
sound, that means that there is really a connection btw Csound and
Pulseaudio. Also, the Pulsaudio output confirms that.



OK : sorry to post so a long message, but it seemed me important to provide
both Pulseaudio and Csound outputs.

If you have a bit time to think all that about, can you tell me if that
gives you any idea at any way i can try to learn more ?



Cheers,


Sergio






-- 
View this message in context: http://www.nabble.com/pulseaudio-IO-module-tp16342198p20282143.html
Sent from the Csound - General mailing list archive at Nabble.com.