Hi all,
I'm tinkering with some fuzzy logic code generators, and though they
produce ANSI-C, my skills as a programmer aren't quite up to the job of
making generated code wrap around PD-ways. I thought of maybe doing the
pipe thing, so I wrote (with help from local LUG) the bit of C below...any
advice on how to wrap this in PD? Also, is this something I should be able
to do from within PD, say with 'shell' (and BTW, where -can- I find the
shell object)
cheers,
dc
/* a bit of c to do pipes, by dc
* bi-pipe.c
* -xs
*
* practical usage:
*
* % bi-pipe 'ls /' 'cat >~/tmp/output'
* % bi-pipe 'ls /adsadsa' 'cat >~/tmp/output'
* % bi-pipe -d 'ls /adsadsa' 'cat >~/tmp/output'
* ls: /adsadsa: No such file or directory
* %
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h> /* needed by some glibc versions, remove if trouble */
enum
{
DEBUG = 0x1
};
void myerr(int, char *);
void usage(void);
void do_half(int, char *);
extern char **environ;
int flags;
int
main(int argc, char *argv[])
{
int fd[2], x;
while ((x = getopt(argc, argv, "dh")) != -1)
{
switch (x)
{
case 'd':
flags |= DEBUG;
break;
case 'h':
default:
usage();
}
}
argc -= optind;
argv += optind;
if (argc == 0)
usage();
if (socketpair(PF_UNIX, SOCK_STREAM, 0, fd) == -1)
myerr(1, "pipe");
switch (fork())
{
case -1:
myerr(1, "fork");
case 0:
close(fd[1]);
do_half(fd[0], argv[0]);
break;
default:
close(fd[0]);
do_half(fd[1], argv[1]);
break;
}
return 1;
}
void
do_half(int fd, char *prog)
{
char *argv[4];
int x;
if (flags & DEBUG)
x = 1;
else
x = 2;
for (; x >= 0; x--)
if (dup2(fd, x) == -1)
myerr(1, "dup2");
close(fd);
argv[0] = "/bin/sh";
argv[1] = "-c";
argv[2] = prog;
argv[3] = NULL;
execve(argv[0], argv, environ);
myerr(1, "execve");
}
void
myerr(int status, char *str)
{
perror(str);
exit(status);
}
void
usage(void)
{
fprintf(stderr, "usage: bi-pipe [-d] <cmd one> <cmd two>\n\n");
exit(1);
}
david casal --0+
---
d.casal(a)uea.ac.uk --9+
---
www.ariada.uea.ac.uk/~dcasal --)+
Hi,
just poking around in the PD sources looking for info on tabread
when I came across a comment in the soundfile.c that the reason
writesf~ and readsf~ don't work in windows is 'cos they need
pthreads - and someone should find a package.
Well I did. Get it here:
http://sources.redhat.com/pthreads-win32/
get the latest build - put the include path as a -I and put the lib in the
lib list - I used pthreadVC.lib - there are two others but it all worked
so I didn't read the docs ;-). Remove the #ifdef __linuxs_'s and do
a build. Put pthreadVC.dll in pd\bin and off you go. The 5.reference
patches now work. Haven't tested them thoughly - in and out of
meetings this afternoon but it all looks good.
cheers
mark
yo, men,
made a little object, just for fun, called scratcher~.
it just records a sound and lets you scratch it with a mouse,
might connect another input device on it one day.
booya !!!!
Yves/
http://ydegoyon.free.fr
hi
i want 2 v abl 2 control
pan/tilt and zoom of a vx1000
with midi controller data
whats d easiest way 2 do d hack?
also what external device do i need
2 do d paning and tilting
thanks
sonofsound.com
hi,
i was wondering if anybody is writing music with PD and if so, what
seuqencer they use, and how they perform live? if they do...
anyway, any comments would be great.
ekran.matt
hi
does anyone have experience with pd running on a dual system?
basically, if i just start 1 pd normally, will it be using both cpus
transparently?
i just made some small test yesterday and i did not have the impression
that this was the case.
pd -> loadmeter said: ~100%
top says pd ~50%
from my experience with dual machines so far, top should actually go up
to 200% with 2 cpus on full load?
then there's the mosix setup, which requires some kernel patching and
brings in the 'runon' command, but all the info i could get seems really
outdated and applying only for up to 2.2 kernels, e.g. the SMP-HOWTO on
linuxdoc.org seems really not up to date ..
any hints ?
-- I x D u · O R g
I have an enquiry, which is the best operating system
for pd after windows 98? We have to upgrade a few
computers and I'm just curious what people out there
think? Thanks in advance!
ROry.
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Hi,
in case, someone wonders how to drive PD (and other software synths) from a
Midi Sequencer on Linux with ALSA installed, I wrote a general Howto about
this topic, that is now available at:
http://www.boosthardware.com/LAU/quicktoots/
Ciao,
--
__ __
Frank Barknecht ____ ______ ____ __ trip\ \ / /wire ______
/ __// __ /__/ __// // __ \ \/ / __ \\ ___\
/ / / ____/ / / / // ____// /\ \\ ___\\____ \
/_/ /_____/ /_/ /_//_____// / \ \\_____\\_____\
/_/ \_\
hello everyone ,
i just finished porting of exciter to windows , i am running it on a winxp
machine here . havent done to much work with it yet, and it took some
manuvering to get it to run , so please let me know if you encounter any
problems . you can find the source i used along with the compiled external
at http://www.rpi.edu/~ardelg/ under the folder with appropiate version of
pd you are working with .
on a side note i also uploaded the source along with visual studio .net work
spaces for the grid and pianoroll objects , for any onw that is interested .
joge .