1
#ifndef INCLUDED_AUDIOFX_ENVELOPE_MODULATION_H
2
#define INCLUDED_AUDIOFX_ENVELOPE_MODULATION_H
6
#include "samplebuffer_iterators.h"
10
* Virtual base for envelope modulation effects.
13
class EFFECT_ENV_MOD : public EFFECT_BASE {
16
virtual ~EFFECT_ENV_MOD(void);
23
class EFFECT_PULSE_GATE: public EFFECT_ENV_MOD {
25
SAMPLE_ITERATOR_INTERLEAVED i;
27
parameter_t on_time_rep;
34
virtual std::string name(void) const { return("Pulse Gate"); }
35
virtual std::string parameter_names(void) const { return("freq-Hz,on-time-%"); }
37
virtual void set_parameter(int param, parameter_t value);
38
virtual parameter_t get_parameter(int param) const;
40
virtual void init(SAMPLE_BUFFER *insample);
41
virtual void process(void);
43
EFFECT_PULSE_GATE (parameter_t freq_Hz = 1.0, parameter_t onTime_percent = 50.0);
44
virtual ~EFFECT_PULSE_GATE(void);
45
EFFECT_PULSE_GATE* clone(void) const { return new EFFECT_PULSE_GATE(*this); }
46
EFFECT_PULSE_GATE* new_expr(void) const { return new EFFECT_PULSE_GATE(); }
48
/** @name Protected virtual functions to notify about changes
49
* (Reimplemented from ECA_SAMPLERATE_AWARE) */
52
virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v);
58
* Wrapper class for pulse shaped gate providing
59
* a beats-per-minute (bpm) based parameters.
61
* @author Kai Vehmanen
63
class EFFECT_PULSE_GATE_BPM : public EFFECT_ENV_MOD {
65
EFFECT_PULSE_GATE pulsegate_rep;
69
virtual std::string name(void) const { return("Pulse gate BPM"); }
70
virtual std::string parameter_names(void) const { return("bpm,on-time-msec"); }
72
virtual void set_parameter(int param, parameter_t value);
73
virtual parameter_t get_parameter(int param) const;
75
virtual void init(SAMPLE_BUFFER *insample);
76
virtual void process(void);
78
EFFECT_PULSE_GATE_BPM (parameter_t bpm = 120.0, parameter_t ontime_percent = 5.0);
79
virtual ~EFFECT_PULSE_GATE_BPM(void);
80
EFFECT_PULSE_GATE_BPM* clone(void) const { return new EFFECT_PULSE_GATE_BPM(*this); }
81
EFFECT_PULSE_GATE_BPM* new_expr(void) const { return new EFFECT_PULSE_GATE_BPM(); }
83
/** @name Protected virtual functions to notify about changes
84
* (Reimplemented from ECA_SAMPLERATE_AWARE) */
87
virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v);
96
class EFFECT_TREMOLO: public EFFECT_ENV_MOD {
98
SAMPLE_ITERATOR_INTERLEAVED i;
101
parameter_t currentTime;
102
parameter_t incrTime;
106
virtual std::string name(void) const { return("Tremolo"); }
107
virtual std::string parameter_names(void) const { return("bpm,depth-%"); }
109
virtual void set_parameter(int param, parameter_t value);
110
virtual parameter_t get_parameter(int param) const;
112
virtual void init(SAMPLE_BUFFER *insample);
113
virtual void process(void);
115
EFFECT_TREMOLO (parameter_t freq_bpm = 60.0, parameter_t depth_percent = 100.0);
116
virtual ~EFFECT_TREMOLO(void);
117
EFFECT_TREMOLO* clone(void) const { return new EFFECT_TREMOLO(*this); }
118
EFFECT_TREMOLO* new_expr(void) const { return new EFFECT_TREMOLO(); }