Ejemplo n.º 1
0
void C74_EXPORT ext_main(void *r)
{
  t_class *c;
  
  c = class_new("y.filesys", (method)filesys_new, (method)filesys_free, 
        (long)sizeof(t_filesys), (method)NULL, A_GIMME, 0);
  
  class_addmethod(c, (method)filesys_assist, "assist", A_CANT, 0);  

  class_addmethod(c, (method)filesys_cd, "cd", A_SYM, 0);
  class_addmethod(c, (method)filesys_getdir, "getdir", 0);
  class_addmethod(c, (method)filesys_postdir, "postdir", 0);

  class_addmethod(c, (method)filesys_rename, "rename", A_GIMME, 0);
  class_addmethod(c, (method)filesys_rename, "ren", A_GIMME, 0);
  class_addmethod(c, (method)filesys_rename, "mv", A_GIMME, 0);
  class_addmethod(c, (method)filesys_delete, "delete", A_GIMME, 0);
  class_addmethod(c, (method)filesys_delete, "del", A_GIMME, 0);
  class_addmethod(c, (method)filesys_delete, "rm", A_GIMME, 0);

  class_addmethod(c, (method)filesys_anything, "anything", A_GIMME, 0);

  CLASS_ATTR_CHAR(c, "verbose", 0, t_filesys, a_verbose);
	CLASS_ATTR_STYLE_LABEL(c, "verbose", 0, "onoff", "Verbose");
  CLASS_ATTR_SAVE(c, "verbose", 0);
  CLASS_ATTR_ORDER(c, "verbose", 0, "1");

  CLASS_ATTR_CHAR(c, "err_report", 0, t_filesys, a_error_report);
	CLASS_ATTR_STYLE_LABEL(c, "err_report", 0, "onoff", "Error reporting");
  CLASS_ATTR_SAVE(c, "err_report", 0);
  CLASS_ATTR_ORDER(c, "err_report", 0, "2");

  class_register(CLASS_BOX, c);
  filesys_class = c;
}
Ejemplo n.º 2
0
int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("hoa.2d.vector~", (method)hoa_vector_new, (method)hoa_vector_free, (long)sizeof(t_hoa_vector), 0L, A_GIMME, 0);
    class_alias(c, gensym("hoa.vector~"));
	
    hoa_initclass(c, (method)hoa_getinfos);
	class_addmethod(c, (method)hoa_vector_dsp64,	"dsp64",	A_CANT, 0);
	class_addmethod(c, (method)hoa_vector_assist,   "assist",	A_CANT, 0);
    
    CLASS_ATTR_LONG                 (c, "channels", 0, t_hoa_vector, f_attrs);
	CLASS_ATTR_CATEGORY             (c, "channels", 0, "Planewaves");
    CLASS_ATTR_LABEL                (c, "channels", 0, "Number of Channels");
	CLASS_ATTR_ACCESSORS            (c, "channels", channels_get, channels_set);
    CLASS_ATTR_ORDER                (c, "channels", 0, "1");
    CLASS_ATTR_DEFAULT              (c, "channels", 0, "4");
    CLASS_ATTR_SAVE                 (c, "channels", 0);
    
    CLASS_ATTR_FLOAT_VARSIZE        (c, "angles", 0, t_hoa_vector, f_attrs, f_attrs, MAX_CHANNELS);
	CLASS_ATTR_CATEGORY             (c, "angles", 0, "Planewaves");
    CLASS_ATTR_LABEL                (c, "angles", 0, "Angles of Channels");
	CLASS_ATTR_ACCESSORS            (c, "angles", angles_get, angles_set);
    CLASS_ATTR_ORDER                (c, "angles", 0, "2");
	CLASS_ATTR_SAVE                 (c, "angles", 0);
	CLASS_ATTR_DEFAULT              (c, "angles", 0, "0. 90. 180. 270.");
    
    class_dspinit(c);
	class_register(CLASS_BOX, c);	
	hoa_vector_class = c;
    
	return 0;
}
Ejemplo n.º 3
0
void ext_main(void *r)
{
	t_class *c;

	c = class_new("smoov", (method)smoov_new, (method)smoov_free, sizeof(t_smoov), 0L, A_GIMME, 0); // class_new() loads our external's class into Max's memory so it can be used in a patch

	class_addmethod(c, (method)smoov_bang,		"bang",		0);                 // the method it uses when it gets a bang in the left inlet
    class_addmethod(c, (method)smoov_set,		"set",		A_GIMME,    0);     // the method to set and int or a float in the left inlet       (inlet 0)
	class_addmethod(c, (method)smoov_int,		"int",		A_LONG,     0);     // the method for an int in the left inlet                      (inlet 0)
    class_addmethod(c, (method)smoov_list,		"list",		A_GIMME,     0);    // the method for a list in the left inlet                      (inlet 0)
    class_addmethod(c, (method)smoov_float,		"float",	A_FLOAT,    0);     // the method for a float in the left inlet                     (inlet 0)
	class_addmethod(c, (method)smoov_assist,	"assist",	A_CANT,     0);     // (optional) assistance method needs to be declared like this

    CLASS_ATTR_CHAR(c, "active", 0, t_smoov, s_active);
    CLASS_ATTR_ORDER(c, "active", 0, "1");
    CLASS_ATTR_STYLE_LABEL(c, "active", 0, "onoff", "Toggle smoothing");

    CLASS_ATTR_DOUBLE(c, "smooth", 0, t_smoov, s_smooth);
    CLASS_ATTR_LABEL(c, "smooth", 0, "Smoothing value");
    CLASS_ATTR_ORDER(c, "smooth", 0, "2");
    CLASS_ATTR_FILTER_CLIP(c, "smooth", 0., 1.);
    
    CLASS_ATTR_CHAR(c, "force_output", 0, t_smoov, s_force_output);
    CLASS_ATTR_ORDER(c, "force_output", 0, "3");
    CLASS_ATTR_ENUMINDEX3(c, "force_output",0,"as input","int output","float output");
    CLASS_ATTR_LABEL(c, "force_output", 0, "Fore output style");
    
	class_register(CLASS_BOX, c);
	smoov_class = c;
}
Ejemplo n.º 4
0
void C74_EXPORT ext_main(void *r)
{
	t_class *c;
	c = class_new("bezier",(method)bezier_new, (method)bezier_free, (short)sizeof(t_bezier), (method)0L, A_GIMME, 0);
	
	class_addmethod(c, (method)bezier_assist,			"assist",			A_CANT, 0L);
	class_addmethod(c, (method)bezier_bang,				"bang",						0L);
	class_addmethod(c, (method)bezier_int,				"int",				A_LONG,0L);
	class_addmethod(c, (method)bezier_float,			"float",			A_FLOAT,0L);
	class_addmethod(c, (method)bezier_list,				"list",				A_GIMME,0L);
	
	CLASS_ATTR_LONG(c,			"steps",		0, t_bezier, b_steps);
	CLASS_ATTR_SAVE(c,			"steps",		0);
	CLASS_ATTR_ACCESSORS(c,		"steps",		0L, (method)bezier_steps);
	CLASS_ATTR_ORDER(c,			"steps",		0, "-0");
	
	CLASS_ATTR_LONG(c,			"mode",			0, t_bezier, b_mode);
	CLASS_ATTR_SAVE(c,			"mode",			0);
	CLASS_ATTR_ACCESSORS(c,		"mode",			0L, (method)bezier_mode);
	CLASS_ATTR_ORDER(c,			"mode",			0, "-1");
	
	CLASS_ATTR_LONG(c,			"last",			0, t_bezier, b_last);
	CLASS_ATTR_SAVE(c,			"last",			0);
	CLASS_ATTR_ACCESSORS(c,		"last",			0L, (method)bezier_last);
	CLASS_ATTR_ORDER(c,			"last",			0, "-2");
	
	class_register(CLASS_BOX, c);
	bezier_class = c;
	
	post("·    bezier    ·    jasch    ·    "__DATE__"    ·    © all rights reserved",0);
	
	return;
}
Ejemplo n.º 5
0
extern "C" void setup_c0x2eblackboard(void)
{
    t_eclass *c;
    
    c = eclass_new("c.blackboard", (method)blackboard_new, (method)blackboard_free, (short)sizeof(t_blackboard), 0L, A_GIMME, 0);
    eclass_guiinit(c, 0);

    
    eclass_addmethod(c, (method) blackboard_paint,           "paint",            A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_notify,          "notify",           A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_oksize,          "oksize",           A_NULL, 0);
    
    eclass_addmethod(c, (method) blackboard_width,           "width",            A_FLOAT,0);
    eclass_addmethod(c, (method) blackboard_color,           "color",            A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_fill,            "fill",             A_FLOAT,0);
    
    eclass_addmethod(c, (method) blackboard_line,            "line",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_path,            "path",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_rect,            "rect",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_oval,            "oval",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_arc,             "arc",              A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_image,           "image",            A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_text,            "text",             A_GIMME,0);
    
    eclass_addmethod(c, (method) blackboard_clear,           "clear",            A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_reset,           "reset",            A_NULL, 0);
    
    eclass_addmethod(c, (method) blackboard_mousemove,       "mousemove",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mousedrag,       "mousedrag",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mousedown,       "mousedown",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mouseup,         "mouseup",          A_NULL, 0);
    
    CLASS_ATTR_DEFAULT              (c, "size", 0, "200 200");
    CLASS_ATTR_INVISIBLE            (c, "send", 1);
    
    CLASS_ATTR_LONG                 (c, "chalkmode", 0, t_blackboard, f_pen_mode);
    CLASS_ATTR_LABEL                (c, "chalkmode", 0, "Chalk Mode");
    CLASS_ATTR_FILTER_CLIP          (c, "chalkmode", 0, 1);
    CLASS_ATTR_ORDER                (c, "chalkmode", 0, "1");
    CLASS_ATTR_DEFAULT              (c, "chalkmode", 0, "1");
    CLASS_ATTR_SAVE                 (c, "chalkmode", 0);
    CLASS_ATTR_STYLE                (c, "chalkmode", 0, "onoff");
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_blackboard, f_color_background);
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_blackboard, f_color_border);
    CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
    CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
    blackboard_class = c;
}
Ejemplo n.º 6
0
extern "C" void setup_c0x2enumber_tilde(void)
{
	t_eclass *c;

	c = eclass_new("c.number~", (method)number_tilde_new, (method)number_tilde_free, (short)sizeof(t_number_tilde), 0L, A_GIMME, 0);

	eclass_dspinit(c);
	eclass_init(c, 0);
    cream_initclass(c);

	eclass_addmethod(c, (method) number_tilde_dsp,             "dsp",              A_NULL, 0);
	eclass_addmethod(c, (method) number_tilde_assist,          "assist",           A_NULL, 0);
	eclass_addmethod(c, (method) number_tilde_paint,           "paint",            A_NULL, 0);
	eclass_addmethod(c, (method) number_tilde_notify,          "notify",           A_NULL, 0);
    eclass_addmethod(c, (method) number_tilde_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) number_tilde_oksize,          "oksize",           A_NULL, 0);
    eclass_addmethod(c, (method) number_tilde_output,          "bang",             A_NULL, 0);

	CLASS_ATTR_DEFAULT			(c, "size", 0, "53 13");

    CLASS_ATTR_LONG                 (c, "interval", 0, t_number_tilde, f_interval);
	CLASS_ATTR_ORDER                (c, "interval", 0, "2");
	CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN           (c, "interval", 20);
	CLASS_ATTR_DEFAULT              (c, "interval", 0, "50");
	CLASS_ATTR_SAVE                 (c, "interval", 1);
    CLASS_ATTR_STYLE                (c, "interval", 0, "number");
    
    CLASS_ATTR_LONG                 (c, "decimal", 0, t_number_tilde, f_ndecimal);
	CLASS_ATTR_ORDER                (c, "decimal", 0, "3");
	CLASS_ATTR_LABEL                (c, "decimal", 0, "Number of decimal");
    CLASS_ATTR_DEFAULT              (c, "decimal", 0, "6");
	CLASS_ATTR_FILTER_MIN           (c, "decimal", 0);
    CLASS_ATTR_FILTER_MAX           (c, "decimal", 6);
	CLASS_ATTR_SAVE                 (c, "decimal", 1);
    CLASS_ATTR_STYLE                (c, "decimal", 0, "number");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_number_tilde, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_number_tilde, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "textcolor", 0, t_number_tilde, f_color_text);
	CLASS_ATTR_LABEL                (c, "textcolor", 0, "Text Color");
	CLASS_ATTR_ORDER                (c, "textcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "textcolor", 0, "0. 0. 0. 1.");
    CLASS_ATTR_STYLE                (c, "textcolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
	number_tilde_class = c;
}
Ejemplo n.º 7
0
extern "C" void setup_c0x2eincdec(void)
{
	t_eclass *c;

	c = eclass_new("c.incdec", (method)incdec_new, (method)incdec_free, (short)sizeof(t_incdec), 0L, A_GIMME, 0);

	eclass_init(c, 0);

	eclass_addmethod(c, (method) incdec_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) incdec_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) incdec_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) incdec_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) incdec_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) incdec_set,             "set",              A_FLOAT,0);
    eclass_addmethod(c, (method) incdec_float,           "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) incdec_output,          "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) incdec_inc,             "inc",              A_CANT, 0);
    eclass_addmethod(c, (method) incdec_dec,             "dec",              A_CANT, 0);
    eclass_addmethod(c, (method) incdec_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) incdec_mouseup,         "mouseup",          A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
    CLASS_ATTR_INVISIBLE            (c, "send", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "13 20");

    CLASS_ATTR_FLOAT                (c, "step", 0, t_incdec, f_increment);
	CLASS_ATTR_LABEL                (c, "step", 0, "Step increment");
    CLASS_ATTR_FILTER_MIN           (c, "step", 0.);
	CLASS_ATTR_ORDER                (c, "step", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "step", 0, "1.");
    CLASS_ATTR_STYLE                (c, "step", 0, "number");
    CLASS_ATTR_STEP                 (c, "step", 0.1);
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_incdec, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_incdec, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "arcolor", 0, t_incdec, f_color_arrow);
	CLASS_ATTR_LABEL                (c, "arcolor", 0, "Arrow Color");
	CLASS_ATTR_ORDER                (c, "arcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "arcolor", 0, "0. 0. 0. 1.");
    CLASS_ATTR_STYLE                (c, "arcolor", 0, "color");

    eclass_register(CLASS_BOX, c);
    cicm_post();
	incdec_class = c;
}
Ejemplo n.º 8
0
extern "C" void setup_c0x2ematrix(void)
{
	t_eclass *c;

	c = eclass_new("c.matrix", (method)matrixctrl_new, (method)matrixctrl_free, (short)sizeof(t_matrixctrl), 0L, A_GIMME, 0);
	eclass_guiinit(c, 0);
    eclass_addmethod(c, (method) matrixctrl_assist,          "assist",           A_NULL, 0);
	eclass_addmethod(c, (method) matrixctrl_paint,           "paint",            A_NULL, 0);
	eclass_addmethod(c, (method) matrixctrl_notify,          "notify",           A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_oksize,          "oksize",           A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_set,             "set",              A_GIMME,0);
    eclass_addmethod(c, (method) matrixctrl_list,            "list",             A_GIMME,0);
    eclass_addmethod(c, (method) matrixctrl_bang,            "bang",             A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_clear,           "clear",            A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_getrow,          "getrow",           A_FLOAT,0);
    eclass_addmethod(c, (method) matrixctrl_getcolumn,       "getcolumn",        A_FLOAT,0);

    eclass_addmethod(c, (method) matrixctrl_mousedown,       "mousedown",        A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_mousedrag,       "mousedrag",        A_NULL, 0);
    eclass_addmethod(c, (method) matrixctrl_mouseleave,      "mouseleave",       A_NULL, 0);

    eclass_addmethod(c, (method) matrixctrl_preset,          "preset",           A_NULL, 0);

    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "105 53");

    CLASS_ATTR_FLOAT_ARRAY          (c, "matrix", 0, t_matrixctrl, f_size, 2);
	CLASS_ATTR_LABEL                (c, "matrix", 0, "Matrix Size");
    CLASS_ATTR_ACCESSORS			(c, "matrix", NULL, matrixctrl_matrix_set);
	CLASS_ATTR_ORDER                (c, "matrix", 0, "1");
	CLASS_ATTR_DEFAULT              (c, "matrix", 0, "8 4");
    CLASS_ATTR_SAVE                 (c, "matrix", 0);

    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_matrixctrl, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");

	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_matrixctrl, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");

    CLASS_ATTR_RGBA                 (c, "accolor", 0, t_matrixctrl, f_color_on);
	CLASS_ATTR_LABEL                (c, "accolor", 0, "Active Cell Color");
	CLASS_ATTR_ORDER                (c, "accolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "accolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "accolor", 0, "color");

    eclass_register(CLASS_BOX, c);
	matrixctrl_class = c;
}
void ext_main(void *r)
#endif
{
    t_class *c;
    
    c = class_new("hoa.3d.decoder~", (method)hoa_3d_decoder_new, (method)hoa_3d_decoder_free, (long)sizeof(t_hoa_3d_decoder), 0L, A_GIMME, 0);
    class_setname((char *)"hoa.3d.decoder~", (char *)"hoa.3d.decoder~");
    
    hoa_initclass(c, (method)hoa_getinfos);
    
    // @method signal @digest Array of spherical harmonic signals to decode for a set of loudspeakers.
    // @description Array of spherical harmonic signals to decode for a set of loudspeakers.
    class_addmethod(c, (method)hoa_3d_decoder_dsp64,             "dsp64",      A_CANT, 0);
    class_addmethod(c, (method)hoa_3d_decoder_assist,            "assist",     A_CANT, 0);
    
    CLASS_ATTR_SYM              (c, "mode", 0, t_hoa_3d_decoder, f_mode);
    CLASS_ATTR_LABEL            (c, "mode", 0, "Mode");
    CLASS_ATTR_ENUM             (c, "mode", 0, "ambisonic binaural");
    CLASS_ATTR_ACCESSORS		(c, "mode", NULL, mode_set);
    CLASS_ATTR_ORDER            (c, "mode", 0, "1");
    // @description There is two decoding <m>mode</m> :
    // <ul>
    // <li><b>regular</b> : for a regular or irregular loudspeakers repartition over a sphere.</li>
    // <li><b>binaural</b> : for headphones.</li>
    // </ul>
    
    CLASS_ATTR_DOUBLE_VARSIZE	(c, "angles", ATTR_SET_DEFER_LOW, t_hoa_3d_decoder, f_angles_of_channels, f_number_of_angles, HOA_MAX_PLANEWAVES*2);
    CLASS_ATTR_LABEL			(c, "angles", 0, "Angles of Channels");
    CLASS_ATTR_ACCESSORS		(c, "angles", NULL, angles_set);
    CLASS_ATTR_ORDER			(c, "angles", 0, "2");
    // @description Set the angles of each channels in degrees. The angles of channels are only settable in <b>irregular</b> <m>mode</m>. Each angles are in degrees, wrapped between 0. and 360. You must specify 2 values per channel corresponding to the azimuth value followed by the elevation value.
    
    CLASS_ATTR_DOUBLE_ARRAY     (c, "offset", ATTR_SET_DEFER_LOW, t_hoa_3d_decoder, f_offsets, 3);
    CLASS_ATTR_LABEL            (c, "offset", 0, "Offset of Channels");
    CLASS_ATTR_ACCESSORS		(c, "offset", NULL, offset_set);
    CLASS_ATTR_ORDER            (c, "offset", 0, "3");
    // @description Set the offsets of channels with a list of 2 float values corresponding to the azimuth and elevation offset, in degrees between 0. and 360.
    
    CLASS_ATTR_LONG             (c, "channels", ATTR_SET_DEFER_LOW, t_hoa_3d_decoder, f_number_of_channels);
    CLASS_ATTR_LABEL            (c, "channels", 0, "Number of Channels");
    CLASS_ATTR_ACCESSORS		(c, "channels", NULL, channel_set);
    CLASS_ATTR_ORDER            (c, "channels", 0, "4");
    // @description The number of channels.
    
    CLASS_ATTR_LONG             (c, "crop", 0, t_hoa_3d_decoder, f_cropsize);
    CLASS_ATTR_ACCESSORS		(c, "crop", NULL, crop_set);
    CLASS_ATTR_LABEL            (c, "crop", 0, "Crop of the Responses");
    CLASS_ATTR_ORDER            (c, "crop", 0, "5");
    // @description The crop attribute can be used in binaural mode to reduce the CPU usage by cropping the impulse responses (between 0 and 512) 0 means no crop
    
    class_dspinit(c);
    class_register(CLASS_BOX, c);	
    hoa_3d_decoder_class = c;
}
Ejemplo n.º 10
0
int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("hoa.2d.decoder~", (method)hoa_decoder_new, (method)hoa_decoder_free, (long)sizeof(t_hoa_decoder), 0L, A_GIMME, 0);
    class_alias(c, gensym("hoa.decoder~"));
	
    hoa_initclass(c, (method)hoa_getinfos);
	class_addmethod(c, (method)hoa_decoder_dsp64,		"dsp64",	A_CANT, 0);
	class_addmethod(c, (method)hoa_decoder_assist,		"assist",	A_CANT, 0);
    
    CLASS_ATTR_LONG             (c, "autoconnect", 0, t_hoa_decoder, f_send_config);
	CLASS_ATTR_CATEGORY			(c, "autoconnect", 0, "Behavior");
	CLASS_ATTR_STYLE_LABEL      (c, "autoconnect", 0, "onoff", "Auto connection");
    CLASS_ATTR_ORDER            (c, "autoconnect", 0, "1");
    CLASS_ATTR_SAVE             (c, "autoconnect", 1);
    
    CLASS_ATTR_SYM              (c, "mode", 0, t_hoa_decoder, f_attr);
	CLASS_ATTR_CATEGORY			(c, "mode", 0, "Planewaves");
    CLASS_ATTR_LABEL            (c, "mode", 0, "Mode");
    CLASS_ATTR_ENUM             (c, "mode", 0, "ambisonic binaural irregular");
	CLASS_ATTR_ACCESSORS		(c, "mode", mode_get, mode_set);
    CLASS_ATTR_ORDER            (c, "mode", 0, "1");
    CLASS_ATTR_SAVE             (c, "mode", 1);
    
    CLASS_ATTR_LONG             (c, "channels", 0, t_hoa_decoder, f_attr);
	CLASS_ATTR_CATEGORY			(c, "channels", 0, "Planewaves");
    CLASS_ATTR_LABEL            (c, "channels", 0, "Number of Channels");
	CLASS_ATTR_ACCESSORS		(c, "channels", channel_get, channel_set);
    CLASS_ATTR_DEFAULT          (c, "channels", 0, "4");
    CLASS_ATTR_ORDER            (c, "channels", 0, "2");
    CLASS_ATTR_SAVE             (c, "channels", 0);
    
    CLASS_ATTR_DOUBLE           (c, "offset", 0, t_hoa_decoder, f_attr);
	CLASS_ATTR_CATEGORY			(c, "offset", 0, "Planewaves");
    CLASS_ATTR_LABEL            (c, "offset", 0, "Offset of Channels");
	CLASS_ATTR_ACCESSORS		(c, "offset", offset_get, offset_set);
    CLASS_ATTR_DEFAULT          (c, "offset", 0, "0");
    CLASS_ATTR_ORDER            (c, "offset", 0, "3");
    CLASS_ATTR_SAVE             (c, "offset", 0);
    
    CLASS_ATTR_DOUBLE_VARSIZE   (c, "angles", 0, t_hoa_decoder, f_attr, f_attr, MAX_CHANNELS);
	CLASS_ATTR_CATEGORY			(c, "angles", 0, "Planewaves");
    CLASS_ATTR_LABEL            (c, "angles", 0, "Angles of Channels");
	CLASS_ATTR_ACCESSORS		(c, "angles", angles_get, angles_set);
    CLASS_ATTR_ORDER            (c, "angles", 0, "4");
	CLASS_ATTR_SAVE             (c, "angles", 0);
	
	class_dspinit(c);
	class_register(CLASS_BOX, c);	
	hoa_decoder_class = c;
    
	return 0;
}
Ejemplo n.º 11
0
int main(void)
{	

	t_class *c;
	
	c = class_new("hoa.convolve~", (method)HoaConvolve_new, (method)HoaConvolve_free, (long)sizeof(t_HoaConvolve), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)HoaConvolve_dsp,			"dsp",		A_CANT,     0);
	class_addmethod(c, (method)HoaConvolve_dsp64,		"dsp64",	A_CANT,     0);
	class_addmethod(c, (method)HoaConvolve_assist,		"assist",	A_CANT,     0);
    class_addmethod(c, (method)HoaConvolve_notify,		"notify",	A_CANT,     0);
	class_addmethod(c, (method)HoaConvolve_dblclick,    "dblclick", A_CANT,     0);
    class_addmethod(c, (method)HoaConvolve_clear,       "clear",                0);
    
	CLASS_ATTR_SYM              (c, "buffer",   0, t_HoaConvolve, f_name);
	CLASS_ATTR_CATEGORY			(c, "buffer",   0, "Behavior");
	CLASS_ATTR_LABEL			(c, "buffer",   0, "buffer~ Object Name");
	CLASS_ATTR_ORDER			(c, "buffer",   0, "1");
	CLASS_ATTR_ACCESSORS		(c, "buffer",   NULL, buffer_set);
	CLASS_ATTR_DEFAULT			(c, "buffer",   0, "");
	CLASS_ATTR_SAVE				(c, "buffer",   1);

	CLASS_ATTR_LONG             (c, "channel",  0, t_HoaConvolve, f_channel);
	CLASS_ATTR_CATEGORY			(c, "channel",  0, "Behavior");
	CLASS_ATTR_LABEL			(c, "channel",  0, "buffer~ Object Channel");
	CLASS_ATTR_ORDER			(c, "channel",  0, "2");
	CLASS_ATTR_ACCESSORS		(c, "channel",  NULL, channel_set);
	CLASS_ATTR_DEFAULT			(c, "channel",  0, "1");
	CLASS_ATTR_SAVE				(c, "channel",  1);
    
    CLASS_ATTR_DOUBLE			(c, "dry",      0, t_HoaConvolve, f_dry);
	CLASS_ATTR_CATEGORY			(c, "dry",      0, "Parameters");
	CLASS_ATTR_LABEL			(c, "dry",      0, "Dry value");
	CLASS_ATTR_ORDER			(c, "dry",      0, "1");
	CLASS_ATTR_ACCESSORS		(c, "dry",      NULL, dry_set);
	CLASS_ATTR_DEFAULT			(c, "dry",      0, "0.");
	CLASS_ATTR_SAVE				(c, "dry",      1);
    
    CLASS_ATTR_DOUBLE			(c, "wet",      0, t_HoaConvolve, f_wet);
	CLASS_ATTR_CATEGORY			(c, "wet",      0, "Parameters");
	CLASS_ATTR_LABEL			(c, "wet",      0, "Wet value");
	CLASS_ATTR_ORDER			(c, "wet",      0, "2");
	CLASS_ATTR_ACCESSORS		(c, "wet",      NULL, wet_set);
	CLASS_ATTR_DEFAULT			(c, "wet",      0, "1.");
	CLASS_ATTR_SAVE				(c, "wet",      1);
    

	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	HoaConvolve_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}
Ejemplo n.º 12
0
int C74_EXPORT main(void)
{	
	t_class *c;
	
	c = class_new("hoa.3d.decoder~", (method)hoa_decoder_new, (method)hoa_decoder_free, (long)sizeof(t_hoa_decoder), 0L, A_GIMME, 0);
	
	hoa_initclass(c, (method)hoa_getinfos);
	
	// @method signal @digest Array of spherical harmonic signals to decode for a set of loudspeakers
	// @description Array of spherical harmonic signals to decode for a set of loudspeakers
	class_addmethod(c, (method)hoa_decoder_dsp64,             "dsp64",      A_CANT, 0);
	class_addmethod(c, (method)hoa_decoder_assist,            "assist",     A_CANT, 0);
	
	CLASS_ATTR_SYM              (c, "mode", 0, t_hoa_decoder, f_mode);
    CLASS_ATTR_LABEL            (c, "mode", 0, "Mode");
    CLASS_ATTR_ENUM             (c, "mode", 0, "ambisonic binaural irregular");
	CLASS_ATTR_ACCESSORS		(c, "mode", NULL, mode_set);
    CLASS_ATTR_ORDER            (c, "mode", 0, "1");
    CLASS_ATTR_SAVE             (c, "mode", 1);
    // @description There is three decoding <m>mode</m> :
    // <ul>
    // <li><b>Ambisonics</b> : for a regular loudspeakers repartition over a sphere.</li>
    // <li><b>Binaural</b> : for headphones.</li>
    // <li><b>Irregular</b> : for an irregular loudspeakers repartition</li>
    // </ul>
	
	CLASS_ATTR_DOUBLE_VARSIZE	(c, "angles", ATTR_SET_DEFER_LOW, t_hoa_decoder, f_angles_of_channels, f_number_of_angles, MAX_CHANNELS*2);
	CLASS_ATTR_LABEL			(c, "angles", 0, "Angles of Channels");
	CLASS_ATTR_ACCESSORS		(c, "angles", NULL, angles_set);
	CLASS_ATTR_ORDER			(c, "angles", 0, "2");
	// @description Set the angles of each channels in degrees. The angles of channels are only settable in <b>irregular</b> <m>mode</m>. Each angles are in degrees, wrapped between 0. and 360. You must specify 2 values per channel corresponding to the azimuth value followed by the elevation value.
    
    CLASS_ATTR_DOUBLE_ARRAY     (c, "offset", 0, t_hoa_decoder, f_offset, 2);
    CLASS_ATTR_LABEL            (c, "offset", 0, "Offset of Channels");
	CLASS_ATTR_ACCESSORS		(c, "offset", NULL, offset_set);
    CLASS_ATTR_DEFAULT          (c, "offset", 0, "0 0");
    CLASS_ATTR_ORDER            (c, "offset", 0, "3");
    // @description Set the offsets of channels with a list of 2 float values corresponding to the azimuth and elevation offset, in degrees between 0. and 360.
	
	CLASS_ATTR_SYM              (c, "pinna", 0, t_hoa_decoder, f_pinna);
    CLASS_ATTR_LABEL            (c, "pinna", 0, "Pinna Size");
    CLASS_ATTR_ENUM             (c, "pinna", 0, "small large");
	CLASS_ATTR_ACCESSORS		(c, "pinna", NULL, pinna_set);
    CLASS_ATTR_ORDER            (c, "pinna", 0, "4");
    // @description The pinna size to use for the binaural restitution. The <m>pinna</m> message followed by the <b>symbol</b> <b>small</b> or <b>large</b> set the pinna size of the HRTF responses for the binaural restitution. Choose the one that suits you best.
    
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	hoa_decoder_class = c;
	return 0;
}
Ejemplo n.º 13
0
extern "C" void setup_c0x2ebang(void)
{
	t_eclass *c;
    
	c = eclass_new("c.bang", (method)bang_new, (method)bang_free, (short)sizeof(t_bang), 0L, A_GIMME, 0);
    
	eclass_init(c, 0);
	
	eclass_addmethod(c, (method) bang_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) bang_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) bang_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) bang_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) bang_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) bang_output,          "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) bang_output,          "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) bang_output,          "list",             A_GIMME,0);
    eclass_addmethod(c, (method) bang_output,          "anything",         A_GIMME,0);
    
    eclass_addmethod(c, (method) bang_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) bang_mouseup,         "mouseup",          A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "16. 16.");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_bang, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
	CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_bang, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bacolor", 0, t_bang, f_color_bang);
	CLASS_ATTR_LABEL                (c, "bacolor", 0, "Bang Color");
	CLASS_ATTR_ORDER                (c, "bacolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bacolor", 0, "0. 0. 0. 1.");
	CLASS_ATTR_STYLE                (c, "bacolor", 0, "color");
	
    eclass_register(CLASS_BOX, c);
    cicm_post();
	bang_class = c;
}
Ejemplo n.º 14
0
extern "C" void setup_c0x2earray(void)
{
	t_eclass *c;
    
	c = eclass_new("c.array", (method)carray_new, (method)carray_free, (short)sizeof(t_carray), 0L, A_GIMME, 0);
    
	eclass_init(c, 0);
	
	eclass_addmethod(c, (method) carray_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) carray_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) carray_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) carray_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) carray_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) carray_output,          "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) carray_output,          "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) carray_output,          "list",             A_GIMME,0);
    eclass_addmethod(c, (method) carray_output,          "anything",         A_GIMME,0);
    
    eclass_addmethod(c, (method) carray_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) carray_mouseup,         "mouseup",          A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "16. 16.");
    
    CLASS_ATTR_SYMBOL               (c, "array", 0, t_carray, f_name);
    CLASS_ATTR_ACCESSORS            (c, "array", NULL, carray_buffer_set);
	CLASS_ATTR_LABEL                (c, "array", 0, "Array Name");
	CLASS_ATTR_ORDER                (c, "array", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "array", 0, "(null)");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_carray, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
	CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_carray, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
	
    eclass_register(CLASS_BOX, c);
    cicm_post();
	carray_class = c;
}
Ejemplo n.º 15
0
int main(void)
{	
	t_class *c;
	
	c = class_new("huygens~", (method)Huygens_new, (method)Huygens_free, (long)sizeof(t_Huygens), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)Huygens_dsp,			"dsp",			A_CANT, 0);
	class_addmethod(c, (method)Huygens_dsp64,		"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)Huygens_assist,		"assist",		A_CANT, 0);
	class_addmethod(c, (method)Huygens_float,		"float",		A_FLOAT, 0);
	class_addmethod(c, (method)Huygens_float,		"int",			A_LONG, 0);
	
	CLASS_ATTR_LONG				(c, "shape", 0, t_Huygens, f_mode);
	CLASS_ATTR_LABEL			(c, "shape", 0, "Shape of the loudspeakers array");
	CLASS_ATTR_ENUMINDEX		(c, "shape", 0, "Linear \" \"Circular");
	CLASS_ATTR_SAVE				(c, "shape", 1);
	CLASS_ATTR_FILTER_CLIP		(c, "shape", 0, 1);
	CLASS_ATTR_ORDER			(c, "shape", 0, "0");
	
	CLASS_ATTR_FLOAT			(c, "distance", 0, t_Huygens, f_speakersDistance);
	CLASS_ATTR_LABEL			(c, "distance", 0, "Distance between speakers array and listener");
	//CLASS_ATTR_ACCESSORS		(c, "distance", NULL, distance_set);
	CLASS_ATTR_SAVE				(c, "distance", 1);
	CLASS_ATTR_FILTER_MIN		(c, "distance", 0.);
	CLASS_ATTR_ORDER			(c, "distance", 0, "1");
	
	CLASS_ATTR_FLOAT			(c, "delta", 0, t_Huygens, f_speakersDelta);
	CLASS_ATTR_LABEL			(c, "delta", 0, "Distance between speakers");
	//CLASS_ATTR_ACCESSORS		(c, "delta", NULL, delta_set);
	CLASS_ATTR_SAVE				(c, "delta", 1);
	CLASS_ATTR_FILTER_MIN		(c, "delta", 0.);
	CLASS_ATTR_ORDER			(c, "delta", 0, "2");
	
	CLASS_ATTR_LONG				(c, "interpolation", 0, t_Huygens, f_interpolation);
	CLASS_ATTR_LABEL			(c, "interpolation", 0, "Delay interpolation");
	CLASS_ATTR_ENUMINDEX		(c, "interpolation", 0, "Linear \" \"Quadratic \" \"Lagrange");
	CLASS_ATTR_SAVE				(c, "interpolation", 1);
	CLASS_ATTR_FILTER_CLIP		(c, "interpolation", 0, 2);
	CLASS_ATTR_ORDER			(c, "interpolation", 0, "3");
	
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	Huygens_class = c;
	
	post("huygens~ by Julien Colafrancesco & Pierre Guillot");
	post("Copyright (C) 2012, CICM / Universite Paris 8");
	
	return 0;
}
Ejemplo n.º 16
0
int C74_EXPORT main(void)
{	
	t_class *c;
	
	c = class_new("hoa.binaural~", (method)HoaBinaural_new, (method)HoaBinaural_free, (long)sizeof(t_HoaBinaural), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)HoaBinaural_dsp,			"dsp",		A_CANT,		0);
	class_addmethod(c, (method)HoaBinaural_dsp64,		"dsp64",	A_CANT,		0);
	class_addmethod(c, (method)HoaBinaural_assist,		"assist",	A_CANT,		0);
    
    CLASS_ATTR_SYM              (c,"pinnasize", 0,      t_HoaBinaural, f_pinna_size);
    CLASS_ATTR_ACCESSORS		(c,"pinnasize", NULL,   HoaBinaural_set_pinnasize);
	CLASS_ATTR_LABEL			(c,"pinnasize", 0,      "Pinna Size");
	CLASS_ATTR_CATEGORY			(c,"pinnasize", 0,      "Behavior");
    CLASS_ATTR_ENUM             (c,"pinnasize", 0,      "small large");
	CLASS_ATTR_DEFAULT          (c,"pinnasize", 0,      "small");
    CLASS_ATTR_ORDER			(c,"pinnasize", 0,      "1");
    CLASS_ATTR_SAVE             (c,"pinnasize", 1);
	
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	HoaBinaural_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}
Ejemplo n.º 17
0
int C74_EXPORT main(void)
{	

	t_class *c;
	
	c = class_new("hoa.optim~", (method)HoaOptim_new, (method)dsp_free, (long)sizeof(t_HoaOptim), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)HoaOptim_dsp64,		"dsp64",	A_CANT, 0);
	class_addmethod(c, (method)HoaOptim_assist,		"assist",	A_CANT, 0);
    
    CLASS_ATTR_SYM				(c, "optim", 0, t_HoaOptim, f_optim_mode);
	CLASS_ATTR_CATEGORY			(c, "optim", 0, "Behavior");
	CLASS_ATTR_LABEL			(c, "optim", 0, "Optimization");
    CLASS_ATTR_ENUM             (c, "optim", 0, "basic maxRe inPhase");
	CLASS_ATTR_ORDER			(c, "optim", 0, "1");
	CLASS_ATTR_ACCESSORS		(c, "optim", NULL, HoaOptim_optim);
	CLASS_ATTR_SAVE				(c, "optim", 1);
	
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	HoaOptim_class = c;
	
	class_findbyname(CLASS_BOX, gensym("hoa.encoder~"));
	return 0;
}
Ejemplo n.º 18
0
void C74_EXPORT ext_main(void *r)
{
	t_class *c;
	c = class_new("3Dpoltocar", (method)dpoltocar_new,0L, (short)sizeof(t_dpoltocar), 0L, A_DEFLONG, A_DEFLONG, 0);
    class_addmethod(c, (method)dpoltocar_assist	,	"assist",	A_CANT,	0L);
    class_addmethod(c, (method)dpoltocar_bang,		"bang",				0L);
    class_addmethod(c, (method)dpoltocar_list,		"list",		A_GIMME,0L);
//    class_addmethod(c, (method)dpoltocar_mode,		"mode",		A_LONG, 0L);
//    class_addmethod(c, (method)inspector_open,		"info",		A_CANT,	0L);
	
	
//	CLASS_STICKY_ATTR(c,                                "category",	0L, "3Dcartopol");
	
	CLASS_ATTR_LONG(c,                                  "mode",		0L, t_dpoltocar, d_mode);
	CLASS_ATTR_LABEL(c,                                 "mode",		0L, "angle mode");
	CLASS_ATTR_STYLE(c,                                 "mode",		0L, "enum");
	CLASS_ATTR_ENUMINDEX(c,                             "mode",		0L, "\"radians\" \"degrees\"");
	CLASS_ATTR_SAVE(c,                                  "mode",		0L );
	CLASS_ATTR_FILTER_CLIP(c,                           "mode",		0, 1);
	CLASS_ATTR_ORDER(c,                                 "mode",		0L, "0");
	
	my_pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068;
	half_pi = my_pi / 2.0;
	divide_pi = my_pi / 180.0;
	two_pi = 2.0 * my_pi;
	divide_two_pi = 1.0 / two_pi;
	class_register(CLASS_BOX, c);
	dpoltocar_class = c;
	post("·    3Dpoltocar    ·    jasch    ·    "__DATE__"    ·    © all rights reserved",0);
	return;
}
Ejemplo n.º 19
0
void ext_main(void *r) {
	// Initialize the class - first argument: VERY important to match the name of the object in the procect settings!!!
	cmbuffercloud_class = class_new("cm.buffercloud~", (method)cmbuffercloud_new, (method)cmbuffercloud_free, sizeof(t_cmbuffercloud), 0, A_GIMME, 0);
	
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_dsp64, 		"dsp64", 	A_CANT, 0);  // Bind the 64 bit dsp method
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_assist, 		"assist", 	A_CANT, 0); // Bind the assist message
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_float, 		"float", 	A_FLOAT, 0); // Bind the float message (allowing float input)
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_dblclick, 	"dblclick",	A_CANT, 0); // Bind the double click message
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_notify, 		"notify", 	A_CANT, 0); // Bind the notify message
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_set, 		"set", 		A_GIMME, 0); // Bind the set message for user buffer set
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_limit, 		"limit", 	A_GIMME, 0); // Bind the limit message
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_bang,		"bang",		0);
	
	CLASS_ATTR_ATOM_LONG(cmbuffercloud_class, "stereo", 0, t_cmbuffercloud, attr_stereo);
	CLASS_ATTR_ACCESSORS(cmbuffercloud_class, "stereo", (method)NULL, (method)cmbuffercloud_stereo_set);
	CLASS_ATTR_BASIC(cmbuffercloud_class, "stereo", 0);
	CLASS_ATTR_SAVE(cmbuffercloud_class, "stereo", 0);
	CLASS_ATTR_STYLE_LABEL(cmbuffercloud_class, "stereo", 0, "onoff", "Multichannel playback");
	
	CLASS_ATTR_ATOM_LONG(cmbuffercloud_class, "w_interp", 0, t_cmbuffercloud, attr_winterp);
	CLASS_ATTR_ACCESSORS(cmbuffercloud_class, "w_interp", (method)NULL, (method)cmbuffercloud_winterp_set);
	CLASS_ATTR_BASIC(cmbuffercloud_class, "w_interp", 0);
	CLASS_ATTR_SAVE(cmbuffercloud_class, "w_interp", 0);
	CLASS_ATTR_STYLE_LABEL(cmbuffercloud_class, "w_interp", 0, "onoff", "Window interpolation on/off");
	
	CLASS_ATTR_ATOM_LONG(cmbuffercloud_class, "s_interp", 0, t_cmbuffercloud, attr_sinterp);
	CLASS_ATTR_ACCESSORS(cmbuffercloud_class, "s_interp", (method)NULL, (method)cmbuffercloud_sinterp_set);
	CLASS_ATTR_BASIC(cmbuffercloud_class, "s_interp", 0);
	CLASS_ATTR_SAVE(cmbuffercloud_class, "s_interp", 0);
	CLASS_ATTR_STYLE_LABEL(cmbuffercloud_class, "s_interp", 0, "onoff", "Sample interpolation on/off");
	
	CLASS_ATTR_ATOM_LONG(cmbuffercloud_class, "zero", 0, t_cmbuffercloud, attr_zero);
	CLASS_ATTR_ACCESSORS(cmbuffercloud_class, "zero", (method)NULL, (method)cmbuffercloud_zero_set);
	CLASS_ATTR_BASIC(cmbuffercloud_class, "zero", 0);
	CLASS_ATTR_SAVE(cmbuffercloud_class, "zero", 0);
	CLASS_ATTR_STYLE_LABEL(cmbuffercloud_class, "zero", 0, "onoff", "Zero crossing trigger mode on/off");
	
	CLASS_ATTR_ORDER(cmbuffercloud_class, "stereo", 0, "1");
	CLASS_ATTR_ORDER(cmbuffercloud_class, "w_interp", 0, "2");
	CLASS_ATTR_ORDER(cmbuffercloud_class, "s_interp", 0, "3");
	CLASS_ATTR_ORDER(cmbuffercloud_class, "zero", 0, "4");
	
	class_dspinit(cmbuffercloud_class); // Add standard Max/MSP methods to your class
	class_register(CLASS_BOX, cmbuffercloud_class); // Register the class with Max
	ps_buffer_modified = gensym("buffer_modified"); // assign the buffer modified message to the static pointer created above
	ps_stereo = gensym("stereo");
}
Ejemplo n.º 20
0
extern "C" void setup_c0x2etoggle(void)
{
	t_eclass *c;

	c = eclass_new("c.toggle", (method)toggle_new, (method)toggle_free, (short)sizeof(t_toggle), 0L, A_GIMME, 0);

	eclass_init(c, 0);

	eclass_addmethod(c, (method) toggle_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) toggle_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) toggle_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) toggle_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) toggle_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) toggle_float,           "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) toggle_set,             "set",              A_FLOAT,0);
    eclass_addmethod(c, (method) toggle_bang,            "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) toggle_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) toggle_preset,          "preset",           A_CANT, 0);

    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "15. 15.");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_toggle, f_color_background);
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_toggle, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
	CLASS_ATTR_RGBA                 (c, "crcolor", 0, t_toggle, f_color_cross);
	CLASS_ATTR_LABEL                (c, "crcolor", 0, "Cross Color");
	CLASS_ATTR_ORDER                (c, "crcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "crcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "crcolor", 0, "color");

    eclass_register(CLASS_BOX, c);
    cicm_post();
	toggle_class = c;
}
Ejemplo n.º 21
0
int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("hoa.2d.vector~", (method)hoa_vector_new, (method)hoa_vector_free, (long)sizeof(t_hoa_vector), 0L, A_GIMME, 0);
	
    hoa_initclass(c, (method)hoa_getinfos);
	
	// @method signal @digest Array of channels signals.
	// @description Array of channels signals.
	class_addmethod(c, (method)hoa_vector_dsp64,	"dsp64",	A_CANT, 0);
	class_addmethod(c, (method)hoa_vector_assist,   "assist",	A_CANT, 0);
    
    CLASS_ATTR_LONG                 (c, "channels", 0, t_hoa_vector, f_attrs);
	CLASS_ATTR_CATEGORY             (c, "channels", 0, "Planewaves");
    CLASS_ATTR_LABEL                (c, "channels", 0, "Number of Channels");
	CLASS_ATTR_ACCESSORS            (c, "channels", channels_get, channels_set);
    CLASS_ATTR_ORDER                (c, "channels", 0, "1");
    CLASS_ATTR_DEFAULT              (c, "channels", 0, "4");
    CLASS_ATTR_SAVE                 (c, "channels", 0);
	// @description The number of channels.
    
    CLASS_ATTR_DOUBLE               (c, "offset", 0, t_hoa_vector, f_attrs);
	CLASS_ATTR_CATEGORY             (c, "offset", 0, "Planewaves");
    CLASS_ATTR_LABEL                (c, "offset", 0, "Offset of Channels");
	CLASS_ATTR_ACCESSORS            (c, "offset", offset_get, offset_set);
    CLASS_ATTR_DEFAULT              (c, "offset", 0, "0");
    CLASS_ATTR_ORDER                (c, "offset", 0, "2");
    CLASS_ATTR_SAVE                 (c, "offset", 0);
	// @description The offset of the channels.
    
    CLASS_ATTR_FLOAT_VARSIZE        (c, "angles", 0, t_hoa_vector, f_attrs, f_attrs, MAX_CHANNELS);
	CLASS_ATTR_CATEGORY             (c, "angles", 0, "Planewaves");
    CLASS_ATTR_LABEL                (c, "angles", 0, "Angles of Channels");
	CLASS_ATTR_ACCESSORS            (c, "angles", angles_get, angles_set);
    CLASS_ATTR_ORDER                (c, "angles", 0, "3");
	CLASS_ATTR_SAVE                 (c, "angles", 0);
	CLASS_ATTR_DEFAULT              (c, "angles", 0, "0. 90. 180. 270.");
	// @description The angles of the channels. Angles are in degree wrapped between 0. and 360.
    
    class_dspinit(c);
	class_register(CLASS_BOX, c);	
	hoa_vector_class = c;
    
	return 0;
}
Ejemplo n.º 22
0
int main(void)
{	
	t_class *c;
	
	c = class_new("hoa.delay~", (method)HoaDelay_new, (method)dsp_free, (long)sizeof(t_HoaDelay), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)HoaDelay_float,		"float",	A_FLOAT, 0);
	class_addmethod(c, (method)HoaDelay_int,		"int",		A_LONG, 0);
	class_addmethod(c, (method)HoaDelay_dsp64,		"dsp64",	A_CANT, 0);
	class_addmethod(c, (method)HoaDelay_assist,		"assist",	A_CANT, 0);
    
    CLASS_ATTR_DOUBLE			(c, "ramp", 0, t_HoaDelay, f_ramp_time);
	CLASS_ATTR_CATEGORY			(c, "ramp", 0, "Behavior");
	CLASS_ATTR_LABEL			(c, "ramp", 0, "Ramp time (ms)");
	CLASS_ATTR_ORDER			(c, "ramp", 0, "1");
	CLASS_ATTR_ACCESSORS		(c, "ramp", NULL, ramp_set);
	CLASS_ATTR_SAVE				(c, "ramp", 1);
    
    CLASS_ATTR_LONG             (c, "compensation", 0, t_HoaDelay, f_encoding_compensation);
	CLASS_ATTR_CATEGORY			(c, "compensation", 0, "Behavior");
    CLASS_ATTR_STYLE_LABEL      (c, "compensation", 0, "onoff", "Encoding compensation")
	CLASS_ATTR_ORDER			(c, "compensation", 0, "2");
	CLASS_ATTR_ACCESSORS		(c, "compensation", NULL, comp_set);
	CLASS_ATTR_SAVE				(c, "compensation", 1);
    
    CLASS_ATTR_DOUBLE			(c, "delay", 0, t_HoaDelay, f_delay);
	CLASS_ATTR_CATEGORY			(c, "delay", 0, "Parameters");
	CLASS_ATTR_LABEL			(c, "delay", 0, "Delay time (ms)");
	CLASS_ATTR_ORDER			(c, "delay", 0, "1");
	CLASS_ATTR_ACCESSORS		(c, "delay", NULL, delay_set);
	CLASS_ATTR_SAVE				(c, "delay", 1);
    
    CLASS_ATTR_DOUBLE			(c, "diffusion", 0, t_HoaDelay, f_diffuse_factor);
	CLASS_ATTR_CATEGORY			(c, "diffusion", 0, "Parameters");
	CLASS_ATTR_LABEL			(c, "diffusion", 0, "Diffusion factor");
	CLASS_ATTR_ORDER			(c, "diffusion", 0, "2");
	CLASS_ATTR_ACCESSORS		(c, "diffusion", NULL, diff_set);
	CLASS_ATTR_SAVE				(c, "diffusion", 1);
	
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	HoaDelay_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}
Ejemplo n.º 23
0
extern "C" void setup_c0x2edsp_tilde(void)
{
    t_eclass *c;
    
    c = eclass_new("c.dsp~", (method)dsp_tilde_new, (method)dsp_tilde_free, (short)sizeof(t_dsp_tilde), CLASS_NOINLET, A_GIMME, 0);
    
    eclass_init(c, 0);
    cream_initclass(c);
    
    eclass_addmethod(c, (method) dsp_tilde_assist,          "assist",           A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_paint,           "paint",            A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_oksize,          "oksize",           A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_mousedown,       "mousedown",        A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_anything,        "anything",         A_GIMME, 0);
    eclass_addmethod(c, (method) dsp_tilde_open,            "settings",         A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_start,           "start",            A_NULL, 0);
    eclass_addmethod(c, (method) dsp_tilde_stop,            "stop",             A_NULL, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
    CLASS_ATTR_DEFAULT              (c, "size", 0, "30 30");
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_dsp_tilde, f_color_background);
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
    
    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_dsp_tilde, f_color_border);
    CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
    CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
    
    CLASS_ATTR_RGBA                 (c, "logocolor", 0, t_dsp_tilde, f_color_logo);
    CLASS_ATTR_LABEL                (c, "logocolor", 0, "Logo Color");
    CLASS_ATTR_ORDER                (c, "logocolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "logocolor", 0, "0. 0.6 0. 0.8");
    CLASS_ATTR_STYLE                (c, "logocolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
    dsp_tildeclass = c;
}
Ejemplo n.º 24
0
int main(void){	
	t_class *c;
        
	c = class_new("sc.gendy1~", (method)gendy_new, (method)gendy_free, (long)sizeof(t_gendy), 0L, A_GIMME, 0);
    
	class_addmethod(c, (method)gendy_dsp,		"dsp",		A_CANT, 0);
	class_addmethod(c, (method)gendy_assist,    "assist",	A_CANT, 0);
    
    // the gendy parameters are set via attributes
    
    CLASS_ATTR_LONG         (c, "ampdist",  ATTR_FLAGS_NONE, t_gendy, g_ampdist);
    CLASS_ATTR_FILTER_CLIP  (c, "ampdist",  0, 6);
    CLASS_ATTR_ORDER        (c, "ampdist",	ATTR_FLAGS_NONE, "1");
    
    CLASS_ATTR_LONG         (c, "durdist",  ATTR_FLAGS_NONE, t_gendy, g_durdist);
    CLASS_ATTR_FILTER_CLIP  (c, "durdist",  0, 6);
    CLASS_ATTR_ORDER        (c, "durdist",	ATTR_FLAGS_NONE, "2");
    
    CLASS_ATTR_FLOAT        (c, "adparam",  ATTR_FLAGS_NONE, t_gendy, g_adparam);
    CLASS_ATTR_ORDER        (c, "adparam",	ATTR_FLAGS_NONE, "3");
    
    CLASS_ATTR_FLOAT        (c, "ddparam",  ATTR_FLAGS_NONE, t_gendy, g_ddparam);
    CLASS_ATTR_ORDER        (c, "ddparam",	ATTR_FLAGS_NONE, "4");
    
    CLASS_ATTR_FLOAT        (c, "minfreq",  ATTR_FLAGS_NONE, t_gendy, g_minfreq);
    CLASS_ATTR_FILTER_MIN   (c, "minfreq",  1.f);
    CLASS_ATTR_ORDER        (c, "minfreq",	ATTR_FLAGS_NONE, "5");
    
    CLASS_ATTR_FLOAT        (c, "maxfreq",  ATTR_FLAGS_NONE, t_gendy, g_maxfreq);
    CLASS_ATTR_FILTER_MIN   (c, "maxfreq",  1.f);
    CLASS_ATTR_ORDER        (c, "maxfreq",	ATTR_FLAGS_NONE, "6");
    
    CLASS_ATTR_FLOAT        (c, "ampscale", ATTR_FLAGS_NONE, t_gendy, g_ampscale);
    CLASS_ATTR_FILTER_CLIP  (c, "ampscale", 0.f, 1.f);
    CLASS_ATTR_ORDER        (c, "ampscale",	ATTR_FLAGS_NONE, "7");
    
    CLASS_ATTR_FLOAT        (c, "durscale", ATTR_FLAGS_NONE, t_gendy, g_durscale);
    CLASS_ATTR_FILTER_CLIP  (c, "durscale", 0.f, 1.f);
    CLASS_ATTR_ORDER        (c, "durscale",	ATTR_FLAGS_NONE, "8");
    
    CLASS_ATTR_LONG         (c, "knum",     ATTR_FLAGS_NONE, t_gendy, g_knum);
    CLASS_ATTR_ORDER        (c, "knum",     ATTR_FLAGS_NONE, "9");
    
	class_dspinit(c);				
	class_register(CLASS_BOX, c);
	gendy_class = c;
	
	return EXIT_SUCCESS;
}
Ejemplo n.º 25
0
int main(void)
{	
	t_class *c;
	
	c = class_new("rev.freeverb~", (method)freeverb_new, (method)freeverb_free, (long)sizeof(t_freeverb ), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)freeverb_dsp,		"dsp",			A_CANT, 0);
	class_addmethod(c, (method)freeverb_dsp64,		"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)freeverb_assist,		"assist",		A_CANT, 0);

	CLASS_ATTR_FLOAT			(c, "size", 0, t_freeverb, f_size);
	CLASS_ATTR_CATEGORY			(c, "size", 0, "Parameters");
	CLASS_ATTR_LABEL			(c, "size", 0, "Room size");
	CLASS_ATTR_ORDER			(c, "size", 0, "1");
	CLASS_ATTR_ACCESSORS		(c, "size", NULL, size_set);
	CLASS_ATTR_DEFAULT			(c, "size", 0, "0.5");
	CLASS_ATTR_FILTER_MIN		(c, "size", 0);
	CLASS_ATTR_SAVE				(c, "size", 1);

	CLASS_ATTR_FLOAT			(c, "damp", 0, t_freeverb, f_damp);
	CLASS_ATTR_CATEGORY			(c, "damp", 0, "Parameters");
	CLASS_ATTR_LABEL			(c, "damp", 0, "Damping value");
	CLASS_ATTR_ORDER			(c, "damp", 0, "2");
	CLASS_ATTR_ACCESSORS		(c, "damp", NULL, damp_set);
	CLASS_ATTR_DEFAULT			(c, "damp", 0, "0.5");
	CLASS_ATTR_FILTER_MIN		(c, "damp", 0);
	CLASS_ATTR_SAVE				(c, "damp", 1);

	CLASS_ATTR_LONG				(c, "freeze", 0, t_freeverb, f_freeze);
	CLASS_ATTR_CATEGORY			(c, "freeze", 0, "Behaviors");
	CLASS_ATTR_STYLE_LABEL		(c, "freeze", 0, "onoff", "Freeze");
	CLASS_ATTR_ACCESSORS		(c, "freeze", NULL, freeze_set);
	CLASS_ATTR_DEFAULT			(c, "freeze", 0, "0");
	CLASS_ATTR_SAVE				(c, "freeze", 1);

	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	freeverb_class = c;
	
	post("rev.library by Pierre Guillot");
	post("Copyright (C) 2012, CICM / Universite Paris 8");
	
	return 0;
}
Ejemplo n.º 26
0
int C74_EXPORT main(void)
{	

	t_class *c;
	
	c = class_new("hoa.2d.map~", (method)hoa_map_new, (method)hoa_map_free, (long)sizeof(t_hoa_map), 0L, A_GIMME, 0);
	
	hoa_initclass(c, (method)hoa_getinfos);
	
	// @method signal @digest Sources signals to encode.
	// @description If you have a single source, the first signal inlet is for the source to encode, the two other ones are to control source position at signal rate. if you have more than one single source to spatialize, all of the inputs represent a signal to encode and coordonates are given with messages.
	class_addmethod(c, (method)hoa_map_dsp64,		"dsp64",	A_CANT, 0);
	
	// @method float @digest Set single source coordinate with messages depending on the mode.
	// @description Set single source coordinate with messages depending on the mode.
	// @marg 0 @name coord @optional 0 @type float
	class_addmethod(c, (method)hoa_map_float,		"float",	A_FLOAT, 0);
	
	// @method float @digest Set single source coordinate with messages depending on the mode.
	// @description Set single source coordinate with messages depending on the mode.
	// @marg 0 @name coord @optional 0 @type float
	class_addmethod(c, (method)hoa_map_int,         "int",		A_LONG, 0);
	
	// @method cartesian @digest Swith the input mode to cartesian (default).
	// @description The <m>cartesian</m> message swith the input mode to cartesian
	class_addmethod(c, (method)hoa_map_cartesian,   "cartesian",A_NOTHING, 0);
	
	// @method polar @digest Swith the input mode to polar.
	// @description The <m>polar</m> message swith the input mode to polar
	class_addmethod(c, (method)hoa_map_polar,		"polar",	A_NOTHING, 0);
	
	// @method list @digest Send source messages like coordinates and mute state.
	// @description Send source messages like coordinates and mute state. The list must be formatted like this : source-index input-mode radius/abscissa azimuth/ordinate to set source positions or like this : source-index 'mute' mute-state to set the mute state of a source.
	// marg 0 @name source-index @optional 0 @type int
	// marg 1 @name input-mode/mute @optional 0 @type symbol
	// marg 2 @name coord-1/mute-state @optional 0 @type float/int
	// marg 3 @name coord-2 @optional 0 @type float
    class_addmethod(c, (method)hoa_map_list,        "list",				A_GIMME, 0);
	class_addmethod(c, (method)hoa_map_assist,      "assist",			A_CANT, 0);
    
    CLASS_ATTR_DOUBLE           (c, "ramp", 0, t_hoa_map, f_ramp);
	CLASS_ATTR_CATEGORY			(c, "ramp", 0, "Behavior");
	CLASS_ATTR_LABEL			(c, "ramp", 0, "Ramp Time (ms)");
	CLASS_ATTR_ORDER			(c, "ramp", 0, "2");
	CLASS_ATTR_ACCESSORS		(c, "ramp", NULL, ramp_set);
	CLASS_ATTR_SAVE				(c, "ramp", 1);
	// @description The ramp time in milliseconds.
	
	class_dspinit(c);
	class_register(CLASS_BOX, c);	
	hoa_map_class = c;
	return 0;
}
Ejemplo n.º 27
0
/****************************************************************
*  Initialization
*/
void ext_main(void *r)
{
  t_class *c;

  c = class_new("strstr",
    (method)strstr_new,
    (method)strstr_free,
    (long)sizeof(t_strstr),
    (method)NULL,
    A_GIMME, 0);

  class_addmethod(c, (method)strstr_assist,   "assist",    A_CANT,  0);
  class_addmethod(c, (method)strstr_bang,     "bang",               0);
  class_addmethod(c, (method)strstr_int,      "int",       A_LONG,  0);
  class_addmethod(c, (method)strstr_float,    "float",     A_FLOAT, 0);
  class_addmethod(c, (method)strstr_list,     "list",      A_GIMME, 0);
  class_addmethod(c, (method)strstr_anything, "anything",  A_GIMME, 0);
  class_addmethod(c, (method)strstr_set,      "set",       A_GIMME, 0);
  class_addmethod(c, (method)strstr_post,     "post",               0);
  class_addmethod(c, (method)stdinletinfo,    "inletinfo", A_CANT,  0);

  CLASS_ATTR_LONG(c, "mode", 0, t_strstr, mode);
  CLASS_ATTR_ORDER(c, "mode", 0, "1");            // order
  CLASS_ATTR_LABEL(c, "mode", 0, "mode");         // label
  CLASS_ATTR_FILTER_CLIP(c, "mode", 0, 1);        // min-max filter
  CLASS_ATTR_SAVE(c, "mode", 0);                  // save with patcher
  CLASS_ATTR_SELFSAVE(c, "mode", 0);              // display as saved
  CLASS_ATTR_ACCESSORS(c, "mode", NULL, str_mode_set);

  CLASS_ATTR_LONG(c, "fprecision", 0, t_strstr, fprecision);
  CLASS_ATTR_ORDER(c, "fprecision", 0, "2");
  CLASS_ATTR_LABEL(c, "fprecision", 0, "float precision");
  CLASS_ATTR_FILTER_CLIP(c, "fprecision", 0, 10);
  CLASS_ATTR_SAVE(c, "fprecision", 0);
  CLASS_ATTR_SELFSAVE(c, "fprecision", 0);
  CLASS_ATTR_ACCESSORS(c, "fprecision", NULL, str_fprecision_set);

  class_register(CLASS_BOX, c);
  strstr_class = c;
}
Ejemplo n.º 28
0
int C74_EXPORT main(void)
{
	t_class *c;
	c = class_new("el.adsr~", (method)adsr_new, (method)dsp_free, sizeof(t_adsr), 0,A_GIMME, 0);
	
	class_addmethod(c, (method)adsr_assist,"assist",A_CANT,0);
	class_addmethod(c, (method)adsr_list, "list", A_GIMME, 0);
	class_addmethod(c, (method)adsr_mute, "mute", A_FLOAT, 0);
	class_addmethod(c, (method)adsr_set_gain2, "ft1", A_FLOAT, 0);
	class_addmethod(c, (method)adsr_set_gain1, "ft2", A_FLOAT, 0);
	class_addmethod(c, (method)adsr_set_r, "ft3", A_FLOAT, 0);
	class_addmethod(c, (method)adsr_set_s, "ft4", A_FLOAT, 0);
	class_addmethod(c, (method)adsr_set_d, "ft5", A_FLOAT, 0);
	class_addmethod(c, (method)adsr_set_a, "ft6", A_FLOAT, 0);
	class_addmethod(c, (method)adsr_bang, "bang", 0);
    class_addmethod(c, (method)adsr_dsp64, "dsp64", A_CANT,0);

		
	CLASS_ATTR_FLOAT(c, "attack", 0, t_adsr, a);
	CLASS_ATTR_DEFAULT_SAVE(c, "attack", 0, "20");
	CLASS_ATTR_ACCESSORS(c, "attack", (method)adsr_a_get, (method)adsr_a_set);
	CLASS_ATTR_LABEL(c, "attack", 0, "Attack Time");

	CLASS_ATTR_FLOAT(c, "decay", 0, t_adsr, d);
	CLASS_ATTR_DEFAULT_SAVE(c, "decay", 0, "50");
	CLASS_ATTR_ACCESSORS(c, "decay", (method)adsr_d_get, (method)adsr_d_set);
	CLASS_ATTR_LABEL(c, "decay", 0, "Decay Time");
	
	CLASS_ATTR_FLOAT(c, "sustain", 0, t_adsr, s); 
	CLASS_ATTR_DEFAULT_SAVE(c, "sustain", 0, "150");
	CLASS_ATTR_ACCESSORS(c, "sustain", (method)adsr_s_get, (method)adsr_s_set);
	CLASS_ATTR_LABEL(c, "sustain", 0, "Sustain Time");
	
	CLASS_ATTR_FLOAT(c, "release", 0, t_adsr, r);
	CLASS_ATTR_DEFAULT_SAVE(c, "release", 0, "200");
	CLASS_ATTR_ACCESSORS(c, "release", (method)adsr_r_get, (method)adsr_r_set);
	CLASS_ATTR_LABEL(c, "release", 0, "Release Time");

	CLASS_ATTR_FLOAT(c, "gain1", 0, t_adsr, egain1);
	CLASS_ATTR_DEFAULT_SAVE(c, "gain1", 0, "1.0");
	CLASS_ATTR_LABEL(c, "gain1", 0, "Gain 1");
	
	CLASS_ATTR_FLOAT(c, "gain2", 0, t_adsr, egain2);
	CLASS_ATTR_DEFAULT_SAVE(c, "gain2", 0, "0.7");
	CLASS_ATTR_LABEL(c, "gain2", 0, "Gain 2");

	CLASS_ATTR_ORDER(c, "attack",    0, "1");
	CLASS_ATTR_ORDER(c, "decay",    0, "2");
	CLASS_ATTR_ORDER(c, "sustain",    0, "3");
	CLASS_ATTR_ORDER(c, "release",    0, "4");
	CLASS_ATTR_ORDER(c, "gain1",    0, "5");
	CLASS_ATTR_ORDER(c, "gain2",    0, "6"); 
	class_dspinit(c);
	class_register(CLASS_BOX, c);
	adsr_class = c;
	
	potpourri_announce(OBJECT_NAME);
	return 0;
}
Ejemplo n.º 29
0
extern "C" void setup_c0x2escope_tilde(void)
{
    t_eclass *c;

    c = eclass_new("c.scope~", (method)scope_new, (method)scope_free, (short)sizeof(t_scope), 0L, A_GIMME, 0);

    eclass_guiinit(c, 0);
    eclass_dspinit(c);
    eclass_addmethod(c, (method) scope_dsp,             "dsp",              A_NULL, 0);
    eclass_addmethod(c, (method) scope_paint,           "paint",            A_NULL, 0);
    eclass_addmethod(c, (method) scope_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) scope_oksize,          "oksize",           A_NULL, 0);

    CLASS_ATTR_INVISIBLE            (c, "send", 1);
    CLASS_ATTR_DEFAULT              (c, "size", 0, "125 100");

    CLASS_ATTR_LONG                 (c, "bufdis", 0, t_scope, f_display_size);
    CLASS_ATTR_ORDER                (c, "bufdis", 0, "1");
    CLASS_ATTR_LABEL                (c, "bufdis", 0, "Display Buffer Size");
    CLASS_ATTR_FILTER_CLIP          (c, "bufdis", 2, 8092);
    CLASS_ATTR_DEFAULT              (c, "bufdis", 0, "256");
    CLASS_ATTR_SAVE                 (c, "bufdis", 1);
    CLASS_ATTR_STYLE                (c, "bufdis", 0, "number");

    CLASS_ATTR_LONG                 (c, "bufsig", 0, t_scope, f_signal_size);
    CLASS_ATTR_ORDER                (c, "bufsig", 0, "2");
    CLASS_ATTR_LABEL                (c, "bufsig", 0, "Signal Buffer Size");
    CLASS_ATTR_FILTER_CLIP          (c, "bufsig", 2, 8092);
    CLASS_ATTR_DEFAULT              (c, "bufsig", 0, "256");
    CLASS_ATTR_SAVE                 (c, "bufsig", 1);
    CLASS_ATTR_STYLE                (c, "bufsig", 0, "number");

    CLASS_ATTR_FLOAT_ARRAY          (c, "range", 0, t_scope, f_range, 2);
    CLASS_ATTR_ORDER                (c, "range", 0, "2");
    CLASS_ATTR_LABEL                (c, "range", 0, "Range");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "range", 0, "-1 1");

    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_scope, f_color_background);
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");

    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_scope, f_color_border);
    CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
    CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");

    CLASS_ATTR_RGBA                 (c, "sicolor", 0, t_scope, f_color_signal);
    CLASS_ATTR_LABEL                (c, "sicolor", 0, "Signal Color");
    CLASS_ATTR_ORDER                (c, "sicolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "sicolor", 0, "0. 0.6 0. 0.8");
    CLASS_ATTR_STYLE                (c, "sicolor", 0, "color");

    eclass_register(CLASS_BOX, c);
    cscope_class = c;
}
Ejemplo n.º 30
0
int C74_EXPORT main(void)
{
    
	t_class *c;
	
	c = class_new("hoa.recomposer~", (method)HoaRecomposer_new, (method)HoaRecomposer_free, (long)sizeof(t_HoaRecomposer), 0L, A_GIMME, 0);
	;

	class_addmethod(c, (method)HoaRecomposer_dsp64,			"dsp64",	A_CANT, 0);
	class_addmethod(c, (method)HoaRecomposer_assist,		"assist",	A_CANT, 0);
	class_addmethod(c, (method)HoaRecomposer_angle,         "angles",    A_GIMME,0);
    class_addmethod(c, (method)HoaRecomposer_wide,          "directivities",     A_GIMME,0);
    class_addmethod(c, (method)HoaRecomposer_float,         "float",    A_FLOAT,0);
    
    CLASS_ATTR_SYM              (c,"mode", 0, t_HoaRecomposer, f_mode);
	CLASS_ATTR_LABEL			(c,"mode", 0, "Mode");
    CLASS_ATTR_ENUM             (c,"mode", 0, "fixe fisheye free");
	CLASS_ATTR_CATEGORY			(c,"mode", 0, "Behavior");
    CLASS_ATTR_ACCESSORS		(c,"mode", NULL, HoaRecomposer_set_attr_mode);
    CLASS_ATTR_ORDER			(c,"mode", 0,  "1");
    CLASS_ATTR_SAVE             (c,"mode", 1);
    
    CLASS_ATTR_DOUBLE			(c,"ramp", 0, t_HoaRecomposer, f_ramp_time);
	CLASS_ATTR_LABEL			(c,"ramp", 0, "Ramp Time in milliseconds");
	CLASS_ATTR_CATEGORY			(c,"ramp", 0, "Behavior");
    CLASS_ATTR_ACCESSORS		(c,"ramp", NULL, HoaRecomposer_ramp);
    CLASS_ATTR_ORDER			(c,"ramp", 0,  "2");
    CLASS_ATTR_SAVE             (c,"ramp", 1);
    
	class_dspinit(c);
	class_register(CLASS_BOX, c);
	HoaRecomposer_class = c;
	
	class_findbyname(CLASS_BOX, gensym("hoa.encoder~"));
	return 0;
}