Ejemplo n.º 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;
}
Ejemplo n.º 2
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~"));
}
Ejemplo n.º 3
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;
}
Ejemplo n.º 4
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.º 5
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.º 6
0
int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("uisimp4", 
							(method)uisimp_new,
							(method)uisimp_free,
							sizeof(t_uisimp),
							(method)NULL,
							A_GIMME,
							0L);
	
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH | JBOX_FONTATTR);
	
	class_addmethod(c, (method) uisimp_paint, "paint", A_CANT, 0);
	class_addmethod(c, (method) uisimp_int, "int", A_LONG, 0);
	
	class_addmethod(c, (method) uisimp_mousedown, "mousedown", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mousedragdelta, "mousedragdelta", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mouseup, "mouseup", A_CANT, 0);

	class_addmethod(c, (method) uisimp_assist, "assist", A_CANT, 0);
	class_addmethod(c, (method) jbox_notify, "notify", A_CANT, 0);

	CLASS_ATTR_DEFAULT(c, "patching_rect", 0, "0 0 60 60");
	CLASS_ATTR_DEFAULT(c, "color", 0, "0.8 0.5 0.2 1");
	
	CLASS_ATTR_LONG(c,"inset",0, t_uisimp, j_inset);
	CLASS_ATTR_LABEL(c,"inset",0,"Filled Area Inset");
	CLASS_ATTR_CATEGORY(c,"inset",0,"Tweaks");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,"inset",0,"3");
	
	CLASS_ATTR_CHAR(c,"reset",0, t_uisimp, j_reset);
	CLASS_ATTR_STYLE_LABEL(c,"reset",0,"onoff","Reset Counter on Click");
	CLASS_ATTR_CATEGORY(c,"reset",0,"Tweaks");
	CLASS_ATTR_DEFAULT_SAVE(c,"reset",0,"1");
	
	CLASS_ATTR_LONG(c,"shape",0, t_uisimp, j_shape);
	CLASS_ATTR_LABEL(c,"shape", 0, "Fill Shape");
	CLASS_ATTR_CATEGORY(c,"shape",0,"Shape");
	CLASS_ATTR_ENUMINDEX(c,"shape", 0, "Square Circle Angle");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,"shape",0,"0");
	
	s_uisimp_class = c;
	class_register(CLASS_BOX, s_uisimp_class);
	return 0;
}
Ejemplo n.º 7
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.º 8
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.º 9
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.º 10
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.º 11
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;
}
Ejemplo n.º 12
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.º 13
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.º 14
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_float,		"float",	A_FLOAT, 0);
	class_addmethod(c, (method)HoaConvolve_int,			"int",		A_LONG, 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_ATTR_SYM              (c, "buffers", 0, t_HoaConvolve, f_name);
	CLASS_ATTR_CATEGORY			(c, "buffers", 0, "Behavior");
	CLASS_ATTR_LABEL			(c, "buffers", 0, "buffer~ Object Name");
	CLASS_ATTR_ORDER			(c, "buffers", 0, "1");
	CLASS_ATTR_ACCESSORS		(c, "buffers", NULL, buffer_set);
	CLASS_ATTR_DEFAULT			(c, "buffers", 0, "");
	CLASS_ATTR_SAVE				(c, "buffers", 1);

	CLASS_ATTR_LONG             (c, "channels", 0, t_HoaConvolve, f_channel);
	CLASS_ATTR_CATEGORY			(c, "channels", 0, "Behavior");
	CLASS_ATTR_LABEL			(c, "channels", 0, "buffer~ Object Channel");
	CLASS_ATTR_ORDER			(c, "channels", 0, "2");
	CLASS_ATTR_ACCESSORS		(c, "channels", NULL, channel_set);
	CLASS_ATTR_DEFAULT			(c, "channels", 0, "1");
	CLASS_ATTR_SAVE				(c, "channels", 1);

	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	HoaConvolve_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}
Ejemplo n.º 15
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;
}
Ejemplo n.º 16
0
t_jit_err jit_alphablend_init(void)
{
	long attrflags=0;
	t_jit_object *attr,*mop,*o;
	t_symbol *atsym;
	t_atom a[3];

	atsym = gensym("jit_attr_offset");

	_jit_alphablend_class = jit_class_new("jit_alphablend",(method)jit_alphablend_new,(method)jit_alphablend_free,
										  sizeof(t_jit_alphablend),0L);

	//add mop
	mop = jit_object_new(_jit_sym_jit_mop,2,1);
//	jit_mop_single_planecount(mop,4);
	jit_atom_setsym(a,_jit_sym_char);
	jit_atom_setsym(a+1,_jit_sym_float32);
	jit_atom_setsym(a+2,_jit_sym_float64);
	o = jit_object_method(mop,_jit_sym_getinput,2);
	jit_object_method(o,_jit_sym_types,3,a);
	o = jit_object_method(mop,_jit_sym_getoutput,1);
	jit_object_method(o,_jit_sym_types,3,a);

	jit_class_addadornment(_jit_alphablend_class,mop);
	//add methods
	jit_class_addmethod(_jit_alphablend_class, (method)jit_alphablend_matrix_calc, 		"matrix_calc", 		A_CANT, 0L);

	//add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(atsym,"mode",_jit_sym_long,attrflags,
						  (method)0L,(method)0L,calcoffset(t_jit_alphablend,mode));
	jit_class_addattr(_jit_alphablend_class,attr);
	CLASS_ATTR_BASIC(_jit_alphablend_class,"mode",0);
	CLASS_ATTR_LABEL(_jit_alphablend_class,"mode",0,"Crossfade Mode");
	CLASS_ATTR_ENUMINDEX2(_jit_alphablend_class, "mode", 0, "Left-to-Right", "Right-to-Left");
	CLASS_ATTR_CATEGORY(_jit_alphablend_class, "mode", 0, "Mode");

	jit_class_register(_jit_alphablend_class);

	return JIT_ERR_NONE;
}
Ejemplo n.º 17
0
int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("uisimp3", 
							(method)uisimp_new,
							(method)uisimp_free,
							sizeof(t_uisimp),
							(method)NULL,
							A_GIMME,
							0L);
	
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH | JBOX_FONTATTR);
	
	class_addmethod(c, (method) uisimp_paint, "paint", A_CANT, 0);
	class_addmethod(c, (method) uisimp_int, "int", A_LONG, 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_mousewheel, "mousewheel", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mouseup, "mouseup", A_CANT, 0);
	class_addmethod(c, (method) uisimp_getdrawparams, "getdrawparams", A_CANT, 0);

	class_addmethod(c, (method) uisimp_assist, "assist", A_CANT, 0);
	class_addmethod(c, (method) jbox_notify, "notify", A_CANT, 0);

	CLASS_ATTR_DEFAULT(c, "patching_rect", 0, "0 0 50 50");
	CLASS_ATTR_DEFAULT(c, "color", 0, "0.8 0.5 0.2 1");
	
	CLASS_ATTR_CHAR(c,"reset",0, t_uisimp, j_reset);
	CLASS_ATTR_STYLE_LABEL(c,"reset",0,"onoff","Reset Counter on Click");
	CLASS_ATTR_CATEGORY(c,"reset",0,"Tweaks");
	CLASS_ATTR_DEFAULT_SAVE(c,"reset",0,"1");
	
	s_uisimp_class = c;
	class_register(CLASS_BOX, s_uisimp_class);
	return 0;
}
Ejemplo n.º 18
0
extern "C" void setup_hoa0x2e3d0x2emap_tilde(void)
{
    t_eclass* c;
    
    c = eclass_new("hoa.3d.map~", (method)hoa_map_3D_tilde_new, (method)hoa_map_3D_tilde_free, (short)sizeof(t_hoa_map_3D_tilde), CLASS_NOINLET, A_GIMME, 0);
    
	eclass_dspinit(c);
    hoa_initclass(c, (method)hoa_getinfos);
	eclass_addmethod(c, (method)hoa_map_3D_tilde_dsp,          "dsp",      A_CANT, 0);
    eclass_addmethod(c, (method)hoa_map_3D_tilde_list,         "list",     A_GIMME, 0);
    eclass_addmethod(c, (method)hoa_map_3D_tilde_float,        "float",    A_FLOAT, 0);
    
    CLASS_ATTR_DOUBLE           (c, "ramp", 0, t_hoa_map_3D_tilde, 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);
    
    eclass_register(CLASS_OBJ, c);
    hoa_map_3D_tilde_class = c;
}
Ejemplo n.º 19
0
extern "C" void setup_hoa0x2escope_tilde(void)
{
	t_eclass *c;

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

	class_dspinitjbox(c);
    
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH);

	class_addmethod(c, (method)scope_dsp,			"dsp",          A_CANT, 0);
	class_addmethod(c, (method)scope_assist,		"assist",		A_CANT,	0);
	class_addmethod(c, (method)scope_paint,			"paint",		A_CANT,	0);
	class_addmethod(c, (method)scope_notify,		"notify",		A_CANT, 0);
	class_addmethod(c, (method)scope_getdrawparams, "getdrawparams", A_CANT, 0);
	class_addmethod(c, (method)scope_oksize,		"oksize",		A_CANT, 0);

	CLASS_ATTR_DEFAULT			(c, "size", 0, "225 225");

    CLASS_ATTR_LONG             (c, "order", 0, t_scope, f_order);
    CLASS_ATTR_ACCESSORS        (c, "order", (method)NULL,(method)scope_setattr_order);
	CLASS_ATTR_CATEGORY			(c, "order", 0, "Behavior");
	CLASS_ATTR_ORDER			(c, "order", 0, "1");
	CLASS_ATTR_LABEL			(c, "order", 0, "Ambisonic Order");
	CLASS_ATTR_FILTER_MIN		(c, "order", 1);
	CLASS_ATTR_DEFAULT			(c, "order", 0, "3");
	CLASS_ATTR_SAVE				(c, "order", 1);
    
    CLASS_ATTR_FLOAT            (c, "gain", 0, t_scope, f_normalize);
	CLASS_ATTR_CATEGORY			(c, "gain", 0, "Behavior");
	CLASS_ATTR_ORDER			(c, "gain", 0, "2");
	CLASS_ATTR_LABEL			(c, "gain", 0, "Gain factor");
	CLASS_ATTR_FILTER_MIN		(c, "gain", 1.);
	CLASS_ATTR_DEFAULT			(c, "gain", 0, "1.");
	CLASS_ATTR_SAVE				(c, "gain", 1);

	CLASS_ATTR_LONG             (c, "interval", 0, t_scope, f_interval);
	CLASS_ATTR_CATEGORY			(c, "interval", 0, "Behavior");
	CLASS_ATTR_ORDER			(c, "interval", 0, "3");
	CLASS_ATTR_LABEL			(c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN		(c, "interval", 20);
	CLASS_ATTR_DEFAULT			(c, "interval", 0, "100");
	CLASS_ATTR_SAVE				(c, "interval", 1);
    
    CLASS_ATTR_LONG             (c, "drawcircle", 0, t_scope, f_drawCircle);
	CLASS_ATTR_CATEGORY			(c, "drawcircle", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcircle", 0, "1");
	CLASS_ATTR_STYLE            (c, "drawcircle", 0, "onoff");
    CLASS_ATTR_LABEL			(c, "drawcircle", 0, "Draw Circle");
	CLASS_ATTR_DEFAULT			(c, "drawcircle", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcircle", 1);
    
    CLASS_ATTR_LONG             (c, "drawangles", 0, t_scope, f_drawAngles);
	CLASS_ATTR_CATEGORY			(c, "drawangles", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawangles", 0, "2");
    CLASS_ATTR_STYLE            (c, "drawangles", 0, "onoff");
    CLASS_ATTR_LABEL			(c, "drawangles", 0, "Draw Angles");
	CLASS_ATTR_DEFAULT			(c, "drawangles", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawangles", 1);
    
    CLASS_ATTR_LONG             (c, "drawcontrib", 0, t_scope, f_drawContributions);
	CLASS_ATTR_CATEGORY			(c, "drawcontrib", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcontrib", 0, "3");
    CLASS_ATTR_STYLE            (c, "drawcontrib", 0, "onoff");
    CLASS_ATTR_LABEL			(c, "drawcontrib", 0, "Draw Contributions");
	CLASS_ATTR_DEFAULT			(c, "drawcontrib", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcontrib", 1);
	
	CLASS_ATTR_INVISIBLE		(c, "color", 0);
	CLASS_ATTR_INVISIBLE		(c, "textcolor", 0);
	
	CLASS_ATTR_RGBA				(c, "bgcolor", 0, t_scope, f_colorBackground);
	CLASS_ATTR_CATEGORY			(c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER			(c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "bgcolor", 0, "0.76 0.76 0.76 1.");
    
    CLASS_ATTR_RGBA				(c, "bdcolor", 0, t_scope, f_bordercolor);
	CLASS_ATTR_CATEGORY			(c, "bdcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "bdcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER			(c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "bdcolor", 0, "0.7 0.7 0.7 1.");
	
	CLASS_ATTR_RGBA				(c, "txcolor", 0, t_scope, f_colorText);
	CLASS_ATTR_CATEGORY			(c, "txcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "txcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "txcolor", 0, "Text Color");
	CLASS_ATTR_ORDER			(c, "txcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "txcolor", 0, "0. 0. 0. 7.");
	
	CLASS_ATTR_RGBA				(c, "phcolor", 0, t_scope, f_colorPositif);
	CLASS_ATTR_CATEGORY			(c, "phcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "phcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "phcolor", 0, "Positifs Harmonics");
	CLASS_ATTR_ORDER			(c, "phcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "phcolor", 0, "1. 0. 0. 1.");
	
	CLASS_ATTR_RGBA				(c, "nhcolor", 0, t_scope, f_colorNegatif);
	CLASS_ATTR_CATEGORY			(c, "nhcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "nhcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "nhcolor", 0, "Negatifs Harmonics");
	CLASS_ATTR_ORDER			(c, "nhcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "nhcolor", 0, "0. 0. 1. 1.");
	
    class_register(CLASS_NOBOX, c);
	scope_class = c;
	
}
Ejemplo n.º 20
0
int main(void)
{	
	t_class *c;
	
	c = class_new("hoa.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_FLOAT			(c, "dry", 0, t_freeverb, f_dry);
	CLASS_ATTR_CATEGORY			(c, "dry", 0, "Parameters");
	CLASS_ATTR_LABEL			(c, "dry", 0, "Dry value");
	CLASS_ATTR_ORDER			(c, "dry", 0, "3");
	CLASS_ATTR_ACCESSORS		(c, "dry", NULL, dry_set);
	CLASS_ATTR_DEFAULT			(c, "dry", 0, "0.");
	CLASS_ATTR_FILTER_MIN		(c, "dry", 0);
	CLASS_ATTR_SAVE				(c, "dry", 1);
    
    CLASS_ATTR_FLOAT			(c, "wet", 0, t_freeverb, f_wet);
	CLASS_ATTR_CATEGORY			(c, "wet", 0, "Parameters");
	CLASS_ATTR_LABEL			(c, "wet", 0, "Wet value");
	CLASS_ATTR_ORDER			(c, "wet", 0, "4");
	CLASS_ATTR_ACCESSORS		(c, "wet", NULL, wet_set);
	CLASS_ATTR_DEFAULT			(c, "wet", 0, "1.");
	CLASS_ATTR_FILTER_MIN		(c, "wet", 0);
	CLASS_ATTR_SAVE				(c, "wet", 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;
    
    class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	
	return 0;
}
Ejemplo n.º 21
0
extern "C" void setup_hoa0x2e2d0x2emeter_tilde(void)
{
	t_eclass *c;
    
	c = eclass_new("hoa.2d.meter~", (method)hoa_meter_new, (method)hoa_meter_free, (short)sizeof(t_hoa_meter), 0L, A_GIMME, 0);
    class_addcreator((t_newmethod)hoa_meter_new, gensym("hoa.meter~"), A_GIMME, 0);
    
	eclass_dspinit(c);
	eclass_init(c, 0);
	hoa_initclass(c, (method)hoa_getinfos);
	eclass_addmethod(c, (method) hoa_meter_dsp,             "dsp",           A_CANT, 0);
	eclass_addmethod(c, (method) hoa_meter_assist,          "assist",		 A_CANT, 0);
	eclass_addmethod(c, (method) hoa_meter_paint,           "paint",		 A_CANT, 0);
	eclass_addmethod(c, (method) hoa_meter_notify,          "notify",        A_CANT, 0);
    eclass_addmethod(c, (method) hoa_meter_getdrawparams,   "getdrawparams", A_CANT, 0);
    eclass_addmethod(c, (method) hoa_meter_oksize,          "oksize",        A_CANT, 0);
    
    eclass_addmethod(c, (method)hoa_meter_deprecated,   "loudspeakers",	A_GIMME, 0);
    eclass_addmethod(c, (method)hoa_meter_deprecated,   "bordercolor",	A_GIMME, 0);
    eclass_addmethod(c, (method)hoa_meter_deprecated,   "mbgcolor",     A_GIMME, 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, "225. 225.");
	
    CLASS_ATTR_LONG                 (c, "channels", 0 , t_hoa_meter, f_attrs);
    CLASS_ATTR_ACCESSORS            (c, "channels", channels_get, channels_set);
	CLASS_ATTR_ORDER                (c, "channels", 0, "1");
	CLASS_ATTR_LABEL                (c, "channels", 0, "Number of Channels");
	CLASS_ATTR_SAVE                 (c, "channels", 1);
    CLASS_ATTR_DEFAULT              (c, "channels", 0, "8");
    CLASS_ATTR_STYLE                (c, "channels", 1, "number");
    
    CLASS_ATTR_FLOAT_VARSIZE        (c, "angles", 0, t_hoa_meter, f_attrs, f_attrs, MAX_SPEAKER);
	CLASS_ATTR_ACCESSORS            (c, "angles", angles_get, angles_set);
	CLASS_ATTR_ORDER                (c, "angles", 0, "2");
	CLASS_ATTR_LABEL                (c, "angles", 0, "Angles of Channels");
	CLASS_ATTR_SAVE                 (c, "angles", 1);
    CLASS_ATTR_DEFAULT              (c, "angles", 0, "0 45 90 135 180 225 270 315");
    
    CLASS_ATTR_FLOAT                (c, "offset", 0, t_hoa_meter, f_attrs);
    CLASS_ATTR_ACCESSORS            (c, "offset", offset_get, offset_set);
	CLASS_ATTR_ORDER                (c, "offset", 0, "3");
	CLASS_ATTR_LABEL                (c, "offset", 0, "Offset of Channels");
	CLASS_ATTR_DEFAULT              (c, "offset", 0, "0");
	CLASS_ATTR_SAVE                 (c, "offset", 1);
    CLASS_ATTR_STYLE                (c, "offset", 1, "number");
    
    CLASS_ATTR_SYMBOL               (c, "rotation", 0, t_hoa_meter, f_clockwise);
    CLASS_ATTR_ACCESSORS            (c, "rotation", NULL, rotation_set);
    CLASS_ATTR_ORDER                (c, "rotation", 0, "4");
	CLASS_ATTR_LABEL                (c, "rotation", 0, "Rotation of Channels");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "rotation", 0, "0");
    CLASS_ATTR_STYLE                (c, "rotation", 1, "menu");
    CLASS_ATTR_ITEMS                (c, "rotation", 1, "anti-clockwise clockwise");
    
	CLASS_ATTR_SYMBOL               (c, "vectors", 0, t_hoa_meter, f_vector_type);
    CLASS_ATTR_ACCESSORS            (c, "vectors", NULL, vectors_set);
	CLASS_ATTR_ORDER                (c, "vectors", 0, "2");
    CLASS_ATTR_LABEL                (c, "vectors", 0, "Vectors");
	CLASS_ATTR_DEFAULT              (c, "vectors", 0, "Energy");
	CLASS_ATTR_SAVE                 (c, "vectors", 1);
    CLASS_ATTR_STYLE                (c, "vectors", 1, "menu");
    CLASS_ATTR_ITEMS                (c, "vectors", 1, "none energy velocity both");
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_hoa_meter, f_interval);
	CLASS_ATTR_ORDER                (c, "interval", 0, "5");
	CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval (in ms)");
	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", 1, "number");
    
    CLASS_ATTR_RGBA					(c, "bgcolor", 0, t_hoa_meter, f_color_bg);
	CLASS_ATTR_CATEGORY				(c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "bgcolor", 0, "0.76 0.76 0.76 1.");
	CLASS_ATTR_STYLE                (c, "bgcolor", 1, "color");
    
    CLASS_ATTR_RGBA					(c, "bdcolor", 0, t_hoa_meter, f_color_bd);
	CLASS_ATTR_CATEGORY				(c, "bdcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "rgba");
    CLASS_ATTR_LABEL				(c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "bdcolor", 0, "0.7 0.7 0.7 1.");
	CLASS_ATTR_STYLE                (c, "bdcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_hoa_meter, f_color_cold_signal);
	CLASS_ATTR_LABEL                (c, "coldcolor", 0, "Cold Signal Color");
	CLASS_ATTR_ORDER                (c, "coldcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "coldcolor", 0, "0. 0.6 0. 0.8");
	CLASS_ATTR_STYLE                (c, "coldcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "tepidcolor", 0, t_hoa_meter, f_color_tepid_signal);
	CLASS_ATTR_LABEL                (c, "tepidcolor", 0, "Tepid Signal Color");
	CLASS_ATTR_ORDER                (c, "tepidcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "tepidcolor", 0, "0.6 0.73 0. 0.8");
	CLASS_ATTR_STYLE                (c, "tepidcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "warmcolor", 0, t_hoa_meter, f_color_warm_signal);
	CLASS_ATTR_LABEL                (c, "warmcolor", 0, "Warm Signal Color");
	CLASS_ATTR_ORDER                (c, "warmcolor", 0, "6");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "warmcolor", 0, ".85 .85 0. 0.8");
	CLASS_ATTR_STYLE                (c, "warmcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "hotcolor", 0, t_hoa_meter, f_color_hot_signal);
	CLASS_ATTR_LABEL                (c, "hotcolor", 0, "Hot Signal Color");
	CLASS_ATTR_ORDER                (c, "hotcolor", 0, "7");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hotcolor", 0, "1. 0.6 0. 0.8");
	CLASS_ATTR_STYLE                (c, "hotcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "overcolor", 0, t_hoa_meter, f_color_over_signal);
	CLASS_ATTR_LABEL                (c, "overcolor", 0, "Overload Signal Color");
	CLASS_ATTR_ORDER                (c, "overcolor", 0, "8");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "overcolor", 0, "1. 0. 0. 0.8");
	CLASS_ATTR_STYLE                (c, "overcolor", 1, "color");
    
	CLASS_ATTR_RGBA                 (c, "energycolor", 0, t_hoa_meter, f_color_energy_vector);
	CLASS_ATTR_LABEL                (c, "energycolor", 0, "Energy Vector Color");
	CLASS_ATTR_ORDER                (c, "energycolor", 0, "9");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "energycolor", 0, "0. 0. 1. 0.8");
    CLASS_ATTR_STYLE                (c, "energycolor", 1, "color");
    
    CLASS_ATTR_RGBA                 (c, "velocitycolor", 0, t_hoa_meter, f_color_velocity_vector);
	CLASS_ATTR_LABEL                (c, "velocitycolor", 0, "Velocity Vector Color");
	CLASS_ATTR_ORDER                (c, "velocitycolor", 0, "9");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "velocitycolor", 0, "1. 0. 0. 0.8");
    CLASS_ATTR_STYLE                (c, "velocitycolor", 1, "color");
	
    eclass_register(CLASS_BOX, c);
	hoa_meter_class = c;
}
void ext_main(void *r)
#endif
{
    t_class *c;
    
    c = class_new("hoa.gain~", (method)hoa_gain_new, (method)hoa_gain_free, sizeof(t_hoa_gain), (method)NULL, A_GIMME, 0L);
    class_setname((char *)"hoa.gain~", (char *)"hoa.gain~");
    
    c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
    class_dspinitjbox(c);
    jbox_initclass(c, JBOX_FIXWIDTH | JBOX_COLOR );
    
    hoa_initclass(c, (method)hoa_getinfos);
    
    class_addmethod (c, (method) hoa_gain_assist,              "assist",               A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_paint,               "paint",                A_CANT, 0);
    
    // @method signal @digest The inputs signals to be scaled by the slider.
    // @description The inputs signals to be scaled by the slider.
    class_addmethod (c, (method) hoa_gain_dsp64,               "dsp64",                A_CANT, 0);
    
    // @method int @digest Set the value of the slider
    // @description The <m>int</m> method sets the value of the slider, ramps the output signal to the level corresponding to the new value over the specified ramp time, and outputs the slider's value out the right outlet.
    // @marg 0 @name value @optional 0 @type int
    class_addmethod (c, (method) hoa_gain_int,                 "int",                  A_LONG, 0);
    
    // @method float @digest Set the value of the slider
    // @description The <m>float</m> method sets the value of the slider, ramps the output signal to the level corresponding to the new value over the specified ramp time, and outputs the slider's value out the right outlet.
    // @marg 0 @name value @optional 0 @type int
    class_addmethod (c, (method) hoa_gain_float,               "float",                A_FLOAT, 0);
    
    // @method contextvalue @digest Set the value of the slider with DeciBels, Amplitude or MIDI value type.
    // @description Set the value of the slider with DeciBels, Amplitude or MIDI value type.
    // @marg 0 @name inputmode @optional 0 @type int @description 0 = DeciBels, 1 = 1mplitude, 2 = MIDI.
    // @marg 1 @name value @optional 0 @type float @description The slider value
    class_addmethod (c, (method) hoa_gain_contextValue,        "contextvalue", A_LONG, A_FLOAT, 0);
    
    // @method bang @digest Send current value out right outlet.
    // @description The <m>bang</m> message send current value out right outlet.
    class_addmethod (c, (method) hoa_gain_bang,                "bang",                         0);
    
    // @method set @digest Set the value of the slider without outputting slider value.
    // @description The word set, followed by a number, sets the value of the slider, ramps the output signal to the level corresponding to the new value over the specified ramp time, but does not output the slider's value out the right outlet.
    // @marg 1 @name value @optional 0 @type float @description The slider value
    class_addmethod (c, (method) hoa_gain_set,                 "set",                  A_GIMME, 0);
    //class_addmethod (c, (method) hoa_gain_tometer,             "anything",             A_GIMME, 0);
    class_addmethod (c, (method) hoa_gain_anything,            "anything",             A_GIMME, 0);
    
    // @method (mouse) @digest click and drag to set the slider outlet.
    // @description Clicking and dragging with the mouse sets the value of the slider, ramps the output signal to the level corresponding to the new value over the specified ramp time, and outputs the slider’s value out the right outlet. double-click to set the slider value to <m>defvaldb</m>
    
    class_addmethod (c, (method) hoa_gain_mousedoubleclick,    "mousedoubleclick",     A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_mousedown,           "mousedown",            A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_mousedragdelta,      "mousedragdelta",       A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_mouseup,             "mouseup",              A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_getvalueof,          "getvalueof",           A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_setvalueof,          "setvalueof",           A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_preset,              "preset",                       0);
    class_addmethod (c, (method) hoa_gain_notify,              "notify",               A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_oksize,              "oksize",               A_CANT, 0);
    
    CLASS_ATTR_DEFAULT(c,"patching_rect",0, "0. 0. 140. 22.");
    
    CLASS_STICKY_CATEGORY		(c,0,"Value");
    
    CLASS_ATTR_DOUBLE			(c, "interp", 0, t_hoa_gain, f_interp);
    CLASS_ATTR_ACCESSORS		(c, "interp",(method)NULL,(method)hoa_gain_setattr_interp);
    CLASS_ATTR_LABEL			(c, "interp", 0, "Ramp Time (ms)");
    CLASS_ATTR_FILTER_MIN		(c, "interp", 0);
    // @description Ramp time in milliseconds
    
    CLASS_ATTR_CHAR				(c,"relative", 0, t_hoa_gain, j_relative);
    CLASS_ATTR_LABEL			(c,"relative", 0, "Mousing Mode");
    CLASS_ATTR_ENUMINDEX2		(c, "relative", 0, "Absolute", "Relative");
    CLASS_ATTR_BASIC			(c, "relative", 0);
    // @description Mousing can either be <b>absolute</b> or <b>relative</b>
    
    CLASS_ATTR_CHAR				(c,"inputmode", 0, t_hoa_gain, f_inputMode);
    CLASS_ATTR_LABEL			(c,"inputmode", 0, "Input Mode");
    CLASS_ATTR_ENUMINDEX3		(c, "inputmode", 0, "DeciBels", "Amplitude", "Midi");
    // @description Input mode can either be in <b>DeciBels</b>, <b>Amplitude</b> or <b>Midi</b>
    
    CLASS_ATTR_DOUBLE			(c, "defvaldb", 0, t_hoa_gain, j_defaultValuedB);
    CLASS_ATTR_LABEL			(c, "defvaldb", 0, "Default Value (dB)");
    // @description Default value in <b>DeciBels</b>, <b>Amplitude</b> or <b>Midi</b>
    
    CLASS_STICKY_CATEGORY_CLEAR(c);
    
    CLASS_ATTR_CHAR				(c,"orientation",0,t_hoa_gain,j_orientation);
    CLASS_ATTR_LABEL			(c,"orientation",0,"Orientation");
    CLASS_ATTR_ENUMINDEX3		(c,"orientation", 0,"Automatic", "Horizontal", "Vertical");
    CLASS_ATTR_CATEGORY			(c, "orientation", 0, "Appearance");
    CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "orientation", 0, "0");
    // @description Orientation can either be in <b>Automatic</b>, <b>Horizontal</b> or <b>Vertical</b>
    
    CLASS_STICKY_CATEGORY(c, 0, "Color");
    
    CLASS_ATTR_INVISIBLE(c, "color", 0);
    // @exclude hoa.gain~
    
    CLASS_ATTR_RGBA_LEGACY		(c, "bgcolor", "brgb", 0, t_hoa_gain, j_brgba);
    CLASS_ATTR_ALIAS			(c,"bgcolor", "brgba");
    CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c,"bgcolor",0,"0.611765 0.611765 0.611765 1.");
    CLASS_ATTR_STYLE_LABEL		(c, "bgcolor", 0, "rgba", "Background Color");
    CLASS_ATTR_BASIC			(c, "bgcolor", 0);
    // @description Sets the RGBA values for the background color of the <o>hoa.gain~</o> object
    
    CLASS_ATTR_RGBA				(c, "knobcolor", 0, t_hoa_gain, j_knobcolor);
    CLASS_ATTR_STYLE_LABEL      (c, "knobcolor", 0, "rgba","Knob Color");
    CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "knobcolor", 0, "0.396078 0.396078 0.396078 1.");
    // @description Sets the RGBA values for the knob color of the <o>hoa.gain~</o> object
    
    CLASS_ATTR_RGBA				(c, "barcolor", 0, t_hoa_gain, j_barcolor);
    CLASS_ATTR_STYLE_LABEL      (c, "barcolor", 0, "rgba","Value Bar Color");
    CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "barcolor", 0, "0.396078 0.396078 0.396078 0.6");
    // @description Sets the RGBA values for the value bar color of the <o>hoa.gain~</o> object
    
    CLASS_STICKY_CATEGORY_CLEAR(c);
    
    CLASS_ATTR_DEFAULT_SAVE		(c,"relative",0,"0");
    CLASS_ATTR_DEFAULT_SAVE		(c,"defvaldb",0,"0");
    CLASS_ATTR_DEFAULT_SAVE		(c,"inputmode",0,"0");
    CLASS_ATTR_DEFAULT_SAVE		(c,"interp",0,"20");
    CLASS_ATTR_LABEL			(c,"min", 0, "Output Minimum");
    CLASS_ATTR_LABEL			(c,"mult", 0, "Output Multiplier");
    CLASS_ATTR_STYLE_LABEL		(c,"floatoutput",0,"onoff","Float Output");
    
    CLASS_ATTR_ORDER			(c, "relative",		0, "2");
    CLASS_ATTR_ORDER			(c, "size",			0, "3");
    CLASS_ATTR_ORDER			(c, "min",			0, "4");
    CLASS_ATTR_ORDER			(c, "mult",			0, "5");
    
    CLASS_ATTR_CATEGORY			(c, "channels", 0, "Custom");
    CLASS_ATTR_LONG				(c, "channels", 0, t_hoa_gain, f_number_of_channels);
    CLASS_ATTR_ACCESSORS        (c, "channels", NULL, hoa_gain_setattr_channels);
    CLASS_ATTR_ORDER			(c, "channels", 0, "1");
    CLASS_ATTR_LABEL			(c, "channels", 0, "Number of Channels");
    CLASS_ATTR_FILTER_CLIP		(c, "channels", 1, MAX_IO);
    CLASS_ATTR_DEFAULT			(c, "channels", 0, "8");
    CLASS_ATTR_SAVE				(c, "channels", 1);
    
    CLASS_ATTR_CATEGORY			(c, "range", 0, "Value");
    CLASS_ATTR_DOUBLE_ARRAY     (c, "range", 0, t_hoa_gain, f_range, 2);
    CLASS_ATTR_ACCESSORS        (c, "range", NULL, hoa_gain_setattr_range);
    CLASS_ATTR_ORDER			(c, "range", 0, "2");
    CLASS_ATTR_LABEL			(c, "range", 0, "Range (dB)");
    CLASS_ATTR_DEFAULT			(c, "range", 0, "-70. 18.");
    CLASS_ATTR_SAVE             (c, "range", 1);
    
    class_register(CLASS_BOX, c);
    s_hoa_gain_class = c;    
}
void ext_main(void *r)
#endif
{
    t_class *c;
    
    c = class_new("hoa.3d.scope~", (method)hoa_3d_scope_new, (method)hoa_3d_scope_free, (short)sizeof(t_hoa_3d_scope), 0L, A_GIMME, 0);
    class_setname((char *)"hoa.3d.scope~", (char *)"hoa.3d.scope~");
    
    c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
    class_dspinitjbox(c);
    jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH);
    
    hoa_initclass(c, (method)hoa_getinfos);
    
    // @method signal @digest Array of spherical harmonic signals that represent a sound field
    // @description Array of spherical harmonic signals that represent a sound field
    class_addmethod(c, (method)hoa_3d_scope_dsp64,		"dsp64",		A_CANT, 0);
    class_addmethod(c, (method)hoa_3d_scope_assist,		"assist",		A_CANT,	0);
    class_addmethod(c, (method)hoa_3d_scope_paint,		"paint",		A_CANT,	0);
    class_addmethod(c, (method)hoa_3d_scope_notify,		"notify",		A_CANT, 0);
    class_addmethod(c, (method)hoa_3d_scope_oksize,		"oksize",		A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "color", 0);
    CLASS_ATTR_INVISIBLE            (c, "textcolor", 0);
    CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 150 150");
    
    CLASS_ATTR_LONG                 (c, "order", 0, t_hoa_3d_scope, f_order);
    CLASS_ATTR_ACCESSORS            (c, "order", NULL, set_order);
    CLASS_ATTR_CATEGORY             (c, "order", 0, "Ambisonic");
    CLASS_ATTR_ORDER                (c, "order", 0, "1");
    CLASS_ATTR_LABEL                (c, "order", 0, "Ambisonic Order");
    CLASS_ATTR_FILTER_MIN           (c, "order", 1);
    CLASS_ATTR_DEFAULT              (c, "order", 0, "1");
    CLASS_ATTR_SAVE                 (c, "order", 1);
    // @description The ambisonic order of decomposition. Will adapt the number of input accordingly.
    
    CLASS_ATTR_FLOAT                (c, "gain", 0, t_hoa_3d_scope, f_gain);
    CLASS_ATTR_CATEGORY             (c, "gain", 0, "Behavior");
    CLASS_ATTR_ORDER                (c, "gain", 0, "1");
    CLASS_ATTR_LABEL                (c, "gain", 0, "Gain");
    CLASS_ATTR_FILTER_MIN           (c, "gain", 1.);
    CLASS_ATTR_DEFAULT              (c, "gain", 0, "1.");
    CLASS_ATTR_SAVE                 (c, "gain", 1);
    // @description The <b>gain</b> factor can be used to offer a better visualisation of low amplitude sound fields.
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_hoa_3d_scope, f_interval);
    CLASS_ATTR_CATEGORY             (c, "interval", 0, "Behavior");
    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, "100");
    CLASS_ATTR_SAVE                 (c, "interval", 1);
    // @description The refresh interval time in milliseconds.
    
    CLASS_ATTR_DOUBLE_ARRAY         (c, "view", 0, t_hoa_3d_scope, f_view, 3);
    CLASS_ATTR_CATEGORY             (c, "view", 0, "Behavior");
    CLASS_ATTR_ORDER                (c, "view", 0, "3");
    CLASS_ATTR_LABEL                (c, "view", 0, "Offset of the View");
    CLASS_ATTR_ACCESSORS            (c, "view", NULL, view_set);
    CLASS_ATTR_DEFAULT              (c, "view", 0, "0. 0. 0.");
    CLASS_ATTR_SAVE                 (c, "view", 1);
    // @description Set the offset of the view with a list of 3 double values corresponding to the x y z offset, in degrees between 0. and 360.
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_hoa_3d_scope, f_color_bg);
    CLASS_ATTR_CATEGORY             (c, "bgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.76 0.76 0.76 1.");
    // @description Sets the RGBA values for the background color of the <o>hoa.3d.scope~</o> object
    
    CLASS_ATTR_RGBA                 (c, "phcolor", 0, t_hoa_3d_scope, f_color_ph);
    CLASS_ATTR_CATEGORY             (c, "phcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "phcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "phcolor", 0, "Positive Harmonics Color");
    CLASS_ATTR_ORDER                (c, "phcolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "phcolor", 0, "1. 0. 0. 1.");
    // @description Sets the RGBA values for the positive harmonics color of the <o>hoa.3d.scope~</o> object
    
    CLASS_ATTR_RGBA                 (c, "nhcolor", 0, t_hoa_3d_scope, f_color_nh);
    CLASS_ATTR_CATEGORY             (c, "nhcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "nhcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "nhcolor", 0, "Negative Harmonics Color");
    CLASS_ATTR_ORDER                (c, "nhcolor", 0, "4");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "nhcolor", 0, "0. 0. 1. 1.");
    // @description Sets the RGBA values for the negative harmonics color of the <o>hoa.3d.scope~</o> object
    
    class_register(CLASS_BOX, c);
    hoa_3d_scope_class = c;
}
Ejemplo n.º 24
0
extern "C" void setup_hoa0x2espace(void)
{
    t_eclass* c;
    c = class_new("hoa.space", (method)hoa_space_new, (method)hoa_space_free, sizeof(t_hoa_space), 0L, A_GIMME, 0);

    jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH);
    
    class_addmethod(c, (method)hoa_space_assist,        "assist",           A_CANT, 0);
    class_addmethod(c, (method)hoa_space_paint,         "paint",            A_CANT, 0);
    class_addmethod(c, (method)hoa_space_notify,        "notify",           A_CANT, 0);
    class_addmethod(c, (method)hoa_space_bang,          "bang",             A_CANT, 0);
    class_addmethod(c, (method)hoa_space_getdrawparams, "getdrawparams",    A_CANT, 0);
    class_addmethod(c, (method)hoa_space_oksize,        "oksize",           A_CANT, 0);
    class_addmethod(c, (method)hoa_space_mouse_down,    "mousedown",        A_CANT, 0);
    class_addmethod(c, (method)hoa_space_mouse_move,    "mousemove",        A_CANT, 0);
    class_addmethod(c, (method)hoa_space_mouse_drag,    "mousedrag",        A_CANT, 0);
    class_addmethod(c, (method)hoa_space_mouse_enddrag, "mouseup",          A_CANT, 0);
    class_addmethod(c, (method)hoa_space_coefficients_set,"list",           A_GIMME,0);
    //class_addmethod(c, (method)hoa_space_anything,		"anything",       A_GIMME,0);

    CLASS_ATTR_DEFAULT		(c, "size", 0, "225 225");
	CLASS_ATTR_INVISIBLE	(c, "color", 0);
	CLASS_ATTR_INVISIBLE	(c, "textcolor", 0);
    
    CLASS_ATTR_LONG             (c, "channels", 0, t_hoa_space, f_number_of_microphones);
	CLASS_ATTR_CATEGORY         (c, "channels", 0, "Behavior");
	CLASS_ATTR_ORDER            (c, "channels", 0, "1");
	CLASS_ATTR_LABEL            (c, "channels", 0, "Number of channels");
	CLASS_ATTR_ACCESSORS        (c, "channels", NULL, hoa_space_channels_set);
    CLASS_ATTR_DEFAULT          (c, "channels", 0, "8");
	CLASS_ATTR_SAVE             (c, "channels", 0);
    
    CLASS_ATTR_DOUBLE_VARSIZE      (c, "coeffs", 0, t_hoa_space, f_microphonesValues, f_number_of_microphones, MAX_CHANNELS);
	CLASS_ATTR_CATEGORY             (c, "coeffs", 0, "Behavior");
	CLASS_ATTR_ORDER                (c, "coeffs", 0, "2");
	CLASS_ATTR_LABEL                (c, "coeffs", 0, "Virtuals microphones coefficients");
    CLASS_ATTR_ACCESSORS			(c, "coeffs", NULL, hoa_space_coefficients_set);
	CLASS_ATTR_DEFAULT              (c, "coeffs", 0, "0.");
	CLASS_ATTR_SAVE                 (c, "coeffs", 0);
    
	CLASS_ATTR_RGBA					(c, "bgcolor", 0, t_hoa_space, f_color_background);
	CLASS_ATTR_CATEGORY				(c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "bgcolor", 0, "0.7 0.7 0.7 1.");
	
    CLASS_ATTR_RGBA					(c, "bordercolor", 0, t_hoa_space, f_color_border_box);
	CLASS_ATTR_CATEGORY				(c, "bordercolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bordercolor", 0, "rgba");
    CLASS_ATTR_LABEL				(c, "bordercolor", 0, "Border Box Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "bordercolor", 0, "0.5 0.5 0.5 1.");
    
	CLASS_ATTR_RGBA					(c, "harmocolor", 0, t_hoa_space, f_color_harmonics);
	CLASS_ATTR_CATEGORY				(c, "harmocolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "harmocolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "harmocolor", 0, "Harmonics color");
    CLASS_ATTR_DEFAULT              (c, "harmocolor", 0, "0. 0.4 0.6 1.");
	CLASS_ATTR_SAVE                 (c, "harmocolor", 0);
    
	CLASS_ATTR_RGBA					(c, "miccolor", 0, t_hoa_space, f_color_points);
	CLASS_ATTR_CATEGORY				(c, "miccolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "miccolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "miccolor", 0, "Virtuals microphones color");
	CLASS_ATTR_DEFAULT              (c, "miccolor", 0, "0. 0. 0. 1.");
	CLASS_ATTR_SAVE                 (c, "miccolor", 0);
    
	CLASS_ATTR_RGBA					(c, "circolor", 0, t_hoa_space, f_color_inner_circle);
	CLASS_ATTR_CATEGORY				(c, "circolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "circolor", 0, "rgba");
    CLASS_ATTR_LABEL				(c, "circolor", 0, "Circle Inner Color");
	CLASS_ATTR_DEFAULT              (c, "circolor", 0, "0.7 0.7 0.7 1.");
	CLASS_ATTR_SAVE                 (c, "circolor", 0);
    
	CLASS_ATTR_ORDER				(c, "bgcolor", 0, "1");
	CLASS_ATTR_ORDER				(c, "bordercolor", 0, "2");
	CLASS_ATTR_ORDER				(c, "cicolor", 0, "3");
	CLASS_ATTR_ORDER				(c, "circolor", 0, "4");
	CLASS_ATTR_ORDER				(c, "cishadcolor", 0, "5");
	CLASS_ATTR_ORDER				(c, "harmocolor", 0, "6");
	CLASS_ATTR_ORDER				(c, "miccolor", 0, "7");
    
    class_register(CLASS_NOBOX, c);
    hoa_space_class = c;
}
void ext_main(void *r)
#endif
{
    t_class *c;
    
    c = class_new("hoa.2d.meter~", (method)meter_new, (method)meter_free, (short)sizeof(t_meter), 0L, A_GIMME, 0);
    class_setname((char *)"hoa.2d.meter~", (char *)"hoa.2d.meter~");
    
    c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
    class_dspinitjbox(c);
    jbox_initclass(c, JBOX_COLOR);
    
    hoa_initclass(c, (method)hoa_getinfos);
    
    // @method signal @digest Array of signals to visualize.
    // @description Array of signals to visualize.
    // @marg 0 @name channel-signal @optional 0 @type signal
    class_addmethod(c, (method) meter_dsp64,		 "dsp64",		  A_CANT, 0);
    class_addmethod(c, (method) meter_assist,		 "assist",		  A_CANT, 0);
    class_addmethod(c, (method) meter_paint,		 "paint",		  A_CANT, 0);
    class_addmethod(c, (method) meter_notify,        "notify",		  A_CANT, 0);
    
    CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 150 150");
    CLASS_ATTR_INVISIBLE            (c, "color", 0);
    
    /* APPEARANCE */
    CLASS_STICKY_CATEGORY           (c, 0, "Appearance");
    CLASS_ATTR_LONG                 (c, "ledsbg", 0, t_meter, f_drawledsbg);
    CLASS_ATTR_ORDER                (c, "ledsbg", 0, "1");
    CLASS_ATTR_STYLE_LABEL          (c, "ledsbg", 0, "onoff", "Draw Leds Background");
    CLASS_ATTR_DEFAULT              (c, "ledsbg", 0, "1");
    CLASS_ATTR_SAVE                 (c, "ledsbg", 1);
    // @description Draw leds background ?
    
    CLASS_ATTR_LONG                 (c, "vectors", 0, t_meter, f_drawvector);
    CLASS_ATTR_ORDER                (c, "vectors", 0, "2");
    CLASS_ATTR_LABEL                (c, "vectors", 0, "Draw Vectors");
    CLASS_ATTR_ENUMINDEX4           (c, "vectors", 0, "none", "energy", "velocity", "both")
    CLASS_ATTR_DEFAULT              (c, "vectors", 0, "1");
    CLASS_ATTR_SAVE                 (c, "vectors", 1);
    // @description The vector(s) to draw.
    
    CLASS_ATTR_LONG                 (c, "mborder", 0, t_meter, f_drawmborder);
    CLASS_ATTR_ORDER                (c, "mborder", 0, "3");
    CLASS_ATTR_LABEL                (c, "mborder", 0, "Draw Meter Borders");
    CLASS_ATTR_ENUMINDEX4           (c, "mborder", 0, "none", "Circles", "Axes", "both")
    CLASS_ATTR_DEFAULT              (c, "mborder", 0, "3");
    CLASS_ATTR_SAVE                 (c, "mborder", 1);
    // @description The meter border(s) to draw.
    
    CLASS_ATTR_DOUBLE               (c, "metersize", 0, t_meter, f_metersize);
    CLASS_ATTR_ORDER                (c, "metersize", 0, "4");
    CLASS_ATTR_LABEL                (c, "metersize", 0, "Meter Circle Size");
    CLASS_ATTR_FILTER_CLIP          (c, "metersize", 0., 1);
    CLASS_ATTR_DEFAULT              (c, "metersize", 0, "0.8");
    CLASS_ATTR_SAVE                 (c, "metersize", 1);
    // @description The size of the inner circle of the <o>hoa.2d.meter~</o>.
    
    CLASS_ATTR_LONG                 (c, "orientation", 0, t_meter, f_direction);
    CLASS_ATTR_LABEL                (c, "orientation", 0, "Meter Fill Orientation");
    CLASS_ATTR_ORDER                (c, "orientation", 0, "5");
    CLASS_ATTR_ENUMINDEX            (c, "orientation", 0, "inside outside");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "orientation", 0, "0");
    // @description The filling orientation of the peak level indicators <o>hoa.2d.meter~</o>.
    
    CLASS_STICKY_CATEGORY_CLEAR (c);
    
    CLASS_STICKY_CATEGORY           (c, 0, "Behavior");
    CLASS_ATTR_LONG                 (c, "channels", 0 , t_meter, f_attrs);
    CLASS_ATTR_ACCESSORS            (c, "channels", channels_get, channels_set);
    CLASS_ATTR_ORDER                (c, "channels", 0, "1");
    CLASS_ATTR_LABEL                (c, "channels", 0, "Number of Channels");
    CLASS_ATTR_SAVE                 (c, "channels", 1);
    CLASS_ATTR_DEFAULT              (c, "channels", 0, "4");
    // @description The number of displayed channel and peak level indicators.
    
    CLASS_ATTR_DOUBLE_VARSIZE       (c, "angles", ATTR_SET_DEFER_LOW, t_meter, f_attrs, f_attrs, MAX_UI_CHANNELS);
    CLASS_ATTR_ACCESSORS            (c, "angles", angles_get, angles_set);
    CLASS_ATTR_ORDER                (c, "angles", 0, "2");
    CLASS_ATTR_LABEL                (c, "angles", 0, "Angles of Channels");
    CLASS_ATTR_SAVE                 (c, "angles", 1);
    // @description The angles of the displayed channels and peak level indicators. Values are in degrees, wrapped between 0. and 360., so you can also set the angles with negative values.
    
    CLASS_ATTR_DOUBLE               (c, "offset", 0, t_meter, f_attrs);
    CLASS_ATTR_ACCESSORS            (c, "offset", offset_get, offset_set);
    CLASS_ATTR_ORDER                (c, "offset", 0, "3");
    CLASS_ATTR_LABEL                (c, "offset", 0, "Offset of Channels");
    CLASS_ATTR_DEFAULT              (c, "offset", 0, "0");
    CLASS_ATTR_SAVE                 (c, "offset", 1);
    // @description Display offset of channels and peak level indicators. the value is in degree, clipped between -180. and 180.
    
    CLASS_ATTR_LONG                 (c, "rotation", 0, t_meter, f_rotation);
    CLASS_ATTR_ORDER                (c, "rotation", 0, "4");
    CLASS_ATTR_LABEL                (c, "rotation", 0, "Rotation of Channels");
    CLASS_ATTR_ENUMINDEX            (c, "rotation", 0, "clockwise anti-clockwise");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "rotation",0, "1");
    // @description The rotation can either be <b>clockwise</b> or <b>anti-clockwise</b>
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_meter, f_interval);
    CLASS_ATTR_ORDER                (c, "interval", 0, "5");
    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);
    // @description The refresh interval time in milliseconds.
    
    CLASS_STICKY_CATEGORY_CLEAR     (c);
    
    CLASS_ATTR_LONG                 (c, "dbperled", 0, t_meter, f_dbperled);
    CLASS_ATTR_CATEGORY             (c, "dbperled", 0, "Value");
    CLASS_ATTR_ORDER                (c, "dbperled", 0, "4");
    CLASS_ATTR_LABEL                (c, "dbperled", 0, "DeciBels per Led");
    CLASS_ATTR_FILTER_CLIP          (c, "dbperled", 1, 12);
    CLASS_ATTR_DEFAULT              (c, "dbperled", 0, "3");
    CLASS_ATTR_SAVE                 (c, "dbperled", 1);
    // @description Sets the amount of signal level in deciBels represented by each LED. By default each LED represents a 3dB change in volume from its neighboring LEDs.
    
    CLASS_ATTR_LONG                 (c, "nhotleds", 0, t_meter, f_nhotleds);
    CLASS_ATTR_CATEGORY             (c, "nhotleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "nhotleds", 0, "5");
    CLASS_ATTR_LABEL                (c, "nhotleds", 0, "Number of Hot Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "nhotleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "nhotleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "nhotleds", 1);
    // @description Sets the total number "hot" warning LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>hotcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "ntepidleds", 0, t_meter, f_ntepidleds);
    CLASS_ATTR_CATEGORY             (c, "ntepidleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "ntepidleds", 0, "6");
    CLASS_ATTR_LABEL                (c, "ntepidleds", 0, "Number of Tepid Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "ntepidleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "ntepidleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "ntepidleds", 1);
    // @description Sets the total number "tepid" mid-range LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>tepidcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "nwarmleds", 0, t_meter, f_nwarmleds);
    CLASS_ATTR_CATEGORY             (c, "nwarmleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "nwarmleds", 0, "7");
    CLASS_ATTR_LABEL                (c, "nwarmleds", 0, "Number of Warm Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "nwarmleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "nwarmleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "nwarmleds", 1);
    // @description Sets the total number "warm" lower-mid-range LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>warmcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "numleds", 0, t_meter, f_numleds);
    CLASS_ATTR_CATEGORY             (c, "numleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "numleds", 0, "8");
    CLASS_ATTR_LABEL                (c, "numleds", 0, "Total Number of Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "numleds", 10, 20);
    CLASS_ATTR_DEFAULT              (c, "numleds", 0, "12");
    CLASS_ATTR_SAVE                 (c, "numleds", 1);
    // @description The word numleds, followed by a number between 10 and 20, sets the total number of LEDs displayed on the <o>hoa.2d.meter~</o> object. The range is 10-20 LEDs.
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_meter, f_color_bg);
    CLASS_ATTR_CATEGORY             (c, "bgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.76 0.76 0.76 1.");
    // @description Sets the RGBA values for the background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "mbgcolor", 0, t_meter, f_color_mbg);
    CLASS_ATTR_LABEL                (c, "mbgcolor", 0, "Meter Background Color");
    CLASS_ATTR_CATEGORY             (c, "mbgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "mbgcolor", 0, "rgba");
    CLASS_ATTR_ORDER                (c, "mbgcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "mbgcolor", 0, "0.61 0.61 0.61 1.");
    // @description Sets the RGBA values for the filled circle background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "ledbgcolor", 0, t_meter, f_color_ledbg);
    CLASS_ATTR_LABEL                (c, "ledbgcolor", 0, "Leds Background Color");
    CLASS_ATTR_CATEGORY             (c, "ledbgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "ledbgcolor", 0, "rgba");
    CLASS_ATTR_ORDER                (c, "ledbgcolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "ledbgcolor", 0, "0. 0. 0. 0.05");
    // @description Sets the RGBA values for leds background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_meter, f_color_cold);
    CLASS_ATTR_CATEGORY             (c, "coldcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "coldcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "coldcolor", 0, "Cold Signal Color");
    CLASS_ATTR_ORDER                (c, "coldcolor", 0, "4");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "coldcolor", 0, "0. 0.6 0. 0.8");
    // @description Sets the RGBA values for the cold signal color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "tepidcolor", 0, t_meter, f_color_tepid);
    CLASS_ATTR_CATEGORY             (c, "tepidcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "tepidcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "tepidcolor", 0, "Tepid Signal Color");
    CLASS_ATTR_ORDER                (c, "tepidcolor", 0, "5");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "tepidcolor", 0, "0.6 0.73 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the lower-middle "tepid" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "warmcolor", 0, t_meter, f_color_warm);
    CLASS_ATTR_CATEGORY             (c, "warmcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "warmcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "warmcolor", 0, "Warm Signal Color");
    CLASS_ATTR_ORDER                (c, "warmcolor", 0, "6");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "warmcolor", 0, ".85 .85 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for upper-middle "warm" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "hotcolor", 0, t_meter, f_color_hot);
    CLASS_ATTR_CATEGORY             (c, "hotcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "hotcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "hotcolor", 0, "Hot Signal Color");
    CLASS_ATTR_ORDER                (c, "hotcolor", 0, "7");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hotcolor", 0, "1. 0.6 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the upper "hot" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "overloadcolor", 0, t_meter, f_color_over);
    CLASS_ATTR_CATEGORY             (c, "overloadcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "overloadcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "overloadcolor", 0, "Overload Signal Color");
    CLASS_ATTR_ORDER                (c, "overloadcolor", 0, "8");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "overloadcolor", 0, "1. 0. 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the "over" indicator of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "energycolor", 0, t_meter, f_color_energy);
    CLASS_ATTR_CATEGORY             (c, "energycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "energycolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "energycolor", 0, "Energy Vector Color");
    CLASS_ATTR_ORDER                (c, "energycolor", 0, "9");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "energycolor", 0, "0. 0. 1. 0.8");
    // @description Sets the RGBA values for the energy vector color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "velocitycolor", 0, t_meter, f_color_velocity);
    CLASS_ATTR_CATEGORY             (c, "velocitycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "velocitycolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "velocitycolor", 0, "Velocity Vector Color");
    CLASS_ATTR_ORDER                (c, "velocitycolor", 0, "9");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "velocitycolor", 0, "1. 0. 0. 0.8");
    // @description Sets the RGBA values for the velocity vector color of the <o>hoa.2d.meter~</o> object
    
    class_register(CLASS_BOX, c);
    class_alias(c, gensym("hoa.meter~"));
    meter_class = c;
}
Ejemplo n.º 26
0
int main()
{
	t_class *c;
    common_symbols_init();
    
	c = class_new("hoa.space", (method)space_new, (method)space_free, (short)sizeof(t_space), 0L, A_GIMME, 0);

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

	class_addmethod(c, (method)space_assist,          "assist",         A_CANT,	0);
	class_addmethod(c, (method)space_paint,           "paint",          A_CANT,	0);
	class_addmethod(c, (method)space_notify,          "notify",         A_CANT, 0);
	class_addmethod(c, (method)space_getdrawparams,   "getdrawparams",  A_CANT, 0);
	class_addmethod(c, (method)space_mouse_down,      "mousedown",      A_CANT, 0);
	class_addmethod(c, (method)space_mouse_drag,      "mousedrag",      A_CANT, 0);
    class_addmethod(c, (method)space_mouse_enddrag,   "mouseup",         A_CANT, 0);
    class_addmethod(c, (method)space_preset,          "preset",         0);
    class_addmethod(c, (method)space_getvalueof,      "getvalueof",     A_CANT, 0);
	class_addmethod(c, (method)space_setvalueof,      "setvalueof",     A_CANT, 0);
    class_addmethod(c, (method)coefficients_set,      "list",           A_GIMME, 0);
    
	CLASS_ATTR_DEFAULT				(c, "patching_rect", 0, "0 0 225 225");
	CLASS_ATTR_INVISIBLE			(c, "color", 0);
	CLASS_ATTR_INVISIBLE			(c, "textcolor", 0);
	
	CLASS_ATTR_LONG					(c, "shadow", 0, t_space, f_shadow);
	CLASS_ATTR_CATEGORY				(c, "shadow", 0, "Appearance");
	CLASS_ATTR_ORDER				(c, "shadow", 0, "1");
	CLASS_ATTR_STYLE_LABEL			(c, "shadow", 0, "onoff", "Draw Shadows");
	CLASS_ATTR_DEFAULT				(c, "shadow", 0, "1");
	CLASS_ATTR_SAVE					(c, "shadow", 1);

    CLASS_ATTR_LONG					(c, "nmics", 0, t_space, f_number_of_microphones);
	CLASS_ATTR_CATEGORY				(c, "nmics", 0, "Behavior");
	CLASS_ATTR_ORDER				(c, "nmics", 0, "1");
	CLASS_ATTR_LABEL				(c, "nmics", 0, "Number of virtuals microphones");
	CLASS_ATTR_ACCESSORS			(c, "nmics", NULL, number_of_microphones_set);
	CLASS_ATTR_DEFAULT				(c, "nmics", 0, "10");
	CLASS_ATTR_SAVE					(c, "nmics", 1);

    CLASS_ATTR_DOUBLE_VARSIZE       (c, "coeffs", 0, t_space, f_microphonesValues, f_number_of_microphones, MAX_MICS);
	CLASS_ATTR_CATEGORY             (c, "coeffs", 0, "Behavior");
	CLASS_ATTR_ORDER                (c, "coeffs", 0, "2");
	CLASS_ATTR_LABEL                (c, "coeffs", 0, "Virtuals microphones coefficients");
    CLASS_ATTR_ACCESSORS			(c, "coeffs", NULL, coefficients_set);
	CLASS_ATTR_DEFAULT              (c, "coeffs", 0, "666.");
	CLASS_ATTR_SAVE                 (c, "coeffs", 1);
    
	CLASS_ATTR_RGBA					(c, "bgcolor", 0, t_space, f_color_background);
	CLASS_ATTR_CATEGORY				(c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "bgcolor", 0, "1. 1. 1. 1.");
	
	CLASS_ATTR_RGBA					(c, "circlecolor", 0, t_space, f_color_circle);
	CLASS_ATTR_CATEGORY				(c, "circlecolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "circlecolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "circlecolor", 0, "Circle Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "circlecolor", 0, "0.6 0.6 0.6 1.");
	
	CLASS_ATTR_RGBA					(c, "harmocolor", 0, t_space, f_color_harmonics);
	CLASS_ATTR_CATEGORY				(c, "harmocolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "harmocolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "harmocolor", 0, "Harmonics color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "harmocolor", 0, "0. 0. 1. 0.25");
	
	CLASS_ATTR_RGBA					(c, "miccolor", 0, t_space, f_color_points);
	CLASS_ATTR_CATEGORY				(c, "miccolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "miccolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "miccolor", 0, "Virtuals microphones color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "miccolor", 0, "0. 0. 0. 1.");
	
	CLASS_ATTR_RGBA					(c, "cishadcolor", 0, t_space, f_color_circleShadow);
	CLASS_ATTR_CATEGORY				(c, "cishadcolor", 0, "Color");
	CLASS_ATTR_STYLE				(c, "cishadcolor", 0, "rgba");
	CLASS_ATTR_LABEL				(c, "cishadcolor", 0, "Circle Shadow Color");
	CLASS_ATTR_DEFAULT_SAVE_PAINT	(c, "cishadcolor", 0, "1. 1. 1. 0.2");
	
	CLASS_ATTR_RGBA					(c, "cicolorin", 0, t_space, f_color_circleInner);
	CLASS_ATTR_CATEGORY				(c, "cicolorin", 0, "Color");
	CLASS_ATTR_STYLE_LABEL			(c, "cicolorin", 0, "rgba", "Circle Inner Color");
	CLASS_ATTR_DEFAULTNAME_SAVE		(c, "cicolorin", 0, "0.7 0.7 0.7 1.");
	
	CLASS_ATTR_RGBA					(c, "borderboxcolor", 0, t_space, f_color_border_box);
	CLASS_ATTR_CATEGORY				(c, "borderboxcolor", 0, "Color");
	CLASS_ATTR_STYLE_LABEL			(c, "borderboxcolor", 0, "rgba", "Border Box Color");
	CLASS_ATTR_DEFAULTNAME_SAVE		(c, "borderboxcolor", 0, "0.5 0.5 0.5 1.");
	
	CLASS_ATTR_ORDER				(c, "bgcolor", 0, "1");
	CLASS_ATTR_ORDER				(c, "borderboxcolor", 0, "2");
	CLASS_ATTR_ORDER				(c, "cicolor", 0, "3");
	CLASS_ATTR_ORDER				(c, "cicolorin", 0, "4");
	CLASS_ATTR_ORDER				(c, "cishadcolor", 0, "5");
	CLASS_ATTR_ORDER				(c, "harmocolor", 0, "6");
	CLASS_ATTR_ORDER				(c, "miccolor", 0, "7");
	
	class_register(CLASS_BOX, c);
	space_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}
Ejemplo n.º 27
0
int C74_EXPORT main()
{
	t_class *c;

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

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

	class_addmethod(c, (method)scope_dsp,			"dsp",			A_CANT, 0);
	class_addmethod(c, (method)scope_dsp64,			"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)scope_assist,		"assist",		A_CANT,	0);
	class_addmethod(c, (method)scope_paint,			"paint",		A_CANT,	0);
	class_addmethod(c, (method)scope_notify,		"notify",		A_CANT, 0);
	class_addmethod(c, (method)scope_getdrawparams, "getdrawparams", A_CANT, 0);
	class_addmethod(c, (method)scope_oksize,		"oksize",		A_CANT, 0);

	CLASS_ATTR_DEFAULT			(c, "patching_rect", 0, "0 0 225 225");

    CLASS_ATTR_LONG             (c, "order", 0, t_scope, f_order);
    CLASS_ATTR_ACCESSORS        (c, "order", (method)NULL,(method)scope_setattr_order);
	CLASS_ATTR_CATEGORY			(c, "order", 0, "Value");
	CLASS_ATTR_ORDER			(c, "order", 0, "1");
	CLASS_ATTR_LABEL			(c, "order", 0, "Ambisonic Order");
	CLASS_ATTR_FILTER_MIN		(c, "order", 1);
	CLASS_ATTR_DEFAULT			(c, "order", 0, "3");
	CLASS_ATTR_SAVE				(c, "order", 1);
	
    CLASS_ATTR_LONG             (c, "mode", 0, t_scope, f_process_mode);
	CLASS_ATTR_CATEGORY			(c, "mode", 0, "Value");
    CLASS_ATTR_ENUMINDEX2       (c, "mode", 0, "Peak", "Average");
	CLASS_ATTR_ORDER			(c, "mode", 0, "2");
	CLASS_ATTR_LABEL			(c, "mode", 0, "Process Mode");
	CLASS_ATTR_DEFAULT			(c, "mode", 0, "0");
	CLASS_ATTR_SAVE				(c, "mode", 1);
    
    CLASS_ATTR_LONG             (c, "bufsize", 0, t_scope, f_bufsize);
	CLASS_ATTR_CATEGORY			(c, "bufsize", 0, "Value");
	CLASS_ATTR_ORDER			(c, "bufsize", 0, "3");
    CLASS_ATTR_FILTER_MIN		(c, "bufsize", 1);
	CLASS_ATTR_LABEL			(c, "bufsize", 0, "Buffer Size (in samps)");
	CLASS_ATTR_DEFAULT			(c, "bufsize", 0, "128");
	CLASS_ATTR_SAVE				(c, "bufsize", 1);
    
	CLASS_ATTR_LONG             (c, "interval", 0, t_scope, f_interval);
	CLASS_ATTR_CATEGORY			(c, "interval", 0, "Value");
	CLASS_ATTR_ORDER			(c, "interval", 0, "4");
	CLASS_ATTR_LABEL			(c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN		(c, "interval", 20);
	CLASS_ATTR_DEFAULT			(c, "interval", 0, "100");
	CLASS_ATTR_SAVE				(c, "interval", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawcircle", 0, t_scope, f_drawCircle);
	CLASS_ATTR_CATEGORY			(c, "drawcircle", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcircle", 0, "1");
	CLASS_ATTR_STYLE_LABEL		(c, "drawcircle", 0, "onoff", "Draw Circle");
	CLASS_ATTR_DEFAULT			(c, "drawcircle", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcircle", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawangles", 0, t_scope, f_drawAngles);
	CLASS_ATTR_CATEGORY			(c, "drawangles", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawangles", 0, "2");
	CLASS_ATTR_STYLE_LABEL		(c, "drawangles", 0, "onoff", "Draw Angles");
	CLASS_ATTR_DEFAULT			(c, "drawangles", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawangles", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawcontrib", 0, t_scope, f_drawContributions);
	CLASS_ATTR_CATEGORY			(c, "drawcontrib", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcontrib", 0, "3");
	CLASS_ATTR_STYLE_LABEL		(c, "drawcontrib", 0, "onoff", "Draw Contributions");
	CLASS_ATTR_DEFAULT			(c, "drawcontrib", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcontrib", 1);
	
	CLASS_ATTR_INVISIBLE		(c, "color", 0);
	CLASS_ATTR_INVISIBLE		(c, "textcolor", 0);
	
	CLASS_ATTR_RGBA				(c, "bgcolor", 0, t_scope, f_colorBackground);
	CLASS_ATTR_CATEGORY			(c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER			(c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "bgcolor", 0, "0.76 0.76 0.76 1.");
    
    CLASS_ATTR_RGBA				(c, "bordercolor", 0, t_scope, f_bordercolor);
	CLASS_ATTR_CATEGORY			(c, "bordercolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "bordercolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "bordercolor", 0, "Border Color");
	CLASS_ATTR_ORDER			(c, "bordercolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "bordercolor", 0, "0.7 0.7 0.7 1.");
	
	CLASS_ATTR_RGBA				(c, "txcolor", 0, t_scope, f_colorText);
	CLASS_ATTR_CATEGORY			(c, "txcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "txcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "txcolor", 0, "Text Color");
	CLASS_ATTR_ORDER			(c, "txcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "txcolor", 0, "0. 0. 0. 7.");
	
	CLASS_ATTR_RGBA				(c, "phcolor", 0, t_scope, f_colorPositif);
	CLASS_ATTR_CATEGORY			(c, "phcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "phcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "phcolor", 0, "Positifs Harmonics");
	CLASS_ATTR_ORDER			(c, "phcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "phcolor", 0, "1. 0. 0. 1.");
	
	CLASS_ATTR_RGBA				(c, "nhcolor", 0, t_scope, f_colorNegatif);
	CLASS_ATTR_CATEGORY			(c, "nhcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "nhcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "nhcolor", 0, "Negatifs Harmonics");
	CLASS_ATTR_ORDER			(c, "nhcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "nhcolor", 0, "0. 0. 1. 1.");
	
	class_register(CLASS_BOX, c);
	scope_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}
Ejemplo n.º 28
0
int C74_EXPORT main(void)
{
	t_class *c;
    
	c = class_new("hoa.meter3D~", (method)hoa_meter_new, (method)hoa_meter_free, sizeof(t_hoa_meter), 0L, A_GIMME, 0);
    
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	
    class_dspinitjbox(c);
    jucebox_initclass(c, (method)hoa_meter_paint,  JBOX_COLOR | JBOX_FIXWIDTH);
    hoa_initclass(c, (method)hoa_getinfos);
    
	class_addmethod(c, (method)hoa_meter_dsp64,				"dsp64",            A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_mousedown,			"mousedown",        A_CANT, 0);
    class_addmethod(c, (method)hoa_meter_mousedrag,			"mousedrag",        A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_assist,			"assist",           A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_getdrawparams,		"getdrawparams",    A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_notify,			"notify",           A_CANT, 0);
	class_addmethod(c, (method)hoa_meter_setLoudspeakers,   "lscoord",    A_GIMME, 0);
    
    CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 200 200");
    CLASS_ATTR_INVISIBLE            (c, "color", 0);
    
    CLASS_ATTR_LONG                 (c, "loudspeakers", 0, t_hoa_meter, f_number_of_loudspeakers);
    CLASS_ATTR_ACCESSORS            (c, "loudspeakers", NULL,  hoa_meter_attr_set_loudspeakers);
	CLASS_ATTR_CATEGORY             (c, "loudspeakers", 0, "Planewaves");
	CLASS_ATTR_ORDER                (c, "loudspeakers", 0, "1");
	CLASS_ATTR_LABEL                (c, "loudspeakers", 0, "Number Of Loudspeakers");
	CLASS_ATTR_FILTER_MIN           (c, "loudspeakers", 1);
	CLASS_ATTR_DEFAULT              (c, "loudspeakers", 0, "8");
	CLASS_ATTR_SAVE                 (c, "loudspeakers", 1);
    CLASS_ATTR_PAINT                (c, "loudspeakers", 1);
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_hoa_meter, f_interval);
	CLASS_ATTR_CATEGORY             (c, "interval", 0, "Behavior");
	CLASS_ATTR_ORDER                (c, "interval", 0, "1");
	CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN           (c, "interval", 20);
	CLASS_ATTR_DEFAULT              (c, "interval", 0, "100");
	CLASS_ATTR_SAVE                 (c, "interval", 1);
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_hoa_meter, f_color_bg);
	CLASS_ATTR_CATEGORY             (c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.9 0.9 0.9 1.");
	
	CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_hoa_meter, f_color_bd);
	CLASS_ATTR_CATEGORY             (c, "bdcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.1 0.1 0.1 1.");
	
    CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_hoa_meter, f_color_cold);
    CLASS_ATTR_CATEGORY             (c, "coldcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "coldcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "coldcolor", 0, "Cold Signal Color");
	CLASS_ATTR_ORDER                (c, "coldcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "coldcolor", 0, "0. 0.6 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "tepidcolor", 0, t_hoa_meter, f_color_tepid);
    CLASS_ATTR_CATEGORY             (c, "tepidcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "tepidcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "tepidcolor", 0, "Tepid Signal Color");
	CLASS_ATTR_ORDER                (c, "tepidcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "tepidcolor", 0, "0.6 0.73 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "warmcolor", 0, t_hoa_meter, f_color_warm);
    CLASS_ATTR_CATEGORY             (c, "warmcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "warmcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "warmcolor", 0, "Warm Signal Color");
	CLASS_ATTR_ORDER                (c, "warmcolor", 0, "6");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "warmcolor", 0, ".85 .85 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "hotcolor", 0, t_hoa_meter, f_color_hot);
    CLASS_ATTR_CATEGORY             (c, "hotcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "hotcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "hotcolor", 0, "Hot Signal Color");
	CLASS_ATTR_ORDER                (c, "hotcolor", 0, "7");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hotcolor", 0, "1. 0.6 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "overcolor", 0, t_hoa_meter, f_color_over);
    CLASS_ATTR_CATEGORY             (c, "overcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "overcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "overcolor", 0, "Overload Signal Color");
	CLASS_ATTR_ORDER                (c, "overcolor", 0, "8");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "overcolor", 0, "1. 0. 0. 0.8");
	
	CLASS_ATTR_DOUBLE_ARRAY         (c, "camera", 0, t_hoa_meter, f_camera, 2);
	CLASS_ATTR_CATEGORY             (c, "camera", 0, "Rendering Context");
    CLASS_ATTR_ORDER                (c, "camera", 0, "1");
	CLASS_ATTR_LABEL                (c, "camera", 0, "Camera");
	CLASS_ATTR_DEFAULT_SAVE         (c, "camera", 0, "0. 0.");
	CLASS_ATTR_ACCESSORS            (c, "camera", NULL, hoa_meter_attr_set_camera);
    CLASS_ATTR_PAINT                (c, "camera", 1);
    
	class_register(CLASS_BOX, c);
	hoa_meter_class = c;
    
	return 0;
}
Ejemplo n.º 29
0
int C74_EXPORT main()
{
	t_class *c;

	c = class_new("hoa.2d.scope~", (method)hoa_scope_new, (method)hoa_scope_free, (short)sizeof(t_hoa_scope), 0L, A_GIMME, 0);
    class_alias(c, gensym("hoa.scope~"));
    
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	class_dspinitjbox(c);
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH);
    
    hoa_initclass(c, (method)hoa_getinfos);
	class_addmethod(c, (method)hoa_scope_dsp64,			"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)hoa_scope_assist,		"assist",		A_CANT,	0);
	class_addmethod(c, (method)hoa_scope_paint,			"paint",		A_CANT,	0);
	class_addmethod(c, (method)hoa_scope_notify,		"notify",		A_CANT, 0);
	class_addmethod(c, (method)hoa_scope_getdrawparams, "getdrawparams", A_CANT, 0);
	class_addmethod(c, (method)hoa_scope_oksize,		"oksize",		A_CANT, 0);

    CLASS_ATTR_INVISIBLE            (c, "color", 0);
	CLASS_ATTR_INVISIBLE            (c, "textcolor", 0);
	CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 225 225");

    CLASS_ATTR_LONG                 (c, "order", 0, t_hoa_scope, f_order);
    CLASS_ATTR_ACCESSORS            (c, "order", NULL, set_order);
	CLASS_ATTR_CATEGORY             (c, "order", 0, "Ambisonic");
	CLASS_ATTR_ORDER                (c, "order", 0, "1");
	CLASS_ATTR_LABEL                (c, "order", 0, "Ambisonic Order");
	CLASS_ATTR_FILTER_MIN           (c, "order", 1);
	CLASS_ATTR_DEFAULT              (c, "order", 0, "1");
	CLASS_ATTR_SAVE                 (c, "order", 1);
    
    CLASS_ATTR_FLOAT                (c, "gain", 0, t_hoa_scope, f_gain);
	CLASS_ATTR_CATEGORY             (c, "gain", 0, "Behavior");
	CLASS_ATTR_ORDER                (c, "gain", 0, "1");
	CLASS_ATTR_LABEL                (c, "gain", 0, "Gain");
	CLASS_ATTR_FILTER_MIN           (c, "gain", 1.);
	CLASS_ATTR_DEFAULT              (c, "gain", 0, "1.");
	CLASS_ATTR_SAVE                 (c, "gain", 1);

	CLASS_ATTR_LONG                 (c, "interval", 0, t_hoa_scope, f_interval);
	CLASS_ATTR_CATEGORY             (c, "interval", 0, "Behavior");
	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, "100");
	CLASS_ATTR_SAVE                 (c, "interval", 1);
	
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_hoa_scope, f_color_bg);
	CLASS_ATTR_CATEGORY             (c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.76 0.76 0.76 1.");
    
    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_hoa_scope, f_color_bd);
	CLASS_ATTR_CATEGORY             (c, "bdcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.7 0.7 0.7 1.");
	
	CLASS_ATTR_RGBA                 (c, "phcolor", 0, t_hoa_scope, f_color_ph);
	CLASS_ATTR_CATEGORY             (c, "phcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "phcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "phcolor", 0, "Positive Harmonics Color");
	CLASS_ATTR_ORDER                (c, "phcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "phcolor", 0, "1. 0. 0. 1.");
	
	CLASS_ATTR_RGBA                 (c, "nhcolor", 0, t_hoa_scope, f_color_nh);
	CLASS_ATTR_CATEGORY             (c, "nhcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "nhcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "nhcolor", 0, "Negative Harmonics Color");
	CLASS_ATTR_ORDER                (c, "nhcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "nhcolor", 0, "0. 0. 1. 1.");
	
	class_register(CLASS_BOX, c);
	hoa_scope_class = c;
	
	return 0;
}
Ejemplo n.º 30
0
extern "C" void setup_hoa0x2e2d0x2escope_tilde(void)
{
    t_eclass *c;

    c = eclass_new("hoa.2d.scope~", (method)hoa_scope_new, (method)hoa_scope_free, (short)sizeof(t_hoa_scope), 0L, A_GIMME, 0);
    class_addcreator((t_newmethod)hoa_scope_new, gensym("hoa.scope~"), A_GIMME, 0);

    eclass_dspinit(c);
    eclass_init(c, 0);
    hoa_initclass(c, (method)hoa_getinfos);
    eclass_addmethod(c, (method)hoa_scope_dsp,			"dsp",          A_CANT, 0);
    eclass_addmethod(c, (method)hoa_scope_assist,		"assist",		A_CANT,	0);
    eclass_addmethod(c, (method)hoa_scope_paint,		"paint",		A_CANT,	0);
    eclass_addmethod(c, (method)hoa_scope_notify,		"notify",		A_CANT, 0);
    eclass_addmethod(c, (method)hoa_scope_getdrawparams,"getdrawparams", A_CANT, 0);
    eclass_addmethod(c, (method)hoa_scope_oksize,		"oksize",		A_CANT, 0);

    eclass_addmethod(c, (method)hoa_scope_deprecated,   "drawcircle",	A_GIMME, 0);
    eclass_addmethod(c, (method)hoa_scope_deprecated,   "drawangles",	A_GIMME, 0);
    eclass_addmethod(c, (method)hoa_scope_deprecated,   "drawcontrib",	A_GIMME, 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, "225. 225.");

    CLASS_ATTR_LONG                 (c, "order", 0, t_hoa_scope, f_order);
    CLASS_ATTR_ACCESSORS            (c, "order", NULL, set_order);
    CLASS_ATTR_CATEGORY             (c, "order", 0, "Ambisonic");
    CLASS_ATTR_ORDER                (c, "order", 0, "1");
    CLASS_ATTR_LABEL                (c, "order", 0, "Ambisonic Order");
    CLASS_ATTR_FILTER_MIN           (c, "order", 1);
    CLASS_ATTR_DEFAULT              (c, "order", 0, "1");
    CLASS_ATTR_SAVE                 (c, "order", 1);

    CLASS_ATTR_FLOAT                (c, "gain", 0, t_hoa_scope, f_gain);
    CLASS_ATTR_CATEGORY             (c, "gain", 0, "Behavior");
    CLASS_ATTR_ORDER                (c, "gain", 0, "1");
    CLASS_ATTR_LABEL                (c, "gain", 0, "Gain");
    CLASS_ATTR_FILTER_MIN           (c, "gain", 1.);
    CLASS_ATTR_DEFAULT              (c, "gain", 0, "1.");
    CLASS_ATTR_SAVE                 (c, "gain", 1);

    CLASS_ATTR_LONG                 (c, "interval", 0, t_hoa_scope, f_interval);
    CLASS_ATTR_CATEGORY             (c, "interval", 0, "Behavior");
    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, "100");
    CLASS_ATTR_SAVE                 (c, "interval", 1);

    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_hoa_scope, f_color_bg);
    CLASS_ATTR_CATEGORY             (c, "bgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "bgcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
    CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.76 0.76 0.76 1.");

    CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_hoa_scope, f_color_bd);
    CLASS_ATTR_CATEGORY             (c, "bdcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "bdcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
    CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.7 0.7 0.7 1.");

    CLASS_ATTR_RGBA                 (c, "phcolor", 0, t_hoa_scope, f_color_ph);
    CLASS_ATTR_CATEGORY             (c, "phcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "phcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "phcolor", 0, "Positive Harmonics Color");
    CLASS_ATTR_ORDER                (c, "phcolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "phcolor", 0, "1. 0. 0. 1.");

    CLASS_ATTR_RGBA                 (c, "nhcolor", 0, t_hoa_scope, f_color_nh);
    CLASS_ATTR_CATEGORY             (c, "nhcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "nhcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "nhcolor", 0, "Negative Harmonics Color");
    CLASS_ATTR_ORDER                (c, "nhcolor", 0, "4");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "nhcolor", 0, "0. 0. 1. 1.");

    eclass_register(CLASS_BOX, c);
    hoa_scope_class = c;
}