4#include "../vae_types.hpp"
5#include "../vae_util.hpp"
7namespace vae {
namespace core {
32 for (
const auto& speaker : positions) {
36 for (i = 0; i < N; i++) {
37 for (
Size j = 0; j < N; j++) {
63 const Sample tightness = 1.0;
64 std::fill_n(result, N,
Sample(0));
65 for (
Size i = 0; i < N; i++) {
67 gain = powf(gain, tightness);
75 for (
Size i = 0; i < N; i++) {
76 result[i] = sqrtf(result[i] / sumGains) * attenuation;
97 { -1, 0, 0 }, { +1, 0, 0 }
100 { -1, 0, -1 }, { +1, 0, -1 }
103 { -1, 0, -1 }, { +1, 0, -1 },
104 { -1, 0, +1 }, { +1, 0, +1 }
107 { -1, 0, -1 }, { +1, 0, -1 },
108 { -1, 0, +1 }, { +1, 0, +1 },
Class handling SPCAP for arbitrary speaker setups.
void pan(const Vec3 &direction, Sample result[N], Sample attenuation, Sample spread) const
Calculate per channel volumes for a given direction.
SPCAPConfig(const std::initializer_list< Vec3 > &positions)
Construct a new SPCAPConfig object Implemented according to https://www.researchgate....
static constexpr Size speakers
Contains Typedefinitions and basic structures use by the public API and internally.
unsigned int Size
How the elements are addressed in the heapbuffer.
float Sample
Default sample types used where ever possible, changing this means the engine needs to be recompiled,...
Vec3 dir
Position of the speaker on a unit sphere.
Struct containing SPCAP and preconfigured speaker setups.
static const SPCAPConfig< 2 > StereroSPCAP
static const SPCAPConfig< 1 > MonoSPCAP
TODO there's probably a smart way to make this all constexpr.
static const SPCAPConfig< 4 > QuadSPCAP
static const SPCAPConfig< 5 > SuroundSPCAP
static const SPCAPConfig< 2 > HeadphoneSPCAP
#define VAE_PROFILER_SCOPE_NAMED(name)
Profiles a scope and names it.