Skip to content

Commit 0a1635c

Browse files
committed
Arduino Support
1 parent de3edb1 commit 0a1635c

File tree

3 files changed

+229
-0
lines changed

3 files changed

+229
-0
lines changed

STK.md

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# The Synthesis ToolKit in C++ (STK)
2+
By Perry R. Cook and Gary P. Scavone, 1995--2019.
3+
4+
This distribution of the Synthesis ToolKit in C++ (STK) contains the following:
5+
6+
* [`src`](src/): STK class source and header files
7+
* [`rawwaves`](rawwaves): STK audio files (1-channel, 16-bit, big-endian)
8+
* [`doc`](doc): STK documentation
9+
* [`projects`](projects): example STK projects and programs
10+
* [`examples`](examples): Arduino example STK projects and programs for the ESP32
11+
12+
Please read the [Legal and Ethical notes](#legal-and-ethical) near the bottom of this document and the [License](LICENSE).
13+
14+
For compiling and installing STK, see the [INSTALL.md](INSTALL.md) file in this directory.
15+
16+
## Contents
17+
18+
* [Overview](#overview)
19+
* [System Requirements](#system-requirements)
20+
* [What's New (and not so new)](#whats-new-and-not-so-new)
21+
* [Disclaimer](#disclaimer)
22+
* [Legal and Ethical](#legal-and-ethical)
23+
* [Further Reading](#further-reading)
24+
* [Perry's Notes From the Original Distribution](#perrys-notes-from-the-original-distribution)
25+
26+
# OVERVIEW
27+
28+
The Synthesis ToolKit in C++ (STK) is a set of open source audio
29+
signal processing and algorithmic synthesis classes written in the C++
30+
programming language. STK was designed to facilitate rapid
31+
development of music synthesis and audio processing software, with an
32+
emphasis on cross-platform functionality, realtime control, ease of
33+
use, and educational example code. The Synthesis ToolKit is extremely
34+
portable (most classes are platform-independent C++ code), and it's
35+
completely user-extensible (all source included, no unusual libraries,
36+
and no hidden drivers). We like to think that this increases the
37+
chances that our programs will still work in another 5-10 years. STK
38+
currently runs with "realtime" support (audio and MIDI) on Linux,
39+
Macintosh OS X, and Windows computer platforms. Generic, non-realtime
40+
support has been tested under NeXTStep, Sun, and other platforms and
41+
should work with any standard C++ compiler.
42+
43+
The only classes of the Synthesis ToolKit that are platform-dependent
44+
concern sockets, threads, mutexes, and real-time audio and MIDI input
45+
and output. The interface for MIDI input and the simple Tcl/Tk
46+
graphical user interfaces (GUIs) provided is the same, so it's easy to
47+
experiment in real time using either the GUIs or MIDI. The Synthesis
48+
ToolKit can generate simultaneous SND (AU), WAV, AIFF, and MAT-file
49+
output soundfile formats (as well as realtime sound output), so you
50+
can view your results using one of a large variety of sound/signal
51+
analysis tools already available (e.g. Snd, Cool Edit, Matlab).
52+
53+
The Synthesis Toolkit is not one particular program. Rather, it is a
54+
set of C++ classes that you can use to create your own programs. A
55+
few example applications are provided to demonstrate some of the ways
56+
to use the classes. If you have specific needs, you will probably
57+
have to either modify the example programs or write a new program
58+
altogether. Further, the example programs don't have a fancy GUI
59+
wrapper. If you feel the need to have a "drag and drop" graphical
60+
patching GUI, you probably don't want to use the ToolKit. Spending
61+
hundreds of hours making platform-dependent graphics code would go
62+
against one of the fundamental design goals of the ToolKit - platform
63+
independence.
64+
65+
For those instances where a simple GUI with sliders and buttons is
66+
helpful, we use Tcl/Tk (https://www.tcl.tk/) which is freely
67+
distributed for all the supported ToolKit platforms. A number of
68+
Tcl/Tk GUI scripts are distributed with the ToolKit release. For
69+
control, the Synthesis Toolkit uses raw MIDI (on supported platforms),
70+
and SKINI (Synthesis ToolKit Instrument Network Interface, a MIDI-like
71+
text message synthesis control format).
72+
73+
74+
# SYSTEM REQUIREMENTS
75+
76+
See the individual README's (e.g. README-linux) in the /doc directory
77+
for platform specific information and system requirements. In
78+
general, you will use the configure script to create Makefiles on unix
79+
platforms (and MinGW) or the VS2017 workspace files to compile the
80+
example programs. To use the Tcl/Tk GUIs, you will need Tcl/Tk
81+
version 8.0 or higher.
82+
83+
84+
# WHAT'S NEW (AND NOT SO NEW)
85+
86+
Despite being available in one form or another since 1996, we still
87+
consider STK to be alpha software. We attempt to maintain backward
88+
compatability but changes are sometimes made in an effort to improve
89+
the overall design or performance of the software. Please read the
90+
"Release Notes" in the /doc directory to see what has changed since
91+
the last release.
92+
93+
A new StkFrames class has been created to facilitate the handling and
94+
passing of multichannel, vectorized audio data. All STK classes have
95+
been updated to include tick() functions that accept StkFrames
96+
arguments.
97+
98+
The control message handling scheme has been simplified greatly
99+
through the use of the Messager class. It is now possible to have
100+
access to simultaneous piped, socketed, and/or MIDI input control
101+
messages. In most cases, this should eliminate the use of the
102+
Md2Skini program.
103+
104+
Realtime audio input capabilities were added to STK with release 3.0,
105+
though the behavior of such is very hardware dependent. Under Linux
106+
and Macintosh OS-X, audio input and output are possible with very low
107+
latency. Using the Windows DirectSound API, minimum dependable output
108+
sound latency seems to be around 20 milliseconds or so, while input
109+
sound latency is generally higher. Performance with the ASIO audio
110+
API on Windows provides much better performance.
111+
112+
As mentioned above, it is possible to record the audio ouput of an STK
113+
program to .snd, .wav, .raw, .aif, and .mat (Matlab MAT-file) output
114+
file types. Though somewhat obsolete, the program Md2Skini can be
115+
used to write SKINI scorefiles from realtime MIDI input. Finally, STK
116+
should compile with non-realtime functionality on any platform with a
117+
generic C++ compiler.
118+
119+
For those who wish to make a library from the core STK classes, the
120+
configure script generates a Makefile in the src directory that will
121+
accomplish that.
122+
123+
124+
# DISCLAIMER
125+
126+
You probably already guessed this, but just to be sure, we don't
127+
guarantee anything works. :-) It's free ... what do you expect? If
128+
you find a bug, please let us know and we'll try to correct it. You
129+
can also make suggestions, but again, no guarantees. Send email to
130+
the mail list.
131+
132+
133+
# LEGAL AND ETHICAL
134+
135+
This software was designed and created to be made publicly available
136+
for free, primarily for academic purposes, so if you use it, pass it
137+
on with this documentation, and for free.
138+
139+
If you make a million dollars with it, it would be nice if you would
140+
share. If you make compositions with it, put us in the program notes.
141+
142+
Some of the concepts are covered by various patents, some known to us
143+
and likely others which are unknown. Many of the ones known to us are
144+
administered by the Stanford Office of Technology and Licensing.
145+
146+
The good news is that large hunks of the techniques used here are
147+
public domain. To avoid subtle legal issues, we'll not state what's
148+
freely useable here, but we'll try to note within the various classes
149+
where certain things are likely to be protected by patents.
150+
151+
152+
# FURTHER READING
153+
154+
For complete documentation on this ToolKit, the classes, etc., see the
155+
doc directory of the distribution or surf to
156+
http://ccrma.stanford.edu/software/stk/. Also check the platform
157+
specific README's for specific system requirements.
158+
159+
160+
# PERRY'S NOTES FROM THE ORIGINAL DISTRIBUTION
161+
162+
This whole world was created with no particular hardware in mind.
163+
These examples are intended to be tutorial in nature, as a platform
164+
for the continuation of my research, and as a possible starting point
165+
for a software synthesis system. The basic motivation was to create
166+
the necessary unit generators to do the synthesis, processing, and
167+
control that I want to do and teach about. Little thought for
168+
optimization was given and therefore improvements, especially speed
169+
enhancements, should be possible with these classes. It was written
170+
with some basic concepts in mind about how to let compilers optimize.
171+
172+
Your question at this point might be, "But Perry, with CMix, CMusic,
173+
CSound, CShells, CMonkeys, etc. already cluttering the landscape, why
174+
a new set of stupid C functions for music synthesis and processing?"
175+
The answers lie below.
176+
177+
1) I needed to port many of the things I've done into something which is generic enough to port further to different machines.
178+
179+
2) I really plan to document this stuff, so that you don't have to be me to figure out what's going on. (I'll probably be sorry I said this in a couple of years, when even I can't figure out what I was thinking.)
180+
181+
3) The classic difficulties most people have in trying to implement physical models are:
182+
183+
A) They have trouble understanding the papers, and/or in turning the theory into practice.
184+
185+
B) The Physical Model instruments are a pain to get to oscillate, and coming up with stable and meaningful parameter values is required to get the models to work at all.
186+
187+
This set of C++ unit generators and instruments might help to diminish the scores of emails I get asking what to do with those block diagrams I put in my papers.
188+
189+
4) I wanted to try some new stuff with modal synthesis, and implement some classic FM patches as well.
190+
191+
5) I wanted to reimplement, and newly implement more of the intelligent and physical performer models I've talked about in some of my papers. But I wanted to do it in a portable way, and in such a way that I can hook up modules quickly. I also wanted to make these instruments connectable to such player objects, so folks like Brad Garton who really think a lot about the players can connect them to my instruments, a lot about which I think.
192+
193+
6) More rationalizations to follow . . .
194+

library.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "Arduino-STK",
3+
"description": "The Synthesis ToolKit in C++ (STK)",
4+
"keywords": "ESP8266, ESP32, MP3, I2S, DAC, Syntheziser, STK, DSP",
5+
"authors": [
6+
{
7+
"name": "Phil Schatzmann",
8+
"email": "[email protected]",
9+
"url": "https://github.com/pschatzmann/Arduino-STK",
10+
"maintainer": true
11+
}
12+
],
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/pschatzmann/Arduino-STK"
16+
},
17+
"version": "1.1.3",
18+
"homepage": "https://github.com/pschatzmann/Arduino-STK",
19+
"dependencies": {
20+
},
21+
"frameworks": "Arduino",
22+
"examples": [
23+
"examples/*/*.ino"
24+
]
25+
}

library.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name=Arduino-STK
2+
version=4.6.1
3+
author=Phil Schatzmann
4+
maintainer=Phil Schatzmann
5+
sentence=The Synthesis ToolKit in C++ (STK)
6+
paragraph=Syntheizer which plays on an I2S DAC or a software-driven delta-sigma DAC and 1-transistor amplifier.
7+
category=Signal Input/Output
8+
url=https://github.com/pschatzmann/Arduino-STK
9+
architectures=esp8266,esp32
10+

0 commit comments

Comments
 (0)