21 #ifndef _FLUID_VOICE_H 22 #define _FLUID_VOICE_H 29 #define NO_CHANNEL 0xff 75 unsigned _cachedFrames = 0;
77 unsigned _initialCacheFrames = 0;
88 void effects(
int startBufIdx,
int count,
float* out,
float* effect1,
float* effect2);
94 bool generateDataForDSPChain(
unsigned frames);
100 std::tuple<unsigned, bool> interpolateGeneratedDSPData(
unsigned n);
225 void init(
Sample*,
Channel*,
int key,
int vel,
unsigned id,
double tuning);
226 void gen_incr(
int i,
float val);
227 void gen_set(
int i,
float val);
228 float gen_get(
int gen);
229 unsigned int get_id()
const {
return id; }
231 void set_param(
int gen,
float nrpn_value,
int abs);
238 void update_param(
int gen);
240 double GEN(
int n) {
return gen[n].val + gen[n].mod + gen[n].nrpn; }
243 void modulate(
bool _cc,
int _ctrl);
244 float get_lower_boundary_for_attenuation();
245 void check_sample_sanity();
248 int calculate_hold_decay_frames(
int gen_base,
int gen_key2base,
int is_decay);
249 void calculate_gen_pitch();
262 void write(
unsigned n,
float* out,
float* reverb,
float* chorus);
263 void add_mod(
const Mod* mod,
int mode);
265 static void dsp_float_config();
266 bool updateAmpInc(
unsigned int &nextNewAmpInc, std::map<int, qreal>::iterator &curSample2AmpInc, qreal &dsp_amp_incr,
unsigned int &dsp_i);
267 int dsp_float_interpolate_none(
unsigned);
268 int dsp_float_interpolate_linear(
unsigned);
269 int dsp_float_interpolate_4th_order(
unsigned);
270 int dsp_float_interpolate_7th_order(
unsigned);
bool RELEASED() const
Definition: voice.h:255
float amp
Definition: voice.h:121
double GEN(int n)
Definition: voice.h:240
float pitch
Definition: voice.h:130
unsigned char vel
Definition: voice.h:108
float modenv_val
Definition: voice.h:156
float attenuation
Definition: voice.h:131
float amp_right
Definition: voice.h:203
float root_pitch_hz
Definition: voice.h:134
float modlfo_to_vol
Definition: voice.h:167
bool ON() const
Definition: voice.h:258
float amp_left
Definition: voice.h:202
float min
Definition: voice.h:44
float modlfo_to_fc
Definition: voice.h:165
Phase phase
Definition: voice.h:122
bool isPlaying()
Definition: voice.h:230
float amp_reverb
Definition: voice.h:207
int modenv_section
Definition: voice.h:155
float viblfo_to_pitch
Definition: voice.h:173
float last_fres
Definition: voice.h:177
fluid_voice_status
Definition: voice.h:31
#define NO_CHANNEL
Definition: voice.h:29
float volenv_val
Definition: voice.h:147
unsigned int modenv_count
Definition: voice.h:154
float filter_gain
Definition: voice.h:181
double _noteTuning
Definition: voice.h:71
int positionToTurnOff
Definition: voice.h:150
unsigned int id
Definition: voice.h:103
float coeff
Definition: voice.h:42
std::vector< float > _cacheReverb
Definition: voice.h:80
double ref
Definition: voice.h:218
int debug
Definition: voice.h:217
unsigned int count
Definition: voice.h:41
float b02
Definition: voice.h:189
float modlfo_to_pitch
Definition: voice.h:166
float hist2
Definition: voice.h:182
float amplitude_that_reaches_noise_floor_loop
Definition: voice.h:149
float reverb_send
Definition: voice.h:206
int loopend
Definition: voice.h:140
unsigned char key
Definition: voice.h:107
unsigned char status
Definition: voice.h:105
float b1_incr
Definition: voice.h:195
std::vector< float > dsp_buf
Definition: voice.h:127
Value defines the count of generators (fluid_gen_type)
Definition: fluid.h:209
float max
Definition: voice.h:45
float chorus_send
Definition: voice.h:210
float b02_incr
Definition: voice.h:194
int loopstart
Definition: voice.h:139
unsigned int ticks
Definition: voice.h:119
float a1
Definition: voice.h:191
fluid_voice_envelope_index_t
Definition: voice.h:49
unsigned int modlfo_delay
Definition: voice.h:162
unsigned int viblfo_delay
Definition: voice.h:171
float phase_incr
Definition: voice.h:125
std::vector< float > _cacheOut
Definition: voice.h:79
float incr
Definition: voice.h:43
float modenv_to_pitch
Definition: voice.h:158
float modlfo_val
Definition: voice.h:161
int check_sample_sanity_flag
Definition: voice.h:117
int end
Definition: voice.h:138
float a2_incr
Definition: voice.h:197
float pan
Definition: voice.h:201
int volenv_section
Definition: voice.h:145
float a2
Definition: voice.h:192
float modenv_to_fc
Definition: voice.h:157
int start
Definition: voice.h:137
Channel * channel
Definition: voice.h:110
float fres
Definition: voice.h:176
float b1
Definition: voice.h:190
int mod_count
Definition: voice.h:114
int filter_startup
Definition: voice.h:183
float min_attenuation_cB
Definition: voice.h:132
unsigned int modlfo_dur
Definition: voice.h:164
#define FLUID_INTERP_MAX
Definition: fluid.h:629
#define FLUID_NUM_MOD
Definition: fluid.h:493
unsigned char chan
Definition: voice.h:106
float a1_incr
Definition: voice.h:196
std::map< int, qreal > Sample2AmpInc
Definition: voice.h:146
qreal amp_incr
Definition: voice.h:126
SoundFont generator structure.
Definition: fluid.h:498
Sample * sample
Definition: voice.h:116
Fluid * _fluid
Definition: voice.h:70
float viblfo_val
Definition: voice.h:170
float amplitude_that_reaches_noise_floor_nonloop
Definition: voice.h:148
float viblfo_incr
Definition: voice.h:172
int SAMPLEMODE() const
Definition: voice.h:259
std::vector< float > _cacheChorus
Definition: voice.h:81
bool PLAYING() const
Definition: voice.h:257
Channel * get_channel() const
Definition: voice.h:222
bool has_looped
Definition: voice.h:115
Sample mode flags.
Definition: fluid.h:198
int interp_method
Definition: voice.h:214
bool SUSTAINED() const
Definition: voice.h:256
float q_lin
Definition: voice.h:180
int filter_coeff_incr_count
Definition: voice.h:198
float amp_chorus
Definition: voice.h:211
unsigned int volenv_count
Definition: voice.h:144
unsigned int modlfo_pos
Definition: voice.h:163
unsigned int get_id() const
Definition: voice.h:229