sfFDN
Loading...
Searching...
No Matches
fdn_config.h
1#pragma once
2
3#include "sffdn/fdn.h"
4#include "sffdn/types.h"
5
6#include <cstdint>
7#include <variant>
8#include <vector>
9
10namespace sfFDN
11{
12
16{
18 uint32_t fdn_size;
19
22
25
27 uint32_t block_size;
28
31
34
36 struct
37 {
40 std::vector<single_channel_processor_variant_t> single_channel_processors;
42 ParallelGainsOptions parallel_gains_config{.mode = ParallelGainsMode::Split, .gains = {}};
44 std::vector<multi_channel_processor_variant_t> multichannel_processors;
46
49
51 std::vector<multi_channel_processor_variant_t> loop_filter_configs;
52
54 struct
55 {
58 std::vector<multi_channel_processor_variant_t> multichannel_processors;
60 ParallelGainsOptions parallel_gains_config{.mode = ParallelGainsMode::Merge, .gains = {}};
63 std::vector<single_channel_processor_variant_t> single_channel_processors;
65
67 std::vector<single_channel_processor_variant_t> tone_correction_filters;
68};
69
70std::unique_ptr<FDN> CreateFDNFromConfig(const FDNConfig& config);
71
72void to_json(nlohmann::json& j, const sfFDN::FDNConfig& p);
73void from_json(const nlohmann::json& j, sfFDN::FDNConfig& p);
74
75} // namespace sfFDN
std::variant< CascadedFeedbackMatrixOptions, ScalarFeedbackMatrixOptions > feedback_matrix_variant_t
Variant type for holding different feedback matrix options.
Definition types.h:381
@ Merge
Process each input channel separately and output to one channel.
@ Split
Process input as a single channel and output to multiple channels.
Options for configuring a delay bank.
Definition types.h:198
Options for configuring parallel gain processing.
Definition types.h:174
Configuration for the FDN.
Definition fdn_config.h:16
uint32_t block_size
Internal block size for processing audio. Ideally should match the block size of the system.
Definition fdn_config.h:27
bool transposed
Whether to use transposed configuration.
Definition fdn_config.h:21
DelayBankOptions delay_bank_config
Delay bank configuration.
Definition fdn_config.h:33
uint32_t fdn_size
Size of the FDN (number of channels)
Definition fdn_config.h:18
std::vector< single_channel_processor_variant_t > tone_correction_filters
Tone correction filter block.
Definition fdn_config.h:67
struct sfFDN::FDNConfig::@1 output_block_config
Output gain block.
struct sfFDN::FDNConfig::@0 input_block_config
Input gain Block.
float sample_rate
Sample rate for the FDN. This is used to configure time-based components like delays and filters.
Definition fdn_config.h:30
float direct_gain
Direct path gain.
Definition fdn_config.h:24
feedback_matrix_variant_t feedback_matrix_config
Feedback matrix block.
Definition fdn_config.h:48
std::vector< multi_channel_processor_variant_t > loop_filter_configs
Loop filter block.
Definition fdn_config.h:51