Krotos Modules 3
Loading...
Searching...
No Matches
krotos::MouseVelocityExtractor Class Reference

A class specifically designed to extract some kind of useable velocity value from parameters whose values are driven by mouse move messages The signal is very noisy, and unpredictable with respect to when it changes. More...

#include <OscillatorUtils.h>

Public Member Functions

 MouseVelocityExtractor ()
 
 ~MouseVelocityExtractor ()
 
void process ()
 Do the calculation.
 
void prepare (double sampleRate, int samplesPerBlock)
 Set the sample rate and block size.
 
void setInput (float val)
 Input the value to be processed.
 
float getOutput ()
 Fetch the processed output.
 

Private Attributes

double m_sampleRate {0.0}
 
int m_samplesPerBlock {0}
 
float m_blockRateHZ {0.f}
 
float m_input {0.0f}
 
float m_previousInput {0.0f}
 
float m_velocity {0.0f}
 
float m_calibration {0}
 
SmoothedFloat m_smoothedVelocity
 
const float VELOCITY_LP_FILTER_HZ {4.5f}
 
const float VELOCITY_LP_FILTER_Q {1.f}
 
const float CALIBRATION_FACTOR {0.1f}
 
dsp::IIR::Filter< float > m_smoother
 

Detailed Description

A class specifically designed to extract some kind of useable velocity value from parameters whose values are driven by mouse move messages The signal is very noisy, and unpredictable with respect to when it changes.

Constructor & Destructor Documentation

◆ MouseVelocityExtractor()

krotos::MouseVelocityExtractor::MouseVelocityExtractor ( )
inline

◆ ~MouseVelocityExtractor()

krotos::MouseVelocityExtractor::~MouseVelocityExtractor ( )
inline

Member Function Documentation

◆ getOutput()

float krotos::MouseVelocityExtractor::getOutput ( )

Fetch the processed output.

Returns

◆ prepare()

void krotos::MouseVelocityExtractor::prepare ( double sampleRate,
int samplesPerBlock )

Set the sample rate and block size.

Parameters
sampleRate
samplesPerBlock

◆ process()

void krotos::MouseVelocityExtractor::process ( )

Do the calculation.

◆ setInput()

void krotos::MouseVelocityExtractor::setInput ( float val)

Input the value to be processed.

Parameters
val

Member Data Documentation

◆ CALIBRATION_FACTOR

const float krotos::MouseVelocityExtractor::CALIBRATION_FACTOR {0.1f}
private

◆ m_blockRateHZ

float krotos::MouseVelocityExtractor::m_blockRateHZ {0.f}
private

◆ m_calibration

float krotos::MouseVelocityExtractor::m_calibration {0}
private

◆ m_input

float krotos::MouseVelocityExtractor::m_input {0.0f}
private

◆ m_previousInput

float krotos::MouseVelocityExtractor::m_previousInput {0.0f}
private

◆ m_sampleRate

double krotos::MouseVelocityExtractor::m_sampleRate {0.0}
private

◆ m_samplesPerBlock

int krotos::MouseVelocityExtractor::m_samplesPerBlock {0}
private

◆ m_smoothedVelocity

SmoothedFloat krotos::MouseVelocityExtractor::m_smoothedVelocity
private

◆ m_smoother

dsp::IIR::Filter<float> krotos::MouseVelocityExtractor::m_smoother
private

◆ m_velocity

float krotos::MouseVelocityExtractor::m_velocity {0.0f}
private

◆ VELOCITY_LP_FILTER_HZ

const float krotos::MouseVelocityExtractor::VELOCITY_LP_FILTER_HZ {4.5f}
private

◆ VELOCITY_LP_FILTER_Q

const float krotos::MouseVelocityExtractor::VELOCITY_LP_FILTER_Q {1.f}
private

The documentation for this class was generated from the following files: