Commit 5b19f99c authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*updated markex and maxlib exterals

*improved maxlib average to support arbitrary size of elements
*added diff for future reference between svn maxlib/average and pd-l2ork's version of the same
parent 5465b8dc
This diff is collapsed.
## Pd library template version 1.0.3
## Pd library template version 1.0.11
# For instructions on how to use this template, see:
# http://puredata.info/docs/developer/MakefileTemplate
LIBRARY_NAME = markex
......@@ -31,9 +31,11 @@ EXTRA_DIST = markex.c
#
#------------------------------------------------------------------------------#
CFLAGS = -DPD -I"$(PD_INCLUDE)" -Wall -W -g
LDFLAGS =
LIBS =
ALL_CFLAGS = -I"$(PD_INCLUDE)"
ALL_LDFLAGS =
SHARED_LDFLAGS =
ALL_LIBS =
#------------------------------------------------------------------------------#
#
......@@ -41,12 +43,17 @@ LIBS =
#
#------------------------------------------------------------------------------#
# these can be set from outside without (usually) breaking the build
CFLAGS = -Wall -W -g
LDFLAGS =
LIBS =
# get library version from meta file
LIBRARY_VERSION = $(shell sed -n 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' $(LIBRARY_NAME)-meta.pd)
CFLAGS += -DVERSION='"$(LIBRARY_VERSION)"'
ALL_CFLAGS += -DPD -DVERSION='"$(LIBRARY_VERSION)"'
PD_INCLUDE = $(PD_PATH)/include
PD_INCLUDE = $(PD_PATH)/include/pd
# where to install the library, overridden below depending on platform
prefix = /usr/local
libdir = $(prefix)/lib
......@@ -62,7 +69,7 @@ ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx)
$(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows)
DISTDIR=$(LIBRARY_NAME)-$(LIBRARY_VERSION)
ORIGDIR=pd-$(LIBRARY_NAME)_$(LIBRARY_VERSION)
ORIGDIR=pd-$(LIBRARY_NAME:~=)_$(LIBRARY_VERSION)
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
......@@ -70,6 +77,7 @@ ifeq ($(UNAME),Darwin)
ifeq ($(CPU),arm) # iPhone/iPod Touch
SOURCES += $(SOURCES_iphoneos)
EXTENSION = pd_darwin
SHARED_EXTENSION = dylib
OS = iphoneos
PD_PATH = /Applications/Pd-extended.app/Contents/Resources
IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
......@@ -79,14 +87,16 @@ ifeq ($(UNAME),Darwin)
ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6
OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer
CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS)
LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
LIBS += -lc
ALL_CFLAGS := $(IPHONE_CFLAGS) $(ALL_CFLAGS)
ALL_LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
SHARED_LDFLAGS += -arch armv6 -dynamiclib -undefined dynamic_lookup $(ISYSROOT)
ALL_LIBS += -lc $(LIBS_iphoneos)
STRIP = strip -x
DISTBINDIR=$(DISTDIR)-$(OS)
else # Mac OS X
SOURCES += $(SOURCES_macosx)
EXTENSION = pd_darwin
SHARED_EXTENSION = dylib
OS = macosx
PD_PATH = /Applications/Pd-extended.app/Contents/Resources
OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
......@@ -97,27 +107,87 @@ ifeq ($(UNAME),Darwin)
FAT_FLAGS = -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.4
SOURCES += $(SOURCES_iphoneos)
endif
CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include
LDFLAGS += $(FAT_FLAGS) -bundle -undefined dynamic_lookup -L/sw/lib
ALL_CFLAGS += $(FAT_FLAGS) -fPIC -I/sw/include
# if the 'pd' binary exists, check the linking against it to aid with stripping
LDFLAGS += $(shell test -e $(PD_PATH)/bin/pd && echo -bundle_loader $(PD_PATH)/bin/pd)
LIBS += -lc
BUNDLE_LOADER = $(shell test ! -e $(PD_PATH)/bin/pd || echo -bundle_loader $(PD_PATH)/bin/pd)
ALL_LDFLAGS += $(FAT_FLAGS) -bundle $(BUNDLE_LOADER) -undefined dynamic_lookup -L/sw/lib
SHARED_LDFLAGS += $(FAT_FLAGS) -dynamiclib -undefined dynamic_lookup \
-install_name @loader_path/$(SHARED_LIB) -compatibility_version 1 -current_version 1.0
ALL_LIBS += -lc $(LIBS_macosx)
STRIP = strip -x
DISTBINDIR=$(DISTDIR)-$(OS)
# install into ~/Library/Pd on Mac OS X since /usr/local isn't used much
pkglibdir=$(HOME)/Library/Pd
endif
endif
# Tho Android uses Linux, we use this fake uname to provide an easy way to
# setup all this things needed to cross-compile for Android using the NDK
ifeq ($(UNAME),ANDROID)
CPU := arm
SOURCES += $(SOURCES_android)
EXTENSION = pd_linux
SHARED_EXTENSION = so
OS = android
PD_PATH = /usr
NDK_BASE := /usr/local/android-ndk
NDK_PLATFORM_VERSION := 5
NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_VERSION)/arch-arm
NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]')
NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/$(NDK_UNAME)-x86
CC := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-gcc --sysroot=$(NDK_SYSROOT)
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
CFLAGS +=
LDFLAGS += -rdynamic -shared
SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
LIBS += -lc $(LIBS_android)
STRIP := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-strip \
--strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
ifeq ($(UNAME),Linux)
CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux
SHARED_EXTENSION = so
OS = linux
PD_PATH = /usr
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
ALL_CFLAGS += -fPIC
ALL_LDFLAGS += -rdynamic -shared -fPIC
SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
ALL_LIBS += -lc $(LIBS_linux)
STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
ifeq ($(UNAME),GNU)
# GNU/Hurd, should work like GNU/Linux for basically all externals
CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux
SHARED_EXTENSION = so
OS = linux
PD_PATH = /usr
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
CFLAGS += -fPIC
LDFLAGS += -Wl,--export-dynamic -shared -fPIC
LIBS += -lc
ALL_CFLAGS += -fPIC
ALL_LDFLAGS += -rdynamic -shared -fPIC
SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
ALL_LIBS += -lc $(LIBS_linux)
STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
ifeq ($(UNAME),GNU/kFreeBSD)
# Debian GNU/kFreeBSD, should work like GNU/Linux for basically all externals
CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux
SHARED_EXTENSION = so
OS = linux
PD_PATH = /usr
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
ALL_CFLAGS += -fPIC
ALL_LDFLAGS += -rdynamic -shared -fPIC
SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
ALL_LIBS += -lc $(LIBS_linux)
STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
......@@ -125,12 +195,14 @@ ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME)))
CPU := $(shell uname -m)
SOURCES += $(SOURCES_cygwin)
EXTENSION = dll
SHARED_EXTENSION = dll
OS = cygwin
PD_PATH = $(cygpath $(PROGRAMFILES))/pd
PD_PATH = $(shell cygpath $$PROGRAMFILES)/pd
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
CFLAGS +=
LDFLAGS += -Wl,--export-dynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin"
LIBS += -lc -lpd
ALL_CFLAGS +=
ALL_LDFLAGS += -rdynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin"
SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB)
ALL_LIBS += -lc -lpd $(LIBS_cygwin)
STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)
endif
......@@ -138,12 +210,16 @@ ifeq (MINGW,$(findstring MINGW,$(UNAME)))
CPU := $(shell uname -m)
SOURCES += $(SOURCES_windows)
EXTENSION = dll
SHARED_EXTENSION = dll
OS = windows
PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd)
PD_PATH = $(shell cd "$$PROGRAMFILES/pd" && pwd)
# MinGW doesn't seem to include cc so force gcc
CC=gcc
OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer
CFLAGS += -mms-bitfields
LDFLAGS += -s -shared -Wl,--enable-auto-import
LIBS += -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32
ALL_CFLAGS += -mms-bitfields
ALL_LDFLAGS += -s -shared -Wl,--enable-auto-import -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj"
SHARED_LDFLAGS += -shared
ALL_LIBS += -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 $(LIBS_windows)
STRIP = strip --strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)
endif
......@@ -151,42 +227,57 @@ endif
# in case somebody manually set the HELPPATCHES above
HELPPATCHES ?= $(SOURCES:.c=-help.pd) $(PDOBJECTS:.pd=-help.pd)
CFLAGS += $(OPT_CFLAGS)
ALL_CFLAGS := $(ALL_CFLAGS) $(CFLAGS) $(OPT_CFLAGS)
ALL_LDFLAGS := $(LDFLAGS) $(ALL_LDFLAGS)
ALL_LIBS := $(LIBS) $(ALL_LIBS)
SHARED_SOURCE ?= $(shell test ! -e lib$(LIBRARY_NAME).c || \
echo lib$(LIBRARY_NAME).c )
SHARED_HEADER ?= $(shell test ! -e $(LIBRARY_NAME).h || echo $(LIBRARY_NAME).h)
SHARED_LIB = $(SHARED_SOURCE:.c=.$(SHARED_EXTENSION))
.PHONY = install libdir_install single_install install-doc install-exec install-examples install-manual clean dist etags $(LIBRARY_NAME)
.PHONY = install libdir_install single_install install-doc install-examples install-manual clean distclean dist etags $(LIBRARY_NAME)
all: $(SOURCES:.c=.$(EXTENSION))
all: $(SOURCES:.c=.$(EXTENSION)) $(SHARED_LIB)
%.o: %.c
$(CC) $(CFLAGS) -o "$*.o" -c "$*.c"
$(CC) $(ALL_CFLAGS) -o "$*.o" -c "$*.c"
%.$(EXTENSION): %.o
$(CC) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS)
%.$(EXTENSION): %.o $(SHARED_LIB)
$(CC) $(ALL_LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(ALL_LIBS) $(SHARED_LIB)
chmod a-x "$*.$(EXTENSION)"
# this links everything into a single binary file
$(LIBRARY_NAME): $(SOURCES:.c=.o) $(LIBRARY_NAME).o
$(CC) $(LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(LIBS)
$(CC) $(ALL_LDFLAGS) -o $(LIBRARY_NAME).$(EXTENSION) $(SOURCES:.c=.o) $(LIBRARY_NAME).o $(ALL_LIBS)
chmod a-x $(LIBRARY_NAME).$(EXTENSION)
$(SHARED_LIB): $(SHARED_SOURCE:.c=.o)
$(CC) $(SHARED_LDFLAGS) -o $(SHARED_LIB) $(SHARED_SOURCE:.c=.o) $(LIBS)
install: libdir_install
# The meta and help files are explicitly installed to make sure they are
# actually there. Those files are not optional, then need to be there.
libdir_install: $(SOURCES:.c=.$(EXTENSION)) install-doc install-examples install-manual
libdir_install: $(SOURCES:.c=.$(EXTENSION)) $(SHARED_LIB) install-doc install-examples install-manual
$(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
$(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd \
$(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
test -z "$(strip $(SOURCES))" || (\
$(INSTALL_PROGRAM) $(SOURCES:.c=.$(EXTENSION)) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME) && \
$(STRIP) $(addprefix $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/,$(SOURCES:.c=.$(EXTENSION))))
test -z "$(strip $(SHARED_LIB))" || \
$(INSTALL_DATA) $(SHARED_LIB) \
$(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
test -z "$(strip $(wildcard $(SOURCES:.c=.tcl)))" || \
$(INSTALL_DATA) $(wildcard $(SOURCES:.c=.tcl)) \
$(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
test -z "$(strip $(PDOBJECTS))" || \
$(INSTALL_DATA) $(PDOBJECTS) \
$(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
# install library linked as single binary
single_install: $(LIBRARY_NAME) install-doc install-exec
single_install: $(LIBRARY_NAME) install-doc install-examples install-manual
$(INSTALL_DIR) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
$(INSTALL_PROGRAM) $(LIBRARY_NAME).$(EXTENSION) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)
$(STRIP) $(DESTDIR)$(objectsdir)/$(LIBRARY_NAME)/$(LIBRARY_NAME).$(EXTENSION)
......@@ -215,10 +306,11 @@ install-manual:
clean:
-rm -f -- $(SOURCES:.c=.o) $(SOURCES_LIB:.c=.o)
-rm -f -- $(SOURCES:.c=.o) $(SOURCES_LIB:.c=.o) $(SHARED_SOURCE:.c=.o)
-rm -f -- $(SOURCES:.c=.$(EXTENSION))
-rm -f -- $(LIBRARY_NAME).o
-rm -f -- $(LIBRARY_NAME).$(EXTENSION)
-rm -f -- $(SHARED_LIB)
distclean: clean
-rm -f -- $(DISTBINDIR).tar.gz
......@@ -234,7 +326,7 @@ $(DISTBINDIR):
libdir: all $(DISTBINDIR)
$(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTBINDIR)
$(INSTALL_DATA) $(SOURCES) $(DISTBINDIR)
$(INSTALL_DATA) $(SOURCES) $(SHARED_SOURCE) $(SHARED_HEADER) $(DISTBINDIR)
$(INSTALL_DATA) $(HELPPATCHES) $(DISTBINDIR)
test -z "$(strip $(EXTRA_DIST))" || \
$(INSTALL_DATA) $(EXTRA_DIST) $(DISTBINDIR)
......@@ -253,6 +345,12 @@ dist: $(DISTDIR)
$(INSTALL_DATA) $(LIBRARY_NAME)-meta.pd $(DISTDIR)
test -z "$(strip $(ALLSOURCES))" || \
$(INSTALL_DATA) $(ALLSOURCES) $(DISTDIR)
test -z "$(strip $(wildcard $(ALLSOURCES:.c=.tcl)))" || \
$(INSTALL_DATA) $(wildcard $(ALLSOURCES:.c=.tcl)) $(DISTDIR)
test -z "$(strip $(SHARED_HEADER))" || \
$(INSTALL_DATA) $(SHARED_HEADER) $(DISTDIR)
test -z "$(strip $(SHARED_SOURCE))" || \
$(INSTALL_DATA) $(SHARED_SOURCE) $(DISTDIR)
test -z "$(strip $(PDOBJECTS))" || \
$(INSTALL_DATA) $(PDOBJECTS) $(DISTDIR)
test -z "$(strip $(HELPPATCHES))" || \
......@@ -285,17 +383,25 @@ etags:
etags *.h $(SOURCES) ../../pd/src/*.[ch] /usr/include/*.h /usr/include/*/*.h
showsetup:
@echo "CC: $(CC)"
@echo "CFLAGS: $(CFLAGS)"
@echo "LDFLAGS: $(LDFLAGS)"
@echo "LIBS: $(LIBS)"
@echo "ALL_CFLAGS: $(ALL_CFLAGS)"
@echo "ALL_LDFLAGS: $(ALL_LDFLAGS)"
@echo "ALL_LIBS: $(ALL_LIBS)"
@echo "PD_INCLUDE: $(PD_INCLUDE)"
@echo "PD_PATH: $(PD_PATH)"
@echo "objectsdir: $(objectsdir)"
@echo "LIBRARY_NAME: $(LIBRARY_NAME)"
@echo "LIBRARY_VERSION: $(LIBRARY_VERSION)"
@echo "SOURCES: $(SOURCES)"
@echo "SHARED_HEADER: $(SHARED_HEADER)"
@echo "SHARED_SOURCE: $(SHARED_SOURCE)"
@echo "SHARED_LIB: $(SHARED_LIB)"
@echo "PDOBJECTS: $(PDOBJECTS)"
@echo "ALLSOURCES: $(ALLSOURCES)"
@echo "ALLSOURCES TCL: $(wildcard $(ALLSOURCES:.c=.tcl))"
@echo "UNAME: $(UNAME)"
@echo "CPU: $(CPU)"
@echo "pkglibdir: $(pkglibdir)"
......
......@@ -7,7 +7,7 @@
#X msg 247 164 reset 5;
#X msg 345 168 clear;
#X text 89 408 The initial argument is the number to average together.
The default is 10 numbers.;
The default is 10 numbers, the maximum is 100 numbers;
#X obj 421 231 average 20;
#X text 139 23 [average];
#X text 81 371 [average] together a series of numbers.;
......
......@@ -11,12 +11,14 @@
/* instance structure */
static t_class *average_class;
#define MAX_NUMBERS 100
typedef struct _average
{
t_object x_obj; /* obligatory object header */
int a_total; /* number of numbers to average */
int a_whichNum; /* which number are pointing at */
float a_numbers[100]; /* numbers to average, 100 maximum */
float a_numbers[MAX_NUMBERS]; /* numbers to average */
t_outlet *t_out1; /* the outlet */
} t_average;
......@@ -39,21 +41,27 @@ void average_float(t_average *x, t_floatarg n)
average_bang(x);
}
void average_total(t_average *x, t_floatarg n)
void average_total(t_average *x, t_float f)
{
x->a_total = (int)n;
if (f) x->a_total = (int)f;
else x->a_total = 10;
if (x->a_total > MAX_NUMBERS) {
logpost(x, 2, "[average]: argument set max numbers greater than %i, setting to %i",
MAX_NUMBERS, MAX_NUMBERS);
x->a_total = MAX_NUMBERS;
}
}
void average_reset(t_average *x, t_floatarg newVal)
{
int n;
for (n=0; n < 100; n ++) x->a_numbers[n] = newVal;
for (n=0; n < MAX_NUMBERS; n ++) x->a_numbers[n] = newVal;
}
void average_clear(t_average *x)
{
int n;
for ( n = 0; n < 100; n ++) x->a_numbers[n] = 0.0f;
for ( n = 0; n < MAX_NUMBERS; n ++) x->a_numbers[n] = 0.0f;
}
void *average_new(t_floatarg f) /* init vals in struc */
......@@ -62,8 +70,7 @@ void *average_new(t_floatarg f) /* init vals in struc */
x->t_out1 = outlet_new(&x->x_obj, 0);
inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("fl1"));
average_clear(x);
if (f) x->a_total = (int)f;
else x->a_total = 10;
average_total(x, f);
x->a_whichNum = 0;
return (x);
}
......
#N canvas 1 53 600 590 10;
#N canvas 1 88 600 590 10;
#X text 124 68 GEM object;
#X obj 123 298 print out1;
#X text 138 23 counter;
......@@ -24,7 +24,7 @@ value and send the value out the left outlet.;
#X text 58 486 A clear message will set the counter back to the starting
value.;
#X text 331 189 count from 0 to 5 and back down to 0;
#N canvas 490 209 494 344 META 0;
#N canvas 488 217 494 344 META 0;
#X text 12 265 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#X text 12 245 AUTHOR Mark Danks;
......@@ -39,7 +39,7 @@ Wilkes for Pd version 0.42.;
#X text 12 185 OUTLET_1;
#X text 12 205 OUTLET_2;
#X text 12 225 OUTLET_3;
#X text 12 5 KEYWORDS control needs_work (INLETS/OUTLETS?);
#X text 12 5 KEYWORDS control;
#X restore 544 562 pd META;
#X connect 3 0 5 0;
#X connect 5 0 1 0;
......
#N canvas 1 53 450 300 10;
#X obj 177 112 vector+;
#X text 138 59 MarkEx vector operation;
#X text 133 181 (placeholder help patch);
#N canvas 462 315 494 344 META 0;
#X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#X text 12 105 AUTHOR Mark Danks;
#N canvas 715 331 450 300 10;
#N canvas 753 488 494 344 META 0;
#X text 12 135 AUTHOR Mark Danks;
#X text 12 25 LICENSE GPL v2;
#X text 12 45 DESCRIPTION;
#X text 12 85 OUTLET_0;
#X text 12 65 INLET_0;
#X text 12 5 KEYWORDS control needs_work (DESCRIPTION/EXAMPLE PATCH)
;
#X text 12 5 KEYWORDS control vector;
#X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42. \, helppatch by IOhannes m zmölnig;
#X text 13 76 INLET_0 list;
#X text 13 116 OUTLET_0 list;
#X text 12 45 DESCRIPTION adds a constant offset to a vector;
#X text 13 96 INLET_1 float;
#X restore 393 265 pd META;
#X msg 64 86 1 2 3;
#X msg 175 86 10;
#X text 27 25 MarkEx vector operation: add a constant offset to a vector
;
#X text 52 248 a "vector" is simply a list of numbers.;
#X obj 64 147 print vector+;
#X obj 64 116 vector+ 42;
#X connect 1 0 6 0;
#X connect 2 0 6 1;
#X connect 6 0 5 0;
#N canvas 1 53 450 300 10;
#X text 138 59 MarkEx vector operation;
#X text 133 181 (placeholder help patch);
#X obj 177 112 vector-;
#N canvas 462 315 494 344 META 0;
#X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#X text 12 105 AUTHOR Mark Danks;
#N canvas 4 49 450 300 10;
#N canvas 246 447 494 344 META 0;
#X text 12 135 AUTHOR Mark Danks;
#X text 12 25 LICENSE GPL v2;
#X text 12 45 DESCRIPTION;
#X text 12 85 OUTLET_0;
#X text 12 65 INLET_0;
#X text 12 5 KEYWORDS control needs_work (DESCRIPTION/EXAMPLE PATCH)
#X text 12 5 KEYWORDS control vector;
#X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42. \, helppatch by IOhannes m zmölnig;
#X text 13 76 INLET_0 list;
#X text 13 116 OUTLET_0 list;
#X text 13 96 INLET_1 float;
#X text 12 45 DESCRIPTION subtracts a constant offset from a vector
;
#X restore 390 271 pd META;
#X msg 64 86 1 2 3;
#X msg 175 86 10;
#X text 27 25 MarkEx vector operation: add a constant offset to a vector
;
#X text 52 248 a "vector" is simply a list of numbers.;
#X obj 64 146 print vector-;
#X obj 64 116 vector- 42;
#X connect 1 0 6 0;
#X connect 2 0 6 1;
#X connect 6 0 5 0;
#N canvas 1 53 450 300 10;
#X text 138 59 MarkEx vector operation;
#X text 133 181 (placeholder help patch);
#X obj 177 112 vector*;
#N canvas 460 257 494 344 META 0;
#X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#X text 12 105 AUTHOR Mark Danks;
#N canvas 382 194 450 300 10;
#N canvas 247 443 494 344 META 0;
#X text 12 135 AUTHOR Mark Danks;
#X text 12 25 LICENSE GPL v2;
#X text 12 45 DESCRIPTION;
#X text 12 85 OUTLET_0;
#X text 12 65 INLET_0;
#X text 12 5 KEYWORDS control needs_work (DESCRIPTION/EXAMPLE PATCH)
#X text 12 5 KEYWORDS control vector;
#X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42. \, helppatch by IOhannes m zmölnig;
#X text 13 76 INLET_0 list;
#X text 13 116 OUTLET_0 list;
#X text 13 96 INLET_1 float;
#X text 12 45 DESCRIPTION multiplies a vector by a number;
#X restore 390 271 pd META;
#X msg 64 86 1 2 3;
#X msg 175 86 10;
#X text 52 248 a "vector" is simply a list of numbers.;
#X text 27 25 MarkEx vector operation: multiply a vector by a factor
;
#X restore 392 269 pd META;
#X obj 64 146 print vector*;
#X obj 64 116 vector* 42;
#X connect 1 0 6 0;
#X connect 2 0 6 1;
#X connect 6 0 5 0;
......@@ -55,6 +55,8 @@ static void vectorMult_setup(void)
class_addcreator((t_newmethod)vectorMult_new, gensym("v*"), A_DEFFLOAT, 0);
class_addmethod(vectorMult_class, (t_method)doVectorMult,
&s_list, A_GIMME, A_NULL);
class_sethelpsymbol(vectorMult_class, gensym("vector0x2a"));
}
void setup_vector0x2a(void){
......
#N canvas 1 53 450 300 10;
#X text 138 59 MarkEx vector operation;
#X text 133 181 (placeholder help patch);
#X obj 177 112 vector/;
#N canvas 461 286 494 344 META 0;
#X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#X text 12 105 AUTHOR Mark Danks;
#N canvas 369 150 450 300 10;
#N canvas 249 435 494 344 META 0;
#X text 12 135 AUTHOR Mark Danks;
#X text 12 25 LICENSE GPL v2;
#X text 12 45 DESCRIPTION;
#X text 12 85 OUTLET_0;
#X text 12 65 INLET_0;
#X text 12 5 KEYWORDS control needs_work (DESCRIPTION/EXAMPLE PATCH)
#X text 12 5 KEYWORDS control vector;
#X text 12 165 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42. \, helppatch by IOhannes m zmölnig;
#X text 13 76 INLET_0 list;
#X text 13 116 OUTLET_0 list;
#X text 13 96 INLET_1 float;
#X text 12 45 DESCRIPTION divides a vector by a number;
#X restore 390 271 pd META;
#X msg 175 86 10;
#X text 52 248 a "vector" is simply a list of numbers.;
#X text 27 25 MarkEx vector operation: divide a vector by a factor
;
#X restore 392 270 pd META;
#X obj 64 116 vector/ 42;
#X msg 64 86 1 42 84;
#X obj 64 146 print vector/;
#X connect 1 0 4 1;
#X connect 4 0 6 0;
#X connect 5 0 4 0;
......@@ -54,14 +54,12 @@ static void vectorDiv_setup(void)
sizeof(t_vectorDiv), 0, A_DEFFLOAT, 0);
class_addcreator((t_newmethod)vectorDiv_new, gensym("v/"), A_DEFFLOAT, 0);
class_addmethod(vectorDiv_class, (t_method)doVectorDiv,
&s_list, A_GIMME, A_NULL);
&s_list, A_GIMME, A_NULL);
class_sethelpsymbol(vectorDiv_class, gensym("vector0x2f"));
}
void setup_vector0x2f(void){
vectorDiv_setup();
}
void setup_v0x2f(void){
vectorDiv_setup();
}
void setup_vector0x2f(void) { vectorDiv_setup(); }
void vector0x2f_setup(void) { vectorDiv_setup(); }
void setup_v0x2f(void) { vectorDiv_setup(); }
void v0x2f_setup(void) { vectorDiv_setup(); }
#N canvas 1 53 450 300 10;
#X text 138 59 MarkEx vector operation;
#X text 133 181 (placeholder help patch);
#N canvas 195 107 506 300 10;
#X obj 177 112 vectorabs;
#N canvas 461 286 494 344 META 0;
#X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#N canvas 464 274 494 344 META 0;
#X text 12 105 AUTHOR Mark Danks;
#X text 12 25 LICENSE GPL v2;
#X text 12 45 DESCRIPTION;
#X text 12 85 OUTLET_0;
#X text 12 65 INLET_0;
#X text 12 5 KEYWORDS control needs_work (DESCRIPTION/EXAMPLE PATCH)
;
#X text 12 5 KEYWORDS control vector;
#X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42. \, helppatch by IOhannes m zmölnig;