2#include <Analysis/GistState.hpp>
3#include <Analysis/Helpers.hpp>
4#include <halp/audio.hpp>
5#include <halp/callback.hpp>
6#include <halp/controls.hpp>
7#include <halp/meta.hpp>
9#if defined(OSSIA_ENABLE_KFR)
10#include <kfr/base.hpp>
12#include <kfr/dsp/iir_design.hpp>
17#if defined(OSSIA_ENABLE_KFR)
21 : hipass{kfr::to_sos(kfr::iir_highpass(kfr::butterworth(12), 200, this->rate))}
25 void filter(halp::dynamic_audio_bus_base<double>& in,
int d)
27 while(hipass.size() < in.channels)
30 kfr::to_sos(kfr::iir_highpass(kfr::butterworth(12), 200, this->rate)));
34 for(
double* chan : in)
36 hipass[c++].apply(chan, d);
40 std::vector<kfr::iir_filter<double>> hipass;
43using PitchState = GistState;
48 halp_meta(name,
"Pitch detector")
49 halp_meta(c_name,
"Pitch")
50 halp_meta(category,
"Analysis/Pitch")
51 halp_meta(author,
"ossia score, Gist library")
52 halp_meta(manual_url,
"https://ossia.io/score-docs/processes/analysis.html#pitch-detection")
53 halp_meta(description,
"Get the pitch of a signal")
54 halp_meta(uuid,
"ed511605-8265-4b2c-8c4b-d3b189539b3b");
65 void operator()(
int frames)
67 if(inputs.audio.channels == 0)
70#if defined(OSSIA_ENABLE_KFR)
71 filter(inputs.audio, frames);
73 process<&Gist<double>::pitch>(inputs.audio, outputs.result, frames);
Definition GistState.hpp:26
Definition Helpers.hpp:27
Definition Helpers.hpp:19