Some changes in style, smaller h/v-scale added

This commit is contained in:
Markus Schmidt
2009-11-25 01:37:01 +01:00
committed by Tobias Doerffel
parent 900b599c2d
commit 9414b90d7b
4 changed files with 25 additions and 1 deletions

View File

@@ -253,7 +253,7 @@ struct pulsator_metadata: public plugin_metadata<pulsator_metadata>
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
enum { param_bypass, param_level_in, param_level_out, param_meter_inL, param_meter_inR,
param_meter_outL, param_meter_outR, param_clip_inL, param_clip_inR, param_clip_outL, param_clip_outR,
param_mode, param_freq, param_amount, param_offset, param_mono, param_count };
param_mode, param_freq, param_amount, param_offset, param_mono, param_reset, param_count };
PLUGIN_NAME_ID_LABEL("pulsator", "pulsator", "Pulsator")
};

View File

@@ -1103,6 +1103,7 @@ public:
void set_params(float f, int m, float o, uint32_t sr, float amount = 1.f);
float get_value();
void advance(uint32_t count);
void set_phase(float ph);
void activate();
void deactivate();
float get_value_from_phase(float ph, float off);
@@ -1117,6 +1118,7 @@ private:
float meter_inL, meter_inR, meter_outL, meter_outR;
float offset_old;
int mode_old;
bool clear_reset;
lfo_audio_module lfoL, lfoR;
public:
float *ins[in_count];
@@ -1129,6 +1131,13 @@ public:
void deactivate();
void params_changed();
void set_sample_rate(uint32_t sr);
void params_reset()
{
if (clear_reset) {
*params[param_reset] = 0.f;
clear_reset = false;
}
}
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
bool get_dot(int index, int subindex, float &x, float &y, int &size, cairo_iface *context);

View File

@@ -509,6 +509,7 @@ CALF_PORT_PROPS(pulsator) = {
{ 1, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "amount", "Modulation" },
{ 0.5, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "offset", "Offset L/R" },
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "mono", "Mono-in" },
{ 0, 0, 1, 2, PF_BOOL | PF_CTL_BUTTON , NULL, "reset", "Reset" },
};
CALF_PLUGIN_INFO(pulsator) = { 0x8514, "Pulsator", "Calf Pulsator", "Markus Schmidt", calf_plugins::calf_copyright_info, "ModulationPlugin" };

View File

@@ -2151,6 +2151,14 @@ void lfo_audio_module::advance(uint32_t count)
phase = fmod(phase, 1.f);
}
void lfo_audio_module::set_phase(float ph)
{
//set the phase from outsinde
phase = fabs(ph);
if (phase >= 1.0)
phase = fmod(phase, 1.f);
}
void lfo_audio_module::set_params(float f, int m, float o, uint32_t sr, float a)
{
// freq: a value in Hz
@@ -2225,6 +2233,12 @@ void pulsator_audio_module::params_changed()
{
lfoL.set_params(*params[param_freq], *params[param_mode], 0.f, srate, *params[param_amount]);
lfoR.set_params(*params[param_freq], *params[param_mode], *params[param_offset], srate, *params[param_amount]);
clear_reset = false;
if (*params[param_reset] >= 0.5) {
clear_reset = true;
lfoL.set_phase(0.f);
lfoR.set_phase(0.f);
}
}
void pulsator_audio_module::set_sample_rate(uint32_t sr)