VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vae_voice_filter.hpp
Go to the documentation of this file.
1#ifndef _VAE_VOICE_FILTER
2#define _VAE_VOICE_FILTER
3
4#include "../vae_types.hpp"
5#include "../vae_config.hpp"
6#include <limits>
7
8namespace vae { namespace core {
9 /**
10 * @brief Additional data needed for filtered voices.
11 * Allows lowpass and highpass filtering as well as variable
12 * playback speeds.
13 */
14 struct VoiceFilter {
15 Real lowpass = 0.0; ///< Lowpasses the signal as the value approaches 1
16 Real highpass = 0.0; ///< Highpasses the signal as the value approaches 1
17 Real speed = 1.0; ///< Playback speed, will alter pitch
18 Real timeFract = 0.0; ///< Fractional time component for interpolation
19 Sample lowpassScratch[StaticConfig::MaxChannels]; ///< Last sample per channel for IIR filter
20 Sample highpassScratch[StaticConfig::MaxChannels]; ///< Last sample per channel for IIR filter
21
23 for (Size i = 0; i < StaticConfig::MaxChannels; i++) {
24 lowpassScratch[i] = 0;
25 highpassScratch[i] = 0;
26 }
27 }
28 };
29
31
32} } // core::vae
33
34#endif // _VAE_VOICE_FILTER
constexpr unsigned char MaxChannels
Maximum channel count used to pre allocate buffers.
Definition: vae.hpp:268
float Real
Definition: vae_types.hpp:48
constexpr int _VAE_VOICE_FILTER_FILTERED_SIZE
Contains Typedefinitions and basic structures use by the public API and internally.
Definition: vae.hpp:31
unsigned int Size
How the elements are addressed in the heapbuffer.
Definition: vae.hpp:33
float Sample
Default sample types used where ever possible, changing this means the engine needs to be recompiled,...
Definition: vae.hpp:32
Additional data needed for filtered voices.
Real speed
Playback speed, will alter pitch.
Real lowpass
Lowpasses the signal as the value approaches 1.
Sample highpassScratch[StaticConfig::MaxChannels]
Last sample per channel for IIR filter.
Sample lowpassScratch[StaticConfig::MaxChannels]
Last sample per channel for IIR filter.
Real highpass
Highpasses the signal as the value approaches 1.
Real timeFract
Fractional time component for interpolation.