[PD] shell pipe to signal]

Alexandre Quessy listes at sourcelibre.com
Wed Dec 21 19:03:40 CET 2005


This command adds ";" at the end of every line of a text file before to send 
it. Then, we would just need to create a fifo with something like tail -f in 
order to create a udp channel to pd. 

cat data.txt | while read line; do echo "${line};" | nc -ub -q 0  localhost 
3001; done

:-))


-- 
Alexandre Quessy
http://www.sourcelibre.com/

L'harmonie la plus douce est les son de la voix de celle qu'on aime.
	-+- Jean de La Bruyere, Les Caractères -+-




Le Décembre 21, 2005 11:09 AM, august a écrit :
> Federico Bonelli say:
> > Hallo,
> >
> > I would like to pass some data from a shell to a pd patch that is on
> > another machine in the subnetwork. I have solved most of the troubles
> > using nc in the form
> >
> > >  more junk | nc 146.50.10.35 9000
> >
> > and putting my patch with netsreceive  on port 9000.
> >
> > My problem is rather banale for you guys, but i had not find a
> > solution in the archives of the list...
> >
> >  but how do i translate these data (floating point values in between
> > 0 and 1) in audio signal? The data represents a 8khz sample of sound....
>
> fredd,
>
> what you want to do sounds pretty interesting.
>
> some tips:  as far as I can remember, you will want to add ";" to all of
> your values that you send over the net.   the ";" is Pd's end of line
> character and I believe netreceive will expect one for each value.
>
> on the pd end, you probably want something like this:
>
> [netreceive 9000 1]
>
> [$1 10(
>
> [line~]
>
> [dac~]
>
>
> for that example, inorder to hear something, you would want to scale your
> original data to be in the range of  -1.0 <-> 1.0   (not 0.0 <-> 1.0)
>
> but, I just tried it now and can't seem to get nc to send more than just
> the first value.
>
> I try:   cat file.txt | nc -uv localhost 9000
> (the "-u" is for udp)
>
> the file.txt looks like this:
> 0.41;
> 0.31;
> 0.31;
> 0.21;
> 0.11;
>
>
> but "nc"   seems to hang with the first value of 0.41, not sending the
> rest.
>
> best of luck.
>
> -august.
>
>
>
>
>
> 	------------------
> 	http://aug.ment.org
>
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list





More information about the Pd-list mailing list