10using json = nlohmann::json;
73 float render(
int position);
76 void renderToBuffer(
float* buffer,
int num_frames,
int frame_size);
82 void initFromAudioFile(
const float* audio_buffer,
int num_samples,
int sample_rate,
155 std::vector<std::unique_ptr<WavetableGroup>>
groups_;
FadeStyle
Different methods to blend or interpolate the loaded audio window into a wavetable frame.
Definition file_source.h:38
A class for generating and storing a line shape, defined by a series of points and associated powers.
Definition line_generator.h:20
A class responsible for creating complete wavetables from groups of wavetable components.
Definition wavetable_creator.h:27
void initPredefinedWaves()
Definition wavetable_creator.cpp:171
void initFromLineGenerator(LineGenerator *line_generator)
Definition wavetable_creator.cpp:292
bool full_normalize_
Definition wavetable_creator.h:159
void removeGroup(int index)
Definition wavetable_creator.cpp:51
void setFileLoaded(const std::string &path)
Records the path of the last file loaded to create this wavetable.
Definition wavetable_creator.h:104
WavetableGroup * getGroup(int index) const
Retrieves a WavetableGroup by index.
Definition wavetable_creator.h:71
json updateJson(json data)
Definition wavetable_creator.cpp:321
static bool isValidJson(json data)
Checks if a given JSON data represents a valid wavetable creator state.
Definition wavetable_creator.cpp:309
vital::WaveFrame compute_frame_combine_
Definition wavetable_creator.h:153
void moveUp(int index)
Definition wavetable_creator.cpp:37
void setAuthor(const std::string &author)
Sets the author of the wavetable.
Definition wavetable_creator.h:97
std::string getAuthor() const
Gets the author of the wavetable.
Definition wavetable_creator.h:118
void initFromPitchedAudioFile(const float *audio_buffer, int num_samples, int sample_rate)
Definition wavetable_creator.cpp:271
void addGroup(WavetableGroup *group)
Definition wavetable_creator.h:53
void loadDefaultCreator()
Definition wavetable_creator.cpp:163
void init()
Definition wavetable_creator.cpp:151
void clear()
Definition wavetable_creator.cpp:157
AudioFileLoadStyle
Defines how audio files are interpreted when loading into a wavetable.
Definition wavetable_creator.h:33
@ kWavetableSplice
Slice the audio into segments mapping onto wavetable frames.
Definition wavetable_creator.h:35
@ kNone
Definition wavetable_creator.h:34
@ kTtwt
Similar to vocoded but optimized for TTWT (text-to-wavetable).
Definition wavetable_creator.h:37
@ kVocoded
Apply vocoder-like analysis to extract fundamental cycles.
Definition wavetable_creator.h:36
@ kPitched
Attempts to extract pitch-based cycles from the audio.
Definition wavetable_creator.h:38
@ kNumDragLoadStyles
Definition wavetable_creator.h:39
std::string last_file_loaded_
Definition wavetable_creator.h:157
json stateToJson()
Definition wavetable_creator.cpp:477
void jsonToState(json data)
Definition wavetable_creator.cpp:493
int numGroups() const
Gets the total number of WavetableGroups.
Definition wavetable_creator.h:63
int getGroupIndex(WavetableGroup *group)
Definition wavetable_creator.cpp:29
void initFromAudioFile(const float *audio_buffer, int num_samples, int sample_rate, AudioFileLoadStyle load_style, FileSource::FadeStyle fade_style)
Definition wavetable_creator.cpp:196
vital::Wavetable * getWavetable()
Gets the internal wavetable object being created.
Definition wavetable_creator.h:144
bool remove_all_dc_
Definition wavetable_creator.h:160
vital::Wavetable * wavetable_
Definition wavetable_creator.h:158
void moveDown(int index)
Definition wavetable_creator.cpp:44
void render()
Definition wavetable_creator.cpp:89
void initFromVocodedAudioFile(const float *audio_buffer, int num_samples, int sample_rate, bool ttwt)
Definition wavetable_creator.cpp:243
std::string getName() const
Gets the name of the wavetable.
Definition wavetable_creator.h:111
std::vector< std::unique_ptr< WavetableGroup > > groups_
Definition wavetable_creator.h:155
vital::WaveFrame compute_frame_
Definition wavetable_creator.h:154
void renderToBuffer(float *buffer, int num_frames, int frame_size)
Definition wavetable_creator.cpp:117
void postRender(float max_span)
Definition wavetable_creator.cpp:109
void setName(const std::string &name)
Sets the name of the wavetable.
Definition wavetable_creator.h:90
std::string getLastFileLoaded()
Gets the last loaded file path.
Definition wavetable_creator.h:125
WavetableCreator(vital::Wavetable *wavetable)
Constructs a WavetableCreator associated with a given Wavetable object.
Definition wavetable_creator.h:49
void initFromSplicedAudioFile(const float *audio_buffer, int num_samples, int sample_rate, FileSource::FadeStyle fade_style)
Definition wavetable_creator.cpp:210
A class representing a group of WavetableComponents combined to form part of a wavetable.
Definition wavetable_group.h:24
Represents a single frame of a wavetable, containing both time-domain and frequency-domain data.
Definition wave_frame.h:16
A class representing a wavetable, holding multiple frames of waveforms and their frequency-domain rep...
Definition wavetable.h:20
std::string getAuthor()
Get the author of this wavetable.
Definition wavetable.h:122
std::string getName()
Get the user-defined name of this wavetable.
Definition wavetable.h:115
void setName(const std::string &name)
Set a user-defined name for this wavetable.
Definition wavetable.h:129
void setAuthor(const std::string &author)
Set the author for this wavetable.
Definition wavetable.h:136
nlohmann::json json
Definition line_generator.h:7