MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ processing_function()

void MayaFlux::Buffers::FeedbackProcessor::processing_function ( const std::shared_ptr< Buffer > &  buffer)
overridevirtual

The core processing function that must be implemented by derived classes.

Parameters
bufferBuffer to process

This method is where the actual transformation logic is implemented. It should contain the algorithmic details of how the buffer's data is transformed, analyzed, or processed. The implementation can utilize any backend capabilities available to the processor, including:

  • Parallel Processing: Using multi-threading or GPU compute for large datasets
  • Data Transformations: Applying mathematical operations, filters, or effects
  • Feature Extraction: Analyzing data characteristics for further processing

Derived classes must override this method to provide specific processing behavior.

Implements MayaFlux::Buffers::BufferProcessor.

Definition at line 90 of file FeedbackBuffer.cpp.

91{
92 auto audio_buffer = std::dynamic_pointer_cast<AudioBuffer>(buffer);
93 if (!audio_buffer) {
94 return;
95 }
96
97 if (!m_active_history) {
98 if (auto fb = std::dynamic_pointer_cast<FeedbackBuffer>(buffer)) {
99 m_active_history = &fb->get_history_buffer();
100 } else {
102 }
103 }
104
105 auto& data = audio_buffer->get_data();
106
107 for (double& sample : data) {
108 double delayed = (*m_active_history)[m_feed_samples - 1];
109
110 double output = sample + (m_feedback_amount * delayed);
111
112 m_active_history->push(output);
113
114 sample = output;
115 }
116}
Memory::HistoryBuffer< double > * m_active_history
Memory::HistoryBuffer< double > m_history
void push(const T &value)
Push new value to front of history.

References m_active_history, m_feed_samples, m_feedback_amount, m_history, and MayaFlux::Memory::HistoryBuffer< T >::push().

+ Here is the call graph for this function: