fsh::stk
fantastic spatial holophonic synthesis toolkit
Loading...
Searching...
No Matches
AmbisonicEncoder.h
1/***************************************************************************************************
2 ██████ █████ █████ █████
3 ███░░███ ░░███ ░░███ ░░███
4 ░███ ░░░ █████ ░███████ ██ ██ █████ ███████ ░███ █████
5 ███████ ███░░ ░███░░███ ░░ ░░ ███░░ ░░░███░ ░███░░███
6 ░░░███░ ░░█████ ░███ ░███ ░░█████ ░███ ░██████░
7 ░███ ░░░░███ ░███ ░███ ░░░░███ ░███ ███ ░███░░███
8 █████ ██████ ████ █████ ██ ██ ██████ ░░█████ ████ █████
9 ░░░░░ ░░░░░░ ░░░░ ░░░░░ ░░ ░░ ░░░░░░ ░░░░░ ░░░░ ░░░░░
10
11 fantastic spatial holophonic synthesis tool kit
12
13 copyright (c) fabian hummel
14 www.github.com/fshstk
15 www.fshstk.com
16
17 this file is part of the fantastic spatial holophonic synthesis toolkit (fsh::stk)
18 fsh::stk is free software: it is provided under the terms of the gnu general public license v3.0
19 www.gnu.org/licenses/gpl-3.0
20***************************************************************************************************/
21
22#pragma once
23#include "BoundedValue.h"
24#include "EnvelopeFollower.h"
25#include "SphericalHarmonics.h"
26#include "SphericalVector.h"
27
28namespace fsh::fx
29{
46{
47public:
54
56 auto getCoefficientsForNextSample() -> std::array<float, util::maxNumChannels>;
57
59 void setParams(const Params&);
60
62 void setSampleRate(double sampleRate);
63
64private:
65 void updateCoefficients();
66
67 Params _params;
68 std::array<util::EnvelopeFollower, util::maxNumChannels> _coefficients;
69};
70} // namespace fsh::fx
Provides coefficients to encode a mono signal into Ambisonics.
Definition AmbisonicEncoder.h:46
void setParams(const Params &)
Set order and direction for encoding.
Definition AmbisonicEncoder.cpp:43
auto getCoefficientsForNextSample() -> std::array< float, util::maxNumChannels >
Get the channel coefficients for the next input sample.
Definition AmbisonicEncoder.cpp:28
void setSampleRate(double sampleRate)
Set the sample rate. This must be set before using the AmbisonicEncoder.
Definition AmbisonicEncoder.cpp:37
Represents a value that is bounded by a minimum and maximum.
Definition BoundedValue.h:35
Parameters for AmbisonicEncoder.
Definition AmbisonicEncoder.h:50
util::SphericalVector direction
direction to encode to
Definition AmbisonicEncoder.h:51
util::BoundedFloat< 0, util::maxAmbiOrder > order
order to encode to
Definition AmbisonicEncoder.h:52
Represents a direction in spherical coordinates.
Definition SphericalVector.h:31