II.3.1. Writing Simplest Effect Processor

The simplest effect processor is an input-output device without any control. When the device is powered, it would simply work to process the input signal and deliver the processed signal to the output. Here is the steps to write such simple effect processor:

  1. Include the library header <blackstomp.h>
  2. Define an effect module derived from effectModule class with process() and init() methods.
  3. Setup the pedal name and the input-output configuration inside the init() method.
  4. Implement the processing codes inside the process() method.
  5. Call the blackstompSetup() inside Arduino’s setup() function.

Let’s try to write a “Gain Doubler” pedal as an example of the simplest Blackstomp sketch. It would simply boost the signal from the stereo input by multiplying the signal of left and right channel by factor of 2.0 and deliver to the stereo output.

The signal processing algorithm is what we code inside the process() function (line #27). You can see that the processing formula of this “Gain Doubler” pedal is just a simple multiplication by 2 (line #31 and #32).

The function blackstompSetup is called inside the Arduino’s setup function at line #41. Because the serial port is free (not used for MIDI) then we can call the function runSystemMonitor() after blackstompSetup() at line #46 to produce periodic report by sending some texts to the serial port, which can monitored with “serial monitor” tool of the Arduino IDE.

Back to Table of ContentsBuy Blackstomp PCBBuy Blackstomp ModuleBuy Blackstomp Pedal