You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,10 +19,14 @@ Beyond this repository, the reader is encouraged to look at [sc3-plugins](https:
19
19
20
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 (see [Development workflow](#development-workflow)). **Currently, this build system is missing Windows. Sorry, we're working on it...**
21
21
22
+
### Step 1: Obtain header files
23
+
22
24
Before you can compile any plugin, you will need a copy 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.
23
25
24
26
You will **not** need to recompile SuperCollider itself in order to get a plugin working. You only need the source code to get the C++ headers.
25
27
28
+
### Step 2: Create build directory and set `SC_PATH`
29
+
26
30
CMake dumps a lot of files into your working directory, so you should always start by creating the `build/` directory:
27
31
28
32
```shell
@@ -39,13 +43,28 @@ Here, `/path/to/sc3source/` is the path to the source code. Once again, this is
39
43
40
44
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/`.
41
45
42
-
CMake will remember your `SC_PATH`, so you only need to run that once.
46
+
CMake will remember your `SC_PATH`, so you only need to run that once per plugin.
43
47
44
-
If you also want to build a UGen for Supernova, then you need to set the 'SUPERNOVA' flag. The CMake command would then look like this:
48
+
### Step 3: Set flags (optional)
49
+
50
+
If you don't plan on using a debugger, it's advisable to build in release mode so that the compiler optimizes:
Again, all these flags are persistent, and you only need to run them once.
65
+
66
+
### Step 4: Build it!
67
+
49
68
After that, simply build using `make`:
50
69
51
70
```shell
@@ -54,6 +73,8 @@ example-plugins/01a-BoringMixer/build/$ make
54
73
55
74
This will produce a "shared library" file ending in `.scx`. On Linux, the extension is `.so`.
56
75
76
+
You can freely alternate between steps 3 and 4. If you decide to go back and change some CMake flags, just hit `make` again.
77
+
57
78
## Installing
58
79
59
80
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`.
@@ -63,7 +84,8 @@ Please note that on macOS Supernova is more picky about location of UGens (as of
63
84
If you're not using sclang, the installation method varies. Ask the developer(s) of the client if you're not sure how.
64
85
65
86
## Development workflow
66
-
In order to start developing a new UGen, make a copy of one of the example's directory. Change the `.cpp` filename, as well as the name and contents of the corresponding `.sc` file, and update the beginning of `CMakeLists.txt` with your new `.cpp` filename. Then you're ready to work on the code.
87
+
88
+
In order to start developing a new UGen, make a copy of one of the example's directory. Change the `.cpp` filename, as well as the name and contents of the corresponding `.sc` file, and update the beginning of `CMakeLists.txt` with your new `.cpp` filename. Then you're ready to work on the code. If you are using `git`
67
89
68
90
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.
0 commit comments