Exemple #1
0
extern "C" int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	t_class *c;

	c = class_new("tap.colorspace",(method)cs_new, (method)cs_free, sizeof(t_cs), (method)0L, A_GIMME, 0);

	common_symbols_init();
	class_addmethod(c, (method)cs_bang,					"bang", 0L);	
    class_addmethod(c, (method)cs_int, 					"int", A_LONG, 0L);		// Input as int
    class_addmethod(c, (method)cs_float, 				"float", A_FLOAT, 0L);	// Input as float
    class_addmethod(c, (method)cs_list,					"list", A_GIMME, 0L);
    class_addmethod(c, (method)cs_assist, 				"assist", A_CANT, 0L); 
    class_addmethod(c, (method)object_obex_dumpout, 	"dumpout", A_CANT,0);      
	class_addmethod(c, (method)cs_inletinfo,			"inletinfo",	A_CANT, 0);


	CLASS_ATTR_SYM(c,		"mode",			0,	t_cs, attr_mode);
	CLASS_ATTR_ENUM(c,		"mode",			0,	
"no_transform rgb2cmy cmy2rgb rgb2hsv hsv2rgb rgb2xyz xyz2rgb rgb2uvw uvw2rgb rgb2retinalcone retinalcone2rgb rgb2lab lab2rgb rgb2yiq yiq2rgb rgb2hls hls2rgb rgb2rgbcie rgbcie2rgb rgb2rgbsmpte rgbsmpte2rgb rgb2hsl hsl2rgb");
	
	CLASS_ATTR_SYM(c,		"outputtype",	0,	t_cs, attr_outputtype);
	CLASS_ATTR_ENUM(c,		"outputtype",	0,	"split packed");
	
	CLASS_ATTR_LONG(c,		"autopack",		0,	t_cs, attr_autopack);
	CLASS_ATTR_STYLE(c,		"autopack",		0,	"onoff");

	this_class = c; class_register(_sym_box, c);

	// initialize class globals
	ps_no_transform		= gensym("no_transform");
	ps_rgb2cmy			= gensym("rgb2cmy");
	ps_cmy2rgb			= gensym("cmy2rgb");
	ps_rgb2hsv			= gensym("rgb2hsv");
	ps_hsv2rgb			= gensym("hsv2rgb");
	ps_rgb2xyz			= gensym("rgb2xyz");
	ps_xyz2rgb			= gensym("xyz2rgb");
	ps_rgb2uvw			= gensym("rgb2uvw");
	ps_uvw2rgb			= gensym("uvw2rgb");
	ps_rgb2retinalcone	= gensym("rgb2retinalcone");
	ps_retinalcone2rgb	= gensym("retinalcone2rgb");
	ps_rgb2lab			= gensym("rgb2lab");
	ps_lab2rgb			= gensym("lab2rgb");
	ps_rgb2yiq			= gensym("rgb2yiq");
	ps_yiq2rgb			= gensym("yiq2rgb");
	ps_rgb2hls			= gensym("rgb2hls");
	ps_hls2rgb			= gensym("hls2rgb");
	ps_rgb2rgbcie		= gensym("rgb2rgbcie");
	ps_rgbcie2rgb		= gensym("rgbcie2rgb");
	ps_rgb2rgbsmpte		= gensym("rgb2rgbsmpte");
	ps_rgbsmpte2rgb		= gensym("rgbsmpte2rgb");
	ps_rgb2hsl			= gensym("rgb2hsl");
	ps_hsl2rgb			= gensym("hsl2rgb");
	
	ps_split			= gensym("split");
	ps_packed			= gensym("packed");
	
	// Finalize our class
	class_register(CLASS_BOX, c);
	this_class = c;
}
int C74_EXPORT main(void)
{	
	t_class *c;
	
	c = class_new("hoa.3d.decoder~", (method)hoa_decoder_new, (method)hoa_decoder_free, (long)sizeof(t_hoa_decoder), 0L, A_GIMME, 0);
	
	hoa_initclass(c, (method)hoa_getinfos);
	
	// @method signal @digest Array of spherical harmonic signals to decode for a set of loudspeakers
	// @description Array of spherical harmonic signals to decode for a set of loudspeakers
	class_addmethod(c, (method)hoa_decoder_dsp64,             "dsp64",      A_CANT, 0);
	class_addmethod(c, (method)hoa_decoder_assist,            "assist",     A_CANT, 0);
	
	CLASS_ATTR_SYM              (c, "mode", 0, t_hoa_decoder, f_mode);
    CLASS_ATTR_LABEL            (c, "mode", 0, "Mode");
    CLASS_ATTR_ENUM             (c, "mode", 0, "ambisonic binaural irregular");
	CLASS_ATTR_ACCESSORS		(c, "mode", NULL, mode_set);
    CLASS_ATTR_ORDER            (c, "mode", 0, "1");
    CLASS_ATTR_SAVE             (c, "mode", 1);
    // @description There is three decoding <m>mode</m> :
    // <ul>
    // <li><b>Ambisonics</b> : for a regular loudspeakers repartition over a sphere.</li>
    // <li><b>Binaural</b> : for headphones.</li>
    // <li><b>Irregular</b> : for an irregular loudspeakers repartition</li>
    // </ul>
	
	CLASS_ATTR_DOUBLE_VARSIZE	(c, "angles", ATTR_SET_DEFER_LOW, t_hoa_decoder, f_angles_of_channels, f_number_of_angles, MAX_CHANNELS*2);
	CLASS_ATTR_LABEL			(c, "angles", 0, "Angles of Channels");
	CLASS_ATTR_ACCESSORS		(c, "angles", NULL, angles_set);
	CLASS_ATTR_ORDER			(c, "angles", 0, "2");
	// @description Set the angles of each channels in degrees. The angles of channels are only settable in <b>irregular</b> <m>mode</m>. Each angles are in degrees, wrapped between 0. and 360. You must specify 2 values per channel corresponding to the azimuth value followed by the elevation value.
    
    CLASS_ATTR_DOUBLE_ARRAY     (c, "offset", 0, t_hoa_decoder, f_offset, 2);
    CLASS_ATTR_LABEL            (c, "offset", 0, "Offset of Channels");
	CLASS_ATTR_ACCESSORS		(c, "offset", NULL, offset_set);
    CLASS_ATTR_DEFAULT          (c, "offset", 0, "0 0");
    CLASS_ATTR_ORDER            (c, "offset", 0, "3");
    // @description Set the offsets of channels with a list of 2 float values corresponding to the azimuth and elevation offset, in degrees between 0. and 360.
	
	CLASS_ATTR_SYM              (c, "pinna", 0, t_hoa_decoder, f_pinna);
    CLASS_ATTR_LABEL            (c, "pinna", 0, "Pinna Size");
    CLASS_ATTR_ENUM             (c, "pinna", 0, "small large");
	CLASS_ATTR_ACCESSORS		(c, "pinna", NULL, pinna_set);
    CLASS_ATTR_ORDER            (c, "pinna", 0, "4");
    // @description The pinna size to use for the binaural restitution. The <m>pinna</m> message followed by the <b>symbol</b> <b>small</b> or <b>large</b> set the pinna size of the HRTF responses for the binaural restitution. Choose the one that suits you best.
    
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	hoa_decoder_class = c;
	return 0;
}
Exemple #3
0
int C74_EXPORT main(void)
{	
	WrappedClassOptionsPtr	options = new WrappedClassOptions;
	WrappedClassPtr			c = NULL;	
	TTValue					v(2);
	
	TTDSPInit();
	options->append(TT("fixedNumOutputChannels"), v);
	wrapTTClassAsMaxClass(TT("panorama"), "j.panorama~", &c, options);
	CLASS_ATTR_ENUM(c->maxClass, "mode", 0, "calculate lookup");
	CLASS_ATTR_ENUM(c->maxClass, "shape", 0, "equalPower linear squareRoot");
	
	return 0;
}
Exemple #4
0
int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	ClassPtr c;
	
	TTAudioGraphInit();	
	common_symbols_init();
	
	c = class_new("jcom.op≈", (method)OpNew, (method)OpFree, sizeof(Op), (method)0L, A_GIMME, 0);
	
	class_addmethod(c, (method)OpResetAudio,		"audio.reset",		A_CANT, 0);
	class_addmethod(c, (method)OpSetupAudio,		"audio.setup",		A_CANT, 0);
	class_addmethod(c, (method)OpConnectAudio,		"audio.connect",	A_OBJ, A_LONG, 0);
	class_addmethod(c, (method)OpDropAudio,			"audio.drop",		A_CANT, 0);
	class_addmethod(c, (method)MaxAudioGraphObject,	"audio.object",		A_CANT, 0);
	class_addmethod(c, (method)MaxAudioGraphReset,	"graph.reset",			A_CANT, 0);
	//class_addmethod(c, (method)OpSetup,			"graph.setup",			A_CANT, 0); // no setup -- no graph outlets
	class_addmethod(c, (method)MaxGraphConnect,		"graph.connect",		A_OBJ, A_LONG, 0);
 	class_addmethod(c, (method)MaxGraphDrop,		"graph.drop",			A_CANT, 0);
	class_addmethod(c, (method)MaxGraphObject,		"graph.object",			A_CANT, 0);
	class_addmethod(c, (method)OpAssist,			"assist",				A_CANT, 0); 
    class_addmethod(c, (method)object_obex_dumpout,	"dumpout",				A_CANT, 0);  
	
	CLASS_ATTR_SYM(c,		"operator",	0,		Op,	attrOperator);
	CLASS_ATTR_ACCESSORS(c,	"operator",	OpGetOperator,	OpSetOperator);
	CLASS_ATTR_ENUM(c,		"operator",	0,	"+ - * / % > >= == != <= < abs acos asin atan ceil cos cosh exp floor log log10 sin sinh sqrt tan tanh");
	
	CLASS_ATTR_FLOAT(c,		"operand",	0,		Op,	attrOperand);
	CLASS_ATTR_ACCESSORS(c,	"operand",	OpGetOperand,	OpSetOperand);
	
	class_register(_sym_box, c);
	sOpClass = c;
	return 0;
}
Exemple #5
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;
}
Exemple #6
0
t_jit_err jit_field_mesh_init(void)
{
	long attrflags=0;
	t_jit_object *attr;
		
	_jit_field_mesh_class = jit_class_new("jit_field_mesh",(method)jit_field_mesh_new,(method)jit_field_mesh_free,
		sizeof(t_jit_field_mesh),0L);

	// add attributes	
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_jit_field, "jit_field", A_GIMME, 0L);
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_vertex_matrix, "get_vertex_matrix", A_CANT, 0L);
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_normal_matrix, "get_normal_matrix", A_CANT, 0L);
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_get_index_matrix, "get_index_matrix",	A_CANT, 0L);
	jit_class_addmethod(_jit_field_mesh_class, (method)jit_field_mesh_volume_to_mesh, "volume_to_mesh",	A_CANT, 0L);
	
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset, "isolevel", _jit_sym_float32, attrflags,
				(method)0L, (method)0L, calcoffset(t_jit_field_mesh, isolevel));
    jit_class_addattr(_jit_field_mesh_class, (t_jit_object*)attr);
	
	attr = (t_jit_object *)jit_object_new(_jit_sym_jit_attr_offset, "mode", _jit_sym_symbol, attrflags,
				(method)0L, (method)0L, calcoffset(t_jit_field_mesh, mode));
    jit_class_addattr(_jit_field_mesh_class, (t_jit_object*)attr);
	CLASS_ATTR_ENUM((t_class *)_jit_field_mesh_class, "mode", 0, "mesh particles");

	jit_class_register(_jit_field_mesh_class);

	return JIT_ERR_NONE;
}
Exemple #7
0
extern "C" int TTCLASSWRAPPERMAX_EXPORT main(void)
{	
	t_class *c;
	
	c = class_new("tap.bits",(method)bits_new, (method)0L, sizeof(t_bits), (method)0L, A_GIMME, 0);

	common_symbols_init();
	class_addmethod(c, (method)bits_int,		"int", A_LONG, 0L);
	class_addmethod(c, (method)bits_list,		"list", A_GIMME, 0L);	
	class_addmethod(c, (method)bits_assist,		"assist", A_CANT, 0L); 
	class_addmethod(c, (method)stdinletinfo,	"inletinfo",	A_CANT, 0);

	CLASS_ATTR_SYM(c,		"mode",			0,	t_bits, mode);
	CLASS_ATTR_ENUM(c,		"mode",			0, "bits2ints ints2bits matrixctrl2ints ints2matrixctrl");
	
	CLASS_ATTR_LONG(c,		"matrix_width",	0,	t_bits, matrix_width);

	class_register(_sym_box, c);
	bits_class = c;

	// Initialize Globals
	ps_bits2ints = gensym("bits2ints");	// Initialize these globals (so we don't have to constantly run a gensym for them in our methods)
	ps_ints2bits = gensym("ints2bits");
	ps_matrixctrl2ints = gensym("matrixctrl2ints");
	ps_ints2matrixctrl = gensym("ints2matrixctrl");
	
	return 0;
}
Exemple #8
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;
}
Exemple #9
0
int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	t_class *c;

	TTDSPInit();	
	common_symbols_init();

	c = class_new("jcom.op~",(method)op_new, (method)op_free, sizeof(t_op), (method)0L, A_GIMME, 0);
	
 	class_addmethod(c, (method)op_dsp,					"dsp",			A_CANT, 0);
	class_addmethod(c, (method)op_dsp64,				"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)op_assist,				"assist",		A_CANT, 0); 
    class_addmethod(c, (method)object_obex_dumpout,		"dumpout", 		A_CANT, 0);  
	
	CLASS_ATTR_SYM(c,		"operator",		0,	t_op,	attrOperator);
	CLASS_ATTR_ACCESSORS(c,	"operator",		NULL,	op_setOperator);
	CLASS_ATTR_ENUM(c,		"operator",	0,	"+ - * / % > >= == != <= < abs acos asin atan ceil cos cosh exp floor log log10 sin sinh sqrt tan tanh");

	CLASS_ATTR_FLOAT(c,		"operand",		0,	t_op,	attrOperand);
	CLASS_ATTR_ACCESSORS(c,	"operand",		NULL,	op_setOperand);

	class_dspinit(c);						// Setup object's class to work with MSP
	class_register(CLASS_BOX, c);
	s_op_class = c;
	return 0;
}
Exemple #10
0
extern "C" int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	t_class *c;

	c = class_new("tap.decibels~",(method)decibels_new, (method)dsp_free, sizeof(t_decibels), 
		(method)0L, A_GIMME, 0);

		common_symbols_init();
	class_addmethod(c, (method)decibels_dsp, 			"dsp", A_CANT, 0L);		
	class_addmethod(c, (method)decibels_dsp64, "dsp64", A_CANT, 0);
    class_addmethod(c, (method)decibels_int, 			"int", A_LONG, 0L);		// Input as int
    class_addmethod(c, (method)decibels_float, 			"float", A_FLOAT, 0L);	// Input as double
    class_addmethod(c, (method)decibels_assist, 		"assist", A_CANT, 0L); 
	class_addmethod(c, (method)stdinletinfo,			"inletinfo",	A_CANT, 0);

	CLASS_ATTR_SYM(c,		"mode",			0,	t_decibels, attr_mode);
	CLASS_ATTR_ACCESSORS(c,	"mode",			NULL, attr_set_mode);
	CLASS_ATTR_ENUM(c,		"mode",			0,	"amp2db db2amp mm2db db2mm mm2amp amp2mm db2midi midi2db");

	class_dspinit(c);									// Setup object's class to work with MSP
class_register(_sym_box, c); 	decibels_class = c;

	// initialize class globals
	ps_amp2db = gensym("amp2db");
	ps_db2amp = gensym("db2amp");
	ps_mm2db = gensym("mm2db");
	ps_db2mm = gensym("db2mm");
	ps_mm2amp = gensym("mm2amp");
	ps_amp2mm = gensym("amp2mm");
	ps_db2midi = gensym("db2midi");
	ps_midi2db = gensym("midi2db");
}
int C74_EXPORT main(void)
{
	MaxAudioGraphWrappedClassOptionsPtr	options = new MaxAudioGraphWrappedClassOptions;
	TTValue								value(0);
	MaxAudioGraphWrappedClassPtr			c = NULL;
	
	TTAudioGraphInit();
	
	wrapAsMaxAudioGraph(TT("soundfile.recorder"), "j.soundfile.recorder=", &c, options);
    CLASS_ATTR_ENUM(c->maxClass, "format", 0, "AIFF AIFF-16bit AIFF-24bit AIFF-32bit CAF CAF-16bit CAF-24bit CAF-32bit FLAC FLAC-16bit FLAC-24bit FLAC-32bit Matlab-16bit Matlab-32bit Matlab-64bit WAV WAV-16bit WAV-24bit WAV-32bit");
	
	wrapAsMaxAudioGraph(TT("soundfile.recorder"), "soundfile.recorder=", &c, options);
    CLASS_ATTR_ENUM(c->maxClass, "format", 0, "AIFF AIFF-16bit AIFF-24bit AIFF-32bit CAF CAF-16bit CAF-24bit CAF-32bit FLAC FLAC-16bit FLAC-24bit FLAC-32bit Matlab-16bit Matlab-32bit Matlab-64bit WAV WAV-16bit WAV-24bit WAV-32bit");

	return 0;
}
int TTCLASSWRAPPERMAX_EXPORT main(void)
{   
	MaxAudioGraphWrappedClassOptionsPtr	options = new MaxAudioGraphWrappedClassOptions;
	TTValue								value(0);
	MaxAudioGraphWrappedClassPtr		c = NULL;
	
	TTAudioGraphInit();
	
	wrapAsMaxAudioGraph(TT("average"), "jcom.average≈", &c, options);
	CLASS_ATTR_ENUM(c->maxClass, "mode", 0, "absolute bipolar rms");

	wrapAsMaxAudioGraph(TT("average"), "average≈", &c, options);
	CLASS_ATTR_ENUM(c->maxClass, "mode", 0, "absolute bipolar rms");

	return 0;
}
Exemple #13
0
int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	MaxAudioGraphWrappedClassOptionsPtr	options = new MaxAudioGraphWrappedClassOptions;
//	TTValue								value(0);
	MaxAudioGraphWrappedClassPtr			c = NULL;

	TTAudioGraphInit();

//	options->append(TT("generator"), value);
	options->append(TT("generator"), YES);
	options->append(TT("userCanSetNumChannels"), YES);
	wrapAsMaxAudioGraph(TT("noise"), "j.noise=", &c, options);
	CLASS_ATTR_ENUM(c->maxClass, "mode", 0, "white pink brown blue gauss");
	wrapAsMaxAudioGraph(TT("noise"), "noise=", &c, options);
	CLASS_ATTR_ENUM(c->maxClass, "mode", 0, "white pink brown blue gauss");
	return 0;
}
int JAMOMA_EXPORT_MAXOBJ main(void)
{
	t_class 	*c;
	t_object 	*attr = NULL;
	long		numDataspaces = 0;
	SymbolPtr*	dataspaceNames = NULL;
	char		dataspaces[2048];
	short		i;

	jamoma_init();
	common_symbols_init();
	
	jamoma_getDataspaceList(&numDataspaces, &dataspaceNames);
	dataspaces[0] = 0;
	for (i=0; i<numDataspaces; i++)
	{
		strcat(dataspaces, dataspaceNames[i]->s_name);
		strcat(dataspaces, " ");
	}

	// Define our class
	c = class_new("jcom.return",(method)return_new, (method)return_free, sizeof(t_return), (method)0L, A_GIMME, 0);
	
	// Make methods accessible for our class:
	class_addmethod(c, (method)return_bang,					"bang",			A_CANT, 0L);
	class_addmethod(c, (method)return_int,					"int",			A_DEFLONG,	0L);
	class_addmethod(c, (method)return_float,				"float",		A_DEFFLOAT,	0L);
 	class_addmethod(c, (method)return_list,					"list",			A_GIMME, 0L);
 	class_addmethod(c, (method)return_symbol,				"anything",		A_GIMME, 0L);
	class_addmethod(c, (method)return_dump,					"dump",			0L);
	class_addmethod(c, (method)return_updatename,			"update_name",	A_CANT, 0L);
	class_addmethod(c, (method)return_assist,				"assist",		A_CANT, 0L); 

	jcom_core_subscriber_classinit_extended(c, attr);
	
	// ATTRIBUTE: type - options are generic, integer, decimal, string, boolean
	jamoma_class_attr_new(c, "type", _sym_symbol, (method)return_attr_settype, (method)return_attr_gettype);
	
	// ATTRIBUTES: dataspace stuff
	
	CLASS_ATTR_SYM(c,						"dataspace",					0,	t_return, attrDataspace);
	CLASS_ATTR_LABEL(c,						"dataspace",					0,	"dataspace");
	CLASS_ATTR_ENUM(c,						"dataspace",					0, dataspaces);

	CLASS_ATTR_SYM(c,						"dataspace/unit/native",		0,	t_return, attrUnitNative);
	CLASS_ATTR_LABEL(c,						"dataspace/unit/native",		0,	"dataspace/unit/native");
		
	CLASS_ATTR_CHAR(c,						"enable",						0,	t_return,	attrEnable);
	CLASS_ATTR_STYLE(c,						"enable",						0,	"onoff");
	
	// Finalize our class
	class_register(CLASS_BOX, c);
	return_class = c;
	
	return 0;
}
void ext_main(void *r)
#endif
{
    t_class *c;
    
    c = class_new("hoa.3d.decoder~", (method)hoa_3d_decoder_new, (method)hoa_3d_decoder_free, (long)sizeof(t_hoa_3d_decoder), 0L, A_GIMME, 0);
    class_setname((char *)"hoa.3d.decoder~", (char *)"hoa.3d.decoder~");
    
    hoa_initclass(c, (method)hoa_getinfos);
    
    // @method signal @digest Array of spherical harmonic signals to decode for a set of loudspeakers.
    // @description Array of spherical harmonic signals to decode for a set of loudspeakers.
    class_addmethod(c, (method)hoa_3d_decoder_dsp64,             "dsp64",      A_CANT, 0);
    class_addmethod(c, (method)hoa_3d_decoder_assist,            "assist",     A_CANT, 0);
    
    CLASS_ATTR_SYM              (c, "mode", 0, t_hoa_3d_decoder, f_mode);
    CLASS_ATTR_LABEL            (c, "mode", 0, "Mode");
    CLASS_ATTR_ENUM             (c, "mode", 0, "ambisonic binaural");
    CLASS_ATTR_ACCESSORS		(c, "mode", NULL, mode_set);
    CLASS_ATTR_ORDER            (c, "mode", 0, "1");
    // @description There is two decoding <m>mode</m> :
    // <ul>
    // <li><b>regular</b> : for a regular or irregular loudspeakers repartition over a sphere.</li>
    // <li><b>binaural</b> : for headphones.</li>
    // </ul>
    
    CLASS_ATTR_DOUBLE_VARSIZE	(c, "angles", ATTR_SET_DEFER_LOW, t_hoa_3d_decoder, f_angles_of_channels, f_number_of_angles, HOA_MAX_PLANEWAVES*2);
    CLASS_ATTR_LABEL			(c, "angles", 0, "Angles of Channels");
    CLASS_ATTR_ACCESSORS		(c, "angles", NULL, angles_set);
    CLASS_ATTR_ORDER			(c, "angles", 0, "2");
    // @description Set the angles of each channels in degrees. The angles of channels are only settable in <b>irregular</b> <m>mode</m>. Each angles are in degrees, wrapped between 0. and 360. You must specify 2 values per channel corresponding to the azimuth value followed by the elevation value.
    
    CLASS_ATTR_DOUBLE_ARRAY     (c, "offset", ATTR_SET_DEFER_LOW, t_hoa_3d_decoder, f_offsets, 3);
    CLASS_ATTR_LABEL            (c, "offset", 0, "Offset of Channels");
    CLASS_ATTR_ACCESSORS		(c, "offset", NULL, offset_set);
    CLASS_ATTR_ORDER            (c, "offset", 0, "3");
    // @description Set the offsets of channels with a list of 2 float values corresponding to the azimuth and elevation offset, in degrees between 0. and 360.
    
    CLASS_ATTR_LONG             (c, "channels", ATTR_SET_DEFER_LOW, t_hoa_3d_decoder, f_number_of_channels);
    CLASS_ATTR_LABEL            (c, "channels", 0, "Number of Channels");
    CLASS_ATTR_ACCESSORS		(c, "channels", NULL, channel_set);
    CLASS_ATTR_ORDER            (c, "channels", 0, "4");
    // @description The number of channels.
    
    CLASS_ATTR_LONG             (c, "crop", 0, t_hoa_3d_decoder, f_cropsize);
    CLASS_ATTR_ACCESSORS		(c, "crop", NULL, crop_set);
    CLASS_ATTR_LABEL            (c, "crop", 0, "Crop of the Responses");
    CLASS_ATTR_ORDER            (c, "crop", 0, "5");
    // @description The crop attribute can be used in binaural mode to reduce the CPU usage by cropping the impulse responses (between 0 and 512) 0 means no crop
    
    class_dspinit(c);
    class_register(CLASS_BOX, c);	
    hoa_3d_decoder_class = c;
}
Exemple #16
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;
}
int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	WrappedClassOptionsPtr	options = new WrappedClassOptions;
	TTValue					value;
	WrappedClassPtr			c = NULL;

	TTFoundationInit();
	
	value.clear();
	value.append(0);
	options->append(TT("fixedNumChannels"), value);
	
	wrapTTClassAsMaxClass(TT("net.send"), "jcom.net.send", &c, options);
	CLASS_ATTR_ENUM(c->maxClass, "mode", 0, "tcp udp");
	return 0;
}
void jcom_core_subscriber_classinit_extended(t_class *c, t_object *attr, bool define_name)
{
	jcom_core_subscriber_classinit_common(c, attr, define_name);

	// TODO: The name of the attributes should be substituted for their jps_* symbol pointers.
	
	// ATTRIBUTE: range <low, high>
	jamoma_class_attr_array_new(c, 	"range/bounds", 		_sym_float32, 2, (method)jcom_core_attr_setrange, (method)jcom_core_attr_getrange);
		
	// ATTRIBUTE: clipmode - options are none, low, high, both, wrap, fold
	jamoma_class_attr_new(c, 		"range/clipmode",	 	_sym_symbol, (method)jcom_core_attr_setclipmode, (method)jcom_core_attr_getclipmode);
	CLASS_ATTR_ENUM(c,				"range/clipmode",		0,	(char*)"none low high both wrap fold");	

	// ATTRIBUTE: repetitions - 0 means repetitive values are not allowed, 1 means they are
	jamoma_class_attr_new(c, 		"repetitions/allow", 	_sym_long, (method)jcom_core_attr_setrepetitions, (method)jcom_core_attr_getrepetitions);

	// ATTRIBUTE: type 
	// this is not defined here because some objects (i.e jcom.parameter) need to treat this in different ways

	// ATTRIBUTE: description - does nothing, but is accessed by jcom.dispatcher for /autodoc generation
	jamoma_class_attr_new(c,		"description", 			_sym_symbol, (method)jcom_core_attr_setdescription, (method)jcom_core_attr_getdescription);
	CLASS_ATTR_STYLE(c,				"description",			0, "text_onesymbol");
}
Exemple #19
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;
}
Exemple #20
0
int C74_EXPORT main(void)
{	
	t_class *c;
	
	c = class_new("hoa.decoder~", (method)HoaDecode_new, (method)HoaDecode_free, (long)sizeof(t_HoaDecode), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)HoaDecode_dsp64,		"dsp64",	A_CANT, 0);
	class_addmethod(c, (method)HoaDecode_assist,	"assist",	A_CANT, 0);
    
    /* Attribut Global */
    CLASS_ATTR_SYM              (c, "mode", 0, t_HoaDecode, f_mode);
	CLASS_ATTR_CATEGORY			(c, "mode", 0, "Behavior");
    CLASS_ATTR_LABEL            (c, "mode", 0, "Mode");
    CLASS_ATTR_ENUM             (c, "mode", 0, "ambisonic binaural irregular");
	CLASS_ATTR_ACCESSORS		(c, "mode", NULL, configuration_set);
    CLASS_ATTR_ORDER            (c, "mode", 0, "1");
    CLASS_ATTR_SAVE             (c, "mode", 1);
    
    CLASS_ATTR_LONG             (c, "channels", 0, t_HoaDecode, f_number_of_loudspeakers);
	CLASS_ATTR_CATEGORY			(c, "channels", 0, "Behavior");
    CLASS_ATTR_LABEL            (c, "channels", 0, "Number of Loudspeakers");
	CLASS_ATTR_ACCESSORS		(c, "channels", NULL, loudspeakers_set);
    CLASS_ATTR_ORDER            (c, "channels", 0, "2");
    CLASS_ATTR_SAVE             (c, "channels", 1);
    CLASS_ATTR_ALIAS            (c, "channels", "loudspeakers");
    CLASS_ATTR_ALIAS            (c, "channels", "ychannels");
    
    /* Binaural */
    CLASS_ATTR_SYM              (c, "pinnaesize", 0, t_HoaDecode, f_pinna_size);
	CLASS_ATTR_CATEGORY			(c, "pinnaesize", 0, "Behavior");
    CLASS_ATTR_LABEL            (c, "pinnaesize", 0, "Pinnae Size");
    CLASS_ATTR_ENUM             (c, "pinnaesize", 0, "small large");
	CLASS_ATTR_ACCESSORS		(c, "pinnaesize", NULL, pinnaesize_set);
    CLASS_ATTR_ORDER            (c, "pinnaesize", 0, "4");
    CLASS_ATTR_SAVE             (c, "pinnaesize", 1);
    
    /* Irregular */
    CLASS_ATTR_DOUBLE_VARSIZE   (c, "angles", 0, t_HoaDecode, f_angles_of_loudspeakers, f_number_of_loudspeakers, MAX_SPEAKER);
	CLASS_ATTR_CATEGORY			(c, "angles", 0, "Behavior");
    CLASS_ATTR_LABEL            (c, "angles", 0, "Angles of Loudspeakers");
	CLASS_ATTR_ACCESSORS		(c, "angles", NULL, angles_set);
    CLASS_ATTR_ORDER            (c, "angles", 0, "5");
	CLASS_ATTR_SAVE             (c, "angles", 1);
    CLASS_ATTR_ALIAS            (c, "angles", "zchannels");
    
    CLASS_ATTR_SYM              (c, "restitution", 0, t_HoaDecode, f_resitution_mode);
	CLASS_ATTR_CATEGORY			(c, "restitution", 0, "Behavior");
    CLASS_ATTR_LABEL            (c, "restitution", 0, "Restitution Mode");
    CLASS_ATTR_ENUM             (c, "restitution", 0, "panning projection");
	CLASS_ATTR_ACCESSORS		(c, "restitution", NULL, restitution_set);
    CLASS_ATTR_ORDER            (c, "restitution", 0, "6");
    CLASS_ATTR_SAVE             (c, "restitution", 1);
    
    CLASS_ATTR_LONG             (c, "autoconnect", 0, t_HoaDecode, 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, "7");
    CLASS_ATTR_SAVE             (c, "autoconnect", 1);
    
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	HoaDecode_class = c;
	
	class_findbyname(CLASS_BOX, gensym("hoa.encoder~"));
	return 0;
}
t_jit_err jit_gl_videoplane_init(void) 
{
	long attrflags=0;
	long ob3d_flags=0;
	t_jit_object *attr;
	void * ob3d;
	
	_jit_gl_videoplane_class = jit_class_new("jit_gl_videoplane", (method)jit_gl_videoplane_new, (method)jit_gl_videoplane_free,
		sizeof(t_jit_gl_videoplane),A_DEFSYM,0L);
	
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_jit_matrix,		"jit_matrix", 			A_USURP_LOW, 0);	
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_sendtexture,	"sendtexture", 			A_DEFER_LOW, 0);	

	// set up object extension for 3d object, customized with flags
	ob3d = jit_ob3d_setup(_jit_gl_videoplane_class, calcoffset(t_jit_gl_videoplane, ob3d), ob3d_flags);

	// add attributes
	attrflags = JIT_ATTR_GET_DEFER_LOW | JIT_ATTR_SET_USURP_LOW;
	attr = jit_object_new(_jit_sym_jit_attr_offset_array,"dim",_jit_sym_long,2,attrflags,
		(method)0L,(method)jit_gl_videoplane_dim,0/*fix*/,calcoffset(t_jit_gl_videoplane,dim));
	jit_attr_addfilterset_clip(attr,2,0,TRUE,FALSE);
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"displaylist",_jit_sym_char,attrflags,
		(method)0L,(method)jit_gl_videoplane_displaylist,calcoffset(t_jit_gl_videoplane, displaylist));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"gridmode",_jit_sym_char,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, gridmode));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"interp",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_videoplane_interp,calcoffset(t_jit_gl_videoplane, interp));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"nudge",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, nudge));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_offset_x",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_offset_x));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_offset_y",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_offset_y));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_scale_x",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_scale_x));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	attr = jit_object_new(_jit_sym_jit_attr_offset,"tex_scale_y",_jit_sym_float32,attrflags,
		(method)0L,(method)jit_gl_videoplane_attr_rebuild,calcoffset(t_jit_gl_videoplane, tex_scale_y));	
	jit_class_addattr(_jit_gl_videoplane_class,attr); 				
	attr = jit_object_new(_jit_sym_jit_attr_offset,"rect_tex",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_videoplane_rect_tex,calcoffset(t_jit_gl_videoplane, rect_tex));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"client_storage",_jit_sym_long,attrflags,
		(method)0L,(method)jit_gl_videoplane_client_storage,calcoffset(t_jit_gl_videoplane, client_storage));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"colormode",_jit_sym_symbol,attrflags,
		(method)0L,(method)jit_gl_videoplane_colormode,calcoffset(t_jit_gl_videoplane, colormode));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);
	CLASS_ATTR_ENUM(_jit_gl_videoplane_class,"colormode",0,"argb uyvy");
	
	attr = jit_object_new(_jit_sym_jit_attr_offset,"texturename",_jit_sym_symbol,attrflags,
		(method)0L,(method)jit_gl_videoplane_texturename,calcoffset(t_jit_gl_videoplane, texturename));	
	jit_class_addattr(_jit_gl_videoplane_class,attr);	

	// define our OB3D draw method.  called in automatic mode by 
	// jit.gl.render or otherwise through ob3d when banged. this 
	// method is A_CANT because our draw setup needs to happen 
	// in the ob3d beforehand to initialize OpenGL state 
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_draw, "ob3d_draw", A_CANT, 0L);
	
	// define our dest_closing and dest_changed methods. 
	// these methods are called by jit.gl.render when the 
	// destination context closes or changes: for example, when 
	// the user moves the window from one monitor to another. Any 
	// resources your object keeps in the OpenGL machine 
	// (e.g. textures, display lists, vertex shaders, etc.) 
	// will need to be freed when closing, and rebuilt when it has 
	// changed. 
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_dest_changed, "dest_changed",	A_CANT, 0L);
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_dest_closing, "dest_closing",	A_CANT, 0L);

	// rebuild_geometry is called if texture units or other 
	// attributes change requiring a rebuild
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_gl_videoplane_rebuild_geometry, "rebuild_geometry", 0L);
	
	// must register for ob3d	
	jit_class_addmethod(_jit_gl_videoplane_class, (method)jit_object_register, 				"register",		A_CANT, 0L);

	jit_class_register(_jit_gl_videoplane_class);

	ps_bind				= gensym("bind");
	ps_unbind			= gensym("unbind");
	ps_jit_gl_texture	= gensym("jit_gl_texture");
	ps_rectangle		= gensym("rectangle");
	ps_colormode		= gensym("colormode");
	ps_mode				= gensym("mode");
	ps_static			= gensym("static");
	ps_dynamic			= gensym("dynamic");
	ps_drawto			= gensym("drawto");
	ps_texture			= gensym("texture");
	ps_filter			= gensym("filter");
	ps_linear			= gensym("linear");
	ps_nearest			= gensym("nearest");

	ps_gridmode			= gensym("gridmode");
	ps_nudge			= gensym("nudge");
	ps_tex_offset_x		= gensym("tex_offset_x");
	ps_tex_offset_y		= gensym("tex_offset_y");
	ps_tex_scale_x		= gensym("tex_scale_x");
	ps_tex_scale_y		= gensym("tex_scale_y");


	return JIT_ERR_NONE;
}
int JAMOMA_EXPORT_MAXOBJ main(void)
{
	long		flags;
	t_class*	c;
	long		numDataspaces = 0;
	t_symbol**	dataspaceNames = NULL;
	TTValue		functionNames;
	TTSymbol*	functionName;
	char		dataspaces[2048];
	char		functions[2048];
	char		tempstr[64];
	short		i;

	jamoma_init();
common_symbols_init();
	jamoma_getDataspaceList(&numDataspaces, &dataspaceNames);
	dataspaces[0] = 0;
	for(i=0; i<numDataspaces; i++){
		strcat(dataspaces, dataspaceNames[i]->s_name);
		strcat(dataspaces, " ");
	}
	FunctionLib::getUnitNames(functionNames);
	functions[0] = 0;
	for(i=0; i<functionNames.getSize(); i++){
		functionNames.get(i, &functionName);
		strcat(functions, functionName->getCString());	
		strcat(functions, " ");
	}

	c = class_new("jcom.paramui",
				  (method)paramui_new,
				  (method)paramui_free,
				  sizeof(t_paramui),
				  (method)NULL,
				  A_GIMME,
				  0L);

	flags = JBOX_TEXTFIELD | JBOX_COLOR;
	jbox_initclass(c, flags);
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY; // to specify dictionary constructor

	class_addmethod(c, (method)paramui_notify,			"notify",			A_CANT, 0);
	class_addmethod(c, (method)paramui_paint,			"paint",			A_CANT, 0);
	class_addmethod(c, (method)paramui_mousedown,		"mousedown",		A_CANT, 0);
	class_addmethod(c, (method)paramui_mousedragdelta,	"mousedragdelta",	A_CANT, 0);
	class_addmethod(c, (method)paramui_mouseup,			"mouseup",			A_CANT, 0);
	class_addmethod(c, (method)paramui_oksize,			"oksize",			A_CANT, 0);

	CLASS_ATTR_DEFAULT(c,		"patching_rect",	0, "0. 0. 144. 20.");
	CLASS_ATTR_DEFAULT(c,		"fontname",			0, JAMOMA_DEFAULT_FONT);
	snprintf(tempstr, 64, "%f", JAMOMA_DEFAULT_FONTSIZE);
	CLASS_ATTR_DEFAULT(c,		"fontsize",			0, tempstr);

	CLASS_STICKY_ATTR(c,		"category",			0, "Jamoma");
	
	CLASS_ATTR_SYM(c,			"name",				0, t_paramui, attr_name);
	CLASS_ATTR_LABEL(c,			"name",				0, "Parameter Name");
	CLASS_ATTR_DEFAULT(c,		"name",				0, "my/parameter");
	CLASS_ATTR_SAVE(c,			"name",				0);
	CLASS_ATTR_ACCESSORS(c,		"name",				paramui_getName, paramui_setName);

	CLASS_ATTR_SYM(c,			"label",			0, t_paramui, attr_label);
	CLASS_ATTR_LABEL(c,			"label",			0, "Parameter Label");
	CLASS_ATTR_STYLE(c,			"label",			0, "text_onesymbol");
	CLASS_ATTR_DEFAULT(c,		"label",			0, "");
	CLASS_ATTR_SAVE(c,			"label",			0);

	CLASS_ATTR_SYM(c,			"type",				0, t_paramui, attr_type);
	CLASS_ATTR_LABEL(c,			"type",				0, "Data Type");
	CLASS_ATTR_ENUM(c,			"type",				0, "decimal integer string boolean");
	CLASS_ATTR_DEFAULT(c,		"type",				0, "decimal");
	CLASS_ATTR_SAVE(c,			"type",				0);
	CLASS_ATTR_ACCESSORS(c,		"type",				paramui_getType, paramui_setType);

	CLASS_ATTR_FLOAT_VARSIZE(c,	"value/default",	0, t_paramui, attr_default, attr_defaultSize, LISTSIZE);
	CLASS_ATTR_LABEL(c,			"value/default",	0, "Default Value");
	CLASS_ATTR_DEFAULT(c,		"value/default",	0, "0.");
	CLASS_ATTR_SAVE(c,			"value/default",	0);
	CLASS_ATTR_ACCESSORS(c,		"value/default",	paramui_getDefault, paramui_setDefault);

	CLASS_ATTR_SYM(c,			"ramp/drive",		0, t_paramui, attr_rampDrive);
	CLASS_ATTR_LABEL(c,			"ramp/drive",		0, "Ramp Drive");
	CLASS_ATTR_DEFAULT(c,		"ramp/drive",		0, "none");
	CLASS_ATTR_SAVE(c,			"ramp/drive",		0);
	CLASS_ATTR_ACCESSORS(c,		"ramp/drive",		paramui_getRampDrive, paramui_setRampDrive);

	CLASS_ATTR_SYM(c,			"ramp/function",	0, t_paramui, attr_rampFunction);
	CLASS_ATTR_LABEL(c,			"ramp/function",	0, "Ramp Function/Shape");
	CLASS_ATTR_ENUM(c,			"ramp/function",	0, functions);
	CLASS_ATTR_DEFAULT(c,		"ramp/function",	0, "linear");
	CLASS_ATTR_SAVE(c,			"ramp/function",	0);
	CLASS_ATTR_ACCESSORS(c,		"ramp/function",	paramui_getRampFunction, paramui_setRampFunction);

	CLASS_ATTR_LONG(c,			"view/freeze",		0, t_paramui, attr_uiFreeze);
	CLASS_ATTR_LABEL(c,			"view/freeze",		0, "Freeze the UI");
	CLASS_ATTR_STYLE(c,			"view/freeze",		0, "onoff");
	CLASS_ATTR_DEFAULT(c,		"view/freeze",		0, "0");
	CLASS_ATTR_SAVE(c,			"view/freeze",		0);
	CLASS_ATTR_ACCESSORS(c,		"view/freeze",		paramui_getUIFreeze, paramui_setUIFreeze);

	CLASS_ATTR_FLOAT(c,			"value/stepsize",	0, t_paramui, attr_stepsize);
	CLASS_ATTR_LABEL(c,			"value/stepsize",	0, "Step Size for inc/dec");
	CLASS_ATTR_DEFAULT(c,		"value/stepsize",	0, "1.0");
	CLASS_ATTR_SAVE(c,			"value/stepsize",	0);
	CLASS_ATTR_ACCESSORS(c,		"value/stepsize",	paramui_getStepsize, paramui_setStepsize);

	CLASS_ATTR_LONG(c,			"priority",			0, t_paramui, attr_priority);
	CLASS_ATTR_LABEL(c,			"priority",			0, "Priority when Recalled from Presets");
	CLASS_ATTR_DEFAULT(c,		"priority",			0, "0");
	CLASS_ATTR_SAVE(c,			"priority",			0);
	CLASS_ATTR_ACCESSORS(c,		"priority",			paramui_getPriority, paramui_setPriority);

	CLASS_ATTR_FLOAT_ARRAY(c,	"range/bounds",		0, t_paramui, attr_range, 2);
	CLASS_ATTR_LABEL(c,			"range/bounds",		0, "Range");
	CLASS_ATTR_DEFAULT(c,		"range/bounds",		0, "0.0 1.0");
	CLASS_ATTR_SAVE(c,			"range/bounds",		0);
	CLASS_ATTR_ACCESSORS(c,		"range/bounds",		paramui_getRange, paramui_setRange);

	CLASS_ATTR_LONG(c,			"repetitions/allow",		0, t_paramui, attr_repetitions);
	CLASS_ATTR_LABEL(c,			"repetitions/allow",		0, "Allow Repeated Values");
	CLASS_ATTR_STYLE(c,			"repetitions/allow",		0, "onoff");
	CLASS_ATTR_DEFAULT(c,		"repetitions/allow",		0, "0");
	CLASS_ATTR_SAVE(c,			"repetitions/allow",		0);
	CLASS_ATTR_ACCESSORS(c,		"repetitions/allow",		paramui_getRepetitions, paramui_setRepetitions);

	CLASS_ATTR_SYM(c,			"range/clipmode",	0, t_paramui, attr_clipmode);
	CLASS_ATTR_LABEL(c,			"range/clipmode",	0, "Mode for Clipping to Range");
	CLASS_ATTR_ENUM(c,			"range/clipmode",	0, "none low high both");
	CLASS_ATTR_DEFAULT(c,		"range/clipmode",	0, "none");
	CLASS_ATTR_SAVE(c,			"range/clipmode",	0);
	CLASS_ATTR_ACCESSORS(c,		"range/clipmode",	paramui_getClipmode, paramui_setClipmode);

	CLASS_ATTR_SYM(c,			"description",		0, t_paramui, attr_description);
	CLASS_ATTR_LABEL(c,			"description",		0, "Parameter Description");
	//CLASS_ATTR_STYLE(c,			"description",		0, "text_large");
	CLASS_ATTR_STYLE(c,			"description",		0, "text_onesymbol");
	CLASS_ATTR_DEFAULT(c,		"description",		0, "This parameter should do something.");
	CLASS_ATTR_SAVE(c,			"description",		0);
	CLASS_ATTR_ACCESSORS(c,		"description",		paramui_getDescription, paramui_setDescription);

	CLASS_ATTR_SYM(c,			"dataspace",		0, t_paramui, attr_dataspace);
	CLASS_ATTR_LABEL(c,			"dataspace",		0, "Dataspace");
	CLASS_ATTR_ENUM(c,			"dataspace",		0, dataspaces);
	CLASS_ATTR_DEFAULT(c,		"dataspace",		0, "none");
	CLASS_ATTR_SAVE(c,			"dataspace",		0);
	CLASS_ATTR_ACCESSORS(c,		"dataspace",		paramui_getDataspace, paramui_setDataspace);

	CLASS_ATTR_SYM(c,			"dataspace/unit/active",		0, t_paramui, attr_unitActive);
	CLASS_ATTR_LABEL(c,			"dataspace/unit/active",		0, "Active Unit within the Dataspace");
	CLASS_ATTR_DEFAULT(c,		"dataspace/unit/active",		0, "none");
	CLASS_ATTR_SAVE(c,			"dataspace/unit/active",		0);
	CLASS_ATTR_ACCESSORS(c,		"dataspace/unit/active",		paramui_getUnitActive, paramui_setUnitActive);

	CLASS_ATTR_SYM(c,			"dataspace/unit/native",		0, t_paramui, attr_unitNative);
	CLASS_ATTR_LABEL(c,			"dataspace/unit/native",		0, "Native Unit within the Dataspace");
	CLASS_ATTR_DEFAULT(c,		"dataspace/unit/native",		0, "none");
	CLASS_ATTR_SAVE(c,			"dataspace/unit/native",		0);
	CLASS_ATTR_ACCESSORS(c,		"dataspace/unit/native",		paramui_getUnitNative, paramui_setUnitNative);

	CLASS_STICKY_ATTR_CLEAR(c,	"category");

	class_register(CLASS_BOX, c);
	s_ui_class = c;
	
	sysmem_freeptr(dataspaceNames);
	return 0;
}
TTErr wrapTTModularClassAsMaxClass(TTSymbol& ttblueClassName, const char* maxClassName, WrappedClassPtr* c, ModularSpec* specificities)
{
	TTObject        o;
	TTValue			v, args;
	WrappedClass*	wrappedMaxClass = NULL;
	TTSymbol		TTName;
	t_symbol		*MaxName = NULL;
    TTUInt16        i;
	
	jamoma_init();
	common_symbols_init();
	
	if (!wrappedMaxClasses)
		wrappedMaxClasses = hashtab_new(0);
	
	wrappedMaxClass = new WrappedClass;
	wrappedMaxClass->maxClassName = gensym(maxClassName);
	wrappedMaxClass->maxClass = class_new(	maxClassName,
										  (method)wrappedModularClass_new,
										  (method)wrappedModularClass_free,
										  sizeof(WrappedModularInstance),
										  (method)0L,
										  A_GIMME,
										  0);
	wrappedMaxClass->ttblueClassName = ttblueClassName;
	wrappedMaxClass->validityCheck = NULL;
	wrappedMaxClass->validityCheckArgument = NULL;
	wrappedMaxClass->options = NULL;
	wrappedMaxClass->maxNamesToTTNames = hashtab_new(0);
	
	wrappedMaxClass->specificities = specificities;
    
#ifdef AUDIO_EXTERNAL
    // Setup our class to work with MSP
	class_dspinit(wrappedMaxClass->maxClass);
#endif
	
	// Create a temporary instance of the class so that we can query it.
	o = TTObject(ttblueClassName);
	
	// Register Messages as Max method
	o.messages(v);
	for (i = 0; i < v.size(); i++)
	{
		TTName = v[i];

        if (TTName == TTSymbol("test")                      ||
            TTName == TTSymbol("getProcessingBenchmark")    ||
            TTName == TTSymbol("resetBenchmarking"))
			continue;
        else if ((MaxName = jamoma_TTName_To_MaxName(TTName))) 
		{
            hashtab_store(wrappedMaxClass->maxNamesToTTNames, MaxName, (t_object*)(TTName.rawpointer()));
            class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_anything, MaxName->s_name, A_GIMME, 0);
        }
	}
	
	// Register Attributes as Max attr
	o.attributes(v);
	for (i = 0; i < v.size(); i++) {
		TTAttributePtr	attr = NULL;
		t_symbol		*maxType = _sym_atom;
		
		TTName = v[i];
        
#ifdef AUDIO_EXTERNAL
        // the enable word is already used by a message declared in the dsp_init method
        if (TTName == TTSymbol("enable"))
            continue;
#endif
        
        // we want to hide service attribute for Max external
        if (TTName == TTSymbol("service"))
            continue;
		
		if ((MaxName = jamoma_TTName_To_MaxName(TTName))) {
            
            if (TTName == kTTSym_bypass && wrappedMaxClass->maxClassName != gensym("j.in") && wrappedMaxClass->maxClassName != gensym("j.in~"))
                continue;
            
			o.instance()->findAttribute(TTName, &attr);
			
			if (attr->type == kTypeFloat32)
				maxType = _sym_float32;
			else if (attr->type == kTypeFloat64)
				maxType = _sym_float64;
			else if (attr->type == kTypeSymbol || attr->type == kTypeString)
				maxType = _sym_symbol;
			else if (attr->type == kTypeLocalValue)
				maxType = _sym_atom;
			
			hashtab_store(wrappedMaxClass->maxNamesToTTNames, MaxName, (t_object*)(TTName.rawpointer()));
			class_addattr(wrappedMaxClass->maxClass, attr_offset_new(MaxName->s_name, maxType, 0, (method)wrappedModularClass_attrGet, (method)wrappedModularClass_attrSet, 0));
			
			// Add display styles for the Max 5 inspector
			if (attr->type == kTypeBoolean)
				CLASS_ATTR_STYLE(wrappedMaxClass->maxClass, (char*)TTName.c_str(), 0, "onoff");
			if (TTName == TTSymbol("fontFace"))
				CLASS_ATTR_STYLE(wrappedMaxClass->maxClass,	"fontFace", 0, "font");
		}
	}
	
	// standalone support:
	class_addmethod(wrappedMaxClass->maxClass, (method)jamoma_fileusage, "fileusage", A_CANT, 0);

	class_addmethod(wrappedMaxClass->maxClass, (method)stdinletinfo,							"inletinfo",			A_CANT, 0);
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_notify,				"notify",				A_CANT, 0);
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_shareContextNode,	"share_context_node",	A_CANT,	0);
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_anything,			"anything",				A_GIMME, 0);
	
	// Register specific methods and do specific things
	if (specificities) {
		if (specificities->_wrap)
			specificities->_wrap(wrappedMaxClass);
	}
	
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_dump,				"dump",					A_GIMME, 0);

#ifdef ARRAY_EXTERNAL
	
	class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_ArraySelect,				"array/select",			A_GIMME,0);
    class_addmethod(wrappedMaxClass->maxClass, (method)wrappedModularClass_ArrayResize,				"array/resize",			A_LONG,0);
	
	CLASS_ATTR_SYM(wrappedMaxClass->maxClass,			"format",	0,		WrappedModularInstance,	arrayAttrFormat);
	CLASS_ATTR_ACCESSORS(wrappedMaxClass->maxClass,		"format",			wrappedModularClass_FormatGet,	wrappedModularClass_FormatSet);
	CLASS_ATTR_ENUM(wrappedMaxClass->maxClass,			"format",	0,		"single array");
#endif
	
	class_register(_sym_box, wrappedMaxClass->maxClass);
	if (c)
		*c = wrappedMaxClass;
	
	hashtab_store(wrappedMaxClasses, wrappedMaxClass->maxClassName, (t_object*)(wrappedMaxClass));
	return kTTErrNone;
}