I made the Synthesis ToolKit (SKT) available as Arduino Library.

The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language. STK was designed to facilitate rapid development of music synthesis and audio processing software, with an emphasis on cross-platform functionality, realtime control, ease of use, and educational example code.

Today I was investigating if the library can be used on an Arduino Nono.

The Arduino development environment for the ESP32 or ESP8266 are providing many std c++ classes – this is not the case in the Standard Arduino.

The STK framework is using the following (missing) classes which are not available in the Standard Arduino implementation:

  • std::vector
  • std::string
  • std::ostringstream
  • std::cout
  • std::queue

Fortunately you can install Mike Materas STL Library that provides the missing functionality. You can find this library in the Arduino Library Manager!

Unfortunately however this library is currently not supporting the current Arduino version (1.8.3) and you will need to downgrade the Arduino AVR Boards version in the Board Manager to 1.8.2!

Here is a simpole Noise example:

#include "Noise.h"
using namespace stk;

Noise noise;
StkFloat output;

void setup() {
  Serial.begin(115200);
}

void loop() {
  output = noise.tick();
  Serial.println(output);
}

Memory Information

Global variables use 718 bytes (35%) of dynamic memory, leaving 1330 bytes for local variables. Maximum is 2048 bytes.
Sketch uses 8396 bytes (27%) of program storage space. Maximum is 30720 bytes.

Output in the Serial Plotter

Caveats

However I noticed that some things are not good:

  • The sine() example is silently crashing
  • There is not enough space for the memory based files

I will look into this if I have some spare time…


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *