• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dsp_setup函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dsp_setup函数的典型用法代码示例。如果您正苦于以下问题:C++ dsp_setup函数的具体用法?C++ dsp_setup怎么用?C++ dsp_setup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dsp_setup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: attr_args_offset

// Create
void *out_new(t_symbol *s, long argc, t_atom *argv)
{
	long 		attrstart = attr_args_offset(argc, argv);		// support normal arguments
	t_out 		*x = (t_out *)object_alloc(out_class);
	short 		i;

	if(x){
		x->dumpout = outlet_new(x, NULL);
		object_obex_store((void *)x, jps_dumpout, (object *)x->dumpout);		// setup the dumpout

		x->numOutputs =  1;
		x->attr_preview = 0;
		x->preview_object = NULL;
		x->attr_bypass = 0;
		x->attr_mute = 0;
		x->attr_mix = 100;										// Assume 100%, so that processed signal is passed through if @has_mix is false
		if(attrstart > 0){
			int argument = atom_getlong(argv);
			x->numOutputs = TTClip(argument, 1, MAX_NUM_CHANNELS);
		}
#ifdef JCOM_OUT_TILDE
		if(x->numOutputs > 0)
			dsp_setup((t_pxobject *)x, x->numOutputs);		// Create Object and Inlets
		else
			dsp_setup((t_pxobject *)x, 1);					// Create Object and Inlets
			
		x->common.ob.z_misc = Z_NO_INPLACE | Z_PUT_LAST;	// Z_PUT_LAST so that thispoly~ gets it's message properly?  		
		for(i=0; i < (x->numOutputs); i++)
			outlet_new((t_pxobject *)x, "signal");			// Create a signal Outlet   		

		x->clock = clock_new(x, (method)update_meters);
		x->clock_is_set = 0;
		TTObjectInstantiate(kTTSym_audiosignal, &x->audioIn, x->numOutputs);
		TTObjectInstantiate(kTTSym_audiosignal, &x->audioOut, x->numOutputs);
		TTObjectInstantiate(kTTSym_audiosignal, &x->audioTemp, x->numOutputs);
		TTObjectInstantiate(kTTSym_audiosignal, &x->zeroSignal, x->numOutputs);
		
		TTObjectInstantiate(TT("crossfade"), &x->xfade, x->numOutputs);
		x->xfade->setAttributeValue(TT("position"), 1.0);
		TTObjectInstantiate(TT("gain"), &x->gain, x->numOutputs);
		TTObjectInstantiate(TT("ramp"), &x->ramp_gain, x->numOutputs);
		TTObjectInstantiate(TT("ramp"), &x->ramp_xfade, x->numOutputs);

//		out_alloc(x, sys_getblksize());						// allocates the vectors for the audio signals
		x->gain->setAttributeValue(TT("linearGain"), 1.0);
#else
		for(i=x->numOutputs-1; i >= 1; i--)
			x->inlet[i] = proxy_new(x, i, 0L);
		for(i=x->numOutputs-1; i >= 0; i--)
			x->outlet[i] = outlet_new(x, 0L);
#endif		
		jcom_core_subscriber_new_common(&x->common, jps__jcom_out__, jps_subscribe_out);
		jcom_core_subscriber_setcustomsubscribe_method(&x->common, &out_subscribe);
		
		attr_args_process(x, argc, argv);					// handle attribute args				
		jcom_core_subscriber_subscribe((t_jcom_core_subscriber_common*)x);
	}
	return (x);												// Return the pointer
}
开发者ID:alexarje,项目名称:JamomaModular,代码行数:60,代码来源:jcom.out.cpp


示例2: SinkerNew

void*
SinkerNew(
	SymbolPtr,
	short		iArgC,
	Atom		iArgV[])
	
	{
	const float kDefVal = 0.0;
	
	short			valCount = (iArgC > 0) ? iArgC : 1;
	objSinker*		me	= NIL;
	tCurPendPair*	vals = (tCurPendPair*) NewPtrClear(valCount * sizeof(tCurPendPair));
	tSampleVector*	inSigs = (tSampleVector*) NewPtrClear(valCount * sizeof(tSampleVector));
	tSampleVector*	outSigs = (tSampleVector*) NewPtrClear(valCount * sizeof(tSampleVector));
	
	if (vals == NIL || inSigs == NIL || outSigs == NIL) {
		// Quick punt before any damage can be done
		if (vals != NIL) DisposePtr((Ptr) vals);
		if (inSigs != NIL) DisposePtr((Ptr) inSigs);
		if (outSigs != NIL) DisposePtr((Ptr) outSigs);
		return NIL;	
		}					
	
	// Let Max/MSP allocate us and inlets
	me = (objSinker*) newobject(gObjectClass);
	
	// Add outlets, right to left, and initialize values
	if (iArgC == 0) {
		// Default to two inlets, one outlet
		dsp_setup(&me->coreObject, 2);
		outlet_new(me, "signal");
		// Don't actually need to initialize as long as kDefVal is zero
		// vals[0].current = vals[0].pending = kDefVal;		
		}
	else {
		dsp_setup(&me->coreObject, iArgC + 1);
		while (--iArgC >= 0) {
			outlet_new(me, "signal");
			vals[iArgC].current = vals[iArgC].pending = AtomGetFloat(&iArgV[iArgC]);
			}
		}
	
	// My own initialization. Do this now before we lose the value of iArgCount
	me->lastSync	= 0.0;
	me->valCount	= valCount;
	me->mode		= trigDef;
	me->vals		= vals;
	me->inSigs		= inSigs;
	me->outSigs		= outSigs;
	
punt:
	return me;
	}
开发者ID:pcastine-lp,项目名称:LitterPower,代码行数:53,代码来源:sinker~.c


示例3: object_error

void *bench_new(t_symbol *msg, short argc, t_atom *argv){
	t_bench *x;

	x = (t_bench *)object_alloc(bench_class);
	if(!x){
		return NULL;
	}


	if(!argc){
		object_error((t_object *)x, "bench~: one argument is required, either in or out");
		return NULL;
	}else{
		if(!argv[0].a_type == A_SYM){
			object_error((t_object *)x, "bench~: the first argument to bench must be a symbol (either \"in\" or \"out\")");
			return NULL;
		}else if(!strcmp(argv[0].a_w.w_sym->s_name, "in")){
			dsp_setup((t_pxobject *)x, 1);
			outlet_new((t_object *)x, "signal");
			outlet_new((t_object *)x, "signal");
			x->t_objmode = BENCH_IN;

			if(argc == 1) x->t_mode = BENCH_MODE_ONES;
			else{
				if(!strcmp(argv[1].a_w.w_sym->s_name, "zeros")){
					x->t_mode = BENCH_MODE_ZEROS;
				}else if(!strcmp(argv[1].a_w.w_sym->s_name, "ones")){
					x->t_mode = BENCH_MODE_ONES;
				}else if(!strcmp(argv[1].a_w.w_sym->s_name, "rand")){
					x->t_mode = BENCH_MODE_RAND;
				}else if(!strcmp(argv[1].a_w.w_sym->s_name, "thru")){
					x->t_mode = BENCH_MODE_THRU;
				}else {
					object_error((t_object *)x, "bench~: unrecognized argument %s.  Setting the mode to \"ones\"", argv[1].a_w.w_sym->s_name);
					x->t_mode = BENCH_MODE_ONES;
				}
			}
		}else if(!strcmp(argv[0].a_w.w_sym->s_name, "out")){
			dsp_setup((t_pxobject *)x, 2);
			outlet_new((t_object *)x, "signal");
			x->t_objmode = BENCH_OUT;
		}else {
			object_error((t_object *)x, "bench~: unrecognized argument %s", argv[0].a_w.w_sym->s_name);
			return NULL;
		}
	}
	//x->t_ob.z_misc |= Z_NO_INPLACE;

	return x;
}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:50,代码来源:bench~.c


示例4: atom_getlong

void *freeverb_new(t_symbol *s, long argc, t_atom *argv)
{
	t_freeverb *x = NULL;
	int aSide = 0;
    x = ((t_freeverb *)object_alloc(freeverb_class));
	if (x)
	{	
		if(atom_gettype(argv) == A_LONG)
			aSide = atom_getlong(argv);
		else if(atom_gettype(argv) == A_FLOAT)
			aSide = atom_getfloat(argv);
		else if(atom_gettype(argv) == A_SYM)
		{
			if(atom_getsym(argv) == gensym("right"))
				aSide = 1;
		}

		 if(aSide <= 0)
			 aSide = 0;

		x->f_freeverb = new Freeverb(aSide);
		
		dsp_setup((t_pxobject *)x, 1);	
		outlet_new(x, "signal");
		attr_args_process(x, argc, argv);
	}
	return (x);
}
开发者ID:CICM,项目名称:PotPourri,代码行数:28,代码来源:rev.freeverb~.cpp


示例5: atom_getfloatarg

void *shoehorn_new(t_symbol *s, int argc, t_atom *argv)
{
	int i;
    double fullFrac, thisFrac, panloc;
    long outIndex;
    t_shoehorn *x = (t_shoehorn *)object_alloc(shoehorn_class);
    x->inChans = (long) atom_getfloatarg(0,argc,argv);
    x->outChans = (long) atom_getfloatarg(1,argc,argv);
    if( x->outChans < 2 || x->inChans < 2){
        object_error((t_object *)x, "%s: illegal channel count: [in = %d] [out = %d]",OBJECT_NAME,x->inChans,x->outChans);
        return NULL;
    }
    dsp_setup((t_pxobject *)x, x->inChans);
    for(i=0; i < x->outChans; i++){
        outlet_new((t_pxobject *)x, "signal");
    }
    x->pio2 = PI / 2.0;
    x->inarr = (double *) malloc(x->inChans * sizeof(double));
    x->pangains1 = (double *) malloc(x->inChans * sizeof(double));
    x->pangains2 = (double *) malloc(x->inChans * sizeof(double));
    x->indexList = (long *) malloc(x->inChans * sizeof(long));
    x->advFrac = (double)(x->outChans - 1)/(double)(x->inChans - 1);
    
    for(i = 1; i < x->inChans - 1; i++){
        fullFrac = i * x->advFrac;
        outIndex = floor(fullFrac);
        thisFrac = fullFrac - outIndex;
        panloc = thisFrac * x->pio2;
        x->indexList[i] = outIndex;
        x->pangains1[i] = cos(panloc);
        x->pangains2[i] = sin(panloc);
    }
    return x;
}
开发者ID:ericlyon,项目名称:LyonPotpourri3.0-MaxMSP,代码行数:34,代码来源:shoehorn~.c


示例6: error

void *errfilt_new(int order, float interp)
{
	t_errfilt *x = NULL;
	
	if (order == 0)
	{
		error("mbc.errfilt~: must specify filter order (this should match the order of mbc.lpc~ and mbc.allpole~)");
		return NULL;
	}
	
	if (x = (t_errfilt *)object_alloc(errfilt_class)) 
	{
		dsp_setup((t_pxobject *)x,3);
		outlet_new(x, "signal");
		
		if (order < 1) {
			error("mbc.errfilt~: mbc.errfilt~ needs a positive integer value for order");
			order = 1;
		} else if (order > 199) {
			error("mbc.errfilt~: max order is 199");
			order = 199;
		}
		
		x->a_order = order;
		x->a_interp = interp;
		errfilt_init(x);
	}
	
    return (x);
}
开发者ID:emmanueljourdan,项目名称:LPC-Toolkit,代码行数:30,代码来源:errfilt~.c


示例7: dsp_setup

void *pvcompand_new(t_symbol *s, int argc, t_atom *argv)
{
#if MSP
  t_pvcompand *x = (t_pvcompand *)newobject(pvcompand_class);
  dsp_setup((t_pxobject *)x,2);
  outlet_new((t_pxobject *)x, "signal");
#endif

#if PD
    t_pvcompand *x = (t_pvcompand *)pd_new(pvcompand_class);
    inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal"));
    outlet_new(&x->x_obj, gensym("signal"));
#endif

  // INITIALIZATIONS
  x->D  = sys_getblksize();
  x->R = sys_getsr();
  x->max_atten = atom_getfloatarg(0,argc,argv);
  x->overlap = atom_getfloatarg(1,argc,argv);
  x->winfac = atom_getfloatarg(2,argc,argv);
  if(!x->max_atten)
  	x->max_atten = -6;

  if(x->D <= 0)
  	x->D = 256;
  if(x->R <= 0)
  	x->R = 44100;

   pvcompand_init(x,0);
  return (x);
}
开发者ID:Angeldude,项目名称:pd,代码行数:31,代码来源:pvcompand~.c


示例8: attr_args_offset

// Create
void *audiosend_new(t_symbol *s, long argc, t_atom *argv)
{
    long			attrstart = attr_args_offset(argc, argv);		// support normal arguments
    t_audiosend 	*x = (t_audiosend *)object_alloc(s_audiosend_class);
    short			i;

    if (x) {
        x->dumpout = outlet_new(x, NULL);
        object_obex_store(x, _sym_dumpout, (t_object *)x->dumpout);

        x->attr_target = _sym_nothing;
        x->num_inputs = 2;		// TODO: make this dynamic from args

        for (i=0; i<attrstart; i++) {
            if (argv[i].a_type == A_LONG)
                x->num_inputs = atom_getlong(argv+i);
            else if (argv[i].a_type == A_SYM)
                x->attr_target = atom_getsym(argv+i);
        }

        dsp_setup((t_pxobject *)x, x->num_inputs);
        x->obj.z_misc = Z_NO_INPLACE;
        attr_args_process(x, argc, argv);					// handle attribute args
    }
    return x;
}
开发者ID:OlivierBaudry,项目名称:JamomaModular,代码行数:27,代码来源:jcom.send~.cpp


示例9: newobject

void *ether_new(t_symbol *s, int argc, t_atom *argv)
{

#if MSP
  t_ether 	*x = (t_ether *) newobject(ether_class);
  dsp_setup((t_pxobject *)x,3);
  outlet_new((t_pxobject *)x, "signal");
#endif
#if PD
  t_ether *x = (t_ether *)pd_new(ether_class);
  /* add two additional signal inlets */
  inlet_new(&x->x_obj, &x->x_obj.ob_pd,gensym("signal"), gensym("signal"));
  inlet_new(&x->x_obj, &x->x_obj.ob_pd,gensym("signal"), gensym("signal"));
  outlet_new(&x->x_obj, gensym("signal"));
#endif

/* optional arguments: overlap winfac */
	
  x->overlap = atom_getfloatarg(0,argc,argv);
  x->winfac = atom_getfloatarg(1,argc,argv);
  if(!power_of_two(x->overlap)){
    x->overlap = 4;
  }
  if(!power_of_two(x->winfac)){
    x->winfac = 1;
  }
  x->vs = sys_getblksize();
  x->R = sys_getsr();
  ether_init(x,0);
  
  return (x);
}
开发者ID:Angeldude,项目名称:pd,代码行数:32,代码来源:ether~.c


示例10: listout

void *bthresher_new(t_symbol *s, int argc, t_atom *argv)
{
#if MSP
  t_bthresher *x = (t_bthresher *)newobject(bthresher_class);
  x->list_outlet = listout((t_pxobject *)x);
  dsp_setup((t_pxobject *)x,3);
  outlet_new((t_pxobject *)x, "signal");
#endif

#if PD
    t_bthresher *x = (t_bthresher *)pd_new(bthresher_class);
    inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal"));
    inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal"));
    outlet_new(&x->x_obj, gensym("signal"));
    x->list_outlet = outlet_new(&x->x_obj,gensym("list"));
#endif


  x->D = sys_getblksize();
  x->R = sys_getsr();
  
  x->init_thresh = atom_getfloatarg(0,argc,argv);
  x->init_damping = atom_getfloatarg(1,argc,argv);
  x->overlap = atom_getintarg(2,argc,argv);
  x->winfac = atom_getintarg(3,argc,argv);
  
  bthresher_init(x,0);
  


  return (x);
}
开发者ID:Angeldude,项目名称:pd,代码行数:32,代码来源:bthresher~.c


示例11: dialer_dial

/* an entry point for an address book or the like */
void dialer_dial( char * number )
{
    int x = 0;
    int ret;
    dsp_st dspz;

    if( !number ) return;

#ifdef __linux__
    ret = dsp_open(&dspz, DSP_LINEOUT);
    if( ret < 0 ) {
        pz_error( "/dev/dsp" );
        return;
    }
    ret = dsp_setup(&dspz, 1, 44100);
#else
    ret = ret;
#endif

    while ( number[x] != '\0' )
    {
        dtmf_play( &dspz, number[x++] );
    }

#ifdef __linux__
    dsp_close(&dspz);
#endif
}
开发者ID:iPodLinux-Community,项目名称:ZacZilla,代码行数:29,代码来源:dialer.c


示例12: newobject

void *shapee_new(t_symbol *s, int argc, t_atom *argv)
{
			
#if MSP
  t_shapee 	*x = (t_shapee *) newobject(shapee_class);
  dsp_setup((t_pxobject *)x, 3);
  outlet_new((t_pxobject *)x, "signal");
#endif
#if PD
  t_shapee *x = (t_shapee *)pd_new(shapee_class);
  inlet_new(&x->x_obj, &x->x_obj.ob_pd,gensym("signal"), gensym("signal"));
  inlet_new(&x->x_obj, &x->x_obj.ob_pd,gensym("signal"), gensym("signal"));
  outlet_new(&x->x_obj, gensym("signal"));
#endif

/* INITIALIZATIONS */
  x->overlap = atom_getfloatarg(0,argc,argv);
  x->winfac = atom_getfloatarg(1,argc,argv);
  if(!x->winfac)	
	x->winfac = 1;
  if(!x->overlap)
	x->overlap = 4;
  x->vs = sys_getblksize();
  x->R = sys_getsr();
  shapee_init(x,0); 

  return (x);
}
开发者ID:pd-projects,项目名称:fftease,代码行数:28,代码来源:shapee~.c


示例13: balance_new

void* balance_new(t_symbol *msg, short argc, t_atom *argv)
{
    t_balance	*x;
	TTValue		sr(sys_getsr());
 	long		attrstart = attr_args_offset(argc, argv);		// support normal arguments
	short		i;
   
    x = (t_balance *)object_alloc(balance_class);
    if(x){
		// Default values
		x->attrFrequency = 10;
		x->attrBypass = 0;
		// An initial argument to this object will set the maximum number of channels to process
		// Two input channels are required for each processed channel (source and comperator)
		x->maxNumChannels = 1;		
		if(attrstart && argv)
			x->maxNumChannels = atom_getlong(argv);

		ttEnvironment->setAttributeValue(kTTSym_SampleRate, sr);
		TTObjectInstantiate(TT("balance"), &x->balance, x->maxNumChannels);
		TTObjectInstantiate(TT("audiosignal"), &x->audioIn, x->maxNumChannels*2);
		TTObjectInstantiate(TT("audiosignal"), &x->audioOut, x->maxNumChannels);

		attr_args_process(x,argc,argv);				// handle attribute args	
				
    	object_obex_store((void *)x, _sym_dumpout, (object *)outlet_new(x,NULL));	// dumpout	
	    dsp_setup((t_pxobject *)x, x->maxNumChannels*2);							// inlets
		for(i=0; i < x->maxNumChannels; i++)
			outlet_new((t_pxobject *)x, "signal");									// outlets
		
		x->obj.z_misc = Z_NO_INPLACE;
	}
	return (x);										// Return the pointer
}
开发者ID:alexarje,项目名称:JamomaDSP,代码行数:34,代码来源:jcom.balance~.cpp


示例14: dsp_setup

void *leaker_new(t_symbol *msg, short argc, t_atom *argv)
{
#if MSP
  t_leaker *x = (t_leaker *)newobject(leaker_class);
  dsp_setup((t_pxobject *)x,3);
  outlet_new((t_pxobject *)x, "signal");
#endif

#if PD
  t_leaker *x = (t_leaker *)pd_new(leaker_class);
  inlet_new(&x->x_obj, &x->x_obj.ob_pd,gensym("signal"), gensym("signal"));
  inlet_new(&x->x_obj, &x->x_obj.ob_pd,gensym("signal"), gensym("signal"));
  outlet_new(&x->x_obj, gensym("signal"));
#endif

  x->D = sys_getblksize();
  x->R = sys_getsr();
  if(!x->D)
    x->D = 256;
  if(!x->R)
    x->R = 44100;

  x->overlap = atom_getfloatarg(0,argc,argv);
  x->winfac = atom_getfloatarg(1,argc,argv);
  if(!x->overlap)
    x->overlap = 4;
  if(!x->winfac)
    x->winfac = 1;

  leaker_init(x,0);	
  return (x);
}
开发者ID:Angeldude,项目名称:pd,代码行数:32,代码来源:leaker~.c


示例15: object_alloc

/********************************************************************************
void *grainstream_new(double initial_pos)

inputs:			*snd		-- name of buffer holding sound
				*win		-- name of buffer holding window
description:	called for each new instance of object in the MAX environment;
		defines inlets and outlets; sets variables and buffers
returns:		nothing
********************************************************************************/
void *grainstream_new(t_symbol *snd, t_symbol *win)
{
	t_grainstream *x = (t_grainstream *) object_alloc((t_class*) grainstream_class);
	dsp_setup((t_pxobject *)x, 4);					// four inlets
    outlet_new((t_pxobject *)x, "signal");          // sample count outlet
    outlet_new((t_pxobject *)x, "signal");			// signal ch2 outlet
    outlet_new((t_pxobject *)x, "signal");			// signal ch1 outlet
	
	/* set buffer names */
	x->snd_sym = snd;
	x->win_sym = win;
	
	/* zero pointers */
	x->snd_buf_ptr = x->next_snd_buf_ptr = NULL;
	x->win_buf_ptr = x->next_win_buf_ptr = NULL;
	
	/* setup variables */
	x->grain_freq = x->next_grain_freq = 20.0;
	x->grain_pos_start = x->next_grain_pos_start = 0.0;
    x->grain_pitch = x->next_grain_pitch = 1.0;
    x->grain_gain = x->next_grain_gain = 1.0;
	x->win_step_size = x->snd_step_size = 0.0;
	x->curr_win_pos = x->curr_snd_pos = 0.0;
	
	/* set flags to defaults */
	x->snd_interp = INTERP_ON;
	x->win_interp = INTERP_ON;
	x->grain_direction = x->next_grain_direction = FORWARD_GRAINS;
	
	x->x_obj.z_misc = Z_NO_INPLACE;
	
	/* return a pointer to the new object */
	return (x);
}
开发者ID:CircuitMusicLabs,项目名称:LowkeyNW,代码行数:43,代码来源:nw.grainstream~.c


示例16: dsp_setup

/********************************************************************************
void *gverb_new(double d)

inputs:			void
description:	called for each new instance of object in the MAX environment;
		defines inlets and outlets; 
returns:		nothing
********************************************************************************/
void *gverb_new(double d)
{
	t_gverb *x = (t_gverb *)object_alloc((t_class*) gverb_class);
	
	dsp_setup((t_pxobject *)x, 2);					// two inlets
	outlet_new((t_pxobject *)x, "signal");			// left outlet
	outlet_new((t_pxobject *)x, "signal");			// right outlet
	
	/* setup variables */
	x->verb_decay = d > 0.0 ? d : 1000.0;
	x->verb_decay_1over = d > 0.0 ? 1.0 / d : 0.001;
	
	// get sample rate info
	x->output_sr = sys_getsr();
	x->output_msr = x->output_sr * 0.001;
	x->output_1overmsr = 1.0 / x->output_msr;
	
	// initialize square injection value
	x->sqinject_val = TINY_DC;
	
	x->verb_decay_coeff = 
			pow(10.0, (-16416.0 * x->verb_decay_1over * x->output_1overmsr));
	
	gverb_init(x);
	
	x->x_obj.z_misc = Z_NO_INPLACE;
    
    #ifdef DEBUG
        post("%s: new function was called", OBJECT_NAME);
    #endif /* DEBUG */
	
	/* return a pointer to the new object */
	return (x);
}
开发者ID:CircuitMusicLabs,项目名称:LowkeyNW,代码行数:42,代码来源:nw.gverb~.c


示例17: atom_getlong

void *HoaSevenDotOne_new(t_symbol *s, long argc, t_atom *argv)
{
	t_HoaSevenDotOne *x = NULL;
	int order = 4;
	double anAngle1 = 30.;
	double anAngle2 = 110.;
	if (x = (t_HoaSevenDotOne *)object_alloc((t_class*)HoaSevenDotOne_class)) 
	{
		if(atom_gettype(argv) == A_LONG)
			order	= atom_getlong(argv);
		if(atom_gettype(argv+1) == A_LONG)
			anAngle1	= atom_getlong(argv+1);
		else if(atom_gettype(argv+1) == A_FLOAT)
			anAngle1	= atom_getfloat(argv+1);
		if(atom_gettype(argv+2) == A_LONG)
			anAngle2	= atom_getlong(argv+2);
		else if(atom_gettype(argv+2) == A_FLOAT)
			anAngle2	= atom_getfloat(argv+2);

		x->f_AmbisonicSixDotOne	= new AmbisonicSixDotOne(order, anAngle1, anAngle2, sys_getblksize());
		
		dsp_setup((t_pxobject *)x, x->f_AmbisonicSixDotOne->getNumberOfInputs());
		for (int i = 0; i < x->f_AmbisonicSixDotOne->getNumberOfOutputs(); i++) 
			outlet_new(x, "signal");
		
	
	}
	return (x);
}
开发者ID:dimibil,项目名称:HoaLibrary,代码行数:29,代码来源:hoa.sixDotOne~.cpp


示例18: listout

void *ibufconcatenate_new (t_symbol *buffer_name, long max_mode)
{
    t_ibufconcatenate *x = (t_ibufconcatenate *)object_alloc (this_class);
	
	x->last_added_out = listout(x);

	if (!max_mode)
	{
		dsp_setup((t_pxobject *)x, 1);
		outlet_new((t_object *)x, "signal");
		outlet_new((t_object *)x, "signal");
		outlet_new((t_object *)x, "signal");
		outlet_new((t_object *)x, "signal");
	}
	else
	{
		x->data_out = listout(x);
	}
	
	x->attachment = new_ibufconcatenate_info(buffer_name);
	
	if (!x->attachment)
		return 0;
	
	x->max_mode = max_mode;
	
	return(x);
}
开发者ID:AlexHarker,项目名称:AHarker_Externals,代码行数:28,代码来源:ibufconcatenate~.cpp


示例19: atom_getlong

void *HoaRecomposer_new(t_symbol *s, long argc, t_atom *argv)
{
	t_HoaRecomposer *x = NULL;
    t_dictionary *d;
	int order = 4, inputs = 10;
    x = (t_HoaRecomposer *)object_alloc((t_class*)HoaRecomposer_class);
	if (x)
	{
		if(atom_gettype(argv) == A_LONG)
			order	= atom_getlong(argv);
		if(atom_gettype(argv+1) == A_LONG)
			inputs	= atom_getlong(argv+1);
        
        /* Base Attributes */
        
		x->f_ambiRecomposer	= new AmbisonicRecomposer(order, inputs, Hoa_Fixe, sys_getblksize(), sys_getsr());
        x->f_ambiRecomposer->setRampInMs(20.);
        
        x->f_ramp_time = x->f_ambiRecomposer->getRampInMs();
        x->f_mode = gensym("fixe");
        
		dsp_setup((t_pxobject *)x, x->f_ambiRecomposer->getNumberOfInputs());
		for (int i = 0; i < x->f_ambiRecomposer->getNumberOfOutputs(); i++)
			outlet_new(x, "signal");
        
		x->f_ob.z_misc = Z_NO_INPLACE;
        
        attr_args_process(x, argc, argv);
        d = (t_dictionary *)gensym("#D")->s_thing;
        if (d) attr_dictionary_process(x, d);
        object_attr_setdisabled((t_object *)x, gensym("ramp"), (x->f_mode == gensym("fixe")) ? 1 : 0);
	}
	return (x);
}
开发者ID:natcl,项目名称:HoaLibrary,代码行数:34,代码来源:hoa.recomposer~.cpp


示例20: attr_args_offset

void *radians_new(t_symbol *msg, short argc, t_atom *argv)
{
	t_atom_long myArg = 0;
	long attrstart;	
	t_radians *x;
	
	attrstart = attr_args_offset(argc, argv);
	if(attrstart && argv)
		atom_arg_getlong(&myArg, 0, attrstart, argv);	// support a normal int argument for bwc	
	
	x = (t_radians *)object_alloc(radians_class);;
	if(x){
		object_obex_store((void *)x, _sym_dumpout, (object *)outlet_new(x,NULL));	// dumpout
		dsp_setup((t_pxobject *)x,1);
		x->radians_out = floatout(x);					// Create a floating-point Outlet
		outlet_new((t_object *)x, "signal");
		
		x->tt = new tt_audio_base;				// Create object for performing radian conversions
		x->tt->set_sr(sys_getsr());
		
		x->radians_mode = myArg;					// default mode

		attr_args_process(x, argc, argv); 			//handle attribute args			
		
	}
	return (x);
}
开发者ID:imclab,项目名称:TapTools,代码行数:27,代码来源:tap.radians~.cpp



注:本文中的dsp_setup函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dsputil_init函数代码示例发布时间:2022-05-30
下一篇:
C++ dsp_free函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap