Synthesis ToolKit

Overview

As stated on their official website https://ccrma.stanford.edu/software/stk/index.html: “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: https://ccrma.stanford.edu/software/stk/download.html Extract, copy the main folder across to the Edison. Navigate into the folder and enter:

./configure
make
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 libstk.so.4.4.4 libstk.so.4
cp libstk.so /usr/lib/
cp libstk.so.4 /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