コード例 #1
0
ファイル: times~.c プロジェクト: AlvaroBuitrago/max-test
void times_dsp64(t_times *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags)
{
	if (!count[1]) {
		dsp_add64(dsp64, (t_object *) x, (t_perfroutine64) scale_perform64_method, 0, 0);
	}
	else if (!count[0]) {
		dsp_add64(dsp64, (t_object *) x, (t_perfroutine64) scale_perform64_method, 0, (void *) 1);
	}
	else {
		dsp_add64(dsp64, (t_object *) x, (t_perfroutine64) times_perform64_method, 0, 0);
	}
}
コード例 #2
0
ファイル: nw.gverb~.c プロジェクト: CircuitMusicLabs/LowkeyNW
/********************************************************************************
 void gverb_dsp64()
 
 inputs:			x		-- pointer to this object
 dsp64		-- signal chain to which object belongs
 count	-- array detailing number of signals attached to each inlet
 samplerate -- number of samples per second
 maxvectorsize -- sample frames per vector of audio
 flags --
 description:	called when 64 bit DSP call chain is built; adds object to signal flow
 returns:		nothing
 ********************************************************************************/
void gverb_dsp64(t_gverb *x, t_object *dsp64, short *count, double samplerate,
                      long maxvectorsize, long flags)
{
    
    #ifdef DEBUG
        post("%s: adding 64 bit perform method", OBJECT_NAME);
    #endif /* DEBUG */
    
    // check inlet connection
    x->verb_decay_connected = count[1];
    
    // get sample rate info
    x->output_sr = samplerate;
    x->output_msr = x->output_sr * 0.001;
    x->output_1overmsr = 1.0 / x->output_msr;
    
    x->verb_decay_coeff =
    pow(10.0, (-16416.0 * x->verb_decay_1over * x->output_1overmsr));
    
    // update allpass mod with sampling rate
    rbb_set_allpassMod_freq(x->apFilters_mod, AP_MODRATE_1, x->output_sr);
    rbb_set_allpassMod_freq(((x->apFilters_mod) + 1), AP_MODRATE_2, x->output_sr);
    
    dsp_add64(dsp64, (t_object*)x, (t_perfroutine64)gverb_perform64, 0, NULL);
    
}
コード例 #3
0
/********************************************************************************
 void grainstream_dsp64()
 
 inputs:     x		-- pointer to this object
 dsp64		-- signal chain to which object belongs
 count	-- array detailing number of signals attached to each inlet
 samplerate -- number of samples per second
 maxvectorsize -- sample frames per vector of audio
 flags --
 description:	called when 64 bit DSP call chain is built; adds object to signal flow
 returns:		nothing
 ********************************************************************************/
void grainstream_dsp64(t_grainstream *x, t_object *dsp64, short *count, double samplerate,
                      long maxvectorsize, long flags)
{
    
    #ifdef DEBUG
        post("%s: adding 64 bit perform method", OBJECT_NAME);
    #endif /* DEBUG */
    
    // set buffers
    grainstream_setsnd(x, x->snd_sym);
    grainstream_setwin(x, x->win_sym);
    
    // test inlets for signal connections
    x->grain_freq_connected = count[0];
    x->grain_pos_start_connected = count[1];
    x->grain_pitch_connected = count[2];
    x->grain_gain_connected = count[3];
    
    x->output_sr = samplerate;
    x->output_1oversr = 1.0 / x->output_sr;
    
    if (count[4] || count[5]) // if either output is connected
    {
        #ifdef DEBUG
            post("%s: output is being computed", OBJECT_NAME);
        #endif /* DEBUG */
        dsp_add64(dsp64, (t_object*)x, (t_perfroutine64)grainstream_perform64, 0, NULL);
    } else {
        #ifdef DEBUG
            post("%s: no output computed", OBJECT_NAME);
        #endif /* DEBUG */
    }
    
}
コード例 #4
0
ファイル: ep.midside~.c プロジェクト: eliottparis/ep.tools
void midside_dsp64(t_midside *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags)
{
    if (count[0] && count[1])
    {
        dsp_add64(dsp64, (t_object*)x, (t_perfroutine64)midside_perform64, 0, NULL);
    }
    else if(count[0])
    {
        dsp_add64(dsp64, (t_object*)x, (t_perfroutine64)midside_perform64_left, 0, NULL);
    }
    else if(count[1])
    {
        dsp_add64(dsp64, (t_object*)x, (t_perfroutine64)midside_perform64_right, 0, NULL);
    }
    else
    {
        dsp_add64(dsp64, (t_object*)x, (t_perfroutine64)midside_perform64_zero, 0, NULL);
    }
}
コード例 #5
0
void max_jit_peek_dsp64(t_max_jit_peek *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags)
{
//	long i;
	t_atom a;

	if (!x->mdata) // matrix may haven been initialized after jit.peek~ object. try again.
	{
		jit_atom_setsym(&a,x->matrix_name);
		max_jit_peek_matrix_name(x,NULL,1,&a);
	}

//	x->vectors[0] = (t_float*)sp[x->dimcount]->s_vec;
//	for (i=0;i<(x->dimcount);i++)
//		x->vectors[i+1] = (t_float*)sp[i]->s_vec;

	dsp_add64(dsp64, (t_object *)x, (t_perfroutine64)max_jit_peek_perform64, 0, NULL);
}
コード例 #6
0
void cmgrainlabs_dsp64(t_cmgrainlabs *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags) {
	x->connect_status[0] = count[1]; // 2nd inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[1] = count[2]; // 3rd inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[2] = count[3]; // 4th inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[3] = count[4]; // 5th inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[4] = count[5]; // 6th inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[5] = count[6]; // 7th inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[6] = count[7]; // 8th inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[7] = count[8]; // 9th inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[8] = count[9]; // 10th inlet: write connection flag into object structure (1 if signal connected)
	x->connect_status[9] = count[10]; // 11th inlet: write connection flag into object structure (1 if signal connected)
	
	if (x->m_sr != samplerate * 0.001) { // check if sample rate stored in object structure is the same as the current project sample rate
		x->m_sr = samplerate * 0.001;
	}
	
	// CALL THE PERFORM ROUTINE
	//object_method(dsp64, gensym("dsp_add64"), x, cmgrainlabs_perform64, 0, NULL);
	dsp_add64(dsp64, (t_object*)x, (t_perfroutine64)cmgrainlabs_perform64, 0, NULL);
}
コード例 #7
0
ファイル: index~.c プロジェクト: eliantor/max-sdk
void index_dsp64(t_index *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags)
{
	dsp_add64(dsp64, (t_object *)x, (t_perfroutine64)index_perform64, 0, NULL);
}