Пример #1
0
int GVERB::run()
{
	const int samps = framesToRun() * inputChannels();
	int i;
	float out[2];

	rtgetin(in, this, samps);
	
	for (i = 0; i < samps; i += inputChannels()) {
		if (--branch <= 0) {
			doupdate();
			branch = getSkip();
		}

		if (currentFrame() > inputframes) in[i+inputchan] = 0.0;
		gverb_do(p, in[i+inputchan], out, out+1);

		out[0] = (out[0] * amp) + (in[i+inputchan] * p->drylevel);
		out[1] = (out[1] * amp) + (in[i+inputchan] * p->drylevel);

		rtaddout(out);

		increment();
	}
	return i;
}
Пример #2
0
static void runAddingGverb(LADSPA_Handle instance, unsigned long sample_count) {
	Gverb *plugin_data = (Gverb *)instance;
	LADSPA_Data run_adding_gain = plugin_data->run_adding_gain;

	/* Roomsize (m) (float value) */
	const LADSPA_Data roomsize = *(plugin_data->roomsize);

	/* Reverb time (s) (float value) */
	const LADSPA_Data revtime = *(plugin_data->revtime);

	/* Damping (float value) */
	const LADSPA_Data damping = *(plugin_data->damping);

	/* Input bandwidth (float value) */
	const LADSPA_Data inputbandwidth = *(plugin_data->inputbandwidth);

	/* Dry signal level (dB) (float value) */
	const LADSPA_Data drylevel = *(plugin_data->drylevel);

	/* Early reflection level (dB) (float value) */
	const LADSPA_Data earlylevel = *(plugin_data->earlylevel);

	/* Tail level (dB) (float value) */
	const LADSPA_Data taillevel = *(plugin_data->taillevel);

	/* Input (array of floats of length sample_count) */
	const LADSPA_Data * const input = plugin_data->input;

	/* Left output (array of floats of length sample_count) */
	LADSPA_Data * const outl = plugin_data->outl;

	/* Right output (array of floats of length sample_count) */
	LADSPA_Data * const outr = plugin_data->outr;
	ty_gverb * verb = plugin_data->verb;

#line 62 "gverb_1216.xml"
	unsigned long pos;
	float l, r;
	float dryc = DB_CO(drylevel);

	gverb_set_roomsize(verb, roomsize);
	gverb_set_revtime(verb, revtime);
	gverb_set_damping(verb, damping);
	gverb_set_inputbandwidth(verb, inputbandwidth);
	gverb_set_earlylevel(verb, DB_CO(earlylevel));
	gverb_set_taillevel(verb, DB_CO(taillevel));

	for (pos = 0; pos < sample_count; pos++) {
	  gverb_do(verb, input[pos], &l, &r);
	  buffer_write(outl[pos], l + input[pos] * dryc);
	  buffer_write(outr[pos], r + input[pos] * dryc);
	}
}
Пример #3
0
    // for Chugins extending UGen
    void tick( SAMPLE * in, SAMPLE * out, int nframes )
    {
      float rev[2];
      memset(out, 0, sizeof(SAMPLE)*2*nframes);

      for (int i=0; i < nframes; i+=2)
	{
	  gverb_do(p, in[i], rev, rev+1);
	  
	  out[i] = rev[0] + in[i] * p->drylevel;
	  out[i+1] = rev[1] + in[i+1] * p->drylevel;
	}
	}
Пример #4
0
void run(const char *desc)
{
	unsigned int i;
	long long then, now;

	// total flush test: verb = gverb_new(48000, 300.0f, 50.0f, 7.0f, 0.5f, 15.0f, 0.5f, 0.5f, 0.5f);
	rdtscll(then);
	for (i=0; i<SIZE; i++) {
//printf("%f\n", in[i]);
		gverb_do(verb, in[i], out[0]+i, out[1]+i);
	}
	rdtscll(now);
	printf("%s took %lld cycles/sample\n", desc, (now - then) / (long long)SIZE);
	gverb_flush(verb);
}