3 #ifndef SPECTMORPH_ENCODER_HH 4 #define SPECTMORPH_ENCODER_HH 12 #include "smwavdata.hh" 49 std::vector<std::string> param_name_d;
50 std::map<std::string, double> param_value_d;
51 std::vector<std::string> param_name_s;
52 std::map<std::string, std::string> param_value_s;
54 bool load_config (
const std::string& filename);
55 bool get_param (
const std::string& param,
double& value)
const;
56 bool get_param (
const std::string& param, std::string& value)
const;
96 Audio::LoopType loop_type;
98 bool check_harmonic (
double freq,
double& new_freq,
double mix_freq);
100 std::vector< std::vector<Tracksel> > frame_tracksels;
104 double attack_start_ms;
105 double attack_end_ms;
107 double attack_error (
const std::vector< std::vector<double> >& unscaled_signal,
const std::vector<float>& window,
const Attack& attack, std::vector<double>& out_scale);
111 Attack optimal_attack;
112 size_t zero_values_at_start;
114 std::vector<float> original_samples;
119 void compute_stft (
const WavData& wav_data,
int channel,
const std::vector<float>& window);
120 void search_local_maxima (
const std::vector<float>& window);
121 void link_partials();
122 void validate_partials();
123 void optimize_partials (
const std::vector<float>& window,
int optimization_level);
124 void spectral_subtract (
const std::vector<float>& window);
125 void approx_noise (
const std::vector<float>& window);
126 void compute_attack_params (
const std::vector<float>& window);
128 void debug_decode (
const std::string& filename,
const std::vector<float>& window);
131 void encode (
const WavData& wav_data,
int channel,
const std::vector<float>& window,
int optimization_level,
132 bool attack,
bool track_sines);
134 void set_loop (Audio::LoopType loop_type,
int loop_start,
int loop_end);
135 void set_loop_seconds (Audio::LoopType loop_type,
double loop_start,
double loop_end);
136 void save (
const std::string& filename);
std::vector< float > original_fft
original zeropadded FFT data - for debugging only
Definition: smencoder.hh:79
float frame_step_ms
Definition: smencoder.hh:28
float frame_size_ms
Definition: smencoder.hh:31
size_t frame_step
Definition: smencoder.hh:37
Definition: smencoder.hh:72
Definition: smencoder.hh:61
std::vector< EncoderBlock > audio_blocks
current state, and end result of the encoding algorithm
Definition: smencoder.hh:110
std::vector< float > phases
phases of the sine components
Definition: smencoder.hh:78
double fundamental_freq
Definition: smencoder.hh:46
Encoder parameters.
Definition: smencoder.hh:22
Definition: smalignedarray.cc:7
float mix_freq
Definition: smencoder.hh:25
std::vector< float > freqs
frequencies of the sine components of this frame
Definition: smencoder.hh:76
std::vector< float > mags
magnitudes of the sine components
Definition: smencoder.hh:77
std::vector< float > debug_samples
original audio samples for this frame - for debugging only
Definition: smencoder.hh:80
Encoder producing SpectMorph parametric data from sample data.
Definition: smencoder.hh:91
int zeropad
Definition: smencoder.hh:34
size_t frame_size
Definition: smencoder.hh:40
std::vector< float > noise
noise envelope, representing the original signal minus sine components
Definition: smencoder.hh:75
size_t block_size
Definition: smencoder.hh:43
Definition: smwavdata.hh:13