Synthesis ToolKit


As stated on their official website “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”

Developed by Perry R. Cook & Gary P. Scavone, one of the main advantages to using STK over just using native ALSA playback functions is polyphony, the ability to play multiple sound files at the same time (even triggered asynchronously).

Installing STK on the Intel Edison

To install the Synthesis ToolKit, download the tarball from here: Extract, copy the main folder across to the Edison. Navigate into the folder and enter:

make install

Then navigate to ./includes and enter:

mkdir /usr/include/stk
cp * /usr/include/stk

Then navigate to the src folder and enter:

cp /usr/lib/
cp /usr/lib/

Everything should now work.

To include the headers, add

#include <stk/[header name].h>

at the top of your C++ code. Don’t forget to compile with the -lstk option.

Audio file playback using STK

(Winston 7/10/2015) A potential method for triggered, polyphonic playback of custom audio files could be as follows

  • The demo program in /projects/demo has functionality to take an ALSA MIDI device as input, and ALSA soundcard as output.
  • Additionally, the STK instrument “Drummer” appears to use .raw audio files located in ~/stk*/rawwaves for the sounds
  • There’s the potential to simply change these raw sound files to the desired ones, and then trigger them using the existing demo example program
  • Audacity or something similar could be used to create/convert the desired audio file to the .raw format