[ Freeverb3VST.OSDN.JP | Freeverb3@Savannah | OSDN.NET ]

Library Usage Examples

Using IIR filter

The classes which have process() member function can get one sample and output one sample. You have to call process() multiple times to process samples.

// g++ -I /usr/include/libfreeverb3-2 -lfreeverb3
#include <freeverb/efilter.hpp>
#include <freeverb/biquad.hpp>

float input[size], output1[size], output2[size];
fv3::iir_1st_f IIR1_LPF;
fv3::biquad_f  IIR2_LPF;
IIR1_LPF.setLPFA(fc, sampleRate);

IIR2_LPF.setLPF(fc, transition_bandWidth, sampleRate);
for(int i = 0;i < size;i ++)
{output1[i] = IIR1_LPF.process(input[i]);
 output2[i] = IIR2_LPF.process(input[i]);}

Using FIR filter

The classes which have processreplace() member function can process multiple arrays of samples. You do not need to call processreplace() multiple times.

// g++ -I /usr/include/libfreeverb3-2 -lfreeverb3
#include <freeverb/irmodel3.hpp>
#include <freeverb/firfilter.hpp>
float inputL[size], inputR[size], outputL[size], outputR[size];

fv3::irmodel3_f FIR_LPF;
long lengthOfFilter; // must be an odd number.
// see fir3bandsplit.cpp predictN to calculate the length from transitionBandWidth
float filter[lengthOfFilter];

Valid XHTML 1.1 Valid CSS!SourceForge.JP

[ Freeverb3VST.OSDN.JP | Freeverb3@Savannah | OSDN.NET ]