Chapter 3. Making a DSP unit

Table of Contents

The header file
The implementation file

The following sample DSP unit is an extract from the Fragmenter unit. You can see that it is extremely easy to implement a new DSP. All you need is a good editor, the IzSound APIs in a browser and a little bit of C++/STL knowledge.

The header file

#ifndef MYDSP_H
#define MYDSP_H

#include <iterator>
#include <algorithm>

#include <dspunit.h>

using namespace std;
using namespace izsound;

class Fragmenter : public DspUnit

  SlotData m_buffer;
  unsigned int m_trigger;


  virtual void performDsp();


  Fragmenter(const unsigned int &length,
             const unsigned int &sampleRate = 44100);

  virtual ~Fragmenter();

  void setLength(const unsigned int &length);