- Reestructuración de ficheros y directorios general
- merge v0.01 --> Añadido fileselector - Añadidas fuentes de Gem y Pure Data - pix2jpg incluído en Gem. Archivos de construcción de Gem modificados. - Añadido fichero ompiling.txt con instrucciones de compilación
This commit is contained in:
parent
c9adfd020b
commit
e85d191b46
3100 changed files with 775434 additions and 3073 deletions
31
pd-0.44-2/extra/pd~/GNUmakefile.am
Normal file
31
pd-0.44-2/extra/pd~/GNUmakefile.am
Normal file
|
@ -0,0 +1,31 @@
|
|||
## Makefile.am -- Process this file with automake to produce Makefile.in
|
||||
|
||||
NAME=pd~
|
||||
|
||||
PATCHES = pd~-help.pd pd~-subprocess.pd
|
||||
OTHERDATA =
|
||||
|
||||
pd__la_SOURCES = pd~.c
|
||||
pdsched_la_SOURCES = pdsched.c
|
||||
|
||||
external_LTLIBRARIES = pd~.la pdsched.la
|
||||
dist_external_DATA = $(PATCHES) $(OTHERDATA)
|
||||
|
||||
|
||||
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src -DPD
|
||||
AM_CFLAGS = @ARCH_CFLAGS@
|
||||
AM_LIBS = $(LIBM)
|
||||
AM_LDFLAGS = -module -avoid-version -shared @ARCH_LDFLAGS@ -shrext .@EXTERNAL_EXTENSION@ -L$(top_srcdir)/src
|
||||
|
||||
externaldir = $(pkglibdir)/extra/$(NAME)
|
||||
|
||||
|
||||
if MINGW
|
||||
AM_LIBS += -lpd
|
||||
endif
|
||||
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
621
pd-0.44-2/extra/pd~/GNUmakefile.in
Normal file
621
pd-0.44-2/extra/pd~/GNUmakefile.in
Normal file
|
@ -0,0 +1,621 @@
|
|||
# GNUmakefile.in generated by automake 1.11.6 from GNUmakefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
@MINGW_TRUE@am__append_1 = -lpd
|
||||
subdir = extra/pd~
|
||||
DIST_COMMON = $(dist_external_DATA) $(srcdir)/GNUmakefile.am \
|
||||
$(srcdir)/GNUmakefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/android.m4 \
|
||||
$(top_srcdir)/m4/iphone.m4 $(top_srcdir)/m4/universal.m4 \
|
||||
$(top_srcdir)/m4/generated/libtool.m4 \
|
||||
$(top_srcdir)/m4/generated/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/generated/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/generated/ltversion.m4 \
|
||||
$(top_srcdir)/m4/generated/lt~obsolete.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(externaldir)" \
|
||||
"$(DESTDIR)$(externaldir)"
|
||||
LTLIBRARIES = $(external_LTLIBRARIES)
|
||||
pdsched_la_LIBADD =
|
||||
am_pdsched_la_OBJECTS = pdsched.lo
|
||||
pdsched_la_OBJECTS = $(am_pdsched_la_OBJECTS)
|
||||
pd__la_LIBADD =
|
||||
am_pd__la_OBJECTS = pd~.lo
|
||||
pd__la_OBJECTS = $(am_pd__la_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/m4/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(pdsched_la_SOURCES) $(pd__la_SOURCES)
|
||||
DIST_SOURCES = $(pdsched_la_SOURCES) $(pd__la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
DATA = $(dist_external_DATA)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALSA_LIBS = @ALSA_LIBS@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
ARCH_CFLAGS = @ARCH_CFLAGS@
|
||||
ARCH_LDFLAGS = @ARCH_LDFLAGS@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTERNAL_CFLAGS = @EXTERNAL_CFLAGS@
|
||||
EXTERNAL_EXTENSION = @EXTERNAL_EXTENSION@
|
||||
EXTERNAL_LDFLAGS = @EXTERNAL_LDFLAGS@
|
||||
EXTERNTARGET = @EXTERNTARGET@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAVE_MSGFMT = @HAVE_MSGFMT@
|
||||
INCLUDES = @INCLUDES@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
JACK_LIBS = @JACK_LIBS@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBM = @LIBM@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
subdirs = @subdirs@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
NAME = pd~
|
||||
PATCHES = pd~-help.pd pd~-subprocess.pd
|
||||
OTHERDATA =
|
||||
pd__la_SOURCES = pd~.c
|
||||
pdsched_la_SOURCES = pdsched.c
|
||||
external_LTLIBRARIES = pd~.la pdsched.la
|
||||
dist_external_DATA = $(PATCHES) $(OTHERDATA)
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src -DPD
|
||||
AM_CFLAGS = @ARCH_CFLAGS@
|
||||
AM_LIBS = $(LIBM) $(am__append_1)
|
||||
AM_LDFLAGS = -module -avoid-version -shared @ARCH_LDFLAGS@ -shrext .@EXTERNAL_EXTENSION@ -L$(top_srcdir)/src
|
||||
externaldir = $(pkglibdir)/extra/$(NAME)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/GNUmakefile.in: $(srcdir)/GNUmakefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign extra/pd~/GNUmakefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign extra/pd~/GNUmakefile
|
||||
.PRECIOUS: GNUmakefile
|
||||
GNUmakefile: $(srcdir)/GNUmakefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-externalLTLIBRARIES: $(external_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(external_LTLIBRARIES)'; test -n "$(externaldir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(externaldir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(externaldir)" || exit 1; \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(externaldir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(externaldir)"; \
|
||||
}
|
||||
|
||||
uninstall-externalLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(external_LTLIBRARIES)'; test -n "$(externaldir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(externaldir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(externaldir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-externalLTLIBRARIES:
|
||||
-test -z "$(external_LTLIBRARIES)" || rm -f $(external_LTLIBRARIES)
|
||||
@list='$(external_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
pdsched.la: $(pdsched_la_OBJECTS) $(pdsched_la_DEPENDENCIES) $(EXTRA_pdsched_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(externaldir) $(pdsched_la_OBJECTS) $(pdsched_la_LIBADD) $(LIBS)
|
||||
pd~.la: $(pd__la_OBJECTS) $(pd__la_DEPENDENCIES) $(EXTRA_pd__la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(externaldir) $(pd__la_OBJECTS) $(pd__la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdsched.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pd~.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-dist_externalDATA: $(dist_external_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(dist_external_DATA)'; test -n "$(externaldir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(externaldir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(externaldir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(externaldir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(externaldir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-dist_externalDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(dist_external_DATA)'; test -n "$(externaldir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(externaldir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: GNUmakefile $(LTLIBRARIES) $(DATA)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(externaldir)" "$(DESTDIR)$(externaldir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-externalLTLIBRARIES clean-generic clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f GNUmakefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-dist_externalDATA install-externalLTLIBRARIES
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f GNUmakefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-dist_externalDATA \
|
||||
uninstall-externalLTLIBRARIES
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean \
|
||||
clean-externalLTLIBRARIES clean-generic clean-libtool ctags \
|
||||
distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dist_externalDATA install-dvi \
|
||||
install-dvi-am install-exec install-exec-am \
|
||||
install-externalLTLIBRARIES install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-dist_externalDATA \
|
||||
uninstall-externalLTLIBRARIES
|
||||
|
||||
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
14
pd-0.44-2/extra/pd~/makefile
Normal file
14
pd-0.44-2/extra/pd~/makefile
Normal file
|
@ -0,0 +1,14 @@
|
|||
NAME=pd~
|
||||
CSYM=pd_tilde
|
||||
|
||||
include ../makefile.subdir
|
||||
|
||||
pd_linux: pdsched.pd_linux
|
||||
|
||||
d_fat: pdsched.d_fat
|
||||
d_ppc: pdsched.d_ppc
|
||||
|
||||
pdsched.pd_linux: pdsched.c
|
||||
$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
|
||||
$(CC) -shared -o $*.pd_linux $*.o -lc -lm
|
||||
rm -f $*.o
|
8
pd-0.44-2/extra/pd~/notes.txt
Normal file
8
pd-0.44-2/extra/pd~/notes.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
pd -schedlib `pwd`/pdsched
|
||||
|
||||
dolist:
|
||||
pd~ to delay starting subproc until asked
|
||||
figure out about setting nchannels from command line
|
||||
fix maximum nchannels in and out
|
||||
|
||||
|
106
pd-0.44-2/extra/pd~/pdsched.c
Normal file
106
pd-0.44-2/extra/pd~/pdsched.c
Normal file
|
@ -0,0 +1,106 @@
|
|||
/* Copyright 2008 Miller Puckette. Berkeley license; see the
|
||||
file LICENSE.txt in this distribution. */
|
||||
|
||||
/* A plug-in scheduler that turns Pd into a filter that inputs and
|
||||
outputs audio and messages. */
|
||||
|
||||
/* todo:
|
||||
fix schedlib code to use extent2
|
||||
figure out about if (sys_externalschedlib) { return; } in s_audio.c
|
||||
make buffer size ynamically growable
|
||||
|
||||
*/
|
||||
#include "m_pd.h"
|
||||
#include "s_stuff.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define BUFSIZE 65536
|
||||
static char inbuf[BUFSIZE];
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
|
||||
void glob_watchdog(t_pd *dummy);
|
||||
|
||||
static void pollwatchdog( void)
|
||||
{
|
||||
static int sched_diddsp, sched_nextpingtime;
|
||||
sched_diddsp++;
|
||||
if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0))
|
||||
{
|
||||
glob_watchdog(0);
|
||||
/* ping every 2 seconds */
|
||||
sched_nextpingtime = sched_diddsp +
|
||||
2 * (int)(sys_dacsr /(double)sys_schedblocksize);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int pd_extern_sched(char *flags)
|
||||
{
|
||||
int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV];
|
||||
int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV];
|
||||
int i, j, rate, advance, callback, chin, chout, fill = 0, c, blocksize;
|
||||
t_binbuf *b = binbuf_new();
|
||||
|
||||
sys_get_audio_params(&naudioindev, audioindev, chindev,
|
||||
&naudiooutdev, audiooutdev, choutdev, &rate, &advance, &callback,
|
||||
&blocksize);
|
||||
|
||||
chin = (naudioindev < 1 ? 0 : chindev[0]);
|
||||
chout = (naudiooutdev < 1 ? 0 : choutdev[0]);
|
||||
|
||||
/* fprintf(stderr, "Pd plug-in scheduler called, chans %d %d, sr %d\n",
|
||||
chin, chout, (int)rate); */
|
||||
sys_setchsr(chin, chout, rate);
|
||||
sys_audioapi = API_NONE;
|
||||
while ((c = getchar()) != EOF)
|
||||
{
|
||||
if (c == ';')
|
||||
{
|
||||
int n;
|
||||
t_atom *ap;
|
||||
binbuf_text(b, inbuf, fill);
|
||||
n = binbuf_getnatom(b);
|
||||
ap = binbuf_getvec(b);
|
||||
fill = 0;
|
||||
if (n > 0 && ap[0].a_type == A_FLOAT)
|
||||
{
|
||||
/* a list -- take it as incoming signals. */
|
||||
int chan, nchan = n/DEFDACBLKSIZE;
|
||||
t_sample *fp;
|
||||
for (i = chan = 0, fp = sys_soundin; chan < nchan; chan++)
|
||||
for (j = 0; j < DEFDACBLKSIZE; j++)
|
||||
*fp++ = atom_getfloat(ap++);
|
||||
for (; chan < chin; chan++)
|
||||
for (j = 0; j < DEFDACBLKSIZE; j++)
|
||||
*fp++ = 0;
|
||||
sched_tick(sys_time+sys_time_per_dsp_tick);
|
||||
sys_pollgui();
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
|
||||
pollwatchdog();
|
||||
#endif
|
||||
printf(";\n");
|
||||
for (i = chout*DEFDACBLKSIZE, fp = sys_soundout; i--; fp++)
|
||||
{
|
||||
printf("%g\n", *fp);
|
||||
*fp = 0;
|
||||
}
|
||||
printf(";\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
else if (n > 1 && ap[0].a_type == A_SYMBOL)
|
||||
{
|
||||
t_pd *whom = ap[0].a_w.w_symbol->s_thing;
|
||||
if (!whom)
|
||||
error("%s: no such object", ap[0].a_w.w_symbol->s_name);
|
||||
else if (ap[1].a_type == A_SYMBOL)
|
||||
typedmess(whom, ap[1].a_w.w_symbol, n-2, ap+2);
|
||||
else pd_list(whom, 0, n-1, ap+1);
|
||||
}
|
||||
}
|
||||
else if (fill < BUFSIZE)
|
||||
inbuf[fill++] = c;
|
||||
else if (fill == BUFSIZE)
|
||||
fprintf(stderr, "pd-extern: input buffer overflow\n");
|
||||
}
|
||||
return (0);
|
||||
}
|
75
pd-0.44-2/extra/pd~/pd~-help.pd
Normal file
75
pd-0.44-2/extra/pd~/pd~-help.pd
Normal file
|
@ -0,0 +1,75 @@
|
|||
#N canvas 12 0 566 872 12;
|
||||
#X msg 31 406 foo bar baz;
|
||||
#X obj 189 466 osc~ 440;
|
||||
#X obj 127 645 env~ 8192;
|
||||
#X floatatom 127 694 5 0 0 0 - - -;
|
||||
#X msg 434 807 \; pd dsp 1;
|
||||
#X msg 24 332 pd~ stop;
|
||||
#X obj 127 670 i;
|
||||
#X obj 241 643 env~ 8192;
|
||||
#X floatatom 241 693 5 0 0 0 - - -;
|
||||
#X obj 241 669 i;
|
||||
#X obj 123 489 *~;
|
||||
#X obj 158 490 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
|
||||
1;
|
||||
#X obj 189 490 *~;
|
||||
#X obj 224 491 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
|
||||
1;
|
||||
#X obj 434 781 loadbang;
|
||||
#X obj 14 691 print x;
|
||||
#X msg 15 309 pd~ start pd~-subprocess.pd;
|
||||
#X obj 14 532 pd~ -ninsig 2 -noutsig 2 -fifo 20;
|
||||
#X obj 37 20 pd~;
|
||||
#X text 69 22 - run a pd sub-process;
|
||||
#X text 27 57 The pd~ object starts and manages a Pd sub-process that
|
||||
can communicate with the super-process (this one) via audio channels
|
||||
and/or Pd messages. In this way you can take advantage of multi-core
|
||||
CPUs \, and/or use Pd features from within Max (if you're using the
|
||||
Max version of pd~).;
|
||||
#X text 24 251 Sending a new "start" message will stop the sub-process
|
||||
and start a new one. If you just want to stop the sub-process \, send
|
||||
"stop".;
|
||||
#X text 33 353 Any message besides "pd~" is sent to the sub-process.
|
||||
For instance \, the message below sends "bar baz" to any object in
|
||||
the sub-process named "foo" \, such as a "receive" object.;
|
||||
#X text 43 430 Audio signals appear in adc~ objects in the sub-process.
|
||||
The sub-process doesn't open real audio devices.;
|
||||
#X text 281 473 Creation args:;
|
||||
#X text 265 490 -insig <n> sets input audio channels;
|
||||
#X text 266 508 -outsig <n> sets output channels;
|
||||
#X text 269 542 -fifo <n> sets round-trip delay in blocks;
|
||||
#X text 272 559 -pddir <s> sets Pd directory \, e.g. \,;
|
||||
#X text 299 574 .../Pd-0.42.app/Contents/Resources;
|
||||
#X text 272 590 -scheddir <s> sets scheduler dir \, e.g. \,;
|
||||
#X text 297 607 .../.../Resources/extra/pd~;
|
||||
#X text 267 524 -sr <n> sets sample rate;
|
||||
#X text 20 716 The first outlet reports messages the sub-process sends
|
||||
us via "stdout" objects. Any other outlets are signals corresponding
|
||||
to "dac~" objects in the sub-process.;
|
||||
#X text 10 784 ATTENTION: DSP must be running in this process for the
|
||||
sub-process to run. This is because its clock is slaved to audio I/O
|
||||
it gets from us!;
|
||||
#X text 359 849 Updated for Pd version 0.42.;
|
||||
#X text 24 138 Messages with "pd~" selector control the sub-process.
|
||||
"pd~ start" takes as arguments any startup arguments you wish to send
|
||||
the sub-process. For example \, specify "-nogui" to stop the sub-process's
|
||||
GUI from appearing. You don't have to specify the number of channels
|
||||
in and out \, since that's set by creation arguments below. Audio config
|
||||
arguments arguments (-audiobuf \, -audiodev \, etc.) are ignored.;
|
||||
#X connect 0 0 17 0;
|
||||
#X connect 1 0 10 0;
|
||||
#X connect 1 0 12 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 5 0 17 0;
|
||||
#X connect 6 0 3 0;
|
||||
#X connect 7 0 9 0;
|
||||
#X connect 9 0 8 0;
|
||||
#X connect 10 0 17 0;
|
||||
#X connect 11 0 10 1;
|
||||
#X connect 12 0 17 1;
|
||||
#X connect 13 0 12 1;
|
||||
#X connect 14 0 4 0;
|
||||
#X connect 16 0 17 0;
|
||||
#X connect 17 0 15 0;
|
||||
#X connect 17 1 2 0;
|
||||
#X connect 17 2 7 0;
|
60
pd-0.44-2/extra/pd~/pd~-subprocess.pd
Normal file
60
pd-0.44-2/extra/pd~/pd~-subprocess.pd
Normal file
|
@ -0,0 +1,60 @@
|
|||
#N canvas 577 21 563 559 12;
|
||||
#X obj 202 395 r foo;
|
||||
#X obj 202 423 print foo;
|
||||
#X obj 87 174 adc~;
|
||||
#X obj 72 442 stdout;
|
||||
#X msg 72 364 a b c;
|
||||
#X msg 455 441 \; pd dsp 1;
|
||||
#X obj 87 201 env~ 8192;
|
||||
#X floatatom 87 250 5 0 0 0 - - -;
|
||||
#X obj 87 226 i;
|
||||
#X obj 263 253 dac~;
|
||||
#X obj 262 185 osc~ 440;
|
||||
#X obj 262 219 *~;
|
||||
#X obj 297 220 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
|
||||
1;
|
||||
#X obj 332 186 osc~ 440;
|
||||
#X obj 332 220 *~;
|
||||
#X obj 367 221 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
|
||||
1;
|
||||
#X msg 86 411 bang;
|
||||
#X obj 455 417 loadbang;
|
||||
#X obj 160 201 env~ 8192;
|
||||
#X floatatom 160 250 5 0 0 0 - - -;
|
||||
#X obj 160 226 i;
|
||||
#X msg 86 388 4;
|
||||
#X text 62 8 This is a test patch to demonstrate the Pd~ object. It's
|
||||
intended as the patch to run in the sub-process. The sub-process (which
|
||||
is a separate instance of Pd) can be called from a Max or Pd super-process.
|
||||
;
|
||||
#X text 63 73 Audio inlets and outlets on the Pd~ object (in the super-process)
|
||||
talk to adc~ and dac~ objects here - so \, for instance \, the first
|
||||
adc~ here is the first inlet of the pd~ object \, and the first chanel
|
||||
of dac~ goes to the second outlet of pd~ (because the first one is
|
||||
for messages \, as shown further below.);
|
||||
#X text 58 283 Any message sent to a stdout object in this sub-process
|
||||
(below) appears on the first \, message outlet of the pd~ object in
|
||||
the super-process. The super-process can send messages to any "receive"
|
||||
object in this sub-process.;
|
||||
#X text 137 478 We turn DSP on at load for convenience - control objects
|
||||
in this patch will still work without it (unlike in the super-process
|
||||
\, where DSP must be on for time to move forward in the sub-process.)
|
||||
;
|
||||
#X text 351 538 Updated for Pd version 0.42.;
|
||||
#X connect 0 0 1 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 2 1 18 0;
|
||||
#X connect 4 0 3 0;
|
||||
#X connect 6 0 8 0;
|
||||
#X connect 8 0 7 0;
|
||||
#X connect 10 0 11 0;
|
||||
#X connect 11 0 9 0;
|
||||
#X connect 12 0 11 1;
|
||||
#X connect 13 0 14 0;
|
||||
#X connect 14 0 9 1;
|
||||
#X connect 15 0 14 1;
|
||||
#X connect 16 0 3 0;
|
||||
#X connect 17 0 5 0;
|
||||
#X connect 18 0 20 0;
|
||||
#X connect 20 0 19 0;
|
||||
#X connect 21 0 3 0;
|
771
pd-0.44-2/extra/pd~/pd~.c
Normal file
771
pd-0.44-2/extra/pd~/pd~.c
Normal file
|
@ -0,0 +1,771 @@
|
|||
/*
|
||||
pd~.c - embed a Pd process within Pd or Max.
|
||||
|
||||
Copyright 2008 Miller Puckette
|
||||
BSD license; see README.txt in this distribution for details.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable: 4305 4244)
|
||||
#endif
|
||||
|
||||
#ifdef MSP
|
||||
#include "ext.h"
|
||||
#include "z_dsp.h"
|
||||
#include "math.h"
|
||||
#include "ext_support.h"
|
||||
#include "ext_proto.h"
|
||||
#include "ext_obex.h"
|
||||
|
||||
typedef double t_floatarg;
|
||||
#define w_symbol w_sym
|
||||
#define A_SYMBOL A_SYM
|
||||
#define getbytes t_getbytes
|
||||
#define freebytes t_freebytes
|
||||
#define ERROR error(
|
||||
void *pd_tilde_class;
|
||||
#define MAXPDSTRING 4096
|
||||
#define DEFDACBLKSIZE 64
|
||||
#endif /* MSP */
|
||||
|
||||
#ifdef PD
|
||||
#include "m_pd.h"
|
||||
#include "s_stuff.h"
|
||||
static t_class *pd_tilde_class;
|
||||
char *class_gethelpdir(t_class *c);
|
||||
#define ERROR pd_error(x,
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
|
||||
#ifdef __x86_64__
|
||||
static char pd_tilde_dllextent[] = ".l_ia64",
|
||||
pd_tilde_dllextent2[] = ".pd_linux";
|
||||
#else
|
||||
static char pd_tilde_dllextent[] = ".l_i386",
|
||||
pd_tilde_dllextent2[] = ".pd_linux";
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
static char pd_tilde_dllextent[] = ".d_fat",
|
||||
pd_tilde_dllextent2[] = ".pd_darwin";
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
static char pd_tilde_dllextent[] = ".m_i386", pd_tilde_dllextent2[] = ".dll";
|
||||
#endif
|
||||
|
||||
/* ------------------------ pd_tilde~ ----------------------------- */
|
||||
|
||||
#define MSGBUFSIZE 65536
|
||||
|
||||
typedef struct _pd_tilde
|
||||
{
|
||||
#ifdef PD
|
||||
t_object x_obj;
|
||||
t_clock *x_clock;
|
||||
t_outlet *x_outlet1; /* for messages back from subproc */
|
||||
t_canvas *x_canvas;
|
||||
#endif /* PD */
|
||||
#ifdef MSP
|
||||
t_pxobject x_obj;
|
||||
void *x_outlet1;
|
||||
void *x_clock;
|
||||
#endif /* MSP */
|
||||
FILE *x_infd;
|
||||
FILE *x_outfd;
|
||||
char *x_msgbuf;
|
||||
int x_msgbufsize;
|
||||
int x_infill;
|
||||
int x_childpid;
|
||||
int x_ninsig;
|
||||
int x_noutsig;
|
||||
int x_fifo;
|
||||
t_float x_sr;
|
||||
t_symbol *x_pddir;
|
||||
t_symbol *x_schedlibdir;
|
||||
t_sample **x_insig;
|
||||
t_sample **x_outsig;
|
||||
} t_pd_tilde;
|
||||
|
||||
#ifdef MSP
|
||||
static void *pd_tilde_new(t_symbol *s, long ac, t_atom *av);
|
||||
static void pd_tilde_tick(t_pd_tilde *x);
|
||||
static t_int *pd_tilde_perform(t_int *w);
|
||||
static void pd_tilde_dsp(t_pd_tilde *x, t_signal **sp);
|
||||
void pd_tilde_assist(t_pd_tilde *x, void *b, long m, long a, char *s);
|
||||
static void pd_tilde_free(t_pd_tilde *x);
|
||||
void pd_tilde_setup(void);
|
||||
int main();
|
||||
void pd_tilde_minvel_set(t_pd_tilde *x, void *attr, long ac, t_atom *av);
|
||||
char *strcpy(char *s1, const char *s2);
|
||||
#endif
|
||||
|
||||
static void pd_tilde_tick(t_pd_tilde *x);
|
||||
static void pd_tilde_close(t_pd_tilde *x)
|
||||
{
|
||||
if (x->x_outfd)
|
||||
fclose(x->x_outfd);
|
||||
if (x->x_infd)
|
||||
fclose(x->x_infd);
|
||||
if (x->x_childpid > 0)
|
||||
waitpid(x->x_childpid, 0, 0);
|
||||
if (x->x_msgbuf)
|
||||
free(x->x_msgbuf);
|
||||
x->x_infd = x->x_outfd = 0;
|
||||
x->x_childpid = -1;
|
||||
x->x_msgbuf = 0;
|
||||
x->x_msgbufsize = 0;
|
||||
}
|
||||
|
||||
static void pd_tilde_readmessages(t_pd_tilde *x)
|
||||
{
|
||||
int gotsomething = 0, setclock = 0, wasempty = (x->x_infill == 0);
|
||||
FILE *infd = x->x_infd;
|
||||
while (1)
|
||||
{
|
||||
int c = getc(infd);
|
||||
if (c == EOF)
|
||||
{
|
||||
ERROR "pd~: %s", strerror(errno));
|
||||
pd_tilde_close(x);
|
||||
break;
|
||||
}
|
||||
if (x->x_infill >= x->x_msgbufsize)
|
||||
{
|
||||
char *z = realloc(x->x_msgbuf, x->x_msgbufsize+MSGBUFSIZE);
|
||||
if (!z)
|
||||
{
|
||||
ERROR "pd~: failed to grow input buffer");
|
||||
pd_tilde_close(x);
|
||||
break;
|
||||
}
|
||||
x->x_msgbuf = z;
|
||||
x->x_msgbufsize += MSGBUFSIZE;
|
||||
}
|
||||
x->x_msgbuf[x->x_infill++] = c;
|
||||
if (c == ';')
|
||||
{
|
||||
if (!gotsomething)
|
||||
break;
|
||||
gotsomething = 0;
|
||||
}
|
||||
else if (!isspace(c))
|
||||
gotsomething = setclock = 1;
|
||||
}
|
||||
if (setclock)
|
||||
clock_delay(x->x_clock, 0);
|
||||
else if (wasempty)
|
||||
x->x_infill = 0;
|
||||
}
|
||||
|
||||
static void pd_tilde_donew(t_pd_tilde *x, char *pddir, char *schedlibdir,
|
||||
char *patchdir, char *pdargs, int ninsig, int noutsig, int fifo,
|
||||
t_float samplerate)
|
||||
{
|
||||
int i, pid, pipe1[2], pipe2[2];
|
||||
char cmdbuf[MAXPDSTRING], pdexecbuf[MAXPDSTRING], schedbuf[MAXPDSTRING];
|
||||
struct stat statbuf;
|
||||
x->x_infd = x->x_outfd = 0;
|
||||
x->x_childpid = -1;
|
||||
snprintf(pdexecbuf, MAXPDSTRING, "%s/bin/pd", pddir);
|
||||
if (stat(pdexecbuf, &statbuf) < 0)
|
||||
{
|
||||
snprintf(pdexecbuf, MAXPDSTRING, "%s/../../../bin/pd", pddir);
|
||||
if (stat(pdexecbuf, &statbuf) < 0)
|
||||
{
|
||||
snprintf(pdexecbuf, MAXPDSTRING, "%s/pd", pddir);
|
||||
if (stat(pdexecbuf, &statbuf) < 0)
|
||||
{
|
||||
ERROR "pd~: can't stat %s", pdexecbuf);
|
||||
goto fail1;
|
||||
}
|
||||
}
|
||||
}
|
||||
snprintf(schedbuf, MAXPDSTRING, "%s/pdsched%s", schedlibdir,
|
||||
pd_tilde_dllextent);
|
||||
if (stat(schedbuf, &statbuf) < 0)
|
||||
{
|
||||
snprintf(schedbuf, MAXPDSTRING, "%s/pdsched%s", schedlibdir,
|
||||
pd_tilde_dllextent2);
|
||||
if (stat(schedbuf, &statbuf) < 0)
|
||||
{
|
||||
ERROR "pd~: can't stat %s", schedbuf);
|
||||
goto fail1;
|
||||
}
|
||||
}
|
||||
snprintf(cmdbuf, MAXPDSTRING,
|
||||
"'%s' -schedlib '%s'/pdsched -path '%s' -inchannels %d -outchannels %d -r %g %s\n",
|
||||
pdexecbuf, schedlibdir, patchdir, ninsig, noutsig, samplerate, pdargs);
|
||||
#if 0
|
||||
#ifdef PD
|
||||
fprintf(stderr, "%s", cmdbuf);
|
||||
#endif
|
||||
post("cmd: %s", cmdbuf);
|
||||
#endif
|
||||
if (pipe(pipe1) < 0)
|
||||
{
|
||||
ERROR "pd~: can't create pipe");
|
||||
goto fail1;
|
||||
}
|
||||
if (pipe(pipe2) < 0)
|
||||
{
|
||||
ERROR "pd~: can't create pipe");
|
||||
goto fail2;
|
||||
}
|
||||
if ((pid = fork()) < 0)
|
||||
{
|
||||
ERROR "pd~: can't fork");
|
||||
goto fail3;
|
||||
}
|
||||
else if (pid == 0)
|
||||
{
|
||||
/* child process */
|
||||
if (pipe2[1] == 0)
|
||||
{
|
||||
dup2(pipe2[1], 20);
|
||||
close(pipe2[1]);
|
||||
pipe2[1] = 20;
|
||||
}
|
||||
dup2(pipe1[0], 0);
|
||||
dup2(pipe2[1], 1);
|
||||
if (pipe1[0] >= 2)
|
||||
close(pipe1[0]);
|
||||
if (pipe1[1] >= 2)
|
||||
close(pipe1[1]);
|
||||
if (pipe2[0] >= 2)
|
||||
close(pipe2[0]);
|
||||
if (pipe2[1] >= 2)
|
||||
close(pipe2[1]);
|
||||
execl("/bin/sh", "sh", "-c", cmdbuf, (char*)0);
|
||||
_exit(1);
|
||||
}
|
||||
/* OK, we're parent */
|
||||
close(pipe1[0]);
|
||||
close(pipe2[1]);
|
||||
fcntl(pipe1[1], F_SETFD, FD_CLOEXEC);
|
||||
fcntl(pipe2[0], F_SETFD, FD_CLOEXEC);
|
||||
x->x_outfd = fdopen(pipe1[1], "w");
|
||||
x->x_infd = fdopen(pipe2[0], "r");
|
||||
x->x_childpid = pid;
|
||||
for (i = 0; i < fifo; i++)
|
||||
fprintf(x->x_outfd, "%s", ";\n0;\n");
|
||||
fflush(x->x_outfd);
|
||||
if (!(x->x_msgbuf = calloc(MSGBUFSIZE, 1)))
|
||||
{
|
||||
ERROR "pd~: can't allocate message buffer");
|
||||
goto fail3;
|
||||
}
|
||||
x->x_msgbufsize = MSGBUFSIZE;
|
||||
x->x_infill = 0;
|
||||
/* fprintf(stderr, "read...\n"); */
|
||||
pd_tilde_readmessages(x);
|
||||
/* fprintf(stderr, "... done.\n"); */
|
||||
return;
|
||||
fail3:
|
||||
close(pipe2[0]);
|
||||
close(pipe2[1]);
|
||||
if (x->x_childpid > 0)
|
||||
waitpid(x->x_childpid, 0, 0);
|
||||
fail2:
|
||||
close(pipe1[0]);
|
||||
close(pipe1[1]);
|
||||
fail1:
|
||||
x->x_infd = x->x_outfd = 0;
|
||||
x->x_childpid = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
static t_int *pd_tilde_perform(t_int *w)
|
||||
{
|
||||
t_pd_tilde *x = (t_pd_tilde *)(w[1]);
|
||||
int n = (int)(w[2]), i, j, numbuffill = 0, c;
|
||||
char numbuf[80];
|
||||
FILE *infd = x->x_infd;
|
||||
if (!infd)
|
||||
goto zeroit;
|
||||
fprintf(x->x_outfd, ";\n");
|
||||
if (!x->x_ninsig)
|
||||
fprintf(x->x_outfd, "0\n");
|
||||
else for (i = 0; i < x->x_ninsig; i++)
|
||||
{
|
||||
t_sample *fp = x->x_insig[i];
|
||||
for (j = 0; j < n; j++)
|
||||
fprintf(x->x_outfd, "%g\n", *fp++);
|
||||
for (; j < DEFDACBLKSIZE; j++)
|
||||
fprintf(x->x_outfd, "0\n");
|
||||
}
|
||||
fprintf(x->x_outfd, ";\n");
|
||||
fflush(x->x_outfd);
|
||||
i = j = 0;
|
||||
while (1)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
c = getc(infd);
|
||||
if (c == EOF)
|
||||
{
|
||||
if (errno)
|
||||
ERROR "pd~: %s", strerror(errno));
|
||||
else ERROR "pd~: subprocess exited");
|
||||
pd_tilde_close(x);
|
||||
goto zeroit;
|
||||
}
|
||||
else if (!isspace(c) && c != ';')
|
||||
{
|
||||
if (numbuffill < (80-1))
|
||||
numbuf[numbuffill++] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
t_sample z;
|
||||
if (numbuffill)
|
||||
{
|
||||
numbuf[numbuffill] = 0;
|
||||
if (sscanf(numbuf, "%f", &z) < 1)
|
||||
continue;
|
||||
if (i < x->x_noutsig)
|
||||
x->x_outsig[i][j] = z;
|
||||
if (++j >= DEFDACBLKSIZE)
|
||||
j = 0, i++;
|
||||
}
|
||||
numbuffill = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* message terminated */
|
||||
if (c == ';')
|
||||
break;
|
||||
}
|
||||
for (; i < x->x_noutsig; i++, j = 0)
|
||||
{
|
||||
for (; j < DEFDACBLKSIZE; j++)
|
||||
x->x_outsig[i][j] = 0;
|
||||
}
|
||||
pd_tilde_readmessages(x);
|
||||
return (w+3);
|
||||
zeroit:
|
||||
for (i = 0; i < x->x_noutsig; i++)
|
||||
{
|
||||
for (j = 0; j < DEFDACBLKSIZE; j++)
|
||||
x->x_outsig[i][j] = 0;
|
||||
}
|
||||
return (w+3);
|
||||
}
|
||||
|
||||
static void pd_tilde_dsp(t_pd_tilde *x, t_signal **sp)
|
||||
{
|
||||
int i, n = (x->x_ninsig || x->x_noutsig ? sp[0]->s_n : 1);
|
||||
t_sample **g;
|
||||
|
||||
for (i = 0, g = x->x_insig; i < x->x_ninsig; i++, g++)
|
||||
*g = (*(sp++))->s_vec;
|
||||
|
||||
for (i = 0, g = x->x_outsig; i < x->x_noutsig; i++, g++)
|
||||
*g = (*(sp++))->s_vec;
|
||||
|
||||
dsp_add(pd_tilde_perform, 2, x, n);
|
||||
}
|
||||
|
||||
static void pd_tilde_pdtilde(t_pd_tilde *x, t_symbol *s,
|
||||
int argc, t_atom *argv)
|
||||
{
|
||||
t_symbol *sel = ((argc > 0 && argv->a_type == A_SYMBOL) ?
|
||||
argv->a_w.w_symbol : gensym("?")), *schedlibdir;
|
||||
char *patchdir;
|
||||
if (sel == gensym("start"))
|
||||
{
|
||||
char pdargstring[MAXPDSTRING];
|
||||
if (x->x_infd)
|
||||
pd_tilde_close(x);
|
||||
pdargstring[0] = 0;
|
||||
argc--; argv++;
|
||||
#ifdef PD
|
||||
while (argc--)
|
||||
{
|
||||
atom_string(argv++, pdargstring + strlen(pdargstring),
|
||||
MAXPDSTRING - strlen(pdargstring));
|
||||
if (strlen(pdargstring) < MAXPDSTRING-1)
|
||||
strcat(pdargstring, " ");
|
||||
}
|
||||
patchdir = canvas_getdir(x->x_canvas)->s_name;
|
||||
#endif
|
||||
#ifdef MSP
|
||||
while (argc--)
|
||||
{
|
||||
/* because Mac pathnames sometimes have an evil preceeding
|
||||
colon character, we test for and silently eat them */
|
||||
if (argv->a_type == A_SYM)
|
||||
strncat(pdargstring, (*argv->a_w.w_sym->s_name == ':'?
|
||||
argv->a_w.w_sym->s_name+1 : argv->a_w.w_sym->s_name),
|
||||
MAXPDSTRING - strlen(pdargstring)-3);
|
||||
else if (argv->a_type == A_LONG)
|
||||
snprintf(pdargstring+strlen(pdargstring),
|
||||
MAXPDSTRING - strlen(pdargstring)-3, "%ld",
|
||||
argv->a_w.w_long);
|
||||
else if (argv->a_type == A_FLOAT)
|
||||
snprintf(pdargstring+strlen(pdargstring),
|
||||
MAXPDSTRING - strlen(pdargstring)-3, "%f",
|
||||
argv->a_w.w_float);
|
||||
strcat(pdargstring, " ");
|
||||
argv++;
|
||||
}
|
||||
patchdir = ".";
|
||||
#endif
|
||||
schedlibdir = x->x_schedlibdir;
|
||||
if (schedlibdir == gensym(".") && x->x_pddir != gensym("."))
|
||||
{
|
||||
char *pds = x->x_pddir->s_name, scheddirstring[MAXPDSTRING];
|
||||
int l = strlen(pds);
|
||||
if (l >= 4 && (!strcmp(pds+l-3, "bin") || !strcmp(pds+l-4, "bin/")))
|
||||
snprintf(scheddirstring, MAXPDSTRING, "%s/../extra/pd~", pds);
|
||||
else snprintf(scheddirstring, MAXPDSTRING, "%s/extra/pd~", pds);
|
||||
schedlibdir = gensym(scheddirstring);
|
||||
}
|
||||
pd_tilde_donew(x, x->x_pddir->s_name, schedlibdir->s_name,
|
||||
patchdir, pdargstring, x->x_ninsig, x->x_noutsig, x->x_fifo,
|
||||
x->x_sr);
|
||||
}
|
||||
else if (sel == gensym("stop"))
|
||||
{
|
||||
if (x->x_infd)
|
||||
pd_tilde_close(x);
|
||||
}
|
||||
else if (sel == gensym("pddir"))
|
||||
{
|
||||
if ((argc > 1) && argv[1].a_type == A_SYMBOL)
|
||||
{
|
||||
t_symbol *sym = argv[1].a_w.w_symbol;
|
||||
#ifdef MSP
|
||||
if (sym->s_name[0] == ':')
|
||||
sym = gensym(s->s_name+1);
|
||||
#endif
|
||||
x->x_pddir = sym;
|
||||
}
|
||||
else ERROR "pd~ pddir: needs symbol argument");
|
||||
}
|
||||
else ERROR "pd~: unknown control message: %s", sel->s_name);
|
||||
}
|
||||
|
||||
static void pd_tilde_free(t_pd_tilde *x)
|
||||
{
|
||||
#ifdef MSP
|
||||
dsp_free((t_pxobject *)x);
|
||||
#endif
|
||||
pd_tilde_close(x);
|
||||
clock_free(x->x_clock);
|
||||
}
|
||||
|
||||
/* -------------------------- Pd glue ------------------------- */
|
||||
#ifdef PD
|
||||
|
||||
static void pd_tilde_tick(t_pd_tilde *x)
|
||||
{
|
||||
int messstart = 0, i, n;
|
||||
t_atom *vec;
|
||||
t_binbuf *b;
|
||||
if (!x->x_msgbuf)
|
||||
return;
|
||||
b = binbuf_new();
|
||||
binbuf_text(b, x->x_msgbuf, x->x_infill);
|
||||
/* binbuf_print(b); */
|
||||
n = binbuf_getnatom(b);
|
||||
vec = binbuf_getvec(b);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (vec[i].a_type == A_SEMI)
|
||||
{
|
||||
if (i > messstart && vec[messstart].a_type == A_SYMBOL)
|
||||
outlet_anything(x->x_outlet1, vec[messstart].a_w.w_symbol,
|
||||
i-(messstart+1), vec+(messstart+1));
|
||||
else if (i > messstart)
|
||||
outlet_list(x->x_outlet1, 0, i-messstart, vec+messstart);
|
||||
messstart = i+1;
|
||||
}
|
||||
}
|
||||
binbuf_free(b);
|
||||
x->x_infill = 0;
|
||||
}
|
||||
|
||||
static void pd_tilde_anything(t_pd_tilde *x, t_symbol *s,
|
||||
int argc, t_atom *argv)
|
||||
{
|
||||
char msgbuf[MAXPDSTRING];
|
||||
if (!x->x_outfd)
|
||||
return;
|
||||
fprintf(x->x_outfd, "%s ", s->s_name);
|
||||
while (argc--)
|
||||
{
|
||||
atom_string(argv++, msgbuf, MAXPDSTRING);
|
||||
fprintf(x->x_outfd, "%s ", msgbuf);
|
||||
}
|
||||
fprintf(x->x_outfd, ";\n");
|
||||
}
|
||||
|
||||
static void *pd_tilde_new(t_symbol *s, int argc, t_atom *argv)
|
||||
{
|
||||
t_pd_tilde *x = (t_pd_tilde *)pd_new(pd_tilde_class);
|
||||
int ninsig = 2, noutsig = 2, j, fifo = 5;
|
||||
t_float sr = sys_getsr();
|
||||
t_sample **g;
|
||||
t_symbol *pddir = sys_libdir,
|
||||
*scheddir = gensym(class_gethelpdir(pd_tilde_class));
|
||||
/* fprintf(stderr, "pd %s, sched %s\n", pddir->s_name, scheddir->s_name); */
|
||||
while (argc > 0)
|
||||
{
|
||||
t_symbol *firstarg = atom_getsymbolarg(0, argc, argv);
|
||||
if (!strcmp(firstarg->s_name, "-sr") && argc > 1)
|
||||
{
|
||||
sr = atom_getfloatarg(1, argc, argv);
|
||||
argc -= 2; argv += 2;
|
||||
}
|
||||
else if (!strcmp(firstarg->s_name, "-ninsig") && argc > 1)
|
||||
{
|
||||
ninsig = atom_getfloatarg(1, argc, argv);
|
||||
argc -= 2; argv += 2;
|
||||
}
|
||||
else if (!strcmp(firstarg->s_name, "-noutsig") && argc > 1)
|
||||
{
|
||||
noutsig = atom_getfloatarg(1, argc, argv);
|
||||
argc -= 2; argv += 2;
|
||||
}
|
||||
else if (!strcmp(firstarg->s_name, "-fifo") && argc > 1)
|
||||
{
|
||||
fifo = atom_getfloatarg(1, argc, argv);
|
||||
argc -= 2; argv += 2;
|
||||
}
|
||||
else if (!strcmp(firstarg->s_name, "-pddir") && argc > 1)
|
||||
{
|
||||
pddir = atom_getsymbolarg(1, argc, argv);
|
||||
argc -= 2; argv += 2;
|
||||
}
|
||||
else if (!strcmp(firstarg->s_name, "-scheddir") && argc > 1)
|
||||
{
|
||||
scheddir = atom_getsymbolarg(1, argc, argv);
|
||||
argc -= 2; argv += 2;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
|
||||
if (argc)
|
||||
{
|
||||
pd_error(x,
|
||||
"usage: pd~ [-sr #] [-ninsig #] [-noutsig #] [-fifo #] [-pddir <>]");
|
||||
post(
|
||||
"... [-scheddir <>]");
|
||||
}
|
||||
|
||||
x->x_clock = clock_new(x, (t_method)pd_tilde_tick);
|
||||
x->x_insig = (t_sample **)getbytes(ninsig * sizeof(*x->x_insig));
|
||||
x->x_outsig = (t_sample **)getbytes(noutsig * sizeof(*x->x_outsig));
|
||||
x->x_ninsig = ninsig;
|
||||
x->x_noutsig = noutsig;
|
||||
x->x_fifo = fifo;
|
||||
x->x_sr = sr;
|
||||
x->x_pddir = pddir;
|
||||
x->x_schedlibdir = scheddir;
|
||||
x->x_infd = 0;
|
||||
x->x_outfd = 0;
|
||||
x->x_outfd = 0;
|
||||
x->x_childpid = -1;
|
||||
x->x_msgbuf = 0;
|
||||
x->x_canvas = canvas_getcurrent();
|
||||
for (j = 1, g = x->x_insig; j < ninsig; j++, g++)
|
||||
inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal);
|
||||
x->x_outlet1 = outlet_new(&x->x_obj, 0);
|
||||
for (j = 0, g = x->x_outsig; j < noutsig; j++, g++)
|
||||
outlet_new(&x->x_obj, &s_signal);
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
return (x);
|
||||
}
|
||||
|
||||
void pd_tilde_setup(void)
|
||||
{
|
||||
pd_tilde_class = class_new(gensym("pd~"), (t_newmethod)pd_tilde_new,
|
||||
(t_method)pd_tilde_free, sizeof(t_pd_tilde), 0, A_GIMME, 0);
|
||||
class_addmethod(pd_tilde_class, nullfn, gensym("signal"), 0);
|
||||
class_addmethod(pd_tilde_class, (t_method)pd_tilde_dsp, gensym("dsp"), 0);
|
||||
class_addmethod(pd_tilde_class, (t_method)pd_tilde_pdtilde, gensym("pd~"), A_GIMME, 0);
|
||||
class_addanything(pd_tilde_class, pd_tilde_anything);
|
||||
post("pd~ version 0.2");
|
||||
}
|
||||
#endif
|
||||
|
||||
/* -------------------------- MSP glue ------------------------- */
|
||||
#ifdef MSP
|
||||
|
||||
#define LOTS 10000
|
||||
|
||||
static void pd_tilde_tick(t_pd_tilde *x)
|
||||
{
|
||||
int messstart = 0, i, n = 0;
|
||||
t_atom vec[LOTS];
|
||||
long z1 = 0, z2 = 0;
|
||||
void *b;
|
||||
if (!x->x_msgbuf)
|
||||
return;
|
||||
b = binbuf_new();
|
||||
binbuf_text(b, &x->x_msgbuf, x->x_infill);
|
||||
/* binbuf_print(b); */
|
||||
while (!binbuf_getatom(b, &z1, &z2, vec+n))
|
||||
if (++n >= LOTS)
|
||||
break;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (vec[i].a_type == A_SEMI)
|
||||
{
|
||||
if (i > messstart + 1)
|
||||
{
|
||||
void *whom;
|
||||
if (vec[messstart].a_type == A_SYM)
|
||||
outlet_anything(x->x_outlet1, vec[messstart].a_w.w_sym,
|
||||
i-messstart-1, vec+(messstart+1));
|
||||
else if (vec[messstart].a_type == A_FLOAT && i == messstart+1)
|
||||
outlet_float(x->x_outlet1, vec[messstart].a_w.w_float);
|
||||
else if (vec[messstart].a_type == A_LONG && i == messstart+1)
|
||||
outlet_int(x->x_outlet1, vec[messstart].a_w.w_long);
|
||||
else outlet_list(x->x_outlet1, gensym("list"),
|
||||
i-messstart, vec+(messstart));
|
||||
}
|
||||
messstart = i+1;
|
||||
}
|
||||
}
|
||||
binbuf_free(b);
|
||||
x->x_infill = 0;
|
||||
}
|
||||
|
||||
static void pd_tilde_anything(t_pd_tilde *x, t_symbol *s,
|
||||
long ac, t_atom *av)
|
||||
{
|
||||
char msgbuf[MAXPDSTRING], *sp, *ep = msgbuf+MAXPDSTRING;
|
||||
if (!x->x_outfd)
|
||||
return;
|
||||
msgbuf[0] = 0;
|
||||
strncpy(msgbuf, s->s_name, MAXPDSTRING);
|
||||
msgbuf[MAXPDSTRING-1] = 0;
|
||||
sp = msgbuf + strlen(msgbuf);
|
||||
while (ac--)
|
||||
{
|
||||
if (sp < ep-1)
|
||||
sp[0] = ' ', sp[1] = 0, sp++;
|
||||
if (sp < ep - 80)
|
||||
{
|
||||
if (av->a_type == A_SYM && strlen(av->a_w.w_sym->s_name) < ep - sp-20)
|
||||
strcpy(sp, av->a_w.w_sym->s_name);
|
||||
else if (av->a_type == A_LONG)
|
||||
sprintf(sp, "%ld" ,av->a_w.w_long);
|
||||
else if (av->a_type == A_FLOAT)
|
||||
sprintf(sp, "%g" ,av->a_w.w_float);
|
||||
}
|
||||
sp += strlen(sp);
|
||||
av++;
|
||||
}
|
||||
fprintf(x->x_outfd, "%s;\n", msgbuf);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
t_class *c;
|
||||
|
||||
c = class_new("pd_tilde~", (method)pd_tilde_new, (method)pd_tilde_free, sizeof(t_pd_tilde), (method)0L, A_GIMME, 0);
|
||||
|
||||
class_addmethod(c, (method)pd_tilde_dsp, "dsp", A_CANT, 0);
|
||||
class_addmethod(c, (method)pd_tilde_assist, "assist", A_CANT, 0);
|
||||
class_addmethod(c, (method)pd_tilde_pdtilde, "pd~", A_GIMME, 0);
|
||||
class_addmethod(c, (method)pd_tilde_anything, "anything", A_GIMME, 0);
|
||||
class_dspinit(c);
|
||||
|
||||
class_register(CLASS_BOX, c);
|
||||
pd_tilde_class = c;
|
||||
post("pd~ version 0.2");
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void *pd_tilde_new(t_symbol *s, long ac, t_atom *av)
|
||||
{
|
||||
int ninsig = 2, noutsig = 2, fifo = 5, j;
|
||||
t_float sr = sys_getsr();
|
||||
t_symbol *pddir = gensym("."), *scheddir = gensym(".");
|
||||
t_pd_tilde *x;
|
||||
|
||||
if (x = (t_pd_tilde *)object_alloc(pd_tilde_class))
|
||||
{
|
||||
while (ac > 0 && av[0].a_type == A_SYM)
|
||||
{
|
||||
char *flag = av[0].a_w.w_sym->s_name;
|
||||
if (!strcmp(flag, "-sr") && ac > 1)
|
||||
{
|
||||
sr = (av[1].a_type == A_FLOAT ? av[1].a_w.w_float :
|
||||
(av[1].a_type == A_LONG ? av[1].a_w.w_long : 0));
|
||||
ac -= 2; av += 2;
|
||||
}
|
||||
else if (!strcmp(flag, "-ninsig") && ac > 1)
|
||||
{
|
||||
ninsig = (av[1].a_type == A_FLOAT ? av[1].a_w.w_float :
|
||||
(av[1].a_type == A_LONG ? av[1].a_w.w_long : 0));
|
||||
ac -= 2; av += 2;
|
||||
}
|
||||
else if (!strcmp(flag, "-noutsig") && ac > 1)
|
||||
{
|
||||
noutsig = (av[1].a_type == A_FLOAT ? av[1].a_w.w_float :
|
||||
(av[1].a_type == A_LONG ? av[1].a_w.w_long : 0));
|
||||
ac -= 2; av += 2;
|
||||
}
|
||||
else if (!strcmp(flag, "-fifo") && ac > 1)
|
||||
{
|
||||
fifo = (av[1].a_type == A_FLOAT ? av[1].a_w.w_float :
|
||||
(av[1].a_type == A_LONG ? av[1].a_w.w_long : 0));
|
||||
ac -= 2; av += 2;
|
||||
}
|
||||
else if (!strcmp(flag, "-pddir") && ac > 1)
|
||||
{
|
||||
pddir = (av[1].a_type == A_SYM ? av[1].a_w.w_sym : gensym("."));
|
||||
ac -= 2; av += 2;
|
||||
}
|
||||
else if (!strcmp(flag, "-scheddir") && ac > 1)
|
||||
{
|
||||
scheddir = (av[1].a_type == A_SYM ? av[1].a_w.w_sym : gensym("."));
|
||||
ac -= 2; av += 2;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
if (ac)
|
||||
post("pd~: warning: ignoring extra arguments");
|
||||
dsp_setup((t_pxobject *)x, ninsig);
|
||||
x->x_outlet1 = outlet_new(&x->x_obj, 0);
|
||||
for (j = 0; j < noutsig; j++)
|
||||
outlet_new((t_pxobject *)x, "signal");
|
||||
x->x_clock = clock_new(x, (method)pd_tilde_tick);
|
||||
x->x_insig = (t_sample **)getbytes(ninsig * sizeof(*x->x_insig));
|
||||
x->x_outsig = (t_sample **)getbytes(noutsig * sizeof(*x->x_outsig));
|
||||
x->x_ninsig = ninsig;
|
||||
x->x_noutsig = noutsig;
|
||||
x->x_fifo = fifo;
|
||||
x->x_sr = sr;
|
||||
x->x_pddir = pddir;
|
||||
x->x_schedlibdir = scheddir;
|
||||
x->x_infd = 0;
|
||||
x->x_outfd = 0;
|
||||
x->x_outfd = 0;
|
||||
x->x_childpid = -1;
|
||||
x->x_msgbuf = 0;
|
||||
}
|
||||
return (x);
|
||||
}
|
||||
|
||||
void pd_tilde_assist(t_pd_tilde *x, void *b, long m, long a, char *s)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* MSP */
|
15
pd-0.44-2/extra/pd~/z.pd
Normal file
15
pd-0.44-2/extra/pd~/z.pd
Normal file
|
@ -0,0 +1,15 @@
|
|||
#N canvas 686 241 450 300 10;
|
||||
#X obj 65 58 r foo;
|
||||
#X obj 62 100 print foo;
|
||||
#X obj 244 59 adc~;
|
||||
#X obj 238 102 env~ 8192;
|
||||
#X floatatom 236 140 5 0 0 0 - - -;
|
||||
#X obj 155 234 dac~;
|
||||
#X obj 155 191 osc~ 440;
|
||||
#X obj 287 204 stdout;
|
||||
#X msg 307 153 a b c;
|
||||
#X connect 0 0 1 0;
|
||||
#X connect 2 0 3 0;
|
||||
#X connect 3 0 4 0;
|
||||
#X connect 6 0 5 0;
|
||||
#X connect 8 0 7 0;
|
Loading…
Add table
Add a link
Reference in a new issue