Beispiel #1
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;
}
Beispiel #2
0
void ext_main(void *r)
#endif
{
    t_class* c;
    c = class_new("hoa.in", (method)hoa_in_new, (method)hoa_in_free, sizeof(t_hoa_in), NULL, A_GIMME, 0);
    class_setname((char *)"hoa.in", (char *)"hoa.in");

    hoa_initclass(c, (method)NULL);

    class_addmethod(c, (method)hoa_in_assist,		"assist",			A_CANT, 0);
    class_addmethod(c, (method)hoa_in_bang,			"bang",				A_CANT, 0);
    class_addmethod(c, (method)hoa_in_int,			"int",				A_CANT, 0);
    class_addmethod(c, (method)hoa_in_float,		"float",			A_CANT, 0);
    class_addmethod(c, (method)hoa_in_list,			"list",				A_CANT, 0);
    class_addmethod(c, (method)hoa_in_anything,		"anything",			A_CANT, 0);

    CLASS_ATTR_LONG		(c, "extra", 0, t_hoa_in, extra);
    CLASS_ATTR_ACCESSORS(c, "extra", 0, hoa_in_setattr_extra);
    CLASS_ATTR_LABEL	(c, "extra", 0, "extra index");
    CLASS_ATTR_INVISIBLE(c, "extra", 1);
    CLASS_ATTR_SAVE		(c, "extra", 0);
    // @description Defines an extra inlet. Extra inlet are added to the "normal" instance inlet and can be used to send messages to all instances.

    CLASS_ATTR_SYM		(c, "comment", 0, t_hoa_in, comment);
    CLASS_ATTR_ACCESSORS(c, "comment", 0, hoa_in_setattr_comment);
    CLASS_ATTR_LABEL	(c, "comment", 0, "Description");
    CLASS_ATTR_SAVE		(c, "comment", 1);
    // @description Sets a description to the inlet which will be shown in the assist inlet of the <o>hoa.process~</o> that load this <o>hoa.in</o>.
    // Only works if the <m>extra</m> parameter is greater than 0.

    class_register(CLASS_BOX, c);
    hoa_in_class = c;
}
Beispiel #3
0
int main(void)
{
	t_class	*c;
	long	flags; 
	
	common_symbols_init();
	c = class_new("dbviewer", (method)dbviewer_new, (method)dbviewer_free, sizeof(t_dbviewer), (method)0L, A_GIMME, 0);
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	flags = JBOX_COLOR;
	jbox_initclass(c, flags);
	
	class_addmethod(c, (method)dbviewer_bang,				"bang",				0);			// refresh
	class_addmethod(c, (method)dbviewer_getcelltext,		"getcelltext",		A_CANT, 0);
	class_addmethod(c, (method)dbviewer_newpatcherview,		"newpatcherview",	A_CANT, 0); 
	class_addmethod(c, (method)dbviewer_freepatcherview,	"freepatcherview",	A_CANT, 0);
	class_addmethod(c, (method)dbviewer_notify,				"notify",			A_CANT,	0);
	class_addmethod(c, (method)dbviewer_assist,				"assist",			A_CANT, 0);
	class_addmethod(c, (method)stdinletinfo,				"inletinfo",		A_CANT, 0);
    class_addmethod(c, (method)object_obex_dumpout,			"dumpout",			A_CANT, 0);
	
	CLASS_ATTR_SYM(c,			"query",			ATTR_SET_DEFER,	t_dbviewer, d_query);
	CLASS_ATTR_ACCESSORS(c,		"query",			NULL, dbviewer_set_query);
	CLASS_ATTR_SAVE(c,			"query",			0);
	
	CLASS_ATTR_SYM(c,			"database",			ATTR_SET_DEFER,	t_dbviewer, d_database);
	CLASS_ATTR_ACCESSORS(c,		"database",			NULL, dbviewer_set_database);
	CLASS_ATTR_SAVE(c,			"database",			0);
	
	class_register(_sym_box, c);
	s_dbviewer_class = c;
	
	ps_dbview_update = gensym("dbview_update");
	ps_dbview_query_changed = gensym("dbview_query_changed");
	return 0;
}
Beispiel #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;
}
Beispiel #5
0
int main(void)
{
	t_class *c;

	c = class_new("hoa.connect", (method)connect_new, (method)connect_free, (short)sizeof(t_connect), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)connect_notify,				"notify",		A_CANT, 0);
	class_addmethod(c, (method)connect_bang,				"bang",			A_CANT,	0);
	
	// defaults don't work with non-UI objects (an optimization)
	CLASS_ATTR_CATEGORY(c, "poscolor", 0, "Behavior");
	CLASS_ATTR_RGBA(c, "poscolor", 0, t_connect, f_colorPositiv);
	CLASS_ATTR_ACCESSORS(c, "poscolor", NULL, connect_setattr_poscolor);
	CLASS_ATTR_SAVE(c, "poscolor", 1);
	
	CLASS_ATTR_CATEGORY(c, "negcolor", 0, "Behavior");
	CLASS_ATTR_RGBA(c, "negcolor", 0, t_connect, f_colorNegativ);
	CLASS_ATTR_ACCESSORS(c, "negcolor", NULL, connect_setattr_negcolor);
	CLASS_ATTR_SAVE(c, "poscolor", 1);
	
	CLASS_ATTR_CATEGORY(c, "planecolor", 0, "Behavior");
	CLASS_ATTR_RGBA(c, "planecolor", 0, t_connect, f_colorPlane);
	CLASS_ATTR_ACCESSORS(c, "planecolor", NULL, connect_setattr_planecolor);
	CLASS_ATTR_SAVE(c, "poscolor", 1);
	
	class_register(CLASS_BOX, c);
	connect_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
}
Beispiel #6
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;
}
Beispiel #7
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;
}
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;
}
Beispiel #9
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;
}
Beispiel #10
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;
}
Beispiel #11
0
int C74_EXPORT main(void)
#endif
{
    t_class* c;
    c = class_new("hoa.out", (method)hoa_out_new, (method)hoa_out_free, sizeof(t_hoa_out), NULL, A_GIMME, 0);
    class_setname((char *)"hoa.out", (char *)"hoa.out");
    
    hoa_initclass(c, (method)NULL);
    class_addmethod(c, (method)hoa_out_assist,			"assist",			A_CANT,	 0);
    
    // @method bang @digest output bang message in the corresponding hoa.process~ object's message outlet
    // @description The <m>bang</m> output bang message in the corresponding hoa.process~ object's message outlet
    class_addmethod(c, (method)hoa_out_bang,			"bang",						 0);
    
    // @method int @digest output int message in the corresponding hoa.process~ object's message outlet
    // @description The <m>int</m> output int message in the corresponding hoa.process~ object's message outlet
    // @marg 0 @name number @optional 0 @type int
    class_addmethod(c, (method)hoa_out_int,				"int",				A_LONG,	 0);
    
    // @method float @digest output int message in the corresponding hoa.process~ object's message outlet
    // @description The <m>float</m> output int message in the corresponding hoa.process~ object's message outlet
    // @marg 0 @name number @optional 0 @type float
    class_addmethod(c, (method)hoa_out_float,			"float",			A_FLOAT, 0);
    
    // @method list @digest output a list in the corresponding hoa.process~ object's message outlet
    // @description The <m>list</m> output a list in the corresponding hoa.process~ object's message outlet
    // @marg 0 @name va-args @optional 0 @type list
    class_addmethod(c, (method)hoa_out_list,			"list",				A_GIMME, 0);
    
    // @method anything @digest output a message in the corresponding hoa.process~ object's message outlet
    // @description The <m>list</m> output a message in the corresponding hoa.process~ object's message outlet
    // @marg 0 @name anything @optional 0 @type symbol
    class_addmethod(c, (method)hoa_out_anything,		"anything",			A_GIMME, 0);
    
    CLASS_ATTR_LONG		(c, "extra", 0, t_hoa_out, extra);
    CLASS_ATTR_ACCESSORS(c, "extra", 0, hoa_out_setattr_extra);
    CLASS_ATTR_LABEL	(c, "extra", 0, "extra index");
    CLASS_ATTR_INVISIBLE(c, "extra", 1);
    CLASS_ATTR_SAVE		(c, "extra", 0);
    // @description Defines an extra outlet. Extra outlet are added to the "normal" instance outlet and can be used to receive messages from all instances.
    
    CLASS_ATTR_SYM		(c, "comment", 0, t_hoa_out, comment);
    CLASS_ATTR_ACCESSORS(c, "comment", 0, hoa_out_setattr_comment);
    CLASS_ATTR_LABEL	(c, "comment", 0, "Description");
    CLASS_ATTR_SAVE		(c, "comment", 1);
    // @description Sets a description to the outlet which will be shown in the assist outlet of the <o>hoa.process~</o> that load this <o>hoa.out</o>.
    // Only works if the <m>extra</m> parameter is greater than 0.
    
    class_register(CLASS_BOX, c);
    hoa_out_class = c;
    return 0;
}
Beispiel #12
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;
}
Beispiel #13
0
int C74_EXPORT main(void)
{
	t_class* c;
	c = class_new("hoa.in~", (method)hoa_sig_in_new, (method)hoa_sig_in_free, sizeof(t_hoa_sig_in), NULL, A_GIMME, 0);
    
	hoa_initclass(c, NULL);
	
	class_addmethod(c, (method)hoa_sig_in_dsp64,	"dsp64",	A_CANT, 0);
    class_addmethod(c, (method)hoa_sig_in_assist,	"assist",	A_CANT, 0);
	class_addmethod(c, (method)hoa_sig_in_int,		"int",		A_LONG, 0);
	
	CLASS_ATTR_LONG		(c, "extra", 0, t_hoa_sig_in, extra);
	CLASS_ATTR_ACCESSORS(c, "extra", 0, hoa_sig_in_setattr_extra);
	CLASS_ATTR_LABEL	(c, "extra", 0, "param index");
	
	CLASS_ATTR_SYM		(c, "comment", 0, t_hoa_sig_in, comment);
	CLASS_ATTR_ACCESSORS(c, "comment", 0, hoa_sig_in_setattr_comment);
	CLASS_ATTR_LABEL	(c, "comment", 0, "Description");
	CLASS_ATTR_SAVE		(c, "comment", 1);
    
	class_dspinit(c);
	class_register(CLASS_BOX, c);
	hoa_sig_in_class = c;
	return 0;
}
Beispiel #14
0
void C74_EXPORT ext_main(void *r)
{
  t_class *c;
  
  c = class_new("dict.recurse", (method)dict_recurse_new, (method)dict_recurse_free, 
      (long)sizeof(t_dict_recurse), (method)NULL, A_GIMME, 0);
  
  // Methods
  class_addmethod(c, (method)dict_recurse_assist, "assist", A_CANT, 0);  

  class_addmethod(c, (method)dict_recurse_all, "all", A_SYM, 0);
  class_addmethod(c, (method)dict_recurse_find, "find", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_replace, "replace", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_append, "append", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_delete, "delete", A_GIMME, 0);

  class_addmethod(c, (method)dict_recurse_bang, "bang", 0);
  class_addmethod(c, (method)dict_recurse_set, "set", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_get, "get", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_anything, "anything", A_GIMME, 0);  

  class_addmethod(c, (method)dict_re_compile, "compile", A_GIMME, 0);
  class_addmethod(c, (method)dict_re_simulate, "simulate", A_GIMME, 0);
  class_addmethod(c, (method)dict_re_states, "states", 0);

  // Attributes
  CLASS_ATTR_CHAR(c, "verbose", 0, t_dict_recurse, a_verbose);
  CLASS_ATTR_STYLE(c, "verbose", 0, "onoff");
  CLASS_ATTR_SAVE(c, "verbose", 0);

  class_register(CLASS_BOX, c);
  dict_recurse_class = c;
}
Beispiel #15
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;
}
int C74_EXPORT main(void)
#endif
{
    t_class* c;
    c = class_new("hoa.out~", (method) hoa_sig_out_new, (method)hoa_sig_out_free, sizeof(t_hoa_sig_out), NULL, A_GIMME, 0);
    class_setname((char *)"hoa.out~", (char *)"hoa.out~");
    
    hoa_initclass(c, (method)NULL);
    
    // @method signal @digest output signal in the corresponding hoa.process~ object's signal outlet
    // @description output signal in the corresponding hoa.process~ object's signal outlet
    class_addmethod(c, (method)hoa_sig_out_dsp64, "dsp64", A_CANT, 0);
    class_addmethod(c, (method)hoa_sig_out_assist, "assist", A_CANT, 0);
    
    CLASS_ATTR_LONG		(c, "extra", 0, t_hoa_sig_out, extra);
    CLASS_ATTR_ACCESSORS(c, "extra", 0, hoa_sig_in_setattr_extra);
    CLASS_ATTR_LABEL	(c, "extra", 0, "extra index");
    // @description Defines an extra outlet. Extra outlet are added to the "normal" instance outlet and can be used to receive signal from all instances.
    
    CLASS_ATTR_SYM		(c, "comment", 0, t_hoa_sig_out, comment);
    CLASS_ATTR_ACCESSORS(c, "comment", 0, hoa_sig_in_setattr_comment);
    CLASS_ATTR_LABEL	(c, "comment", 0, "Description");
    CLASS_ATTR_SAVE		(c, "comment", 1);
    // @description Sets a description to the outlet which will be shown in the assist outlet of the <o>hoa.process~</o> that load this <o>hoa.out~</o>.
    // Only works if the <m>extra</m> parameter is greater than 0.
    
    class_dspinit(c);
    class_register(CLASS_BOX, c);
    hoa_sig_out_class = c;
    return 0;
}
Beispiel #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;
}
Beispiel #18
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;
}
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");
}
Beispiel #20
0
int C74_EXPORT main(void)
{
	t_class *c = class_new("j.meter~", (method)meter_new, (method)meter_free, sizeof(t_meter), (method)NULL, A_GIMME, 0L);
	
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY; // use dictionary constructor
	jbox_initclass(c, 0);
	class_dspinitjbox(c);

//	jamoma_init();
	common_symbols_init();
	
	class_addmethod(c, (method)meter_bang,		"bang",			0);
	class_addmethod(c, (method)meter_int,		"int",			A_LONG, 0);
	class_addmethod(c, (method)meter_float,		"float",		A_FLOAT, 0);
	class_addmethod(c, (method)meter_set,    	"set",			A_FLOAT, 0);
	class_addmethod(c, (method)meter_dsp,		"dsp",			A_CANT, 0);
	class_addmethod(c, (method)meter_dsp64,		"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)meter_paint,		"paint",		A_CANT, 0);
	class_addmethod(c, (method)meter_oksize,	"oksize",		A_CANT, 0);
	class_addmethod(c, (method)meter_bang,		"mousedown",	A_CANT, 0);
	class_addmethod(c, (method)meter_notify,	"notify",		A_CANT, 0);
	class_addmethod(c, (method)meter_assist,	"assist",		A_CANT, 0);
	
//	CLASS_ATTR_FLOAT(c,					"interval",			0,	t_meter, attrInterval);
//	CLASS_ATTR_FILTER_CLIP(c,			"interval",			kPollIntervalMinimum, kPollIntervalMaximum);
//	CLASS_ATTR_DEFAULT_SAVE(c,			"interval",			0,	"150");
//	CLASS_ATTR_LABEL(c,					"interval",			0,	"Refresh Interval in Milliseconds");
		
//	CLASS_ATTR_RGBA(c,					"bordercolor",		0,	t_meter, attrBorderColor);
//	CLASS_ATTR_STYLE_LABEL(c,			"bordercolor",		0,	"rgba",	"Border Color");
//	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,	"bordercolor",		0,	"0.2 0.2 0.2 1.");

	CLASS_ATTR_LONG(c,						"orientation",	0, t_meter, attrOrientation);
	CLASS_ATTR_LABEL(c,						"orientation",	0, "Orientation");
	CLASS_ATTR_CATEGORY(c,					"orientation",	0,"Appearance");
	CLASS_ATTR_ENUMINDEX(c,					"orientation",	0, "Automatic Horizontal Vertical");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,		"orientation",	0,"0");
	
	CLASS_ATTR_RGBA(c,						"bgcolor",		0,	t_meter,	attrBgColor);
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c,	"bgcolor",		0,	"0.1 0.1 0.1 1.0");
	CLASS_ATTR_STYLE(c,						"bgcolor",		0,	"rgba");
	CLASS_ATTR_LABEL(c,						"bgcolor",		0,	"Background Color");
	
	CLASS_ATTR_LONG(c,						"defeat",	0, t_meter, attrDefeat);
	CLASS_ATTR_LABEL(c,						"defeat",	0, "defeat");	
	CLASS_ATTR_DEFAULT(c,					"defeat",	0,	"0");
	CLASS_ATTR_SAVE(c,						"defeat",	0);
	CLASS_ATTR_STYLE(c,						"defeat",	0,	"onoff");	
	CLASS_ATTR_CATEGORY(c,					"defeat",	0,"Behavior");
	
	CLASS_ATTR_DEFAULT(c,				"patching_rect",	0,	"0. 0. 100. 12.");
	CLASS_ATTR_MIN(c,					"patching_size",	0,	"1. 1.");

//	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,	"bgcolor",			0,	"0.1 0.1 0.1 1.0");
	
	class_register(CLASS_BOX, c);
	s_meter_class = c;		
	return 0;
}
Beispiel #21
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;
}
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;
}
Beispiel #23
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;
}
Beispiel #24
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;
}
Beispiel #25
0
int C74_EXPORT main(void)
{	
	t_class *c;
		
	c = class_new("uisimp", (method)uisimp_new, (method)uisimp_free, sizeof(t_uisimp), 0L, A_GIMME, 0);

	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	jbox_initclass(c, JBOX_FIXWIDTH | JBOX_COLOR);

	class_addmethod(c, (method)uisimp_paint,		"paint",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mousedown,	"mousedown",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mousedrag,	"mousedrag",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mouseup,		"mouseup",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mouseenter,	"mouseenter",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mouseleave,	"mouseleave",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mousemove,	"mousemove",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_assist,		"assist",	A_CANT, 0);  
	
	// messages for state setting / retrieval
	
	class_addmethod(c, (method)uisimp_int,			"int",	A_LONG, 0);
	class_addmethod(c, (method)uisimp_bang,			"bang", 0);
	
	// attributes
	
	CLASS_ATTR_CHAR(c, "trackmouse", 0, t_uisimp, u_trackmouse);
	CLASS_ATTR_STYLE_LABEL(c, "trackmouse", 0, "onoff", "Track Mouse");
	CLASS_ATTR_SAVE(c, "trackmouse", 0);
	CLASS_ATTR_CATEGORY(c, "trackmouse", 0, "Behavior");
	
	CLASS_STICKY_ATTR(c, "category", 0, "Color");
	CLASS_ATTR_RGBA(c, "bgcolor", 0, t_uisimp, u_background); 
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "bgcolor", 0, "1. 1. 1. 1."); 
	CLASS_ATTR_STYLE_LABEL(c,"bgcolor",0,"rgba","Background Color");
	
	CLASS_ATTR_RGBA(c, "bordercolor", 0, t_uisimp, u_outline); 
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "bordercolor", 0, "0.5 0.5 0.5 1."); 
	CLASS_ATTR_STYLE_LABEL(c,"bordercolor",0,"rgba","Border Color");
	
	CLASS_ATTR_RGBA(c, "hilitecolor", 0, t_uisimp, u_hilite); 
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "hilitecolor", 0, "0.5 0.5 0.5 1."); 
	CLASS_ATTR_STYLE_LABEL(c,"hilitecolor",0,"rgba","Hilite Color");

    // color uses the color declared in t_jbox.b_color
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "color", 0, "0. 0. 0. 1."); 
	CLASS_ATTR_STYLE_LABEL(c,"color",0,"rgba","Check Color");
	
	CLASS_STICKY_ATTR_CLEAR(c, "category");
	
	
	CLASS_ATTR_DEFAULT(c,"patching_rect",0, "0. 0. 20. 20.");
	
	class_register(CLASS_BOX, c);
	s_uisimp_class = c;

	return 0;
}
Beispiel #26
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;
}
Beispiel #27
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;
}
Beispiel #28
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;
}
Beispiel #29
0
int C74_EXPORT main(void)
{
	t_class *c;

	c = class_new("hoa.connect", (method)connect_new, (method)connect_free, sizeof(t_connect), 0L, A_GIMME, 0);
	
	hoa_initclass(c, (method)NULL);
	
	class_addmethod(c, (method)connect_notify,	"notify",	A_CANT, 0);
	class_addmethod(c, (method)connect_bang,	"bang",		A_CANT,	0);
    class_addmethod(c, (method)connect_assist,	"assist",	A_CANT,	0);
	
	CLASS_STICKY_ATTR		(c, "category", 0, "Behavior");
	CLASS_ATTR_RGBA			(c, "zhcolor", 0, t_connect, f_color_zero);
	CLASS_ATTR_ACCESSORS	(c, "zhcolor", NULL, connect_setattr_zerocolor);
	CLASS_ATTR_SAVE			(c, "zhcolor", 1);
	CLASS_ATTR_STYLE_LABEL	(c, "zhcolor", 0, "rgba", "zero harmonics color");
	
	CLASS_ATTR_RGBA			(c, "phcolor", 0, t_connect, f_color_positiv);
	CLASS_ATTR_ACCESSORS	(c, "phcolor", NULL, connect_setattr_poscolor);
	CLASS_ATTR_SAVE			(c, "phcolor", 1);
	CLASS_ATTR_STYLE_LABEL	(c, "phcolor", 0, "rgba", "positive harmonics color");
    
	CLASS_ATTR_RGBA			(c, "nhcolor", 0, t_connect, f_color_negativ);
	CLASS_ATTR_ACCESSORS	(c, "nhcolor", NULL, connect_setattr_negcolor);
	CLASS_ATTR_SAVE			(c, "nhcolor", 1);
	CLASS_ATTR_STYLE_LABEL	(c, "nhcolor", 0, "rgba", "negative harmonics color");
	
	CLASS_ATTR_RGBA			(c, "planecolor", 0, t_connect, f_color_plane);
	CLASS_ATTR_ACCESSORS	(c, "planecolor", NULL, connect_setattr_planecolor);
	CLASS_ATTR_STYLE_LABEL	(c, "planecolor", 0, "rgba", "planewaves signals color");
	CLASS_ATTR_SAVE			(c, "planecolor", 1);
    
	CLASS_STICKY_ATTR_CLEAR	(c, "category");
	
	class_register(CLASS_BOX, c);
	connect_class = c;
	hoa_print_credit();
	return 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;
}