Skip to content

Commit 5a20f02

Browse files
author
Nathan Ho
committed
Merge branch 'master' of github.com:supercollider/example-plugins
2 parents 1394fa6 + e908c2b commit 5a20f02

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
This repository a series of examples demonstrating how to write UGens for [SuperCollider](https://github.com/supercollider/supercollider) (not to be confused with quarks, which are libraries for the language). The [Writing Unit Generators](http://doc.sccode.org/Guides/WritingUGens.html) helpfile is a comprehensive tutorial. Chapter 25 of [the SuperCollider Book](http://www.supercolliderbook.net/) is also a useful resource, although the build instructions are outdated.
1+
# SuperCollider Example Plugins
2+
3+
This repository demonstrates how to write UGens for [SuperCollider](https://github.com/supercollider/supercollider) using a series of examples. Custom UGens are packaged in server plugins. Plugins are not to be confused with quarks, which are libraries for the language.
4+
5+
This supplements the [Writing Unit Generators](http://doc.sccode.org/Guides/WritingUGens.html) helpfile. Chapter 25 of [the SuperCollider Book](http://www.supercolliderbook.net/) is also a useful resource, although the build instructions are outdated.
6+
7+
There is a lot of conflicting material out there for UGen building. This is the official repository and should be the most up to date.
28

39
Beyond this repository, the reader is encouraged to look at [sc3-plugins](https://github.com/supercollider/sc3-plugins) for more complex, real-world examples.
410

@@ -11,38 +17,43 @@ Beyond this repository, the reader is encouraged to look at [sc3-plugins](https:
1117

1218
## Compiling
1319

14-
Make a directory for the `cmake` build files:
20+
This is how you build one of the examples in this directory. The examples are kept separate with duplicated code so that you can simply copy out a directory to start your own ugen. **Currently, this build system is missing two things: Windows and supernova. Sorry, we're working on it...**
21+
22+
CMake dumps a lot of files into your working directory, so you should always start by creating the `build/` directory:
1523

1624
```shell
17-
plugin-example/01-BoringMixer/$ mkdir build && cd build
18-
plugin-example/01-BoringMixer/build/$ cmake -DSC_PATH=/path/to/sc3source/ ..
25+
example-plugins/01a-BoringMixer/$ mkdir build
26+
example-plugins/01a-BoringMixer/$ cd build
1927
```
2028

21-
Here, `/path/to/sc3source/` is the path to a directory of the SuperCollider *source code*. The source code version should match your SuperCollider app version. Slight differences will probably be tolerated, but if they're too far apart you will get an "API version mismatch" error when you boot the server.
29+
Next, we run CMake and tell it where the SuperCollider headers are to be found:
30+
31+
```shell
32+
example-plugins/01a-BoringMixer/build/$ cmake -DSC_PATH=/path/to/sc3source/ ..
33+
```
2234

23-
The path should contain a file at `include/plugin_interface/SC_PlugIn.h`. If you get a warning that `SC_PlugIn.h` could not be found, then `SC_PATH` is not set correctly.
35+
Here, `/path/to/sc3source/` is the path to a directory of the SuperCollider *source code* (NOT the app itself). The source code version should match your SuperCollider app version. Slight differences will probably be tolerated, but if they're too far apart you will get an "API version mismatch" error when you boot the server.
2436

25-
If no `SC_PATH` is provided, the build system assumes the SuperCollider include files in `/usr/include/SuperCollider/`.
37+
The path should contain a file at `include/plugin_interface/SC_PlugIn.h`. If you get a warning that `SC_PlugIn.h` could not be found, then `SC_PATH` is not set correctly. If no `SC_PATH` is provided, the build system assumes the SuperCollider include files in `/usr/include/SuperCollider/`.
38+
39+
CMake will remember your `SC_PATH`, so you only need to run that once. After that, simply build using `make`:
2640

2741
```shell
28-
plugin-example/01-BoringMixer/build/$ make
29-
plugin-example/01-BoringMixer/build/$ make install
42+
example-plugins/01a-BoringMixer/build/$ make
3043
```
3144

32-
WARNING: on OSX, if you want to install into `CMAKE_INSTALL_PREFIX`, you have to specify it by disabling the `IN_PLACE_BUILD` cmake option which defaults to ON (see below).
45+
This will produce a "shared library" file ending in `.scx`. On Linux, the extension is `.so`.
3346

3447
## Installing
3548

3649
You can install each folder -- or the entire repository -- as you would a quark: `Quarks.gui` => `Install a folder`.
3750

38-
Alternatively, you can copy, move, or symbolic link the folder into your Extensions folder. You can find out which one that is by evaluating
51+
Alternatively, you can copy, move, or symbolic link the folder into your Extensions folder. You can find out which one that is by evaluating `Platform.userExtensionDir` in sclang. You can install the plugin(s) system-wide by copying to `Platform.systemExtensionDir`.
3952

40-
```
41-
Platform.userExtensionDir
42-
```
53+
If you're not using sclang, the installation method varies. Ask the developer(s) of the client if you're not sure how.
4354

44-
from within SuperCollider. Alternatively, you may install the plugin(s) system-wide by copying to
55+
## Development workflow
4556

46-
```
47-
Platform.systemExtensionDir
48-
```
57+
If you change your source file(s) or `CMakeLists.txt`, simply use `make` to recompile the shared library. You will need to restart scsynth/supernova for your changes to take effect.
58+
59+
If you change your `.sc` class file, you will need to restart sclang.

0 commit comments

Comments
 (0)