Ejemplo n.º 1
0
//----------------------------------------------------------------------------------------------
void main(void) {
	setup((t_messlist **)&this_class, (method)f0ext_new, (method)dsp_free, (short)sizeof(x_f0ext), 0L, A_DEFFLOAT, 0);
	dsp_initclass();
	addmess((method)f0ext_dsp, "dsp", A_CANT, 0);
	addfloat((method)f0ext_float);
	addmess((method)f0ext_assist, "assist", A_CANT, 0);
	finder_addclass("All Objects", "f0.round~");
	finder_addclass("MSP Modifiers", "f0.round~");
	post("f0.round~ v1.0-ub; distributed under GNU GPL license");		//target specific
}
Ejemplo n.º 2
0
// Main function
void main(void) 
{
	post("gaussdraw object version " VERSION " by Tristan Jehan");
    post("copyright © 2001 Massachusetts Institute of Technology");
	post("");
	
	setup(								// Setup Object
		(Messlist**) &gaussdraw_class,	// Pointer to class
		(method) gaussdraw_new,			// Constructor
		(method) gaussdraw_free,		// Destructor
		(short) sizeof(t_gaussdraw),	// Class Size
		0L,	A_GIMME, 0);

	/* bind your methods to symbols */
	addbang((method)gaussdraw_bang);
	addfloat((method)gaussdraw_float);
	addint((method)gaussdraw_int);
	addinx((method)gaussdraw_int_1,1);
	addinx((method)gaussdraw_int_2,2);
	addftx((method)gaussdraw_float_1,1);
	addftx((method)gaussdraw_float_2,2);
	addmess((method)gaussdraw_assist,"assist",A_CANT,0);
	addmess((method)gaussdraw_min,"min",A_GIMME,0);
	addmess((method)gaussdraw_max,"max",A_GIMME,0);
	addmess((method)gaussdraw_numpts,"numbars",A_GIMME,0);
	addmess((method)gaussdraw_default,"default",A_GIMME,0);
	addmess((method)gaussdraw_print,"print",A_GIMME,0);

	/* list object in the new object list */
	finder_addclass("Statistics", "gaussdraw");

	rescopy('STR#', RES_ID);
}
Ejemplo n.º 3
0
void main()
{
	#ifdef MDebug
		graphmodelutiltests();
	#endif
	
	setup((t_messlist **)&EermMaxClass, (method)EermMaxNew, (method)EermMaxFree, 
		(short)sizeof(EermMax), 0L, A_GIMME, 0);

	addbang((method)EermMaxBang);
	addint((method)EermMaxInt);

	addmess((method)EermMaxSimplexSetEntry, "SimplexSetEntry", A_GIMME, 0);
	addmess((method)EermMaxSetDt, "SetDt", A_GIMME, 0);
	addmess((method)EermMaxSetForce, "SetForce", A_GIMME, 0);
	addmess((method)EermMaxSetWeights, "SetWeights", A_GIMME, 0);
	addmess((method)EermMaxSetSlew, "SetSlew", A_GIMME, 0);
	
	addmess((method)EermMaxForceMeter, "ForceMeter", A_GIMME, 0);
	
	addmess((method)EermMaxPostSimplices, "PostSimplices", A_GIMME, 0);
	addmess((method)EermMaxPostTokens, "PostTokens", A_GIMME, 0);
	
	addmess((method)EermMaxSimplexNew, "SimplexNew", A_GIMME, 0);
	addmess((method)EermMaxSimplexDelete, "SimplexDelete", A_GIMME, 0);
	addmess((method)EermMaxSimplexSetTp, "SimplexSetTp", A_GIMME, 0);
	
	addmess((method)EermMaxNodeNew, "NodeNew", A_GIMME, 0);
	addmess((method)EermMaxNodeSetMean, "NodeSetMean", A_GIMME, 0);
	addmess((method)EermMaxNodeSetVar, "NodeSetVar", A_GIMME, 0);
	addmess((method)EermMaxNodeSetLabelMsg, "NodeSetLabel", A_GIMME, 0);

	addmess((method)EermMaxStulleTokenNew, "StulleTokenNew", A_GIMME, 0);		
	addmess((method)EermMaxTokenNew, "TokenNew", A_GIMME, 0);		
	addmess((method)EermMaxTokenDelete, "TokenDelete", A_GIMME, 0);		
	addmess((method)EermMaxTokenSetCoord, "TokenSetCoord", A_GIMME, 0);		
	addmess((method)EermMaxTokenSetMass, "TokenSetMass", A_GIMME, 0);		
	addmess((method)EermMaxTokenSetDamping, "TokenSetDamping", A_GIMME, 0);		
	addmess((method)EermMaxTokenSetExpScale, "TokenSetExpScale", A_GIMME, 0);		
	addmess((method)EermMaxTokenSetTokenCoupling, "TokenSetTokenCoupling", A_GIMME, 0);		
	addmess((method)EermMaxTokenSetWeights, "TokenSetWeights", A_GIMME, 0);
	addmess((method)EermMaxTokenSetSimplex, "TokenSetSimplex", A_GIMME, 0);

	addmess((method)EermMaxClockEvolution, "ClockEvolution", A_LONG, 0);
	addmess((method)EermMaxClockOnce, "ClockOnce", A_GIMME, 0);

	addmess((method)EermMaxTokenFeatureUpdate, "anything", A_GIMME, 0); // Feature In		

	finder_addclass("Data","Eerm");
}
Ejemplo n.º 4
0
int main()
{
	setup((t_messlist **)&thresh_class, (method)thresh_new, (method)thresh_free, (short)sizeof(t_thresh), 0L, A_DEFLONG, 0);
	addint((method)thresh_int);
	addmess((method)thresh_list,"list", A_GIMME, 0);
	addinx((method)thresh_in1,1);
	addfloat((method)thresh_float);
	addmess((method)thresh_assist,"assist",A_CANT,0);
	addmess((method)thresh_inletinfo, "inletinfo", A_CANT, 0);
	ps_list = gensym("list");
	finder_addclass("Lists","thresh");

	return 0;
}
Ejemplo n.º 5
0
int main()
{
	setup((t_messlist **)&iter_class, (method)iter_new, (method)iter_free, (short)sizeof(t_iter), 0L, A_DEFLONG, 0);
	addint((method)iter_int);
	addbang((method)iter_bang);
	addmess((method)iter_list,"list", A_GIMME, 0);
	addmess((method)iter_anything,"anything",A_GIMME,0);
	addmess((method)iter_assist,"assist",A_CANT,0);
	addfloat((method)iter_float);
	ps_bang = gensym("bang");
	finder_addclass("Lists","iter");

	return 0;
}
Ejemplo n.º 6
0
int main()
{
	setup((t_messlist **)&buddy_class, (method)buddy_new, (method)buddy_free, (short)sizeof(t_buddy), 0L, A_DEFLONG, 0);
	addint((method)buddy_int);
	addbang((method)buddy_bang);
	addfloat((method)buddy_float);
	addmess((method)buddy_list, "list", A_GIMME, 0);
	addmess((method)buddy_clear, "clear", 0);
	addmess((method)buddy_anything, "anything", A_GIMME, 0);
	addmess((method)buddy_assist,"assist",A_CANT,0);
	addmess((method)buddy_inletinfo,"inletinfo",A_CANT,0);
	finder_addclass("Right-to-Left","buddy");
	ps_list = gensym("list");			

	return 0;
}
extern "C" void main(void)
{
	setup((t_messlist **)&freeverb_class,(method)freeverb_new, (method)freeverb_free, 
		(short)sizeof(t_freeverb), 0L, A_DEFFLOAT, 0);
	addmess((method)freeverb_dsp, "dsp", A_CANT, 0);
	addmess((method)freeverb_assist, "assist", A_CANT, 0);
	addmess((method)freeverb_setroomsize, "roomsize", A_FLOAT, 0);
	addmess((method)freeverb_setdamp, "damping", A_FLOAT, 0);
	addmess((method)freeverb_setwidth, "width", A_FLOAT, 0);
	addmess((method)freeverb_setwet, "wet", A_FLOAT, 0);
	addmess((method)freeverb_setdry, "dry", A_FLOAT, 0);
	addmess((method)freeverb_setmode, "freeze", A_FLOAT, 0);
	addmess((method)freeverb_setbypass, "bypass", A_FLOAT, 0);
	addmess((method)freeverb_mute, "clear", 0);
	addmess((method)freeverb_print, "print", 0);
	dsp_initclass();
	finder_addclass("MSP Delays","freeverb~");
	post(version);
}
Ejemplo n.º 8
0
void main(fptr *f)

{

	long oldA4;

	

	// this code is a 68K-only macro

	oldA4 = SetCurrentA4();			// get correct value of A4

	RememberA4();					// store inside code resource

	// this is not necessary (but harmless) on PowerPC

	FNS = f;	

	

	/* tell Max about your class. The cast to short is important for 68K */

	setup(&myobject_class, myobject_new,0L, (short)sizeof(MyObject), 0L, A_DEFLONG, 0);

	/* bind your methods to symbols */

	addbang((method)myobject_bang);

	addint((method)myobject_int);

	addmess((method)myobject_FullPacket, "FullPacket", A_LONG, A_LONG, 0);

	addmess((method)myobject_set, "set", A_LONG, 0);

	/* list object in the new object list */

	finder_addclass("Data","dereffer");

	// restore old value of A4 (68K only)

	RestoreA4(oldA4);

}
Ejemplo n.º 9
0
int main (void)
{  
	t_class *c = class_new(OMAX_DOC_NAME, (method) oudp_new,(method) myobject_free,(short)sizeof(t_oudpreceive),0L,A_GIMME, 0);
  
	class_addmethod(c, (method)oudp_assist, "assist", A_CANT,0);
	class_addmethod(c, (method)odot_version, "version", 0);
	class_addmethod(c, (method)oudp_doc, "doc", 0);

	class_addmethod(c, (method)slipbyte, "int", A_LONG, 0);
	class_addmethod(c, (method)sliplist, "list", A_GIMME, 0);
  
	class_addmethod(c, (method)oudp_printcontents, "printcontents", 0);

	finder_addclass("Devices","slipOSC");

	class_register(CLASS_BOX, c);
	oudp_class = c;

	ODOT_PRINT_VERSION;
	return 0;
}
Ejemplo n.º 10
0
int main (void)
{
    t_class *c = class_new(OMAX_DOC_NAME, (method) oudpsend_new,(method) myobject_free,(short)sizeof(t_oudpsend),0L,A_DEFLONG,0);
    
    class_addmethod(c, (method)oudpsend_assist, "assist", A_CANT,0);
    class_addmethod(c, (method)odot_version, "version", 0);
    class_addmethod(c, (method)oudpsend_doc, "doc", 0);
    
    class_addmethod(c, (method)oudpsend_printcontents, "printcontents", 0);
    class_addmethod(c, (method)oudpsend_FullPacket, "FullPacket", A_LONG, A_LONG, 0);
    
    // remove this if statement when we stop supporting Max 5
    if(omax_dict_resolveDictStubs()){
        class_addmethod(c, (method)omax_dict_dictionary, "dictionary", A_GIMME, 0);
    }
    
    finder_addclass("Devices","slipOSC");
    
    class_register(CLASS_BOX, c);
    oudpsend_class = c;
    
    ODOT_PRINT_VERSION;
    return 0;
}
Ejemplo n.º 11
0
void main(fptr *f) {
	OSStatus err;
	DateTimeRec date;
	
#ifdef MULTI_SEGMENT
	/* Multi-segment code resource stuff */
	{
		Str255 buf;
		short i, n, theID;
		char **ch;
		OSType theType;
		n = Count1Resources('Cccc');
	    post("This external has %ld resources", (long) n);
		for (i = 1; i <= n; i++) {
			ch = Get1IndResource('Cccc', i);
			GetResInfo(ch, &theID, &theType, buf);
			rescopy('Cccc', theID);
		}
	}
#endif

#ifdef EXTENDED_CODE_RESOURCE
	// Cause it's an extended code resource...
	// rescopy('Cccc',22222);
#endif

	setup((t_messlist **)&otudp_class, (method)otudp_new, (method) otudp_free, (short)sizeof(OTUDP), 0L, A_GIMME, 0);
	
	version(0);
#ifdef DAVID_LIKES_EXPIRING_MAX_OBJECTS
	post("Expires %d/%d/%d", MONTH, DAY, YEAR);
#endif


#ifdef DAVID_LIKES_EXPIRING_MAX_OBJECTS
	GetTime(&date);
	if((date.year > YEAR)  || 
       (date.year == YEAR && ((date.month > MONTH) ||
							  (date.month == MONTH && date.day > DAY)))) {
            ouchstring(EXPIRATION_NOTICE);
            return;
    }
#endif
        
    // post ("*** before  InitOpenTransport();");
	err = InitOpenTransportInContext(kInitOTForExtensionMask, &OTContext);
	if (err != kOTNoError) {
		error("¥ OTUDP: Couldn't InitOpenTransport (err %d).  Perhaps Open Transport is not installed.",
					err);
		return;
	}
	
	/* bind methods */
	addmess((method) otudp_write, "FullPacket", A_LONG, A_LONG, 0);
	addmess((method) version, "version", 0);
	addmess((method) otudp_toggleErrorReporting, "errorreporting", 0);
	addmess((method) otudp_tellmeeverything, "tellmeeverything", 0);
	addmess((method) otudp_old_write, "write", A_GIMME, 0);
	addmess((method) otudp_old_write, "gimme", A_GIMME, 0);
	addmess((method) otudp_assist, "assist", A_CANT, 0);
	addmess((method) otudp_changeHost, "host", A_SYM, A_LONG, 0);
	addmess((method) otudp_changeReceivePort, "receiveport", A_LONG, 0);

	/* These methods are just for debugging. */
	addmess((method) otudp_debugstats, "debugstats", 0);
	addmess((method) otudp_resetdebugstats, "resetdebugstats", 0);
	addmess((method) otudp_read, "readitagainsam", 0);

	finder_addclass("System","otudp");

	ps_read = gensym("read");
	ps_write = gensym("write");
	ps_FullPacket = gensym("FullPacket");
	ps_PartialPacket = gensym("PartialPacket");
	ps_nbufs = gensym("nbufs");
	ps_bufsize = gensym("bufsize");
}
Ejemplo n.º 12
0
int main(void) {
	SDIFresult r;
	
	
	version_post_copyright();
	
	r = SDIFmem_Init(my_getbytes, my_freebytes);
	
	if (r) {
		ouchstring("Couldn't initialize SDIF memory utilities! %s", SDIF_GetErrorString(r));
	}	
	
	SDIFlistpoke_class = class_new("SDIF-listpoke", (method)SDIFlistpoke_new, 0,
			(short)sizeof(SDIFlistpoke), 0L, A_GIMME, 0);
	
	/* bind my methods to symbols */
        class_addmethod(SDIFlistpoke_class, (method)version, "version", 0);
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_set, "set", A_SYM, 0);	
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_errorreporting, "errorreporting", A_LONG, 0);
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_time, "time", A_FLOAT, 0);
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_numcolumns, "numcolumns", A_LONG, 0);
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_listpoke, "listpoke", A_GIMME, 0);
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_listpoke, "list", A_GIMME, 0);
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_newmatrix, "newmatrix", A_GIMME, 0);
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_matrixtype, "matrixtype", A_DEFSYM, 0);
	class_addmethod(SDIFlistpoke_class, (method)SDIFlistpoke_tellmeeverything, "tellmeeverything", 0);

  //  initialize SDIF libraries
	if (r = SDIF_Init()) {
		ouchstring("%s: Couldn't initialize SDIF library! %s", 
		           NAME,
		           SDIF_GetErrorString(r));
    return 0;
	}
	
	if (r = SDIFmem_Init(my_getbytes, my_freebytes)) {
		post("¥ %s: Couldn't initialize SDIF memory utilities! %s", 
		     NAME,
		     SDIF_GetErrorString(r));
    return 0;
	}
		
	if (r = SDIFbuf_Init()) {
		post("¥ %s: Couldn't initialize SDIF buffer utilities! %s", 
		     NAME,
		     SDIF_GetErrorString(r));
		return 0;
	}

	/* list object in the new object list */
	finder_addclass("Data", NAME);
	
	ps_SDIFbuffer = gensym("SDIF-buffer");
	ps_SDIF_buffer_lookup = gensym("##SDIF-buffer-lookup");
	ps_emptysymbol  = gensym("");
	ps_concatenate = gensym("concatenate");
	ps_time = gensym("time");
	ps_reltime = gensym("reltime");
	ps_direction = gensym("direction");
	ps_numcolumns = gensym("numcolumns");
	ps_interp = gensym("interp");
	ps_max_rows = gensym("max_rows");

	class_register(CLASS_BOX, SDIFlistpoke_class);

	return 0;
	
}
Ejemplo n.º 13
0
void main(fptr *f) {
	long oldA4;
	OSStatus err;
	DateTimeRec date;
	
	oldA4 = SetCurrentA4();
	RememberA4();
	FNS = f;	

#ifdef MULTI_SEGMENT
	/* Multi-segment code resource stuff */
	{
		Str255 buf;
		short i, n, theID;
		char **ch;
		OSType theType;
		n = Count1Resources('Cccc');
	    post("This external has %ld resources", (long) n);
		for (i = 1; i <= n; i++) {
			ch = Get1IndResource('Cccc', i);
			GetResInfo(ch, &theID, &theType, buf);
			rescopy('Cccc', theID);
		}
	}
#endif

#ifdef EXTENDED_CODE_RESOURCE
	// Cause it's an extended code resource...
	// rescopy('Cccc',22222);
#endif

	ps_readbufsize = gensym("readbufsize");
	ps_writebufsize = gensym("writebufsize");
	ps_OTTCP_nbytes = gensym("OTTCP_nbytes");
	ps_OTTCP_delim = gensym("OTTCP_delim");
	ps_connected = gensym("connected");
	ps_disconnected = gensym("disconnected");

	setup(&ottcp_class, ottcp_new, (method) ottcp_free, (short)sizeof(OTTCP), 0L, A_GIMME, 0);
	
	version(0);
#ifdef DAVID_LIKES_EXPIRING_MAX_OBJECTS
	post("Expires %d/%d/%d", MONTH, DAY, YEAR);
#endif

#ifdef DAVID_LIKES_EXPIRING_MAX_OBJECTS
	GetTime(&date);
	if((date.year > YEAR)  || 
       (date.year == YEAR && ((date.month > MONTH) ||
							  (date.month == MONTH && date.day > DAY)))) {
            ouchstring(EXPIRATION_NOTICE);
            goto quit;
    }
#endif
    
    // post ("*** before  InitOpenTransport();");
	err = InitOpenTransport();
	if (err != kOTNoError) {
		ouchstring("Couldn't InitOpenTransport (err %d).  Perhaps Open Transport is not installed.",
					err);
		goto quit;
	}
	
	/* bind methods */
	addmess((method) ottcp_connect, "connect", A_SYM, A_LONG, 0);
	addmess((method) ottcp_disconnect, "disconnect", 0);
	addmess((method) ottcp_read_nbytes, "nbytes", A_LONG, 0);
	addmess((method) ottcp_read_until_delimiter_symbol, "delim", A_SYM, 0);
	addmess((method) ottcp_read_until_delimiter_bytes, "delim-bytes", A_GIMME, 0);
	addmess((method) ottcp_write, "write", A_LONG, A_LONG, 0);
	addmess((method) version, "version", 0);
	addmess((method) ottcp_ErrorReporting, "errorreporting", 0);
	addmess((method) ottcp_tellmeeverything, "tellmeeverything", 0);
	addmess((method) ottcp_assist, "assist", A_CANT, 0);

	finder_addclass("System","ottcp");

quit:
	RestoreA4(oldA4);
}