the mechanism to mix output from one buffer to another channel
Implements MayaFlux::Buffers::BufferProcessor.
Definition at line 53 of file MixProcessor.cpp.
54{
56 return;
57 }
58
59 if (
auto root_buffer = std::dynamic_pointer_cast<RootAudioBuffer>(
buffer)) {
61
62 auto& data = root_buffer->get_data();
63 const bool normalize = root_buffer->is_mix_normalized();
64
65 for (uint32_t i = 0; i < data.size(); i++) {
67 if (
source.has_sample_at(i)) {
68 data[i] +=
source.get_mixed_sample(i);
69 }
70 }
71
72 if (normalize) {
74 }
75 }
76
78 }
79}
std::shared_ptr< NetworkGeometryBuffer > buffer
std::vector< MixSource > m_sources
void normalize(std::span< double > data, double target_min, double target_max) noexcept
Normalize to [target_min, target_max] in-place Single-pass min/max reduction followed by a single tra...
References buffer, cleanup(), m_sources, and validate_sources().