aboutsummaryrefslogtreecommitdiff
path: root/pd
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2006-10-22 21:46:11 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2006-10-22 21:46:11 +0000
commit982d9823a3f4978b211841adff80c9bc6166c4e9 (patch)
tree85e51f843f5994f62f2b42fb7c30466c4fc5fdca /pd
parentbb23964c64578b5921e3adddabf033b4b7c4c548 (diff)
test release for 0.41 (bug fixes for IA64).
svn path=/trunk/; revision=6154
Diffstat (limited to 'pd')
-rw-r--r--pd/doc/5.reference/append-help.pd26
-rw-r--r--pd/doc/5.reference/element-help.pd28
-rw-r--r--pd/doc/5.reference/getsize-help.pd26
-rw-r--r--pd/doc/5.reference/setsize-help.pd30
-rw-r--r--pd/extra/expr~/makefile4
-rw-r--r--pd/extra/makefile6
-rw-r--r--pd/extra/sigmund~/sigmund~.c12
-rw-r--r--pd/portaudio/pa_win_wdmks/pa_win_wdmks.c2
-rw-r--r--pd/portaudio/pablio/ringbuffer.c2
-rw-r--r--pd/portaudio/pablio/ringbuffer.h2
-rw-r--r--pd/portmidi/pm_mac/pmmacosxcm.c2
-rw-r--r--pd/src/d_array.c106
-rw-r--r--pd/src/d_soundfile.c86
-rw-r--r--pd/src/g_array.c18
-rw-r--r--pd/src/g_graph.c10
-rw-r--r--pd/src/g_readwrite.c3
-rw-r--r--pd/src/m_pd.h7
-rw-r--r--pd/src/makefile.in11
-rw-r--r--pd/src/makefile.irix190
-rw-r--r--pd/src/notes.txt9
-rw-r--r--pd/src/s_audio_sgi.c460
-rw-r--r--pd/src/s_midi_sgi.c203
-rw-r--r--pd/src/s_path.c2
23 files changed, 211 insertions, 1034 deletions
diff --git a/pd/doc/5.reference/append-help.pd b/pd/doc/5.reference/append-help.pd
index 7cacefe4..88efc000 100644
--- a/pd/doc/5.reference/append-help.pd
+++ b/pd/doc/5.reference/append-help.pd
@@ -1,10 +1,9 @@
-#N canvas 330 8 595 450 12;
+#N canvas 330 8 599 454 12;
#X text 15 344 see also:;
-#N canvas 164 72 425 146 help-append-template1 0;
-#X obj 60 21 template float x float y float z;
+#N canvas 164 72 429 150 help-append-template1 0;
#X obj 18 81 filledpolygon z z 0 0 0 20 0 20 30 0 30;
+#X obj 60 21 struct help-append-template1 float x float y float z;
#X restore 357 373 pd help-append-template1;
-#X obj 141 393 template;
#X obj 16 368 get;
#X obj 48 368 set;
#X obj 148 368 getsize;
@@ -12,14 +11,14 @@
#X obj 218 393 element;
#X obj 15 394 sublist;
#X obj 83 393 scalar;
-#N canvas 0 0 276 163 help-append-data 1;
+#N canvas 0 0 280 167 help-append-data 1;
#X restore 357 351 pd help-append-data;
#X obj 212 255 pointer;
#X obj 21 10 append;
#X text 75 9 -- add item to a list;
#X msg 212 231 traverse pd-help-append-data \, bang;
#X obj 34 295 append help-append-template1 x y z;
-#X floatatom 34 246 5 0 0;
+#X floatatom 34 246 5 0 0 0 - - -;
#X obj 34 266 t f f;
#X msg 356 311 \; pd-help-append-data clear;
#X text 27 28 "append" maintains a pointer to a scalar \, or else an
@@ -33,12 +32,13 @@ to point to the new scalar \, and the new pointer is also output.;
to the "head" of the list. You may append objects of different templates
using different "append" objects.;
#X obj 81 368 pointer;
-#X text 341 408 updated for Pd version 0.35;
+#X text 341 408 updated for Pd version 0.40;
#X text 34 226 click this first->;
#X text 230 210 go to (and output) "head" of the list;
-#X connect 11 0 15 3;
-#X connect 14 0 11 0;
-#X connect 16 0 17 0;
-#X connect 17 0 15 0;
-#X connect 17 1 15 1;
-#X connect 17 1 15 2;
+#X obj 141 393 struct;
+#X connect 10 0 14 3;
+#X connect 13 0 10 0;
+#X connect 15 0 16 0;
+#X connect 16 0 14 0;
+#X connect 16 1 14 1;
+#X connect 16 1 14 2;
diff --git a/pd/doc/5.reference/element-help.pd b/pd/doc/5.reference/element-help.pd
index a3faeecf..4a7de49c 100644
--- a/pd/doc/5.reference/element-help.pd
+++ b/pd/doc/5.reference/element-help.pd
@@ -1,22 +1,21 @@
#N struct help-element-template float x float y array array1 help-element-array1-template
;
#N struct help-element-array1-template float y;
-#N canvas 330 34 668 442 12;
+#N canvas 392 102 672 446 12;
#X text 24 373 see also:;
-#X obj 21 393 template;
-#N canvas 393 10 491 261 help-element-template 0;
+#N canvas 393 10 503 273 help-element-template 0;
#X obj 27 76 plot array1 500 1 10 15 20;
#X obj 27 174 filledpolygon 509 509 0 -10 -10 10 -10 10 10 -10 10;
-#X obj 24 16 template float x float y array array1 help-element-array1-template
-;
+#X obj 24 15 struct help-element-template float x float y array array1
+help-element-array1-template;
#X restore 414 349 pd help-element-template;
-#N canvas 0 0 288 159 help-element-data 1;
+#N canvas 0 0 292 163 help-element-data 1;
#X scalar help-element-template 35 24 \; 0 \; 10 \; 0 \; 10 \; 20 \;
10 \; 20 \; 70 \; 10 \; \;;
#X restore 450 328 pd help-element-data;
-#N canvas 196 292 365 134 help-element-array1-template 0;
+#N canvas 196 292 373 142 help-element-array1-template 0;
#X obj 30 71 filledpolygon 0 0 0 -5 0 0 5 5 0 0 -5;
-#X obj 32 27 template float y;
+#X obj 32 27 struct help-element-array1-template float y;
#X restore 354 371 pd help-element-array1-template;
#X obj 22 11 element;
#X text 91 10 -- get pointer to an element of an array;
@@ -30,10 +29,10 @@ are no pointers to arrays themselves \, just to individual elements.
The template and field mane are specified as creation arguments.;
#X obj 150 228 pointer;
#X msg 150 204 traverse pd-help-element-data \, next;
-#X floatatom 38 230 5 0 0;
+#X floatatom 38 230 5 0 0 0 - - -;
#X obj 38 256 element help-element-template array1;
#X obj 38 303 get help-element-array1-template y;
-#X floatatom 38 330 5 0 0;
+#X floatatom 38 330 5 0 0 0 - - -;
#X text 370 256 arguments: template \, field name;
#X text 247 230 pointer inlet;
#X text 36 209 index;
@@ -43,9 +42,10 @@ The template and field mane are specified as creation arguments.;
one \; indices out of range are quietly replaced by the nearest endpoint.
;
#X text 152 184 click here first;
-#X text 407 416 updated for Pd version 0.35;
-#X connect 11 0 14 1;
-#X connect 12 0 11 0;
+#X text 407 416 updated for Pd version 0.40;
+#X obj 21 393 struct;
+#X connect 10 0 13 1;
+#X connect 11 0 10 0;
+#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
-#X connect 15 0 16 0;
diff --git a/pd/doc/5.reference/getsize-help.pd b/pd/doc/5.reference/getsize-help.pd
index f2b17e2f..2045c5c5 100644
--- a/pd/doc/5.reference/getsize-help.pd
+++ b/pd/doc/5.reference/getsize-help.pd
@@ -1,28 +1,27 @@
#N struct help-getsize-template float x float y array array1 help-getsize-array1-template
;
#N struct help-getsize-array1-template float y;
-#N canvas 340 20 655 398 12;
+#N canvas 340 20 659 402 12;
#X text 28 319 see also:;
-#X obj 25 339 template;
-#N canvas 393 10 491 261 help-getsize-template 0;
+#N canvas 393 10 495 265 help-getsize-template 0;
#X obj 27 76 plot array1 500 1 10 15 20;
#X obj 27 174 filledpolygon 509 509 0 -10 -10 10 -10 10 10 -10 10;
-#X obj 24 16 template float x float y array array1 help-getsize-array1-template
-;
+#X obj 24 16 struct help-getsize-template float x float y array array1
+help-getsize-array1-template;
#X restore 338 311 pd help-getsize-template;
-#N canvas 0 0 301 193 help-getsize-data 1;
+#N canvas 0 0 305 197 help-getsize-data 1;
#X scalar help-getsize-template 43 37 \; 0 \; 10 \; 0 \; 10 \; 20 \;
10 \; 20 \; 70 \; 10 \; \;;
#X restore 337 290 pd help-getsize-data;
-#N canvas 196 292 365 134 help-getsize-array1-template 0;
+#N canvas 196 292 369 138 help-getsize-array1-template 0;
#X obj 30 71 filledpolygon 0 0 0 -5 0 0 5 5 0 0 -5;
-#X obj 32 27 template float y;
+#X obj 32 27 struct help-getsize-array1-template float y;
#X restore 337 334 pd help-getsize-array1-template;
#X obj 102 339 pointer;
#X obj 236 338 setsize;
#X obj 25 166 pointer;
#X msg 25 142 traverse pd-help-getsize-data \, next;
-#X floatatom 25 242 5 0 0;
+#X floatatom 25 242 5 0 0 0 - - -;
#X text 360 214 arguments: template \, field name;
#X text 76 240 here we just get the value of y.;
#X obj 25 213 getsize help-getsize-template array1;
@@ -35,7 +34,8 @@ array. The template and field name are specified as creation arguments.
;
#X text 23 110 The smallest possible size is one.;
#X obj 169 339 element;
-#X text 397 374 updated for Pd version 0.35;
-#X connect 7 0 12 0;
-#X connect 8 0 7 0;
-#X connect 12 0 9 0;
+#X text 397 374 updated for Pd version 0.40;
+#X obj 25 339 struct;
+#X connect 6 0 11 0;
+#X connect 7 0 6 0;
+#X connect 11 0 8 0;
diff --git a/pd/doc/5.reference/setsize-help.pd b/pd/doc/5.reference/setsize-help.pd
index ce68f5fc..79ead756 100644
--- a/pd/doc/5.reference/setsize-help.pd
+++ b/pd/doc/5.reference/setsize-help.pd
@@ -1,28 +1,27 @@
#N struct help-setsize-template float x float y array array1 help-setsize-array1-template
;
#N struct help-setsize-array1-template float y;
-#N canvas 331 45 678 459 12;
+#N canvas 331 45 682 463 12;
#X text 31 359 see also:;
-#X obj 28 379 template;
-#N canvas 393 10 491 261 help-setsize-template 0;
+#N canvas 393 10 495 265 help-setsize-template 0;
#X obj 27 174 filledpolygon 509 509 0 -10 -10 10 -10 10 10 -10 10;
-#X obj 24 16 template float x float y array array1 help-setsize-array1-template
-;
#X obj 27 76 plot array1 500 1 10 15 10;
+#X obj 24 16 struct help-setsize-template float x float y array array1
+help-setsize-array1-template;
#X restore 364 261 pd help-setsize-template;
-#N canvas 0 0 295 165 help-setsize-data 1;
+#N canvas 0 0 299 169 help-setsize-data 1;
#X scalar help-setsize-template 31 23 \; 0 \; 10 \; 0 \; 10 \; 20 \;
10 \; 20 \; 70 \; 10 \; \;;
#X restore 363 240 pd help-setsize-data;
-#N canvas 196 292 365 134 help-setsize-array1-template 0;
+#N canvas 196 292 369 138 help-setsize-array1-template 0;
#X obj 30 71 filledpolygon 0 0 0 -5 0 0 5 5 0 0 -5;
-#X obj 32 27 template float y;
+#X obj 32 27 struct help-setsize-array1-template float y;
#X restore 363 284 pd help-setsize-array1-template;
#X obj 107 379 pointer;
#X obj 242 379 setsize;
#X obj 272 186 pointer;
#X msg 272 162 traverse pd-help-setsize-data \, next;
-#X floatatom 25 189 5 0 0;
+#X floatatom 25 189 5 0 0 0 - - -;
#X text 359 210 arguments: template \, field name;
#X obj 25 213 setsize help-setsize-template array1;
#X text 115 183 inlet for pointer;
@@ -41,14 +40,15 @@ are initialized to default values.;
#X msg 566 335 bang;
#X text 297 333 click to reload from file -->;
#X text 274 143 click here first;
-#N canvas 460 63 435 172 readit 1;
+#N canvas 460 63 439 176 readit 1;
#X msg 66 65 \; pd-help-setsize-data read setsize.txt;
#X obj 107 18 inlet;
#X msg 62 123 \; pd-help-setsize-data write setsize.txt;
#X connect 1 0 0 0;
#X restore 566 361 pd readit;
-#X text 416 395 updated for Pd version 0.35;
-#X connect 7 0 11 1;
-#X connect 8 0 7 0;
-#X connect 9 0 11 0;
-#X connect 20 0 23 0;
+#X text 416 395 updated for Pd version 0.40;
+#X obj 28 379 struct;
+#X connect 6 0 10 1;
+#X connect 7 0 6 0;
+#X connect 8 0 10 0;
+#X connect 19 0 22 0;
diff --git a/pd/extra/expr~/makefile b/pd/extra/expr~/makefile
index 7d033b7c..2b4cdc58 100644
--- a/pd/extra/expr~/makefile
+++ b/pd/extra/expr~/makefile
@@ -77,7 +77,7 @@ SGIINCLUDE = -I/usr/people/msp/pd/pd/src
LINUXOBJ = vexp.pd_linux_o vexp_fun.pd_linux_o vexp_if.pd_linux_o
.SUFFIXES: .pd_linux_o
-LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC -m32 \
+LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
-Wall -W -Wshadow -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch
@@ -87,7 +87,7 @@ LINUXINCLUDE = -I../../src
$(CC) -g $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux_o -c $*.c
expr.pd_linux: $(LINUXOBJ)
- $(CC) -m32 -export_dynamic -shared -o expr.pd_linux $(LINUXOBJ) -lc -lm
+ $(CC) -export_dynamic -shared -o expr.pd_linux $(LINUXOBJ) -lc -lm
strip --strip-unneeded expr.pd_linux
expr~.pd_linux: expr.pd_linux
diff --git a/pd/extra/makefile b/pd/extra/makefile
index a328d919..bc913aca 100644
--- a/pd/extra/makefile
+++ b/pd/extra/makefile
@@ -19,7 +19,7 @@ PDNTLIB = $(PDNTLDIR)\libc.lib \
.c.dll:
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
- link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
+ link /nologo /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
# ----------------------- IRIX 5.x -----------------------
@@ -57,7 +57,7 @@ pd_linux: $(NAME).pd_linux
.SUFFIXES: .pd_linux
-LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC -m32 \
+LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
-Wall -W -Wshadow -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
@@ -65,7 +65,7 @@ LINUXINCLUDE = -I../../src
.c.pd_linux:
$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -m32 -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
+ $(CC) -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
strip --strip-unneeded $*.pd_linux
rm -f $*.o
diff --git a/pd/extra/sigmund~/sigmund~.c b/pd/extra/sigmund~/sigmund~.c
index 96d15a2c..09d004cb 100644
--- a/pd/extra/sigmund~/sigmund~.c
+++ b/pd/extra/sigmund~/sigmund~.c
@@ -770,7 +770,7 @@ static t_class *sigmund_class;
#define NHIST 100
#define MODE_STREAM 1
-#define MODE_BLOCK 2 /* uninplemented */
+#define MODE_BLOCK 2 /* unimplemented */
#define MODE_TABLE 3
#define NPOINTS_DEF 1024
@@ -1098,7 +1098,7 @@ static void sigmund_list(t_sigmund *x, t_symbol *s, int argc, t_atom *argv)
int arraysize, totstorage, nfound, i;
t_garray *a;
float *arraypoints, pit;
-
+ t_word *wordarray = 0;
if (argc < 5)
{
post(
@@ -1115,9 +1115,9 @@ static void sigmund_list(t_sigmund *x, t_symbol *s, int argc, t_atom *argv)
error("sigmund: negative onset");
return;
}
-
+ arraypoints = alloca(sizeof(float)*npts);
if (!(a = (t_garray *)pd_findbyclass(syminput, garray_class)) ||
- !garray_getfloatarray(a, &arraysize, &arraypoints) ||
+ !garray_getfloatwords(a, &arraysize, &wordarray) ||
arraysize < onset + npts)
{
error("%s: array missing or too small", syminput->s_name);
@@ -1128,7 +1128,9 @@ static void sigmund_list(t_sigmund *x, t_symbol *s, int argc, t_atom *argv)
error("sigmund~: too few points in array");
return;
}
- sigmund_doit(x, npts, arraypoints+onset, loud, srate);
+ for (i = 0; i < npts; i++)
+ arraypoints[i] = wordarray[i+onset].w_float;
+ sigmund_doit(x, npts, arraypoints, loud, srate);
}
static void sigmund_clear(t_sigmund *x)
diff --git a/pd/portaudio/pa_win_wdmks/pa_win_wdmks.c b/pd/portaudio/pa_win_wdmks/pa_win_wdmks.c
index 7426c7a5..054197c4 100644
--- a/pd/portaudio/pa_win_wdmks/pa_win_wdmks.c
+++ b/pd/portaudio/pa_win_wdmks/pa_win_wdmks.c
@@ -1,5 +1,5 @@
/*
- * $Id: pa_win_wdmks.c,v 1.15 2006-10-09 04:36:12 millerpuckette Exp $
+ * $Id: pa_win_wdmks.c,v 1.16 2006-10-22 21:46:10 millerpuckette Exp $
* PortAudio Windows WDM-KS interface
*
* Author: Andrew Baldwin
diff --git a/pd/portaudio/pablio/ringbuffer.c b/pd/portaudio/pablio/ringbuffer.c
index f20d7965..ab4b9473 100644
--- a/pd/portaudio/pablio/ringbuffer.c
+++ b/pd/portaudio/pablio/ringbuffer.c
@@ -1,5 +1,5 @@
/*
- * $Id: ringbuffer.c,v 1.14 2006-10-09 04:36:12 millerpuckette Exp $
+ * $Id: ringbuffer.c,v 1.15 2006-10-22 21:46:10 millerpuckette Exp $
* ringbuffer.c
* Ring Buffer utility..
*
diff --git a/pd/portaudio/pablio/ringbuffer.h b/pd/portaudio/pablio/ringbuffer.h
index 36fab68f..b26e30b4 100644
--- a/pd/portaudio/pablio/ringbuffer.h
+++ b/pd/portaudio/pablio/ringbuffer.h
@@ -6,7 +6,7 @@ extern "C"
#endif /* __cplusplus */
/*
- * $Id: ringbuffer.h,v 1.15 2006-10-09 04:36:12 millerpuckette Exp $
+ * $Id: ringbuffer.h,v 1.16 2006-10-22 21:46:10 millerpuckette Exp $
* ringbuffer.h
* Ring Buffer utility..
*
diff --git a/pd/portmidi/pm_mac/pmmacosxcm.c b/pd/portmidi/pm_mac/pmmacosxcm.c
index 4fb4a108..6c9df3c7 100644
--- a/pd/portmidi/pm_mac/pmmacosxcm.c
+++ b/pd/portmidi/pm_mac/pmmacosxcm.c
@@ -5,7 +5,7 @@
* and subsequent work by Andrew Zeldis and Zico Kolter
* and Roger B. Dannenberg
*
- * $Id: pmmacosxcm.c,v 1.15 2006-10-09 04:36:12 millerpuckette Exp $
+ * $Id: pmmacosxcm.c,v 1.16 2006-10-22 21:46:10 millerpuckette Exp $
*/
/* Notes:
diff --git a/pd/src/d_array.c b/pd/src/d_array.c
index 6cfea1fc..de72ef12 100644
--- a/pd/src/d_array.c
+++ b/pd/src/d_array.c
@@ -18,7 +18,7 @@ typedef struct _tabwrite_tilde
t_object x_obj;
int x_phase;
int x_nsampsintab;
- float *x_vec;
+ t_word *x_vec;
t_symbol *x_arrayname;
float x_f;
} t_tabwrite_tilde;
@@ -52,7 +52,7 @@ static t_int *tabwrite_tilde_perform(t_int *w)
if (endphase > phase)
{
int nxfer = endphase - phase;
- float *fp = x->x_vec + phase;
+ t_word *wp = x->x_vec + phase;
if (nxfer > n) nxfer = n;
phase += nxfer;
while (nxfer--)
@@ -60,7 +60,7 @@ static t_int *tabwrite_tilde_perform(t_int *w)
float f = *in++;
if (PD_BIGORSMALL(f))
f = 0;
- *fp++ = f;
+ (wp++)->w_float = f;
}
if (phase >= endphase)
{
@@ -85,7 +85,7 @@ void tabwrite_tilde_set(t_tabwrite_tilde *x, t_symbol *s)
x->x_arrayname->s_name);
x->x_vec = 0;
}
- else if (!garray_getfloatarray(a, &x->x_nsampsintab, &x->x_vec))
+ else if (!garray_getfloatwords(a, &x->x_nsampsintab, &x->x_vec))
{
pd_error(x, "%s: bad template for tabwrite~", x->x_arrayname->s_name);
x->x_vec = 0;
@@ -146,7 +146,7 @@ typedef struct _tabplay_tilde
int x_phase;
int x_nsampsintab;
int x_limit;
- float *x_vec;
+ t_word *x_vec;
t_symbol *x_arrayname;
t_clock *x_clock;
} t_tabplay_tilde;
@@ -168,7 +168,8 @@ static void *tabplay_tilde_new(t_symbol *s)
static t_int *tabplay_tilde_perform(t_int *w)
{
t_tabplay_tilde *x = (t_tabplay_tilde *)(w[1]);
- t_float *out = (t_float *)(w[2]), *fp;
+ t_float *out = (t_float *)(w[2]);
+ t_word *wp;
int n = (int)(w[3]), phase = x->x_phase,
endphase = (x->x_nsampsintab < x->x_limit ?
x->x_nsampsintab : x->x_limit), nxfer, n3;
@@ -176,13 +177,13 @@ static t_int *tabplay_tilde_perform(t_int *w)
goto zero;
nxfer = endphase - phase;
- fp = x->x_vec + phase;
+ wp = x->x_vec + phase;
if (nxfer > n)
nxfer = n;
n3 = n - nxfer;
phase += nxfer;
while (nxfer--)
- *out++ = *fp++;
+ *out++ = (wp++)->w_float;
if (phase >= endphase)
{
clock_delay(x->x_clock, 0);
@@ -209,7 +210,7 @@ void tabplay_tilde_set(t_tabplay_tilde *x, t_symbol *s)
x->x_arrayname->s_name);
x->x_vec = 0;
}
- else if (!garray_getfloatarray(a, &x->x_nsampsintab, &x->x_vec))
+ else if (!garray_getfloatwords(a, &x->x_nsampsintab, &x->x_vec))
{
pd_error(x, "%s: bad template for tabplay~", x->x_arrayname->s_name);
x->x_vec = 0;
@@ -273,7 +274,7 @@ typedef struct _tabread_tilde
{
t_object x_obj;
int x_npoints;
- float *x_vec;
+ t_word *x_vec;
t_symbol *x_arrayname;
float x_f;
} t_tabread_tilde;
@@ -295,7 +296,7 @@ static t_int *tabread_tilde_perform(t_int *w)
t_float *out = (t_float *)(w[3]);
int n = (int)(w[4]);
int maxindex;
- float *buf = x->x_vec, *fp;
+ t_word *buf = x->x_vec;
int i;
maxindex = x->x_npoints - 1;
@@ -308,7 +309,7 @@ static t_int *tabread_tilde_perform(t_int *w)
index = 0;
else if (index > maxindex)
index = maxindex;
- *out++ = buf[index];
+ *out++ = buf[index].w_float;
}
return (w+5);
zero:
@@ -328,7 +329,7 @@ void tabread_tilde_set(t_tabread_tilde *x, t_symbol *s)
pd_error(x, "tabread~: %s: no such array", x->x_arrayname->s_name);
x->x_vec = 0;
}
- else if (!garray_getfloatarray(a, &x->x_npoints, &x->x_vec))
+ else if (!garray_getfloatwords(a, &x->x_npoints, &x->x_vec))
{
pd_error(x, "%s: bad template for tabread~", x->x_arrayname->s_name);
x->x_vec = 0;
@@ -369,7 +370,7 @@ typedef struct _tabread4_tilde
{
t_object x_obj;
int x_npoints;
- float *x_vec;
+ t_word *x_vec;
t_symbol *x_arrayname;
float x_f;
} t_tabread4_tilde;
@@ -391,7 +392,7 @@ static t_int *tabread4_tilde_perform(t_int *w)
t_float *out = (t_float *)(w[3]);
int n = (int)(w[4]);
int maxindex;
- float *buf = x->x_vec, *fp;
+ t_word *buf = x->x_vec, *wp;
int i;
maxindex = x->x_npoints - 3;
@@ -425,11 +426,11 @@ static t_int *tabread4_tilde_perform(t_int *w)
else if (index > maxindex)
index = maxindex, frac = 1;
else frac = findex - index;
- fp = buf + index;
- a = fp[-1];
- b = fp[0];
- c = fp[1];
- d = fp[2];
+ wp = buf + index;
+ a = wp[-1].w_float;
+ b = wp[0].w_float;
+ c = wp[1].w_float;
+ d = wp[2].w_float;
/* if (!i && !(count++ & 1023))
post("fp = %lx, shit = %lx, b = %f", fp, buf->b_shit, b); */
cminusb = c-b;
@@ -457,7 +458,7 @@ void tabread4_tilde_set(t_tabread4_tilde *x, t_symbol *s)
pd_error(x, "tabread4~: %s: no such array", x->x_arrayname->s_name);
x->x_vec = 0;
}
- else if (!garray_getfloatarray(a, &x->x_npoints, &x->x_vec))
+ else if (!garray_getfloatwords(a, &x->x_npoints, &x->x_vec))
{
pd_error(x, "%s: bad template for tabread4~", x->x_arrayname->s_name);
x->x_vec = 0;
@@ -563,7 +564,7 @@ typedef struct _tabosc4_tilde
t_object x_obj;
float x_fnpoints;
float x_finvnpoints;
- float *x_vec;
+ t_word *x_vec;
t_symbol *x_arrayname;
float x_f;
double x_phase;
@@ -595,7 +596,7 @@ static t_int *tabosc4_tilde_perform(t_int *w)
int mask = fnpoints - 1;
float conv = fnpoints * x->x_conv;
int maxindex;
- float *tab = x->x_vec, *addr;
+ t_word *tab = x->x_vec, *addr;
int i;
double dphase = fnpoints * x->x_phase + UNITBIT32;
@@ -612,10 +613,10 @@ static t_int *tabosc4_tilde_perform(t_int *w)
addr = tab + (tf.tf_i[HIOFFSET] & mask);
tf.tf_i[HIOFFSET] = normhipart;
frac = tf.tf_d - UNITBIT32;
- a = addr[0];
- b = addr[1];
- c = addr[2];
- d = addr[3];
+ a = addr[0].w_float;
+ b = addr[1].w_float;
+ c = addr[2].w_float;
+ d = addr[3].w_float;
cminusb = c-b;
*out++ = b + frac * (
cminusb - 0.1666667f * (1.-frac) * (
@@ -649,7 +650,7 @@ void tabosc4_tilde_set(t_tabosc4_tilde *x, t_symbol *s)
pd_error(x, "tabosc4~: %s: no such array", x->x_arrayname->s_name);
x->x_vec = 0;
}
- else if (!garray_getfloatarray(a, &pointsinarray, &x->x_vec))
+ else if (!garray_getfloatwords(a, &pointsinarray, &x->x_vec))
{
pd_error(x, "%s: bad template for tabosc4~", x->x_arrayname->s_name);
x->x_vec = 0;
@@ -704,7 +705,7 @@ static t_class *tabsend_class;
typedef struct _tabsend
{
t_object x_obj;
- float *x_vec;
+ t_word *x_vec;
int x_graphperiod;
int x_graphcount;
t_symbol *x_arrayname;
@@ -727,7 +728,7 @@ static t_int *tabsend_perform(t_int *w)
t_tabsend *x = (t_tabsend *)(w[1]);
t_float *in = (t_float *)(w[2]);
int n = w[3];
- t_float *dest = x->x_vec;
+ t_word *dest = x->x_vec;
int i = x->x_graphcount;
if (!x->x_vec) goto bad;
@@ -736,7 +737,7 @@ static t_int *tabsend_perform(t_int *w)
float f = *in++;
if (PD_BIGORSMALL(f))
f = 0;
- *dest++ = f;
+ (dest++)->w_float = f;
}
if (!i--)
{
@@ -761,7 +762,7 @@ static void tabsend_dsp(t_tabsend *x, t_signal **sp)
if (*x->x_arrayname->s_name)
pd_error(x, "tabsend~: %s: no such array", x->x_arrayname->s_name);
}
- else if (!garray_getfloatarray(a, &vecsize, &x->x_vec))
+ else if (!garray_getfloatwords(a, &vecsize, &x->x_vec))
pd_error(x, "%s: bad template for tabsend~", x->x_arrayname->s_name);
else
{
@@ -791,7 +792,7 @@ static t_class *tabreceive_class;
typedef struct _tabreceive
{
t_object x_obj;
- float *x_vec;
+ t_word *x_vec;
int x_vecsize;
t_symbol *x_arrayname;
} t_tabreceive;
@@ -801,12 +802,12 @@ static t_int *tabreceive_perform(t_int *w)
t_tabreceive *x = (t_tabreceive *)(w[1]);
t_float *out = (t_float *)(w[2]);
int n = w[3];
- t_float *from = x->x_vec;
+ t_word *from = x->x_vec;
if (from)
{
int vecsize = x->x_vecsize;
while (vecsize--)
- *out++ = *from++;
+ *out++ = (from++)->w_float;
vecsize = n - x->x_vecsize;
while (vecsize--)
*out++ = 0;
@@ -823,7 +824,7 @@ static void tabreceive_dsp(t_tabreceive *x, t_signal **sp)
if (*x->x_arrayname->s_name)
pd_error(x, "tabsend~: %s: no such array", x->x_arrayname->s_name);
}
- else if (!garray_getfloatarray(a, &x->x_vecsize, &x->x_vec))
+ else if (!garray_getfloatwords(a, &x->x_vecsize, &x->x_vec))
pd_error(x, "%s: bad template for tabreceive~", x->x_arrayname->s_name);
else
{
@@ -865,18 +866,18 @@ static void tabread_float(t_tabread *x, t_float f)
{
t_garray *a;
int npoints;
- t_float *vec;
+ t_word *vec;
if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
pd_error(x, "%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(a, &npoints, &vec))
+ else if (!garray_getfloatwords(a, &npoints, &vec))
pd_error(x, "%s: bad template for tabread", x->x_arrayname->s_name);
else
{
int n = f;
if (n < 0) n = 0;
else if (n >= npoints) n = npoints - 1;
- outlet_float(x->x_obj.ob_outlet, (npoints ? vec[n] : 0));
+ outlet_float(x->x_obj.ob_outlet, (npoints ? vec[n].w_float : 0));
}
}
@@ -916,30 +917,31 @@ static void tabread4_float(t_tabread4 *x, t_float f)
{
t_garray *a;
int npoints;
- t_float *vec;
+ t_word *vec;
if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
pd_error(x, "%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(a, &npoints, &vec))
+ else if (!garray_getfloatwords(a, &npoints, &vec))
pd_error(x, "%s: bad template for tabread4", x->x_arrayname->s_name);
else if (npoints < 4)
outlet_float(x->x_obj.ob_outlet, 0);
else if (f <= 1)
- outlet_float(x->x_obj.ob_outlet, vec[1]);
+ outlet_float(x->x_obj.ob_outlet, vec[1].w_float);
else if (f >= npoints - 2)
- outlet_float(x->x_obj.ob_outlet, vec[npoints - 2]);
+ outlet_float(x->x_obj.ob_outlet, vec[npoints - 2].w_float);
else
{
int n = f;
- float a, b, c, d, cminusb, frac, *fp;
+ float a, b, c, d, cminusb, frac;
+ t_word *wp;
if (n >= npoints - 2)
n = npoints - 3;
- fp = vec + n;
+ wp = vec + n;
frac = f - n;
- a = fp[-1];
- b = fp[0];
- c = fp[1];
- d = fp[2];
+ a = wp[-1].w_float;
+ b = wp[0].w_float;
+ c = wp[1].w_float;
+ d = wp[2].w_float;
cminusb = c-b;
outlet_float(x->x_obj.ob_outlet, b + frac * (
cminusb - 0.1666667f * (1.-frac) * (
@@ -984,11 +986,11 @@ static void tabwrite_float(t_tabwrite *x, t_float f)
{
int i, vecsize;
t_garray *a;
- t_float *vec;
+ t_word *vec;
if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
pd_error(x, "%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(a, &vecsize, &vec))
+ else if (!garray_getfloatwords(a, &vecsize, &vec))
pd_error(x, "%s: bad template for tabwrite", x->x_arrayname->s_name);
else
{
@@ -997,7 +999,7 @@ static void tabwrite_float(t_tabwrite *x, t_float f)
n = 0;
else if (n >= vecsize)
n = vecsize-1;
- vec[n] = f;
+ vec[n].w_float = f;
garray_redraw(a);
}
}
diff --git a/pd/src/d_soundfile.c b/pd/src/d_soundfile.c
index 9f186b2d..56c89e07 100644
--- a/pd/src/d_soundfile.c
+++ b/pd/src/d_soundfile.c
@@ -422,7 +422,7 @@ int open_soundfile_via_canvas(t_canvas *canvas, const char *filename, int header
static void soundfile_xferin(int sfchannels, int nvecs, float **vecs,
long itemsread, unsigned char *buf, int nitems, int bytespersamp,
- int bigendian)
+ int bigendian, int spread)
{
int i, j;
unsigned char *sp, *sp2;
@@ -435,14 +435,14 @@ static void soundfile_xferin(int sfchannels, int nvecs, float **vecs,
{
if (bigendian)
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*fp = SCALE * ((sp2[0] << 24) | (sp2[1] << 16));
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*fp = SCALE * ((sp2[1] << 24) | (sp2[0] << 16));
}
}
@@ -450,15 +450,15 @@ static void soundfile_xferin(int sfchannels, int nvecs, float **vecs,
{
if (bigendian)
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*fp = SCALE * ((sp2[0] << 24) | (sp2[1] << 16)
| (sp2[2] << 8));
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*fp = SCALE * ((sp2[2] << 24) | (sp2[1] << 16)
| (sp2[0] << 8));
}
@@ -467,15 +467,15 @@ static void soundfile_xferin(int sfchannels, int nvecs, float **vecs,
{
if (bigendian)
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*(long *)fp = ((sp2[0] << 24) | (sp2[1] << 16)
| (sp2[2] << 8) | sp2[3]);
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*(long *)fp = ((sp2[3] << 24) | (sp2[2] << 16)
| (sp2[1] << 8) | sp2[0]);
}
@@ -824,7 +824,7 @@ baddonewrite:
static void soundfile_xferout(int nchannels, float **vecs,
unsigned char *buf, int nitems, long onset, int bytespersamp,
- int bigendian, float normalfactor)
+ int bigendian, float normalfactor, int spread)
{
int i, j;
unsigned char *sp, *sp2;
@@ -839,7 +839,7 @@ static void soundfile_xferout(int nchannels, float **vecs,
if (bigendian)
{
for (j = 0, sp2 = sp, fp = vecs[i] + onset;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
int xx = 32768. + (*fp * ff);
xx -= 32768;
@@ -854,7 +854,7 @@ static void soundfile_xferout(int nchannels, float **vecs,
else
{
for (j = 0, sp2 = sp, fp=vecs[i] + onset;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
int xx = 32768. + (*fp * ff);
xx -= 32768;
@@ -873,7 +873,7 @@ static void soundfile_xferout(int nchannels, float **vecs,
if (bigendian)
{
for (j = 0, sp2 = sp, fp=vecs[i] + onset;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
int xx = 8388608. + (*fp * ff);
xx -= 8388608;
@@ -889,7 +889,7 @@ static void soundfile_xferout(int nchannels, float **vecs,
else
{
for (j = 0, sp2 = sp, fp=vecs[i] + onset;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
int xx = 8388608. + (*fp * ff);
xx -= 8388608;
@@ -908,7 +908,7 @@ static void soundfile_xferout(int nchannels, float **vecs,
if (bigendian)
{
for (j = 0, sp2 = sp, fp=vecs[i] + onset;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
float f2 = *fp * normalfactor;
xx = *(long *)&f2;
@@ -919,7 +919,7 @@ static void soundfile_xferout(int nchannels, float **vecs,
else
{
for (j = 0, sp2 = sp, fp=vecs[i] + onset;
- j < nitems; j++, sp2 += bytesperframe, fp++)
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
float f2 = *fp * normalfactor;
xx = *(long *)&f2;
@@ -975,7 +975,7 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
int fd = -1;
char endianness, *filename;
t_garray *garrays[MAXSFCHANS];
- t_float *vecs[MAXSFCHANS];
+ t_word *vecs[MAXSFCHANS];
char sampbuf[SAMPBUFSIZE];
int bufframes, nitems;
FILE *fp;
@@ -1051,7 +1051,8 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
pd_error(x, "%s: no such table", argv[i].a_w.w_symbol->s_name);
goto done;
}
- else if (!garray_getfloatarray(garrays[i], &vecsize, &vecs[i]))
+ else if (!garray_getfloatwords(garrays[i], &vecsize,
+ &vecs[i]))
error("%s: bad template for tabwrite",
argv[i].a_w.w_symbol->s_name);
if (finalsize && finalsize != vecsize && !resize)
@@ -1101,7 +1102,8 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
garray_resize(garrays[i], finalsize);
/* for sanity's sake let's clear the save-in-patch flag here */
garray_setsaveit(garrays[i], 0);
- garray_getfloatarray(garrays[i], &vecsize, &vecs[i]);
+ garray_getfloatwords(garrays[i], &vecsize,
+ &vecs[i]);
/* if the resize failed, garray_resize reported the error */
if (vecsize != framesinfile)
{
@@ -1122,8 +1124,9 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
thisread = (thisread > bufframes ? bufframes : thisread);
nitems = fread(sampbuf, channels * bytespersamp, thisread, fp);
if (nitems <= 0) break;
- soundfile_xferin(channels, argc, vecs, itemsread,
- (unsigned char *)sampbuf, nitems, bytespersamp, bigendian);
+ soundfile_xferin(channels, argc, (float **)vecs, itemsread,
+ (unsigned char *)sampbuf, nitems, bytespersamp, bigendian,
+ sizeof(t_word)/sizeof(float));
itemsread += nitems;
}
/* zero out remaining elements of vectors */
@@ -1131,18 +1134,18 @@ static void soundfiler_read(t_soundfiler *x, t_symbol *s,
for (i = 0; i < argc; i++)
{
int nzero, vecsize;
- garray_getfloatarray(garrays[i], &vecsize, &vecs[i]);
+ garray_getfloatwords(garrays[i], &vecsize, &vecs[i]);
for (j = itemsread; j < vecsize; j++)
- vecs[i][j] = 0;
+ vecs[i][j].w_float = 0;
}
/* zero out vectors in excess of number of channels */
for (i = channels; i < argc; i++)
{
int vecsize;
- float *foo;
- garray_getfloatarray(garrays[i], &vecsize, &foo);
+ t_word *foo;
+ garray_getfloatwords(garrays[i], &vecsize, &foo);
for (j = 0; j < vecsize; j++)
- foo[j] = 0;
+ foo[j].w_float = 0;
}
/* do all graphics updates */
for (i = 0; i < argc; i++)
@@ -1171,7 +1174,7 @@ long soundfiler_dowrite(void *obj, t_canvas *canvas,
long onset, nframes, itemsleft,
maxsize = DEFMAXSIZE, itemswritten = 0;
t_garray *garrays[MAXSFCHANS];
- t_float *vecs[MAXSFCHANS];
+ t_word *vecs[MAXSFCHANS];
char sampbuf[SAMPBUFSIZE];
int bufframes, nitems;
int fd = -1;
@@ -1198,7 +1201,7 @@ long soundfiler_dowrite(void *obj, t_canvas *canvas,
pd_error(obj, "%s: no such table", argv[i].a_w.w_symbol->s_name);
goto fail;
}
- else if (!garray_getfloatarray(garrays[i], &vecsize, &vecs[i]))
+ else if (!garray_getfloatwords(garrays[i], &vecsize, &vecs[i]))
error("%s: bad template for tabwrite",
argv[i].a_w.w_symbol->s_name);
if (nframes > vecsize - onset)
@@ -1206,10 +1209,10 @@ long soundfiler_dowrite(void *obj, t_canvas *canvas,
for (j = 0; j < vecsize; j++)
{
- if (vecs[i][j] > biggest)
- biggest = vecs[i][j];
- else if (-vecs[i][j] > biggest)
- biggest = -vecs[i][j];
+ if (vecs[i][j].w_float > biggest)
+ biggest = vecs[i][j].w_float;
+ else if (-vecs[i][j].w_float > biggest)
+ biggest = -vecs[i][j].w_float;
}
}
if (nframes <= 0)
@@ -1244,8 +1247,9 @@ long soundfiler_dowrite(void *obj, t_canvas *canvas,
{
int thiswrite = nframes - itemswritten, nitems, nbytes;
thiswrite = (thiswrite > bufframes ? bufframes : thiswrite);
- soundfile_xferout(argc, vecs, (unsigned char *)sampbuf, thiswrite,
- onset, bytespersamp, bigendian, normfactor);
+ soundfile_xferout(argc, (t_float **)vecs, (unsigned char *)sampbuf,
+ thiswrite, onset, bytespersamp, bigendian, normfactor,
+ sizeof(t_word)/sizeof(float));
nbytes = write(fd, sampbuf, nchannels * bytespersamp * thiswrite);
if (nbytes < nchannels * bytespersamp * thiswrite)
{
@@ -1789,7 +1793,7 @@ static t_int *readsf_perform(t_int *w)
{
soundfile_xferin(sfchannels, noutlets, x->x_outvec, 0,
(unsigned char *)(x->x_buf + x->x_fifotail), xfersize,
- bytespersample, bigendian);
+ bytespersample, bigendian, 1);
vecsize -= xfersize;
}
/* then zero out the (rest of the) output */
@@ -1804,7 +1808,7 @@ static t_int *readsf_perform(t_int *w)
soundfile_xferin(sfchannels, noutlets, x->x_outvec, 0,
(unsigned char *)(x->x_buf + x->x_fifotail), vecsize,
- bytespersample, bigendian);
+ bytespersample, bigendian, 1);
x->x_fifotail += wantbytes;
if (x->x_fifotail >= x->x_fifosize)
@@ -2264,7 +2268,7 @@ static t_int *writesf_perform(t_int *w)
soundfile_xferout(sfchannels, x->x_outvec,
(unsigned char *)(x->x_buf + x->x_fifohead), vecsize, 0,
- bytespersample, bigendian, 1.);
+ bytespersample, bigendian, 1., 1);
x->x_fifohead += wantbytes;
if (x->x_fifohead >= x->x_fifosize)
diff --git a/pd/src/g_array.c b/pd/src/g_array.c
index 95819282..1b44e548 100644
--- a/pd/src/g_array.c
+++ b/pd/src/g_array.c
@@ -1130,7 +1130,7 @@ char *garray_vec(t_garray *x) /* get the contents */
/* routine that checks if we're just an array of floats and if
so returns the goods */
-int garray_getfloatarray(t_garray *x, int *size, t_float **vec)
+int garray_getfloatwords(t_garray *x, int *size, t_word **vec)
{
int yonset, type, elemsize;
t_array *a = garray_getarray_floatonly(x, &yonset, &elemsize);
@@ -1145,9 +1145,23 @@ int garray_getfloatarray(t_garray *x, int *size, t_float **vec)
return (0);
}
*size = garray_npoints(x);
- *vec = (float *)garray_vec(x);
+ *vec = (t_word *)garray_vec(x);
return (1);
}
+ /* older, non-64-bit safe version, supplied for older externs */
+
+int garray_getfloatarray(t_garray *x, int *size, t_float **vec)
+{
+ if (sizeof(t_word) != sizeof(float))
+ {
+ static int warned;
+ if (!warned)
+ post(
+ "warning: extern using garray_getfloatarray() won't work in 64-bit version");
+ warned = 1;
+ }
+ return (garray_getfloatwords(x, size, (t_word **)vec));
+}
/* set the "saveit" flag */
void garray_setsaveit(t_garray *x, int saveit)
diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c
index 97fe71e7..1f449a63 100644
--- a/pd/src/g_graph.c
+++ b/pd/src/g_graph.c
@@ -999,7 +999,7 @@ static void graph_motion(void *z, t_floatarg dx, t_floatarg dy)
t_garray *a = (t_garray *)(x->gl_list);
int oldx = 0.5 + glist_pixelstox(x, graph_lastxpix);
int newx = 0.5 + glist_pixelstox(x, newxpix);
- t_float *vec;
+ t_word *vec;
int nelem, i;
float oldy = glist_pixelstoy(x, graph_lastypix);
float newy = glist_pixelstoy(x, newypix);
@@ -1008,7 +1008,7 @@ static void graph_motion(void *z, t_floatarg dx, t_floatarg dy)
/* verify that the array is OK */
if (!a || pd_class((t_pd *)a) != garray_class)
return;
- if (!garray_getfloatarray(a, &nelem, &vec))
+ if (!garray_getfloatwords(a, &nelem, &vec))
return;
if (oldx < 0) oldx = 0;
if (oldx >= nelem)
@@ -1019,16 +1019,16 @@ static void graph_motion(void *z, t_floatarg dx, t_floatarg dy)
if (oldx < newx - 1)
{
for (i = oldx + 1; i <= newx; i++)
- vec[i] = newy + (oldy - newy) *
+ vec[i].w_float = newy + (oldy - newy) *
((float)(newx - i))/(float)(newx - oldx);
}
else if (oldx > newx + 1)
{
for (i = oldx - 1; i >= newx; i--)
- vec[i] = newy + (oldy - newy) *
+ vec[i].w_float = newy + (oldy - newy) *
((float)(newx - i))/(float)(newx - oldx);
}
- else vec[newx] = newy;
+ else vec[newx].w_float = newy;
garray_redraw(a);
}
diff --git a/pd/src/g_readwrite.c b/pd/src/g_readwrite.c
index 3efb6c7e..ff93a4dd 100644
--- a/pd/src/g_readwrite.c
+++ b/pd/src/g_readwrite.c
@@ -258,8 +258,7 @@ static void glist_doread(t_glist *x, t_symbol *filename, t_symbol *format,
else if (*format->s_name)
error("qlist_read: unknown flag: %s", format->s_name);
- if (binbuf_read_via_path(b, filename->s_name,
- canvas_getdir(canvas)->s_name, cr))
+ if (binbuf_read_via_canvas(b, filename->s_name, canvas, cr))
{
pd_error(x, "read failed");
binbuf_free(b);
diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h
index 8f22b765..19795414 100644
--- a/pd/src/m_pd.h
+++ b/pd/src/m_pd.h
@@ -9,9 +9,9 @@ extern "C" {
#endif
#define PD_MAJOR_VERSION 0
-#define PD_MINOR_VERSION 40
-#define PD_BUGFIX_VERSION 1
-#define PD_TEST_VERSION ""
+#define PD_MINOR_VERSION 41
+#define PD_BUGFIX_VERSION 0
+#define PD_TEST_VERSION "test03"
/* old name for "MSW" flag -- we have to take it for the sake of many old
"nmakefiles" for externs, which will define NT and not MSW */
@@ -571,6 +571,7 @@ EXTERN_STRUCT _garray;
EXTERN t_class *garray_class;
EXTERN int garray_getfloatarray(t_garray *x, int *size, t_float **vec);
+EXTERN int garray_getfloatwords(t_garray *x, int *size, t_word **vec);
EXTERN float garray_get(t_garray *x, t_symbol *s, t_int indx);
EXTERN void garray_redraw(t_garray *x);
EXTERN int garray_npoints(t_garray *x);
diff --git a/pd/src/makefile.in b/pd/src/makefile.in
index 05a1ecf8..8b41c5bf 100644
--- a/pd/src/makefile.in
+++ b/pd/src/makefile.in
@@ -110,15 +110,14 @@ $(BIN_DIR)/pdreceive: u_pdreceive.c $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c
$(PDEXEC): $(OBJ) $(BIN_DIR)
- cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \
- $(LIB)
-
+ cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) $(LIB)
+
$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC)
- cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \
- $(GLIB)
+ cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) $(GLIB)
-$(BIN_DIR)/pd.tk: u_main.tk
+$(BIN_DIR)/pd.tk: u_main.tk $(BIN_DIR)
cp u_main.tk $(BIN_DIR)/pd.tk
+ touch -r makefile.dependencies $(BIN_DIR)
#this is for Max OSX only...
$(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC)
diff --git a/pd/src/makefile.irix b/pd/src/makefile.irix
deleted file mode 100644
index 38c296a0..00000000
--- a/pd/src/makefile.irix
+++ /dev/null
@@ -1,190 +0,0 @@
-# Makefile mods by Olaf Matthes for use with GCC 3.3
-#
-# This makefile is made for r10000. You can change r10000 to your
-# processor type if you have problems. Just change and type
-# 'make'
-#
-# You will need to change the tck/tk paths if you want to recompile
-# The GUI part.
-
-# compile with GCC as n32 binary
-EXECUTABLE=../bin/pd-n32
-XF1=-mabi=n32 -mips4 -DN32 -funroll-loops -fomit-frame-pointer
-
-# compile with GCC as o32 binary
-#EXECUTABLE=../bin/pd-o32
-#XF1=-mcpu=r4000 -mips3 -funroll-loops -fomit-frame-pointer
-
-CC=gcc
-OBJ_DIR = ../obj
-BIN_DIR = ../bin
-PDEXEC = $(BIN_DIR)/pd
-EXT= pd_irix6
-GUINAME= pd-gui
-
-INSTALL_PREFIX = /usr/local
-GFLAGS = -DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
-
-MANDIR = ${prefix}/man
-
-MORECFLAGS = -DIRIX -DDL_OPEN -DUSEAPI_SGI -I/usr/X11R6/include -Wno-error
-
-INCLUDE = -I. -I../tk/unix/include -I../tcl/unix/include
-GINCLUDE = $(INCLUDE)
-GLIB = ../tk/unix/lib/libtk8.4.a ../tcl/unix/lib/libtcl8.4.a -lm -lX11
-
-LDFLAGS = $(XF1)
-LIB = -laudio -lmd -lm -lpthread
-
-OPT_CFLAGS = -O3
-WARN_CFLAGS = -Wall -W -Werror -Wno-unused \
- -Wno-parentheses -Wno-switch
-ARCH_CFLAGS = -DPD -DUNIX
-
-CFLAGS = $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(MORECFLAGS) $(XF1)
-
-# the sources
-
-SYSSRC = s_midi_sgi.c s_audio_sgi.c
-
-SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \
- g_scalar.c g_traversal.c g_guiconnect.c g_readwrite.c g_editor.c \
- g_all_guis.c g_bang.c g_hdial.c g_hslider.c g_mycanvas.c g_numbox.c \
- g_toggle.c g_vdial.c g_vslider.c g_vumeter.c \
- m_pd.c m_class.c m_obj.c m_atom.c m_memory.c m_binbuf.c \
- m_conf.c m_glob.c m_sched.c \
- s_main.c s_inter.c s_file.c s_print.c \
- s_loader.c s_path.c s_entry.c s_audio.c s_midi.c \
- d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_dac.c d_misc.c \
- d_math.c d_fft.c d_mayer_fft.c d_fftroutine.c d_array.c d_global.c \
- d_delay.c d_resample.c \
- x_arithmetic.c x_connective.c x_interface.c x_midi.c x_misc.c \
- x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c d_soundfile.c \
- $(SYSSRC)
-
-
-OBJ = $(SRC:.c=.o)
-
-GSRC = t_main.c t_tkcmd.c
-
-GOBJ = $(GSRC:.c=.o)
-
-#
-# ------------------ targets ------------------------------------
-#
-
-.PHONY: pd gui pd-watchdog all
-
-all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
- $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
-
-bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
- $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
-
-.c.o:
- gcc $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c
-
-#$(OBJ) : %.o : %.c
-# $(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c
-
-#$(GOBJ) : %.o : %.c
-# $(CC) $(CFLAGS) $(GFLAGS) $(GINCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c
-
-pd: $(PDEXEC)
-
-gui: $(BIN_DIR)/$(GUINAME)
-
-pd-watchdog: $(BIN_DIR)/pd-watchdog
-
-$(BIN_DIR)/pd-watchdog: s_watchdog.c
- gcc -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
-
-$(BIN_DIR)/pdsend: u_pdsend.c
- gcc $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
-
-$(BIN_DIR)/pdreceive: u_pdreceive.c
- gcc $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c
-
-$(PDEXEC): $(OBJ)
- cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \
- $(LIB)
-
-$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC)
- cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \
- $(GLIB)
-
-$(BIN_DIR)/pd.tk: u_main.tk
- echo set pd_nt 2 > $(BIN_DIR)/pd.tk
- grep -v "set pd_nt" < u_main.tk >> $(BIN_DIR)/pd.tk
-
-INSTDIR = $(DESTDIR)/$(INSTALL_PREFIX)
-MANINSTDIR = $(DESTDIR)/$(MANDIR)
-
-install: all
- install -d $(INSTDIR)/lib/pd/bin
- install $(BIN_DIR)/$(GUINAME) $(INSTDIR)/lib/pd/bin/$(GUINAME)
- install $(BIN_DIR)/pd-watchdog $(INSTDIR)/lib/pd/bin/pd-watchdog
- install -m644 $(BIN_DIR)/pd.tk $(INSTDIR)/lib/pd/bin/pd.tk
- install -d $(INSTDIR)/bin
- install -m755 $(PDEXEC) $(INSTDIR)/bin/pd
- install -m 755 $(BIN_DIR)/pdsend $(INSTDIR)/bin/pdsend
- install -m 755 $(BIN_DIR)/pdreceive $(INSTDIR)/bin/pdreceive
- install -d $(INSTDIR)/lib/pd/extra
- install -d $(INSTDIR)/lib/pd/externs
- install -m 644 $(EXTERNS) $(INSTDIR)/lib/pd/extra
- cp -r ../doc $(INSTDIR)/lib/pd/
- install -d $(INSTDIR)/include
- install -m644 m_pd.h $(INSTDIR)/include/m_pd.h
- install -d $(MANINSTDIR)/man1
- gzip < ../man/pd.1 > $(MANINSTDIR)/man1/pd.1.gz
- chmod 644 $(MANINSTDIR)/man1/pd.1.gz
- gzip < ../man/pdsend.1 > $(MANINSTDIR)/man1/pdsend.1.gz
- chmod 644 $(MANINSTDIR)/man1/pdsend.1.gz
- gzip < ../man/pdreceive.1 > $(MANINSTDIR)/man1/pdreceive.1.gz
- chmod 644 $(MANINSTDIR)/man1/pdreceive.1.gz
-
-local-clean:
- -rm -f ../obj/* $(BIN_DIR)/pd $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
- $(BIN_DIR)/pdreceive $(BIN_DIR)/pd-watchdog m_stamp.c
- -rm -f *~
- -(cd ../doc/6.externs; rm -f *.pd_linux)
- -rm -f makefile.dependencies
- touch makefile.dependencies
- chmod 666 makefile.dependencies
-
-extra-clean:
- -rm -f `find ../extra/ -name "*.pd_*"`
- -rm -f tags
-
-clean: extra-clean local-clean
-
-distclean: clean
- rm -rf config.cache config.log config.status makefile tags \
- autom4te-*.cache
- echo all: > makefile
- echo -e "\t./configure" >> makefile
- echo -e "\tmake" >> makefile
-
-tags: $(SRC) $(GSRC); ctags *.[ch]
-
-depend:
- $(CC) $(INCLUDE) $(CFLAGS) -M $(SRC) > makefile.dependencies
-
-uninstall:
- -rm -r $(INSTDIR)/lib/pd
- -rm $(INSTDIR)/bin/pd
- -rm $(INSTDIR)/bin/pdsend
- -rm $(INSTDIR)/bin/pdreceive
- -rm $(INSTDIR)/include/m_pd.h
- -rm $(MANINSTDIR)/man/man1/pd.1.gz
- -rm $(MANINSTDIR)/man/man1/pdsend.1.gz
- -rm $(MANINSTDIR)/man/man1/pdreceive.1.gz
-
-include makefile.dependencies
-
-
-
-
-
-
-
diff --git a/pd/src/notes.txt b/pd/src/notes.txt
index 363741f9..93c9986b 100644
--- a/pd/src/notes.txt
+++ b/pd/src/notes.txt
@@ -1,4 +1,9 @@
---------------- dolist --------------------
+0.40-1:
+ http "about" broken on MSW?
+ help browser broke on Panurge
+ binbuf_read_via_canvas in x_qlist.c
+
check bug reports on sourceforge
double-click fix on mac?
http://sourceforge.net/tracker/index.php?
@@ -49,8 +54,12 @@ more demonstration patches:
vibrato using variable delay
features:
+sigmund~: sort by pitch; one-shot
+add -x flag to drawnumbers....
+grab new ALSA midi code from devel
externs able to usurp built-ins (+mem alignment for SSE)
replace gatom_escapit with a quoting mechanism (handle '[', spaces, etc.)
+unicode in filenames??? How does this work? (bug report about windows)
sprout inlet for "route", "sel" if one arg
more list functions (see x_list.c)
poly inlet to turn stealing on/off, plus mode to handle note-with-duration
diff --git a/pd/src/s_audio_sgi.c b/pd/src/s_audio_sgi.c
deleted file mode 100644
index 26ebdc81..00000000
--- a/pd/src/s_audio_sgi.c
+++ /dev/null
@@ -1,460 +0,0 @@
-
-/* ----------------------- Experimental routines for SGI -------------- */
-
-/* written by Olaf Matthes <olaf.matthes@gmx.de> */
-
-#ifdef USEAPI_SGI
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <m_pd.h>
-#include <s_stuff.h>
-
-#include <dmedia/audio.h>
-#include <dmedia/midi.h>
-#include <sys/fpu.h>
-#include <errno.h>
-
-#define SGI_MAXDEV 4 /* it's just 3, but default counts as well... */
-#define SGI_MAXCH 12 /* max. number of channels - is this enough? */
-
-static ALport sgi_iport[SGI_MAXDEV];
-static ALport sgi_oport[SGI_MAXDEV];
-static ALconfig sgi_inconfig;
-static ALconfig sgi_outconfig;
-static int sgi_nindevs, sgi_noutdevs;
-static int sgi_inchannels, sgi_outchannels;
-static int sgi_ninchans[SGI_MAXDEV], sgi_noutchans[SGI_MAXDEV];
-
-
- /*
- set the special "flush zero" but (FS, bit 24) in the
- Control Status Register of the FPU of R4k and beyond
- so that the result of any underflowing operation will
- be clamped to zero, and no exception of any kind will
- be generated on the CPU.
-
- thanks to cpirazzi@cp.esd.sgi.com (Chris Pirazzi).
- */
-
-static void sgi_flush_all_underflows_to_zero(void)
-{
- union fpc_csr f;
- f.fc_word = get_fpc_csr();
- f.fc_struct.flush = 1;
- set_fpc_csr(f.fc_word);
-}
-
-
- /* convert the most common errors into readable strings */
-static char *sgi_get_error_message(int err)
-{
- switch (err)
- {
- case AL_BAD_CONFIG:
- return "Invalid config";
-
- case AL_BAD_DIRECTION:
- return "Invalid direction (neither \"r\" nor \"w\")";
-
- case AL_BAD_OUT_OF_MEM:
- return "Not enough memory";
-
- case AL_BAD_DEVICE_ACCESS:
- return "Audio hardware is not available or is improperly configured";
-
- case AL_BAD_DEVICE:
- return "Invalid device";
-
- case AL_BAD_NO_PORTS:
- return "No audio ports available";
-
- case AL_BAD_QSIZE:
- return "Invalid fifo size";
-
- case AL_BAD_SAMPFMT:
- return "Invalid sample format";
-
- case AL_BAD_FLOATMAX:
- return "Invalid float maximum";
-
- case AL_BAD_WIDTH:
- return "Invalid sample width";
-
- default:
- return "Unknown error";
- }
-}
-
-
-int sgi_open_audio(int nindev, int *indev, int nchin, int *chin,
- int noutdev, int *outdev, int nchout, int *chout, int rate)
-{
- ALpv pvbuf[2];
- int num_devs = 0;
- int in_dev = 0;
- int out_dev = 0;
- int inchans = 0;
- int outchans = 0;
- int err, n, gotchannels;
- char *indevnames[4] = {"DefaultIn", "AnalogIn", "AESIn", "ADATIn"};
- char *outdevnames[4] = {"DefaultOut", "AnalogOut", "AESOut", "ADATOut"};
-
- sgi_flush_all_underflows_to_zero();
-
- if (sys_verbose)
- post("opening sound input...");
-
- for (n = 0; n < nindev; n++)
- {
- int gotchannels = 0;
-
- if (indev[n] >= 0 && indev[n] < SGI_MAXDEV) /* open specified defice by name */
- {
- if (sys_verbose)
- post("opening %s", indevnames[indev[n]]);
- in_dev = alGetResourceByName(AL_SYSTEM,
- indevnames[indev[n]], AL_DEVICE_TYPE);
- }
- else /* open default device */
- {
- if(sys_verbose)post("opening %s", indevnames[0]);
- in_dev = AL_DEFAULT_INPUT;
- }
- if (!in_dev)
- {
- error("%s\n", sgi_get_error_message(in_dev));
- continue; /* try next device, if any */
- }
-
- sgi_inconfig = alNewConfig();
- alSetSampFmt(sgi_inconfig, AL_SAMPFMT_FLOAT);
- alSetFloatMax(sgi_outconfig, 1.1f);
- alSetChannels(sgi_outconfig, chin[n]);
- alSetQueueSize(sgi_inconfig, sys_advance_samples * chin[n]);
- alSetDevice(sgi_inconfig, in_dev);
- sgi_iport[n] = alOpenPort("Pd input port", "r", sgi_inconfig);
- if (!sgi_iport[n])
- fprintf(stderr,"Pd: failed to open audio read port\n");
-
- /* try to set samplerate */
- pvbuf[0].param = AL_RATE;
- pvbuf[0].value.ll = alDoubleToFixed(rate);
- if ((err = alSetParams(in_dev, pvbuf, 1)) < 0)
- {
- post("could not set specified sample rate for input (%s)\n",
- sgi_get_error_message(err));
- if(pvbuf[0].sizeOut < 0)
- post("rate was invalid\n");
- }
- /* check how many channels we actually got */
- pvbuf[0].param = AL_CHANNELS;
- if (alGetParams(in_dev, pvbuf, 1) < 0)
- {
- post("could not figure out how many input channels we got");
- gotchannels = chin[n]; /* assume we got them all */
- }
- else
- {
- gotchannels = pvbuf[0].value.i;
- }
- inchans += gotchannels; /* count total number of channels */
- sgi_ninchans[n] = gotchannels; /* remember channels for this device */
- }
-
- if (sys_verbose)
- post("opening sound output...");
-
- for (n = 0; n < noutdev; n++)
- {
- if (outdev[n] >= 0 && outdev[n] < SGI_MAXDEV) /* open specified defice by name */
- {
- if(sys_verbose)post("opening %s", outdevnames[outdev[n]]);
- out_dev = alGetResourceByName(AL_SYSTEM,
- outdevnames[outdev[n]], AL_DEVICE_TYPE);
- }
- else /* open default device */
- {
- if (sys_verbose)
- post("opening %s", outdevnames[0]);
- out_dev = AL_DEFAULT_OUTPUT;
- }
- if (!out_dev)
- {
- error("%s\n", sgi_get_error_message(out_dev));
- continue; /* try next device, if any */
- }
-
- /* configure the port before opening it */
- sgi_outconfig = alNewConfig();
- alSetSampFmt(sgi_outconfig, AL_SAMPFMT_FLOAT);
- alSetFloatMax(sgi_outconfig, 1.1f);
- alSetChannels(sgi_outconfig, chout[n]);
- alSetQueueSize(sgi_outconfig, sys_advance_samples * chout[n]);
- alSetDevice(sgi_outconfig, out_dev);
-
- /* open the port */
- sgi_oport[n] = alOpenPort("Pd ouput port", "w", sgi_outconfig);
- if (!sgi_oport[n])
- fprintf(stderr,"Pd: failed to open audio write port\n");
-
- /* now try to set sample rate */
- pvbuf[0].param = AL_RATE;
- pvbuf[0].value.ll = alDoubleToFixed(rate);
- if ((err = alSetParams(out_dev, pvbuf, 1)) < 0)
- {
- post("could not set specified sample rate for output (%s)\n",
- sgi_get_error_message(err));
- if(pvbuf[0].sizeOut < 0)
- post("rate was invalid\n");
- }
- /* check how many channels we actually got */
- pvbuf[0].param = AL_CHANNELS;
- if (alGetParams(out_dev, pvbuf, 1) < 0)
- {
- post("could not figure out how many output channels we got");
- gotchannels = chout[n];
- }
- else
- {
- gotchannels = pvbuf[0].value.i;
- }
- outchans += gotchannels;
- sgi_noutchans[n] = gotchannels;
- }
-
- sgi_noutdevs = noutdev;
- sgi_nindevs = nindev;
-
- sgi_inchannels = inchans;
- sgi_outchannels = outchans;
-
- return (!(inchans || outchans));
-}
-
-
-void sgi_close_audio(void)
-{
- int err, n;
- for (n = 0; n < sgi_nindevs; n++)
- {
- if (sgi_iport[n])
- {
- err = alClosePort(sgi_iport[n]);
- if (err < 0)
- error("closing input %d: %s (%d)", n + 1,
- alGetErrorString(oserror()), err);
- }
- }
- for (n = 0; n < sgi_noutdevs; n++)
- {
- if (sgi_oport[n])
- {
- err = alClosePort(sgi_oport[n]);
- if (err < 0)
- error("closing output %d: %s (%d)", n + 1,
- alGetErrorString(oserror()), err);
- }
- }
-}
-
-
- /* call this only if both input and output are open */
-static void sgi_checkiosync(void)
-{
- int i, result, checkit = 1, giveup = 1000, alreadylogged = 0;
- long indelay, outdelay, defect;
-
- if (!(sgi_outchannels && sgi_inchannels))
- return;
-}
-
-
-int sgi_send_dacs(void)
-{
- float buf[SGI_MAXCH * DEFDACBLKSIZE], *fp1, *fp2, *fp3, *fp4;
- static int xferno = 0;
- static int callno = 0;
- static double timenow;
- double timelast;
- int inchannels = (sys_inchannels > sgi_inchannels ?
- sgi_inchannels : sys_inchannels);
- int outchannels = (sys_outchannels > sgi_outchannels ?
- sgi_outchannels : sys_outchannels);
- long outfill[SGI_MAXDEV], infill[SGI_MAXDEV];
- int outdevchannels, indevchannels;
- int i, n, channel;
- int result;
- unsigned int outtransfersize = DEFDACBLKSIZE;
- unsigned int intransfersize = DEFDACBLKSIZE;
-
- /* no audio channels open, return */
- if (!inchannels && !outchannels)
- return (SENDDACS_NO);
-
- timelast = timenow;
- timenow = sys_getrealtime();
-
-#ifdef DEBUG_SGI_XFER
- if (timenow - timelast > 0.050)
- fprintf(stderr, "(%d)",
- (int)(1000 * (timenow - timelast))), fflush(stderr);
-#endif
-
- callno++;
-
- sgi_checkiosync(); /* check I/O are in sync and data not late */
-
- /* check whether there is enough space in buffers */
- if (sgi_nindevs)
- {
- for (n = 0; n < sgi_nindevs; n++)
- {
- if (alGetFilled(sgi_iport[n]) < intransfersize)
- return SENDDACS_NO;
- }
- }
- if (sgi_noutdevs)
- {
- for(n = 0; n < sgi_noutdevs; n++)
- {
- if (alGetFillable(sgi_oport[n]) < outtransfersize)
- return SENDDACS_NO;
- }
- }
-
- /* output audio data, if we use audio out */
- if (sgi_noutdevs)
- {
- fp2 = sys_soundout; /* point to current output position in buffer */
- for(n = 0; n < sgi_noutdevs; n++)
- {
- outdevchannels = sgi_noutchans[n]; /* channels supported by this device */
-
- for (channel = 0, fp1 = buf;
- channel < outdevchannels; channel++, fp1++, fp2 += DEFDACBLKSIZE)
- {
- for (i = 0, fp3 = fp1, fp4 = fp2; i < DEFDACBLKSIZE;
- i++, fp3 += outdevchannels, fp4++)
- *fp3 = *fp4, *fp4 = 0;
- }
- alWriteFrames(sgi_oport[n], buf, DEFDACBLKSIZE);
- }
- }
-
- /* zero out the output buffer */
- memset(sys_soundout, 0, DEFDACBLKSIZE * sizeof(*sys_soundout) * sys_outchannels);
- if (sys_getrealtime() - timenow > 0.002)
- {
- #ifdef DEBUG_SGI_XFER
- fprintf(stderr, "output %d took %d msec\n",
- callno, (int)(1000 * (timenow - timelast))), fflush(stderr);
- #endif
- timenow = sys_getrealtime();
- sys_log_error(ERR_DACSLEPT);
- }
-
- /* get audio data from input, if we use audio in */
- if (sgi_nindevs)
- {
- fp2 = sys_soundin; /* point to current input position in buffer */
- for (n = 0; n < sgi_nindevs; n++)
- {
- indevchannels = sgi_ninchans[n]; /* channels supported by this device */
-
- if (alGetFilled(sgi_iport[n]) > DEFDACBLKSIZE)
- {
- alReadFrames(sgi_iport[n], buf, DEFDACBLKSIZE);
- }
- else /* have to read but nothing's there... */
- {
- // if (sys_verbose) post("extra ADC buf");
- /* set buffer to silence */
- memset(buf, 0, intransfersize * sizeof(*sys_soundout) * sgi_ninchans[n]);
- }
- for (channel = 0, fp1 = buf;
- channel < indevchannels; channel++, fp1++, fp2 += DEFDACBLKSIZE)
- {
- for (i = 0, fp3 = fp1, fp4 = fp2; i < DEFDACBLKSIZE;
- i++, fp3 += indevchannels, fp4++)
- *fp4 = *fp3;
- }
- }
- }
-
- xferno++;
-
- if (sys_getrealtime() - timenow > 0.002)
- {
-#ifdef DEBUG_SGI_XFER
- fprintf(stderr, "routine took %d msec\n",
- (int)(1000 * (sys_getrealtime() - timenow)));
-#endif
- sys_log_error(ERR_ADCSLEPT);
- }
- return (SENDDACS_YES);
-}
-
-void sgi_getdevs(char *indevlist, int *nindevs,
- char *outdevlist, int *noutdevs, int *canmulti,
- int maxndev, int devdescsize)
-{
-#if 0
- ALpv pvs[1];
- char name[32];
- int i, ndev, err;
- *canmulti = 3; /* supports multiple devices */
-
- /* get max. number of audio ports from system */
- pvs[0].param = AL_DEVICES;
- err = alGetParams(AL_SYSTEM, pvs, 1);
- if (err < 0)
- {
- sprintf("alGetParams failed: %s\n", alGetErrorString(oserror()));
- }
- ndev = pvs[0].value.i;
-
- for (i = 0; i < ndev; i++)
- {
- pvs[0].param = AL_NAME; /* a string parameter */
- pvs[0].value.ptr = name; /* the string we've allocated */
- pvs[0].sizeIn = 32; /* the array size, in characters,
- including space for NULL */
- if (alGetParams(i, pvs, 1) < 0)
- {
- sprintf("alGetParams failed: %s\n", alGetErrorString(oserror()));
- }
- sprintf(indevlist + i * devdescsize, "%d: %s", i + 1, name);
- sprintf(outdevlist + i * devdescsize, "%d: %s", i + 1, name);
- }
- *nindevs = ndev;
- *noutdevs = ndev;
-#else
- sprintf(indevlist + 0 * devdescsize, "Default In");
- sprintf(outdevlist + 0 * devdescsize, "Default Out");
- sprintf(indevlist + 1 * devdescsize, "Analog In");
- sprintf(outdevlist + 1 * devdescsize, "Analog Out");
- sprintf(indevlist + 2 * devdescsize, "AES In");
- sprintf(outdevlist + 2 * devdescsize, "AES Out");
- sprintf(indevlist + 3 * devdescsize, "ADAT In");
- sprintf(outdevlist + 3 * devdescsize, "ADAT Out");
-
- *nindevs = 4;
- *noutdevs = 4;
- *canmulti = 3; /* supports multiple devices */
-#endif
-}
-
-
-/* list devices: only reflect the most common setup (Octane) */
-void sgi_listaudiodevs(void)
-{
- post("common devices on SGI machines:");
- post("#-1 - Default In/Out selected in Audio Panel");
- post("#1 - Analog In/Out");
- post("#2 - AES In/Out");
- post("#3 - ADAT I/O");
-}
-
-#endif /* SGI */
diff --git a/pd/src/s_midi_sgi.c b/pd/src/s_midi_sgi.c
deleted file mode 100644
index 4634b571..00000000
--- a/pd/src/s_midi_sgi.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Copyright (c) 1997-1999 Miller Puckette.
-* For information on usage and redistribution, and for a DISCLAIMER OF ALL
-* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
-
-#include "m_pd.h"
-#include "s_stuff.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#ifdef HAVE_BSTRING_H
-#include <bstring.h>
-#endif
-#include <sys/types.h>
-#include <sys/time.h>
-
-#include <dmedia/audio.h>
-#include <sys/fpu.h>
-#include <dmedia/midi.h>
-int mdInit(void); /* prototype was messed up in midi.h */
-/* #include "sys/select.h" */
-
-
- /*
- set the special "flush zero" but (FS, bit 24) in the
- Control Status Register of the FPU of R4k and beyond
- so that the result of any underflowing operation will
- be clamped to zero, and no exception of any kind will
- be generated on the CPU.
-
- thanks to cpirazzi@cp.esd.sgi.com (Chris Pirazzi).
- */
-
-static void sgi_flush_all_underflows_to_zero(void)
-{
- union fpc_csr f;
- f.fc_word = get_fpc_csr();
- f.fc_struct.flush = 1;
- set_fpc_csr(f.fc_word);
-}
-
-#define NPORT 2
-
-static MDport sgi_inport[NPORT];
-static MDport sgi_outport[NPORT];
-
-void sgi_open_midi(int midiin, int midiout)
-{
- int i;
- int sgi_nports = mdInit();
- if (sgi_nports < 0) sgi_nports = 0;
- else if (sgi_nports > NPORT) sgi_nports = NPORT;
- if (sys_verbose)
- {
- if (!sgi_nports)
- {
- post("no serial ports are configured for MIDI;");
- post("if you want to use MIDI, try exiting Pd, typing");
- post("'startmidi -d /dev/ttyd2' to a shell, and restarting Pd.");
- }
- else if (sgi_nports == 1)
- post("Found one MIDI port on %s", mdGetName(0));
- else if (sgi_nports == 2)
- post("Found MIDI ports on %s and %s",
- mdGetName(0), mdGetName(1));
- }
- if (midiin)
- {
- for (i = 0; i < sgi_nports; i++)
- {
- if (!(sgi_inport[i] = mdOpenInPort(mdGetName(i))))
- error("MIDI input port %d: open failed", i+1);;
- }
- }
- if (midiout)
- {
- for (i = 0; i < sgi_nports; i++)
- {
- if (!(sgi_outport[i] = mdOpenOutPort(mdGetName(i))))
- error("MIDI output port %d: open failed", i+1);;
- }
- }
- return;
-}
-
-void sys_putmidimess(int portno, int a, int b, int c)
-{
- MDevent mdv;
- if (portno >= NPORT || portno < 0 || !sgi_outport[portno]) return;
- mdv.msg[0] = a;
- mdv.msg[1] = b;
- mdv.msg[2] = c;
- mdv.msg[3] = 0;
- mdv.sysexmsg = 0;
- mdv.stamp = 0;
- mdv.msglen = 0;
- if (mdSend(sgi_outport[portno], &mdv, 1) < 0)
- error("MIDI output error\n");
- post("msg out %d %d %d", a, b, c);
-}
-
-void sys_putmidibyte(int portno, int foo)
-{
- error("MIDI raw byte output not available on SGI");
-}
-
-void inmidi_noteon(int portno, int channel, int pitch, int velo);
-void inmidi_controlchange(int portno, int channel, int ctlnumber, int value);
-void inmidi_programchange(int portno, int channel, int value);
-void inmidi_pitchbend(int portno, int channel, int value);
-void inmidi_aftertouch(int portno, int channel, int value);
-void inmidi_polyaftertouch(int portno, int channel, int pitch, int value);
-
-void sys_poll_midi(void)
-{
- int i;
- MDport *mp;
- for (i = 0, mp = sgi_inport; i < NPORT; i++, mp++)
- {
- int ret, status, b1, b2, nfds;
- MDevent mdv;
- fd_set inports;
- struct timeval timeout;
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
- if (!*mp) continue;
- FD_ZERO(&inports);
- FD_SET(mdGetFd(*mp), &inports);
-
- if (select(mdGetFd(*mp)+1 , &inports, 0, 0, &timeout) < 0)
- perror("midi select");
- if (FD_ISSET(mdGetFd(*mp),&inports))
- {
- if (mdReceive(*mp, &mdv, 1) < 0)
- error("failure receiving message\n");
- else if (mdv.msg[0] == MD_SYSEX) mdFree(mdv.sysexmsg);
-
- else
- {
- int status = mdv.msg[0];
- int channel = (status & 0xf) + 1;
- int b1 = mdv.msg[1];
- int b2 = mdv.msg[2];
- switch(status & 0xf0)
- {
- case MD_NOTEOFF:
- inmidi_noteon(i, channel, b1, 0);
- break;
- case MD_NOTEON:
- inmidi_noteon(i, channel, b1, b2);
- break;
- case MD_POLYKEYPRESSURE:
- inmidi_polyaftertouch(i, channel, b1, b2);
- break;
- case MD_CONTROLCHANGE:
- inmidi_controlchange(i, channel, b1, b2);
- break;
- case MD_PITCHBENDCHANGE:
- inmidi_pitchbend(i, channel, ((b2 << 7) + b1));
- break;
- case MD_PROGRAMCHANGE:
- inmidi_programchange(i, channel, b1);
- break;
- case MD_CHANNELPRESSURE:
- inmidi_aftertouch(i, channel, b1);
- break;
- }
- }
- }
- }
-}
-
-void sys_do_open_midi(int nmidiin, int *midiinvec,
- int nmidiout, int *midioutvec)
-{
- sgi_open_midi(nmidiin!=0, nmidiout!=0);
-}
-
-
-void sys_close_midi( void)
-{
- /* ??? */
-}
-
-
-void midi_getdevs(char *indevlist, int *nindevs,
- char *outdevlist, int *noutdevs, int maxndev, int devdescsize)
-{
- int i, nindev = 0, noutdev = 0;
- for (i = 0; i < mdInit(); i++)
- {
- if (nindev < maxndev)
- {
- strcpy(indevlist + nindev * devdescsize, mdGetName(i));
- nindev++;
-
- strcpy(outdevlist + noutdev * devdescsize, mdGetName(i));
- noutdev++;
- }
- }
- *nindevs = nindev;
- *noutdevs = noutdev;
-}
diff --git a/pd/src/s_path.c b/pd/src/s_path.c
index 07520bcf..14620eac 100644
--- a/pd/src/s_path.c
+++ b/pd/src/s_path.c
@@ -262,7 +262,7 @@ ends up in the same buffer as dirresult. Exception:
if the 'name' starts with a slash or a letter, colon, and slash in MSW,
there is no search and instead we just try to open the file literally. */
-/* see also canvas_openfile() which, in addition, searches down the
+/* see also canvas_open() which, in addition, searches down the
canvas-specific path. */
static int do_open_via_path(const char *dir, const char *name,