tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
m_pd.h
Go to the documentation of this file.
1 /* Copyright (c) 1997-1999 Miller Puckette.
2 * For information on usage and redistribution, and for a DISCLAIMER OF ALL
3 * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
4 
5 #ifndef __m_pd_h_
6 
7 #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus)
8 extern "C" {
9 #endif
10 
11 #define PD_MAJOR_VERSION 0
12 #define PD_MINOR_VERSION 47
13 #define PD_BUGFIX_VERSION 1
14 #define PD_TEST_VERSION ""
15 extern int pd_compatibilitylevel; /* e.g., 43 for pd 0.43 compatibility */
16 
17 /* old name for "MSW" flag -- we have to take it for the sake of many old
18 "nmakefiles" for externs, which will define NT and not MSW */
19 #if defined(NT) && !defined(MSW)
20 #define MSW
21 #endif
22 
23 /* These pragmas are only used for MSVC, not MinGW or Cygwin <hans@at.or.at> */
24 #ifdef _MSC_VER
25 /* #pragma warning( disable : 4091 ) */
26 #pragma warning( disable : 4305 ) /* uncast const double to float */
27 #pragma warning( disable : 4244 ) /* uncast float/int conversion etc. */
28 #pragma warning( disable : 4101 ) /* unused automatic variables */
29 #endif /* _MSC_VER */
30 
31  /* the external storage class is "extern" in UNIX; in MSW it's ugly. */
32 #ifdef _WIN32
33 #ifdef PD_INTERNAL
34 #define EXTERN __declspec(dllexport) extern
35 #else
36 #define EXTERN __declspec(dllimport) extern
37 #endif /* PD_INTERNAL */
38 #else
39 #define EXTERN extern
40 #endif /* _WIN32 */
41 
42  /* On most c compilers, you can just say "struct foo;" to declare a
43  structure whose elements are defined elsewhere. On MSVC, when compiling
44  C (but not C++) code, you have to say "extern struct foo;". So we make
45  a stupid macro: */
46 #if defined(_MSC_VER) && !defined(_LANGUAGE_C_PLUS_PLUS) \
47  && !defined(__cplusplus)
48 #define EXTERN_STRUCT extern struct
49 #else
50 #define EXTERN_STRUCT struct
51 #endif
52 
53 /* Define some attributes, specific to the compiler */
54 #if defined(__GNUC__)
55 #define ATTRIBUTE_FORMAT_PRINTF(a, b) __attribute__ ((format (printf, a, b)))
56 #else
57 #define ATTRIBUTE_FORMAT_PRINTF(a, b)
58 #endif
59 
60 #if !defined(_SIZE_T) && !defined(_SIZE_T_)
61 #include <stddef.h> /* just for size_t -- how lame! */
62 #endif
63 
64 /* Microsoft Visual Studio is not C99, it does not provide stdint.h */
65 #ifdef _MSC_VER
66 typedef signed __int8 int8_t;
67 typedef signed __int16 int16_t;
68 typedef signed __int32 int32_t;
69 typedef signed __int64 int64_t;
70 typedef unsigned __int8 uint8_t;
71 typedef unsigned __int16 uint16_t;
72 typedef unsigned __int32 uint32_t;
73 typedef unsigned __int64 uint64_t;
74 #else
75 # include <stdint.h>
76 #endif
77 
78 /* for FILE, needed by sys_fopen() and sys_fclose() only */
79 #include <stdio.h>
80 
81 #define MAXPDSTRING 1000 /* use this for anything you want */
82 #define MAXPDARG 5 /* max number of args we can typecheck today */
83 
84 /* signed and unsigned integer types the size of a pointer: */
85 #if !defined(PD_LONGINTTYPE)
86 #define PD_LONGINTTYPE long
87 #endif
88 
89 #if !defined(PD_FLOATSIZE)
90  /* normally, our floats (t_float, t_sample,...) are 32bit */
91 # define PD_FLOATSIZE 32
92 #endif
93 
94 #if PD_FLOATSIZE == 32
95 # define PD_FLOATTYPE float
96 /* an unsigned int of the same size as FLOATTYPE: */
97 # define PD_FLOATUINTTYPE unsigned int
98 
99 #elif PD_FLOATSIZE == 64
100 # define PD_FLOATTYPE double
101 # define PD_FLOATUINTTYPE unsigned long
102 #else
103 # error invalid FLOATSIZE: must be 32 or 64
104 #endif
105 
106 typedef PD_LONGINTTYPE t_int; /* pointer-size integer */
107 typedef PD_FLOATTYPE t_float; /* a float type at most the same size */
108 typedef PD_FLOATTYPE t_floatarg; /* float type for function calls */
109 
110 typedef struct _symbol
111 {
112  char *s_name;
113  struct _class **s_thing;
114  struct _symbol *s_next;
115 } t_symbol;
116 
118 #define t_array struct _array /* g_canvas.h */
119 
120 /* pointers to glist and array elements go through a "stub" which sticks
121 around after the glist or array is freed. The stub itself is deleted when
122 both the glist/array is gone and the refcount is zero, ensuring that no
123 gpointers are pointing here. */
124 
125 #define GP_NONE 0 /* the stub points nowhere (has been cut off) */
126 #define GP_GLIST 1 /* the stub points to a glist element */
127 #define GP_ARRAY 2 /* ... or array */
128 
129 typedef struct _gstub
130 {
131  union
132  {
133  struct _glist *gs_glist; /* glist we're in */
134  struct _array *gs_array; /* array we're in */
135  } gs_un;
136  int gs_which; /* GP_GLIST/GP_ARRAY */
137  int gs_refcount; /* number of gpointers pointing here */
138 } t_gstub;
139 
140 typedef struct _gpointer /* pointer to a gobj in a glist */
141 {
142  union
143  {
144  struct _scalar *gp_scalar; /* scalar we're in (if glist) */
145  union word *gp_w; /* raw data (if array) */
146  } gp_un;
147  int gp_valid; /* number which must match gpointee */
148  t_gstub *gp_stub; /* stub which points to glist/array */
149 } t_gpointer;
150 
151 typedef union word
152 {
153  t_float w_float;
157  struct _binbuf *w_binbuf;
158  int w_index;
159 } t_word;
160 
161 typedef enum
162 {
175 } t_atomtype;
176 
177 #define A_DEFSYMBOL A_DEFSYM /* better name for this */
178 
179 typedef struct _atom
180 {
182  union word a_w;
183 } t_atom;
184 
186 #define t_class struct _class
187 
189 #define t_outlet struct _outlet
190 
192 #define t_inlet struct _inlet
193 
195 #define t_binbuf struct _binbuf
196 
198 #define t_clock struct _clock
199 
201 #define t_outconnect struct _outconnect
202 
204 #define t_glist struct _glist
205 #define t_canvas struct _glist /* LATER lose this */
206 
207 typedef t_class *t_pd; /* pure datum: nothing but a class pointer */
208 
209 typedef struct _gobj /* a graphical object */
210 {
211  t_pd g_pd; /* pure datum header (class) */
212  struct _gobj *g_next; /* next in list */
213 } t_gobj;
214 
215 typedef struct _scalar /* a graphical object holding data */
216 {
217  t_gobj sc_gobj; /* header for graphical object */
218  t_symbol *sc_template; /* template name (LATER replace with pointer) */
219  t_word sc_vec[1]; /* indeterminate-length array of words */
220 } t_scalar;
221 
222 typedef struct _text /* patchable object - graphical, with text */
223 {
224  t_gobj te_g; /* header for graphical object */
225  t_binbuf *te_binbuf; /* holder for the text */
226  t_outlet *te_outlet; /* linked list of outlets */
227  t_inlet *te_inlet; /* linked list of inlets */
228  short te_xpix; /* x&y location (within the toplevel) */
229  short te_ypix;
230  short te_width; /* requested width in chars, 0 if auto */
231  unsigned int te_type:2; /* from defs below */
232 } t_text;
233 
234 #define T_TEXT 0 /* just a textual comment */
235 #define T_OBJECT 1 /* a MAX style patchable object */
236 #define T_MESSAGE 2 /* a MAX stype message */
237 #define T_ATOM 3 /* a cell to display a number or symbol */
238 
239 #define te_pd te_g.g_pd
240 
241  /* t_object is synonym for t_text (LATER unify them) */
242 
243 typedef struct _text t_object;
244 
245 #define ob_outlet te_outlet
246 #define ob_inlet te_inlet
247 #define ob_binbuf te_binbuf
248 #define ob_pd te_g.g_pd
249 #define ob_g te_g
250 
251 typedef void (*t_method)(void);
252 typedef void *(*t_newmethod)( void);
253 
254 /* in ARM 64 a varargs prototype generates a different function call sequence
255 from a fixed one, so in that special case we make a more restrictive
256 definition for t_gotfn. This will break some code in the "chaos" package
257 in Pd extended. (that code will run incorrectly anyhow so why not catch it
258 at compile time anyhow.) */
259 #if defined(__APPLE__) && defined(__aarch64__)
260 typedef void (*t_gotfn)(void *x);
261 #else
262 typedef void (*t_gotfn)(void *x, ...);
263 #endif
264 
265 /* ---------------- pre-defined objects and symbols --------------*/
266 EXTERN t_pd pd_objectmaker; /* factory for creating "object" boxes */
267 EXTERN t_pd pd_canvasmaker; /* factory for creating canvases */
280 
281 /* --------- prototypes from the central message system ----------- */
282 EXTERN void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv);
283 EXTERN void pd_forwardmess(t_pd *x, int argc, t_atom *argv);
284 EXTERN t_symbol *gensym(const char *s);
285 EXTERN t_gotfn getfn(t_pd *x, t_symbol *s);
286 EXTERN t_gotfn zgetfn(t_pd *x, t_symbol *s);
287 EXTERN void nullfn(void);
288 EXTERN void pd_vmess(t_pd *x, t_symbol *s, const char *fmt, ...);
289 
290 /* the following macrose are for sending non-type-checkable mesages, i.e.,
291 using function lookup but circumventing type checking on arguments. Only
292 use for internal messaging protected by A_CANT so that the message can't
293 be generated at patch level. */
294 #define mess0(x, s) ((*getfn((x), (s)))((x)))
295 typedef void (*t_gotfn1)(void *x, void *arg1);
296 #define mess1(x, s, a) ((*(t_gotfn1)getfn((x), (s)))((x), (a)))
297 typedef void (*t_gotfn2)(void *x, void *arg1, void *arg2);
298 #define mess2(x, s, a,b) ((*(t_gotfn2)getfn((x), (s)))((x), (a),(b)))
299 typedef void (*t_gotfn3)(void *x, void *arg1, void *arg2, void *arg3);
300 #define mess3(x, s, a,b,c) ((*(t_gotfn3)getfn((x), (s)))((x), (a),(b),(c)))
301 typedef void (*t_gotfn4)(void *x,
302  void *arg1, void *arg2, void *arg3, void *arg4);
303 #define mess4(x, s, a,b,c,d) \
304  ((*(t_gotfn4)getfn((x), (s)))((x), (a),(b),(c),(d)))
305 typedef void (*t_gotfn5)(void *x,
306  void *arg1, void *arg2, void *arg3, void *arg4, void *arg5);
307 #define mess5(x, s, a,b,c,d,e) \
308  ((*(t_gotfn5)getfn((x), (s)))((x), (a),(b),(c),(d),(e)))
309 
310 EXTERN void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv);
311 EXTERN t_pd *pd_newest(void);
312 
313 /* --------------- memory management -------------------- */
314 EXTERN void *getbytes(size_t nbytes);
315 EXTERN void *getzbytes(size_t nbytes);
316 EXTERN void *copybytes(void *src, size_t nbytes);
317 EXTERN void freebytes(void *x, size_t nbytes);
318 EXTERN void *resizebytes(void *x, size_t oldsize, size_t newsize);
319 
320 /* -------------------- atoms ----------------------------- */
321 
322 #define SETSEMI(atom) ((atom)->a_type = A_SEMI, (atom)->a_w.w_index = 0)
323 #define SETCOMMA(atom) ((atom)->a_type = A_COMMA, (atom)->a_w.w_index = 0)
324 #define SETPOINTER(atom, gp) ((atom)->a_type = A_POINTER, \
325  (atom)->a_w.w_gpointer = (gp))
326 #define SETFLOAT(atom, f) ((atom)->a_type = A_FLOAT, (atom)->a_w.w_float = (f))
327 #define SETSYMBOL(atom, s) ((atom)->a_type = A_SYMBOL, \
328  (atom)->a_w.w_symbol = (s))
329 #define SETDOLLAR(atom, n) ((atom)->a_type = A_DOLLAR, \
330  (atom)->a_w.w_index = (n))
331 #define SETDOLLSYM(atom, s) ((atom)->a_type = A_DOLLSYM, \
332  (atom)->a_w.w_symbol= (s))
333 
334 EXTERN t_float atom_getfloat(t_atom *a);
335 EXTERN t_int atom_getint(t_atom *a);
338 EXTERN t_float atom_getfloatarg(int which, int argc, t_atom *argv);
339 EXTERN t_int atom_getintarg(int which, int argc, t_atom *argv);
340 EXTERN t_symbol *atom_getsymbolarg(int which, int argc, t_atom *argv);
341 
342 EXTERN void atom_string(t_atom *a, char *buf, unsigned int bufsize);
343 
344 /* ------------------ binbufs --------------- */
345 
346 EXTERN t_binbuf *binbuf_new(void);
347 EXTERN void binbuf_free(t_binbuf *x);
349 
350 EXTERN void binbuf_text(t_binbuf *x, char *text, size_t size);
351 EXTERN void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp);
352 EXTERN void binbuf_clear(t_binbuf *x);
353 EXTERN void binbuf_add(t_binbuf *x, int argc, t_atom *argv);
354 EXTERN void binbuf_addv(t_binbuf *x, const char *fmt, ...);
357 EXTERN void binbuf_restore(t_binbuf *x, int argc, t_atom *argv);
358 EXTERN void binbuf_print(t_binbuf *x);
361 EXTERN int binbuf_resize(t_binbuf *x, int newsize);
362 EXTERN void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv);
363 EXTERN int binbuf_read(t_binbuf *b, char *filename, char *dirname,
364  int crflag);
365 EXTERN int binbuf_read_via_canvas(t_binbuf *b, char *filename, t_canvas *canvas,
366  int crflag);
367 EXTERN int binbuf_read_via_path(t_binbuf *b, char *filename, char *dirname,
368  int crflag);
369 EXTERN int binbuf_write(t_binbuf *x, char *filename, char *dir,
370  int crflag);
371 EXTERN void binbuf_evalfile(t_symbol *name, t_symbol *dir);
373  int tonew);
374 
375 /* ------------------ clocks --------------- */
376 
377 EXTERN t_clock *clock_new(void *owner, t_method fn);
378 EXTERN void clock_set(t_clock *x, double systime);
379 EXTERN void clock_delay(t_clock *x, double delaytime);
380 EXTERN void clock_unset(t_clock *x);
381 EXTERN void clock_setunit(t_clock *x, double timeunit, int sampflag);
382 EXTERN double clock_getlogicaltime(void);
383 EXTERN double clock_getsystime(void); /* OBSOLETE; use clock_getlogicaltime() */
384 EXTERN double clock_gettimesince(double prevsystime);
385 EXTERN double clock_gettimesincewithunits(double prevsystime,
386  double units, int sampflag);
387 EXTERN double clock_getsystimeafter(double delaytime);
388 EXTERN void clock_free(t_clock *x);
389 
390 /* ----------------- pure data ---------------- */
391 EXTERN t_pd *pd_new(t_class *cls);
392 EXTERN void pd_free(t_pd *x);
393 EXTERN void pd_bind(t_pd *x, t_symbol *s);
394 EXTERN void pd_unbind(t_pd *x, t_symbol *s);
395 EXTERN t_pd *pd_findbyclass(t_symbol *s, t_class *c);
396 EXTERN void pd_pushsym(t_pd *x);
397 EXTERN void pd_popsym(t_pd *x);
400 EXTERN void pd_bang(t_pd *x);
401 EXTERN void pd_pointer(t_pd *x, t_gpointer *gp);
402 EXTERN void pd_float(t_pd *x, t_float f);
403 EXTERN void pd_symbol(t_pd *x, t_symbol *s);
404 EXTERN void pd_list(t_pd *x, t_symbol *s, int argc, t_atom *argv);
405 EXTERN void pd_anything(t_pd *x, t_symbol *s, int argc, t_atom *argv);
406 #define pd_class(x) (*(x))
407 
408 /* ----------------- pointers ---------------- */
410 EXTERN void gpointer_copy(const t_gpointer *gpfrom, t_gpointer *gpto);
412 EXTERN int gpointer_check(const t_gpointer *gp, int headok);
413 
414 /* ----------------- patchable "objects" -------------- */
415 EXTERN t_inlet *inlet_new(t_object *owner, t_pd *dest, t_symbol *s1,
416  t_symbol *s2);
418 EXTERN t_inlet *floatinlet_new(t_object *owner, t_float *fp);
420 EXTERN t_inlet *signalinlet_new(t_object *owner, t_float f);
421 EXTERN void inlet_free(t_inlet *x);
422 
423  //CEAMMC EXPERIMENTAL
424 EXTERN void inlet_set_yoffset(t_inlet* inlet, float y);
425 EXTERN void outlet_set_yoffset(t_outlet* outlet, float y);
426  EXTERN float inlet_get_yoffset(t_inlet* inlet);
427  EXTERN float outlet_get_yoffset(t_outlet* outlet);
428 
430 EXTERN void outlet_bang(t_outlet *x);
432 EXTERN void outlet_float(t_outlet *x, t_float f);
434 EXTERN void outlet_list(t_outlet *x, t_symbol *s, int argc, t_atom *argv);
435 EXTERN void outlet_anything(t_outlet *x, t_symbol *s, int argc, t_atom *argv);
437 EXTERN void outlet_free(t_outlet *x);
438 EXTERN t_object *pd_checkobject(t_pd *x);
439 
440 
441 /* -------------------- canvases -------------- */
442 
443 EXTERN void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir);
444 
445 EXTERN void canvas_setargs(int argc, t_atom *argv);
446 EXTERN void canvas_getargs(int *argcp, t_atom **argvp);
449 EXTERN void canvas_makefilename(t_glist *c, char *file,
450  char *result,int resultsize);
452 EXTERN char sys_font[]; /* default typeface set in s_main.c */
453 EXTERN char sys_fontweight[]; /* default font weight set in s_main.c */
454 EXTERN int sys_zoomfontwidth(int fontsize, int zoom, int worstcase);
455 EXTERN int sys_zoomfontheight(int fontsize, int zoom, int worstcase);
456 EXTERN int sys_fontwidth(int fontsize);
457 EXTERN int sys_fontheight(int fontsize);
459 EXTERN int canvas_open(t_canvas *x, const char *name, const char *ext,
460  char *dirresult, char **nameresult, unsigned int size, int bin);
461 
462 /* ---------------- widget behaviors ---------------------- */
463 
465 #define t_widgetbehavior struct _widgetbehavior
466 
468 #define t_parentwidgetbehavior struct _parentwidgetbehavior
470 
471 /* -------------------- classes -------------- */
472 
473 #define CLASS_DEFAULT 0 /* flags for new classes below */
474 #define CLASS_PD 1
475 #define CLASS_GOBJ 2
476 #define CLASS_PATCHABLE 3
477 #define CLASS_NOINLET 8
478 
479 #define CLASS_TYPEMASK 3
480 
481 
482 EXTERN t_class *class_new(t_symbol *name, t_newmethod newmethod,
483  t_method freemethod, size_t size, int flags, t_atomtype arg1, ...);
484 EXTERN void class_addcreator(t_newmethod newmethod, t_symbol *s,
485  t_atomtype type1, ...);
487  t_atomtype arg1, ...);
488 EXTERN void class_addbang(t_class *c, t_method fn);
492 EXTERN void class_addlist(t_class *c, t_method fn);
498 EXTERN char *class_getname(t_class *c);
503 EXTERN void class_domainsignalin(t_class *c, int onset);
505 #define CLASS_MAINSIGNALIN(c, type, field) \
506  class_domainsignalin(c, (char *)(&((type *)0)->field) - (char *)0)
507 
508  /* prototype for functions to save Pd's to a binbuf */
509 typedef void (*t_savefn)(t_gobj *x, t_binbuf *b);
512 EXTERN void obj_saveformat(t_object *x, t_binbuf *bb); /* add format to bb */
513 
514  /* prototype for functions to open properties dialogs */
515 typedef void (*t_propertiesfn)(t_gobj *x, struct _glist *glist);
518 
519 #ifndef PD_CLASS_DEF
520 #define class_addbang(x, y) class_addbang((x), (t_method)(y))
521 #define class_addpointer(x, y) class_addpointer((x), (t_method)(y))
522 #define class_addfloat(x, y) class_doaddfloat((x), (t_method)(y))
523 #define class_addsymbol(x, y) class_addsymbol((x), (t_method)(y))
524 #define class_addlist(x, y) class_addlist((x), (t_method)(y))
525 #define class_addanything(x, y) class_addanything((x), (t_method)(y))
526 #endif
527 
528 /* ------------ printing --------------------------------- */
529 EXTERN void post(const char *fmt, ...);
530 EXTERN void startpost(const char *fmt, ...);
531 EXTERN void poststring(const char *s);
532 EXTERN void postfloat(t_floatarg f);
533 EXTERN void postatom(int argc, t_atom *argv);
534 EXTERN void endpost(void);
535 EXTERN void error(const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
536 EXTERN void verbose(int level, const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3);
537 EXTERN void bug(const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
538 EXTERN void pd_error(void *object, const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3);
539 EXTERN void logpost(const void *object, const int level, const char *fmt, ...)
540  ATTRIBUTE_FORMAT_PRINTF(3, 4);
541 EXTERN void sys_logerror(const char *object, const char *s);
542 EXTERN void sys_unixerror(const char *object);
543 EXTERN void sys_ouch(void);
544 
545 
546 /* ------------ system interface routines ------------------- */
547 EXTERN int sys_isreadablefile(const char *name);
548 EXTERN int sys_isabsolutepath(const char *dir);
549 EXTERN void sys_bashfilename(const char *from, char *to);
550 EXTERN void sys_unbashfilename(const char *from, char *to);
551 EXTERN int open_via_path(const char *dir, const char *name, const char *ext,
552  char *dirresult, char **nameresult, unsigned int size, int bin);
553 EXTERN int sched_geteventno(void);
554 EXTERN double sys_getrealtime(void);
555 EXTERN int (*sys_idlehook)(void); /* hook to add idle time computation */
556 
557 /* Win32's open()/fopen() do not handle UTF-8 filenames so we need
558  * these internal versions that handle UTF-8 filenames the same across
559  * all platforms. They are recommended for use in external
560  * objectclasses as well so they work with Unicode filenames on Windows */
561 EXTERN int sys_open(const char *path, int oflag, ...);
562 EXTERN int sys_close(int fd);
563 EXTERN FILE *sys_fopen(const char *filename, const char *mode);
564 EXTERN int sys_fclose(FILE *stream);
565 
566 /* ------------ threading ------------------- */
567 EXTERN void sys_lock(void);
568 EXTERN void sys_unlock(void);
569 EXTERN int sys_trylock(void);
570 
571 
572 /* --------------- signals ----------------------------------- */
573 
575 typedef union _sampleint_union {
576  t_sample f;
579 #define MAXLOGSIG 32
580 #define MAXSIGSIZE (1 << MAXLOGSIG)
581 
582 typedef struct _signal
583 {
584  int s_n; /* number of points in the array */
585  t_sample *s_vec; /* the array */
586  t_float s_sr; /* sample rate */
587  int s_refcount; /* number of times used */
588  int s_isborrowed; /* whether we're going to borrow our array */
589  struct _signal *s_borrowedfrom; /* signal to borrow it from */
590  struct _signal *s_nextfree; /* next in freelist */
591  struct _signal *s_nextused; /* next in used list */
592  int s_vecsize; /* allocated size of array in points */
593 } t_signal;
594 
595 typedef t_int *(*t_perfroutine)(t_int *args);
596 
597 EXTERN t_int *plus_perform(t_int *args);
598 EXTERN t_int *zero_perform(t_int *args);
599 EXTERN t_int *copy_perform(t_int *args);
600 
601 EXTERN void dsp_add_plus(t_sample *in1, t_sample *in2, t_sample *out, int n);
602 EXTERN void dsp_add_copy(t_sample *in, t_sample *out, int n);
603 EXTERN void dsp_add_scalarcopy(t_float *in, t_sample *out, int n);
604 EXTERN void dsp_add_zero(t_sample *out, int n);
605 
606 EXTERN int sys_getblksize(void);
607 EXTERN t_float sys_getsr(void);
608 EXTERN int sys_get_inchannels(void);
609 EXTERN int sys_get_outchannels(void);
610 
611 EXTERN void dsp_add(t_perfroutine f, int n, ...);
612 EXTERN void dsp_addv(t_perfroutine f, int n, t_int *vec);
613 EXTERN void pd_fft(t_float *buf, int npoints, int inverse);
614 EXTERN int ilog2(int n);
615 
616 EXTERN void mayer_fht(t_sample *fz, int n);
617 EXTERN void mayer_fft(int n, t_sample *real, t_sample *imag);
618 EXTERN void mayer_ifft(int n, t_sample *real, t_sample *imag);
619 EXTERN void mayer_realfft(int n, t_sample *real);
620 EXTERN void mayer_realifft(int n, t_sample *real);
621 
623 #define LOGCOSTABSIZE 9
624 #define COSTABSIZE (1<<LOGCOSTABSIZE)
625 
626 EXTERN int canvas_suspend_dsp(void);
627 EXTERN void canvas_resume_dsp(int oldstate);
628 EXTERN void canvas_update_dsp(void);
630 
631 /* up/downsampling */
632 typedef struct _resample
633 {
634  int method; /* up/downsampling method ID */
635 
636  int downsample; /* downsampling factor */
637  int upsample; /* upsampling factor */
638 
639  t_sample *s_vec; /* here we hold the resampled data */
640  int s_n;
641 
642  t_sample *coeffs; /* coefficients for filtering... */
643  int coefsize;
644 
645  t_sample *buffer; /* buffer for filtering */
646  int bufsize;
647 } t_resample;
648 
651 
652 EXTERN void resample_dsp(t_resample *x, t_sample *in, int insize, t_sample *out, int outsize, int method);
653 EXTERN void resamplefrom_dsp(t_resample *x, t_sample *in, int insize, int outsize, int method);
654 EXTERN void resampleto_dsp(t_resample *x, t_sample *out, int insize, int outsize, int method);
655 
656 /* ----------------------- utility functions for signals -------------- */
657 EXTERN t_float mtof(t_float);
658 EXTERN t_float ftom(t_float);
659 EXTERN t_float rmstodb(t_float);
660 EXTERN t_float powtodb(t_float);
661 EXTERN t_float dbtorms(t_float);
662 EXTERN t_float dbtopow(t_float);
663 
664 EXTERN t_float q8_sqrt(t_float);
665 EXTERN t_float q8_rsqrt(t_float);
666 #ifndef N32
667 EXTERN t_float qsqrt(t_float); /* old names kept for extern compatibility */
668 EXTERN t_float qrsqrt(t_float);
669 #endif
670 /* --------------------- data --------------------------------- */
671 
672  /* graphical arrays */
674 #define t_garray struct _garray
675 
677 EXTERN int garray_getfloatarray(t_garray *x, int *size, t_float **vec);
678 EXTERN int garray_getfloatwords(t_garray *x, int *size, t_word **vec);
679 EXTERN void garray_redraw(t_garray *x);
681 EXTERN char *garray_vec(t_garray *x);
682 EXTERN void garray_resize(t_garray *x, t_floatarg f); /* avoid; use this: */
683 EXTERN void garray_resize_long(t_garray *x, long n); /* better version */
685 EXTERN void garray_setsaveit(t_garray *x, int saveit);
689 
690 EXTERN t_float *value_get(t_symbol *s);
691 EXTERN void value_release(t_symbol *s);
692 EXTERN int value_getfloat(t_symbol *s, t_float *f);
693 EXTERN int value_setfloat(t_symbol *s, t_float f);
694 
695 /* ------- GUI interface - functions to send strings to TK --------- */
696 typedef void (*t_guicallbackfn)(t_gobj *client, t_glist *glist);
697 
698 EXTERN void sys_vgui(const char *fmt, ...);
699 EXTERN void sys_gui(const char *s);
700 EXTERN void sys_pretendguibytes(int n);
701 EXTERN void sys_queuegui(void *client, t_glist *glist, t_guicallbackfn f);
702 EXTERN void sys_unqueuegui(void *client);
703  /* dialog window creation and destruction */
704 EXTERN void gfxstub_new(t_pd *owner, void *key, const char *cmd);
705 EXTERN void gfxstub_deleteforkey(void *key);
706 
707 extern t_class *glob_pdobject; /* object to send "pd" messages */
708 
709 /*------------- Max 0.26 compatibility --------------------*/
710 
711 /* the following reflects the new way classes are laid out, with the class
712  pointing to the messlist and not vice versa. Externs shouldn't feel it. */
714 
715 EXTERN void c_extern(t_externclass *cls, t_newmethod newroutine,
716  t_method freeroutine, t_symbol *name, size_t size, int tiny, \
717  t_atomtype arg1, ...);
718 EXTERN void c_addmess(t_method fn, t_symbol *sel, t_atomtype arg1, ...);
719 
720 #define t_getbytes getbytes
721 #define t_freebytes freebytes
722 #define t_resizebytes resizebytes
723 #define typedmess pd_typedmess
724 #define vmess pd_vmess
725 
726 /* A definition to help gui objects straddle 0.34-0.35 changes. If this is
727 defined, there is a "te_xpix" field in objects, not a "te_xpos" as before: */
728 
729 #define PD_USE_TE_XPIX
730 
731 #ifndef _MSC_VER /* Microoft compiler can't handle "inline" function/macros */
732 #if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
733 /* a test for NANs and denormals. Should only be necessary on i386. */
734 #if PD_FLOATSIZE == 32
735 
736 typedef union
737 {
738  t_float f;
739  unsigned int ui;
740 }t_bigorsmall32;
741 
742 static inline int PD_BADFLOAT(t_float f) /* malformed float */
743 {
744  t_bigorsmall32 pun;
745  pun.f = f;
746  pun.ui &= 0x7f800000;
747  return((pun.ui == 0) | (pun.ui == 0x7f800000));
748 }
749 
750 static inline int PD_BIGORSMALL(t_float f) /* exponent outside (-64,64) */
751 {
752  t_bigorsmall32 pun;
753  pun.f = f;
754  return((pun.ui & 0x20000000) == ((pun.ui >> 1) & 0x20000000));
755 }
756 
757 #elif PD_FLOATSIZE == 64
758 
759 typedef union
760 {
761  t_float f;
762  unsigned int ui[2];
763 }t_bigorsmall64;
764 
765 static inline int PD_BADFLOAT(t_float f) /* malformed double */
766 {
767  t_bigorsmall64 pun;
768  pun.f = f;
769  pun.ui[1] &= 0x7ff00000;
770  return((pun.ui[1] == 0) | (pun.ui[1] == 0x7ff00000));
771 }
772 
773 static inline int PD_BIGORSMALL(t_float f) /* exponent outside (-512,512) */
774 {
775  t_bigorsmall64 pun;
776  pun.f = f;
777  return((pun.ui[1] & 0x20000000) == ((pun.ui[1] >> 1) & 0x20000000));
778 }
779 
780 #endif /* PD_FLOATSIZE */
781 #else /* not INTEL or ARM */
782 #define PD_BADFLOAT(f) 0
783 #define PD_BIGORSMALL(f) 0
784 #endif
785 
786 #else /* _MSC_VER */
787 #if PD_FLOATSIZE == 32
788 #define PD_BADFLOAT(f) ((((*(unsigned int*)&(f))&0x7f800000)==0) || \
789  (((*(unsigned int*)&(f))&0x7f800000)==0x7f800000))
790 /* more stringent test: anything not between 1e-19 and 1e19 in absolute val */
791 #define PD_BIGORSMALL(f) ((((*(unsigned int*)&(f))&0x60000000)==0) || \
792  (((*(unsigned int*)&(f))&0x60000000)==0x60000000))
793 #else /* 64 bits... don't know what to do here */
794 #define PD_BADFLOAT(f) (!(((f) >= 0) || ((f) <= 0)))
795 #define PD_BIGORSMALL(f) ((f) > 1e150 || (f) < -1e150 \
796  || (f) > -1e-150 && (f) < 1e-150 )
797 #endif
798 #endif /* _MSC_VER */
799  /* get version number at run time */
800 EXTERN void sys_getversion(int *major, int *minor, int *bugfix);
801 
803 #define t_pdinstance struct _pdinstance /* m_imp.h */
804 
805 /* m_pd.c */
806 
811 EXTERN int pd_getdspstate(void);
812 
813  //TEST
814  EXTERN void canvas_saveto(t_canvas *x, t_binbuf *b);
815 #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus)
816 }
817 #endif
818 
819 // tilde~
820 typedef struct _loadedlist
821 {
824 } t_loadlist;
826 
827 #define __m_pd_h_
828 #endif /* __m_pd_h_ */
EXTERN_STRUCT _outlet
Definition: m_pd.h:188
void(* t_gotfn3)(void *x, void *arg1, void *arg2, void *arg3)
Definition: m_pd.h:299
EXTERN void gfxstub_new(t_pd *owner, void *key, const char *cmd)
EXTERN void sys_unbashfilename(const char *from, char *to)
struct _atom t_atom
EXTERN void * resizebytes(void *x, size_t oldsize, size_t newsize)
EXTERN_STRUCT _class
Definition: m_pd.h:185
EXTERN int canvas_suspend_dsp(void)
EXTERN t_symbol * pd_getfilename(void)
EXTERN void * copybytes(void *src, size_t nbytes)
EXTERN void dsp_add_copy(t_sample *in, t_sample *out, int n)
EXTERN int binbuf_resize(t_binbuf *x, int newsize)
EXTERN t_symbol * canvas_getdir(t_glist *x)
EXTERN int sys_open(const char *path, int oflag,...)
EXTERN void postfloat(t_floatarg f)
EXTERN t_float qrsqrt(t_float)
int downsample
Definition: m_pd.h:636
EXTERN void pd_vmess(t_pd *x, t_symbol *s, const char *fmt,...)
void(* t_savefn)(t_gobj *x, t_binbuf *b)
Definition: m_pd.h:509
EXTERN void * getzbytes(size_t nbytes)
EXTERN void c_addmess(t_method fn, t_symbol *sel, t_atomtype arg1,...)
EXTERN t_float qsqrt(t_float)
struct _text t_text
struct _glist * gs_glist
Definition: m_pd.h:133
#define t_array
Definition: m_pd.h:118
EXTERN void garray_setsaveit(t_garray *x, int saveit)
EXTERN t_symbol s_
Definition: m_pd.h:279
t_symbol * sc_template
Definition: m_pd.h:218
short te_width
Definition: m_pd.h:230
EXTERN t_symbol s_list
Definition: m_pd.h:272
void(* t_guicallbackfn)(t_gobj *client, t_glist *glist)
Definition: m_pd.h:696
EXTERN t_pd * pd_new(t_class *cls)
EXTERN void resample_init(t_resample *x)
EXTERN void value_release(t_symbol *s)
EXTERN void c_extern(t_externclass *cls, t_newmethod newroutine, t_method freeroutine, t_symbol *name, size_t size, int tiny, t_atomtype arg1,...)
EXTERN char * class_gethelpdir(t_class *c)
t_gpointer * w_gpointer
Definition: m_pd.h:155
EXTERN t_class * scalar_class
Definition: m_pd.h:688
EXTERN t_binbuf * binbuf_new(void)
EXTERN void class_doaddfloat(t_class *c, t_method fn)
EXTERN void outlet_bang(t_outlet *x)
EXTERN t_float powtodb(t_float)
EXTERN t_symbol s_signal
Definition: m_pd.h:274
EXTERN void inlet_free(t_inlet *x)
struct _signal * s_nextused
Definition: m_pd.h:591
struct _scalar * gp_scalar
Definition: m_pd.h:144
EXTERN t_symbol * atom_getsymbol(t_atom *a)
EXTERN void class_setwidget(t_class *c, t_widgetbehavior *w)
EXTERN void resamplefrom_dsp(t_resample *x, t_sample *in, int insize, int outsize, int method)
struct _gstub t_gstub
EXTERN void pd_forwardmess(t_pd *x, int argc, t_atom *argv)
Definition: m_pd.h:140
EXTERN t_propertiesfn class_getpropertiesfn(t_class *c)
int s_isborrowed
Definition: m_pd.h:588
EXTERN void pd_bang(t_pd *x)
t_outlet * te_outlet
Definition: m_pd.h:226
EXTERN t_float q8_rsqrt(t_float)
struct _resample t_resample
EXTERN void canvas_getargs(int *argcp, t_atom **argvp)
EXTERN int gpointer_check(const t_gpointer *gp, int headok)
EXTERN t_float atom_getfloatarg(int which, int argc, t_atom *argv)
EXTERN int sys_trylock(void)
EXTERN int sys_close(int fd)
int s_vecsize
Definition: m_pd.h:592
#define EXTERN_STRUCT
Definition: m_pd.h:50
EXTERN void binbuf_text(t_binbuf *x, char *text, size_t size)
struct _loadedlist * ll_next
Definition: m_pd.h:822
EXTERN t_float mtof(t_float)
EXTERN void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir)
#define t_pdinstance
Definition: m_pd.h:803
EXTERN void sys_unqueuegui(void *client)
EXTERN t_symbol * canvas_getcurrentdir(void)
t_word sc_vec[1]
Definition: m_pd.h:219
EXTERN int sys_get_inchannels(void)
t_atomtype a_type
Definition: m_pd.h:181
EXTERN int ilog2(int n)
EXTERN int class_isdrawcommand(t_class *c)
Definition: m_pd.h:170
EXTERN t_symbol s_y
Definition: m_pd.h:278
EXTERN void gfxstub_deleteforkey(void *key)
EXTERN FILE * sys_fopen(const char *filename, const char *mode)
EXTERN double clock_getsystime(void)
Definition: m_pd.h:179
t_sample * s_vec
Definition: m_pd.h:639
EXTERN void sys_lock(void)
struct _symbol t_symbol
EXTERN void outlet_set_yoffset(t_outlet *outlet, float y)
EXTERN int(* sys_idlehook)(void)
Definition: m_pd.h:555
#define t_inlet
Definition: m_pd.h:192
EXTERN void dsp_add(t_perfroutine f, int n,...)
EXTERN int binbuf_read_via_canvas(t_binbuf *b, char *filename, t_canvas *canvas, int crflag)
EXTERN void clock_delay(t_clock *x, double delaytime)
EXTERN void garray_resize(t_garray *x, t_floatarg f)
Definition: m_pd.h:209
t_pd g_pd
Definition: m_pd.h:211
EXTERN void mayer_fht(t_sample *fz, int n)
EXTERN void binbuf_evalfile(t_symbol *name, t_symbol *dir)
EXTERN int canvas_dspstate
Definition: m_pd.h:629
void(* t_gotfn)(void *x,...)
Definition: m_pd.h:262
EXTERN int sys_getblksize(void)
EXTERN t_symbol s_float
Definition: m_pd.h:269
EXTERN int binbuf_read(t_binbuf *b, char *filename, char *dirname, int crflag)
Definition: m_pd.h:172
Definition: m_pd.h:167
EXTERN void resample_dsp(t_resample *x, t_sample *in, int insize, t_sample *out, int outsize, int method)
t_class * t_externclass
Definition: m_pd.h:713
EXTERN t_pd pd_objectmaker
Definition: m_pd.h:266
EXTERN void postatom(int argc, t_atom *argv)
EXTERN void binbuf_add(t_binbuf *x, int argc, t_atom *argv)
EXTERN void garray_resize_long(t_garray *x, long n)
EXTERN void pd_setinstance(t_pdinstance *x)
EXTERN void sys_pretendguibytes(int n)
EXTERN_STRUCT _parentwidgetbehavior
Definition: m_pd.h:467
EXTERN void nullfn(void)
int s_n
Definition: m_pd.h:584
struct _loadedlist t_loadlist
EXTERN int sys_isreadablefile(const char *name)
EXTERN t_inlet * inlet_new(t_object *owner, t_pd *dest, t_symbol *s1, t_symbol *s2)
t_inlet * te_inlet
Definition: m_pd.h:227
#define EXTERN
Definition: m_pd.h:39
EXTERN void binbuf_addv(t_binbuf *x, const char *fmt,...)
#define class_addpointer(x, y)
Definition: m_pd.h:521
EXTERN char sys_fontweight[]
Definition: m_pd.h:453
EXTERN t_symbol * atom_getsymbolarg(int which, int argc, t_atom *argv)
struct _symbol * s_next
Definition: m_pd.h:114
#define t_canvas
Definition: m_pd.h:205
#define class_addbang(x, y)
Definition: m_pd.h:520
struct _signal t_signal
t_int *(* t_perfroutine)(t_int *args)
Definition: m_pd.h:595
EXTERN void EXTERN void verbose(int level, const char *fmt,...) ATTRIBUTE_FORMAT_PRINTF(2
EXTERN void binbuf_print(t_binbuf *x)
EXTERN t_parentwidgetbehavior * pd_getparentwidget(t_pd *x)
union _gstub::@0 gs_un
EXTERN void freebytes(void *x, size_t nbytes)
#define class_addsymbol(x, y)
Definition: m_pd.h:523
EXTERN_STRUCT _garray
Definition: m_pd.h:673
int method
Definition: m_pd.h:634
#define class_addanything(x, y)
Definition: m_pd.h:525
EXTERN t_object * pd_checkobject(t_pd *x)
EXTERN float inlet_get_yoffset(t_inlet *inlet)
Definition: m_pd.h:168
EXTERN double sys_getrealtime(void)
EXTERN void canvas_update_dsp(void)
EXTERN int sys_fclose(FILE *stream)
EXTERN t_pd * pd_newest(void)
EXTERN_STRUCT _widgetbehavior
Definition: m_pd.h:464
EXTERN t_atom * binbuf_getvec(t_binbuf *x)
#define PD_FLOATUINTTYPE
Definition: m_pd.h:97
t_atomtype
Definition: m_pd.h:161
EXTERN t_symbol s_bang
Definition: m_pd.h:271
t_class * glob_pdobject
#define PD_BIGORSMALL(f)
Definition: m_pd.h:783
Definition: m_pd.h:163
int bufsize
Definition: m_pd.h:646
Definition: m_pd.h:164
EXTERN t_float sys_getsr(void)
struct _gobj * g_next
Definition: m_pd.h:212
struct _gobj t_gobj
EXTERN void gpointer_copy(const t_gpointer *gpfrom, t_gpointer *gpto)
EXTERN t_symbol s_x
Definition: m_pd.h:277
PD_FLOATTYPE t_sample
Definition: m_pd.h:574
EXTERN void pd_unbind(t_pd *x, t_symbol *s)
Definition: g_canvas.h:151
int gp_valid
Definition: m_pd.h:147
EXTERN int sys_get_outchannels(void)
EXTERN_STRUCT _clock
Definition: m_pd.h:197
EXTERN void canvas_makefilename(t_glist *c, char *file, char *result, int resultsize)
#define class_addlist(x, y)
Definition: m_pd.h:524
EXTERN t_symbol * gensym(const char *s)
EXTERN void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv)
EXTERN int sys_isabsolutepath(const char *dir)
t_float w_float
Definition: m_pd.h:153
EXTERN void outlet_symbol(t_outlet *x, t_symbol *s)
EXTERN t_float atom_getfloat(t_atom *a)
EXTERN t_outlet * outlet_new(t_object *owner, t_symbol *s)
t_float s_sr
Definition: m_pd.h:586
t_gobj sc_gobj
Definition: m_pd.h:217
t_sample f
Definition: m_pd.h:576
Definition: m_pd.h:820
#define PD_LONGINTTYPE
Definition: m_pd.h:86
EXTERN t_float q8_sqrt(t_float)
Definition: m_pd.h:632
EXTERN char * class_gethelpname(t_class *c)
EXTERN t_symbol * binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, int tonew)
EXTERN void sys_gui(const char *s)
#define t_widgetbehavior
Definition: m_pd.h:465
union _gpointer::@1 gp_un
EXTERN void resample_free(t_resample *x)
#define PD_FLOATTYPE
Definition: m_pd.h:95
Definition: m_pd.h:582
Definition: m_pd.h:169
t_gobj te_g
Definition: m_pd.h:224
EXTERN void class_addmethod(t_class *c, t_method fn, t_symbol *sel, t_atomtype arg1,...)
EXTERN void canvas_saveto(t_canvas *x, t_binbuf *b)
t_sample * s_vec
Definition: m_pd.h:585
EXTERN void EXTERN void EXTERN void EXTERN void pd_error(void *object, const char *fmt,...) ATTRIBUTE_FORMAT_PRINTF(2
PD_FLOATTYPE t_floatarg
Definition: m_pd.h:108
EXTERN int canvas_open(t_canvas *x, const char *name, const char *ext, char *dirresult, char **nameresult, unsigned int size, int bin)
Definition: m_pd.h:166
EXTERN int pd_getdspstate(void)
Definition: m_pd.h:173
EXTERN t_gotfn getfn(t_pd *x, t_symbol *s)
EXTERN t_symbol * outlet_getsymbol(t_outlet *x)
EXTERN void mayer_realifft(int n, t_sample *real)
#define ATTRIBUTE_FORMAT_PRINTF(a, b)
Definition: m_pd.h:57
EXTERN t_float dbtopow(t_float)
void(* t_gotfn4)(void *x, void *arg1, void *arg2, void *arg3, void *arg4)
Definition: m_pd.h:301
int coefsize
Definition: m_pd.h:643
EXTERN void EXTERN void EXTERN void bug(const char *fmt,...) ATTRIBUTE_FORMAT_PRINTF(1
EXTERN void class_setsavefn(t_class *c, t_savefn f)
#define t_clock
Definition: m_pd.h:198
EXTERN void class_setparentwidget(t_class *c, t_parentwidgetbehavior *w)
EXTERN void EXTERN void EXTERN void EXTERN void EXTERN void logpost(const void *object, const int level, const char *fmt,...) ATTRIBUTE_FORMAT_PRINTF(3
EXTERN t_int * zero_perform(t_int *args)
EXTERN t_pdinstance * pdinstance_new(void)
EXTERN t_int atom_getint(t_atom *a)
EXTERN void outlet_pointer(t_outlet *x, t_gpointer *gp)
EXTERN t_binbuf * binbuf_duplicate(t_binbuf *y)
unsigned int te_type
Definition: m_pd.h:231
union _sampleint_union t_sampleint_union
EXTERN void class_setdrawcommand(t_class *c)
EXTERN_STRUCT _binbuf
Definition: m_pd.h:194
void(* t_gotfn1)(void *x, void *arg1)
Definition: m_pd.h:295
int gs_refcount
Definition: m_pd.h:137
Definition: m_pd.h:575
#define t_binbuf
Definition: m_pd.h:195
t_sample * buffer
Definition: m_pd.h:645
EXTERN t_int * plus_perform(t_int *args)
EXTERN t_symbol s_pointer
Definition: m_pd.h:268
struct _signal * s_borrowedfrom
Definition: m_pd.h:589
void *(* t_newmethod)(void)
Definition: m_pd.h:252
Definition: m_pd.h:174
EXTERN void dsp_addv(t_perfroutine f, int n, t_int *vec)
EXTERN double clock_getsystimeafter(double delaytime)
EXTERN int sys_zoomfontheight(int fontsize, int zoom, int worstcase)
EXTERN t_pd pd_canvasmaker
Definition: m_pd.h:267
EXTERN void class_set_extern_dir(t_symbol *s)
#define t_class
Definition: m_pd.h:186
EXTERN void canvas_setargs(int argc, t_atom *argv)
struct _array * gs_array
Definition: m_pd.h:134
EXTERN void sys_unlock(void)
EXTERN void dsp_add_scalarcopy(t_float *in, t_sample *out, int n)
EXTERN void outlet_float(t_outlet *x, t_float f)
int pd_compatibilitylevel
EXTERN double clock_getlogicaltime(void)
union word t_word
EXTERN_STRUCT _array
Definition: m_pd.h:117
EXTERN t_clock * clock_new(void *owner, t_method fn)
EXTERN void class_addcreator(t_newmethod newmethod, t_symbol *s, t_atomtype type1,...)
short te_xpix
Definition: m_pd.h:228
EXTERN void dsp_add_plus(t_sample *in1, t_sample *in2, t_sample *out, int n)
void(* t_propertiesfn)(t_gobj *x, struct _glist *glist)
Definition: m_pd.h:515
EXTERN void * getbytes(size_t nbytes)
EXTERN t_symbol * atom_gensym(t_atom *a)
PD_FLOATTYPE t_float
Definition: m_pd.h:107
EXTERN void binbuf_restore(t_binbuf *x, int argc, t_atom *argv)
EXTERN t_inlet * symbolinlet_new(t_object *owner, t_symbol **sp)
EXTERN int binbuf_read_via_path(t_binbuf *b, char *filename, char *dirname, int crflag)
EXTERN t_gotfn zgetfn(t_pd *x, t_symbol *s)
EXTERN int garray_npoints(t_garray *x)
EXTERN_STRUCT _glist
Definition: m_pd.h:203
#define t_outlet
Definition: m_pd.h:189
EXTERN float * cos_table
Definition: m_pd.h:622
EXTERN void gpointer_unset(t_gpointer *gp)
EXTERN char * garray_vec(t_garray *x)
EXTERN t_symbol s_anything
Definition: m_pd.h:273
Definition: m_pd.h:215
EXTERN void garray_usedindsp(t_garray *x)
EXTERN t_float ftom(t_float)
EXTERN t_class * garray_class
Definition: m_pd.h:676
void(* t_gotfn5)(void *x, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5)
Definition: m_pd.h:305
EXTERN t_canvas * pd_getcanvaslist(void)
EXTERN t_inlet * pointerinlet_new(t_object *owner, t_gpointer *gp)
union word a_w
Definition: m_pd.h:182
t_sample * coeffs
Definition: m_pd.h:642
#define t_glist
Definition: m_pd.h:204
EXTERN void startpost(const char *fmt,...)
EXTERN t_glist * garray_getglist(t_garray *x)
t_class * t_pd
Definition: m_pd.h:207
EXTERN t_float rmstodb(t_float)
union word * gp_w
Definition: m_pd.h:145
EXTERN void mayer_realfft(int n, t_sample *real)
void(* t_method)(void)
Definition: m_pd.h:251
Definition: m_pd.h:110
EXTERN void mayer_ifft(int n, t_sample *real, t_sample *imag)
EXTERN void resampleto_dsp(t_resample *x, t_sample *out, int insize, int outsize, int method)
EXTERN int garray_getfloatwords(t_garray *x, int *size, t_word **vec)
EXTERN int sys_fontheight(int fontsize)
EXTERN void post(const char *fmt,...)
EXTERN void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv)
int gs_which
Definition: m_pd.h:136
int upsample
Definition: m_pd.h:637
EXTERN void pd_list(t_pd *x, t_symbol *s, int argc, t_atom *argv)
EXTERN t_symbol s_symbol
Definition: m_pd.h:270
EXTERN void pd_free(t_pd *x)
EXTERN t_pd * pd_findbyclass(t_symbol *s, t_class *c)
EXTERN void pd_pointer(t_pd *x, t_gpointer *gp)
EXTERN void outlet_list(t_outlet *x, t_symbol *s, int argc, t_atom *argv)
EXTERN void gpointer_init(t_gpointer *gp)
EXTERN t_symbol s__X
Definition: m_pd.h:276
void(* t_gotfn2)(void *x, void *arg1, void *arg2)
Definition: m_pd.h:297
t_symbol * ll_name
Definition: m_pd.h:823
EXTERN void pd_symbol(t_pd *x, t_symbol *s)
Definition: m_pd.h:151
struct _gpointer t_gpointer
EXTERN void inlet_set_yoffset(t_inlet *inlet, float y)
Definition: m_pd.h:165
struct _class ** s_thing
Definition: m_pd.h:113
EXTERN void EXTERN void EXTERN void EXTERN void EXTERN void EXTERN void sys_logerror(const char *object, const char *s)
EXTERN void pd_bind(t_pd *x, t_symbol *s)
#define PD_BADFLOAT(f)
Definition: m_pd.h:782
short te_ypix
Definition: m_pd.h:229
EXTERN void dsp_add_zero(t_sample *out, int n)
EXTERN int binbuf_getnatom(t_binbuf *x)
Definition: m_pd.h:222
EXTERN double clock_gettimesincewithunits(double prevsystime, double units, int sampflag)
EXTERN t_class * class_new(t_symbol *name, t_newmethod newmethod, t_method freemethod, size_t size, int flags, t_atomtype arg1,...)
char * s_name
Definition: m_pd.h:112
EXTERN void outlet_anything(t_outlet *x, t_symbol *s, int argc, t_atom *argv)
EXTERN void clock_set(t_clock *x, double systime)
EXTERN double clock_gettimesince(double prevsystime)
t_binbuf * te_binbuf
Definition: m_pd.h:225
EXTERN t_glist * canvas_getcurrent(void)
EXTERN char * class_getname(t_class *c)
EXTERN void sys_queuegui(void *client, t_glist *glist, t_guicallbackfn f)
EXTERN void clock_unset(t_clock *x)
EXTERN t_inlet * floatinlet_new(t_object *owner, t_float *fp)
EXTERN void canvas_resume_dsp(int oldstate)
EXTERN void error(const char *fmt,...) ATTRIBUTE_FORMAT_PRINTF(1
EXTERN void class_sethelpsymbol(t_class *c, t_symbol *s)
EXTERN int garray_getfloatarray(t_garray *x, int *size, t_float **vec)
EXTERN void endpost(void)
int s_n
Definition: m_pd.h:640
t_symbol * w_symbol
Definition: m_pd.h:154
EXTERN t_int atom_getintarg(int which, int argc, t_atom *argv)
int w_index
Definition: m_pd.h:158
EXTERN void sys_getversion(int *major, int *minor, int *bugfix)
EXTERN void garray_redraw(t_garray *x)
EXTERN void pd_anything(t_pd *x, t_symbol *s, int argc, t_atom *argv)
EXTERN void sys_unixerror(const char *object)
EXTERN void pd_popsym(t_pd *x)
EXTERN float outlet_get_yoffset(t_outlet *outlet)
EXTERN t_inlet * signalinlet_new(t_object *owner, t_float f)
EXTERN int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag)
EXTERN void sys_ouch(void)
EXTERN int value_setfloat(t_symbol *s, t_float f)
EXTERN void pd_float(t_pd *x, t_float f)
EXTERN void pd_fft(t_float *buf, int npoints, int inverse)
Definition: m_pd.h:129
EXTERN_STRUCT _inlet
Definition: m_pd.h:191
EXTERN t_loadlist * sys_loaded
Definition: m_pd.h:825
EXTERN t_savefn class_getsavefn(t_class *c)
EXTERN void atom_string(t_atom *a, char *buf, unsigned int bufsize)
EXTERN t_symbol s__N
Definition: m_pd.h:275
EXTERN void outlet_free(t_outlet *x)
EXTERN void obj_saveformat(t_object *x, t_binbuf *bb)
EXTERN int sched_geteventno(void)
EXTERN void class_setpropertiesfn(t_class *c, t_propertiesfn f)
struct _binbuf * w_binbuf
Definition: m_pd.h:157
EXTERN void sys_vgui(const char *fmt,...)
EXTERN void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp)
EXTERN void binbuf_clear(t_binbuf *x)
EXTERN int open_via_path(const char *dir, const char *name, const char *ext, char *dirresult, char **nameresult, unsigned int size, int bin)
EXTERN_STRUCT _pdinstance
Definition: m_pd.h:802
t_array * w_array
Definition: m_pd.h:156
EXTERN t_int * copy_perform(t_int *args)
EXTERN void sys_bashfilename(const char *from, char *to)
EXTERN t_parentwidgetbehavior * class_parentwidget(t_class *c)
struct _scalar t_scalar
EXTERN int sys_fontwidth(int fontsize)
EXTERN void canvas_dataproperties(t_glist *x, t_scalar *sc, t_binbuf *b)
EXTERN void binbuf_addbinbuf(t_binbuf *x, t_binbuf *y)
struct _signal * s_nextfree
Definition: m_pd.h:590
t_gstub * gp_stub
Definition: m_pd.h:148
PD_LONGINTTYPE t_int
Definition: m_pd.h:106
EXTERN_STRUCT _outconnect
Definition: m_pd.h:200
PD_FLOATUINTTYPE i
Definition: m_pd.h:577
#define t_parentwidgetbehavior
Definition: m_pd.h:468
EXTERN void clock_free(t_clock *x)
EXTERN t_float dbtorms(t_float)
Definition: m_pd.h:171
EXTERN void binbuf_addsemi(t_binbuf *x)
#define t_garray
Definition: m_pd.h:674
EXTERN void pdinstance_free(t_pdinstance *x)
EXTERN t_symbol * pd_getdirname(void)
EXTERN void clock_setunit(t_clock *x, double timeunit, int sampflag)
EXTERN t_array * garray_getarray(t_garray *x)
EXTERN void binbuf_free(t_binbuf *x)
EXTERN void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv)
EXTERN void poststring(const char *s)
EXTERN char sys_font[]
Definition: m_pd.h:452
EXTERN void pd_pushsym(t_pd *x)
int s_refcount
Definition: m_pd.h:587
EXTERN int value_getfloat(t_symbol *s, t_float *f)
EXTERN void mayer_fft(int n, t_sample *real, t_sample *imag)
EXTERN void class_domainsignalin(t_class *c, int onset)
EXTERN t_float * value_get(t_symbol *s)
EXTERN int sys_zoomfontwidth(int fontsize, int zoom, int worstcase)