Skip to content

Commit d801c4a

Browse files
author
Nathan Ho
authored
clarify build instructions re: sc-dev discussion
1 parent e8a23b5 commit d801c4a

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
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.
22

3+
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.
4+
35
Beyond this repository, the reader is encouraged to look at [sc3-plugins](https://github.com/supercollider/sc3-plugins) for more complex, real-world examples.
46

57
## Directory
@@ -11,42 +13,38 @@ Beyond this repository, the reader is encouraged to look at [sc3-plugins](https:
1113

1214
## Compiling
1315

14-
Make a directory for the `cmake` build files:
16+
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.**
17+
18+
CMake dumps a lot of files into your working directory, so you should always start by creating the `build/` directory:
1519

1620
```shell
17-
plugin-example/01-BoringMixer/$ mkdir build && cd build
18-
plugin-example/01-BoringMixer/build/$ cmake -DSC_PATH=/path/to/sc3source/ ..
21+
example-plugins/01a-BoringMixer/$ mkdir build
22+
example-plugins/01a-BoringMixer/$ cd build
1923
```
2024

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.
25+
Next, we run CMake and tell it where the SuperCollider headers are to be found:
26+
27+
```shell
28+
example-plugins/01a-BoringMixer/build/$ cmake -DSC_PATH=/path/to/sc3source/ ..
29+
```
2230

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.
31+
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.
2432

25-
If no `SC_PATH` is provided, the build system assumes the SuperCollider include files in `/usr/include/SuperCollider/`.
33+
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/`.
2634

27-
After setting `SC_PATH`, simply build using `make`:
35+
CMake will remember your `SC_PATH`, so you only need to run that once. After that, simply build using `make`:
2836

2937
```shell
30-
plugin-example/01-BoringMixer/build/$ make
38+
example-plugins/01-BoringMixer/build/$ make
3139
```
3240

33-
If compilation succeeds, on OSX this will produce a "shared library" file ending in `.scx`, and on Linux `.so`.
41+
This will produce a "shared library" file ending in `.scx`. On Linux, the extension is `.so`.
3442

3543
## Installing
3644

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

39-
Alternatively, you can copy, move, or symbolic link the folder into your Extensions folder. You can find out which one that is by evaluating
40-
41-
```
42-
Platform.userExtensionDir
43-
```
44-
45-
from within SuperCollider. Alternatively, you may install the plugin(s) system-wide by copying to
46-
47-
```
48-
Platform.systemExtensionDir
49-
```
47+
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`.
5048

5149
## Development workflow
5250

0 commit comments

Comments
 (0)