Crest.hpp
1 #pragma once
2 #include <Engine/Node/SimpleApi.hpp>
3 
4 #include <Analysis/GistState.hpp>
5 
6 #include <numeric>
7 namespace Analysis
8 {
9 struct Crest
10 {
12  {
13  static const constexpr auto prettyName = "Spectral Crest";
14  static const constexpr auto objectKey = "Crest";
15  static const constexpr auto category = "Analysis/Spectrum";
16  static const constexpr auto author = "ossia score, Gist library";
17  static const constexpr auto kind = Process::ProcessCategory::Analyzer;
18  static const constexpr auto description = "Get the spectral crest of a signal";
19  static const constexpr auto tags = std::array<const char*, 0>{};
20  static const uuid_constexpr auto uuid
21  = make_uuid("41755e45-dc1f-4bd8-b2c9-6a455119339a");
22 
23  static const constexpr audio_in audio_ins[]{"in"};
24  static const constexpr value_out value_outs[]{"out"};
25  static const constexpr auto controls = tuplet::make_tuple(
26  Control::LogFloatSlider{"Gain", 0., 100., 1.},
27  Control::FloatSlider{"Gate", 0., 1., 0.});
28  };
29 
30  using State = GistState;
31  using control_policy = ossia::safe_nodes::last_tick;
32 
33  static void
34  run(const ossia::audio_port& in, float gain, float gate, ossia::value_port& out,
35  ossia::token_request tk, ossia::exec_state_facade e, State& st)
36  {
37  st.process<&Gist<double>::spectralCrest>(in, gain, gate, out, tk, e);
38  }
39 };
40 }
Utilities for OSSIA data structures.
Definition: DeviceInterface.hpp:33
Definition: Crest.hpp:12
Definition: Crest.hpp:10
Definition: GistState.hpp:24
Definition: score-lib-process/Control/Widgets.hpp:77
Definition: SimpleApi.hpp:32