
// Load the Faust bitcode module.
using "dsp:freeverb";

// Create a new dsp instance and initialize it with the given sample rate.
let dsp = freeverb::newinit 44100;
// Get the number of I/O channels and the control interface in Pure format.
let k,l,ui = freeverb::info dsp;
// As of Pure 0.50, it is also possible to query the metadata of a dsp class.
let m = freeverb::meta;

// Create suitable Pure matrices to hold the input and output samples. There's
// one row for each channel and one column for each frame of samples, so a 2xn
// matrix is used for stereo signals with block size n.
const n = 5000; // #samples per block
let in  = {double (j==1) | i = 1..k; j = 1..n}; // a pulse
let out = {0.0 | i = 1..l; j = 1..n}; // zero matrix for output

// The above Pure matrices can readily be passed as input and output buffers
// to the dsps's compute routine.
freeverb::compute dsp n in out;

// Have a look at some of the computed output samples at the end of the buffer.
out!!(0..1,n-10..n-1);
