Quickstart tool for writing SuperCollider server plugins

Hey all,

I’d like to present a work-in-progress set of tools for writing SuperCollider server plugins. In general I think the experience of setting up a server plugin project can be really frustrating and tedious if you’re not familiar with CMake. I’ve been working on these for about two weeks and I think they’re ready for more general consumption now. If you’ve written UGens before, or are interested in writing UGens please give this a go and let me know how it works for you!

Main features:

  • CMakeLists.txt for free
  • Boilerplate C++ and .sc plugin code for free
  • Stub .schelp file for free
  • AppVeyor & Travis-CI scripts for free (build & test on Windows, MacOS, Ubuntu)
  • Automatically upload releases for free (whenever a new tag is pushed)
  • Command to regenerate CMakeLists.txt for free whenever you add more plugins (i.e., you should never have to touch any CMake at all, ever)

All you have to do to try it is:

  1. Install Python 3 if you don’t have it already

  2. Install the cookiecutter package (it’s available via pip)

  3. Get the branch of SuperCollider that has my setup scripts in it. If you’ve already cloned the SuperCollider source somewhere, all you need to do is this:

    git fetch https://github.com/brianlheim/supercollider topic/cmake_gen
    git checkout FETCH_HEAD

If you haven’t cloned it before, do this first:

cd path-where-sc-should-live
git clone --recursive https://github.com/supercollider/supercollider
cd supercollider

Note that you don’t need to build SuperCollider to try this out!

  1. Run cookiecutter on the repo:

    cookiecutter https://github.com/supercollider/cookiecutter-supercollider-plugin

Here’s an example of what it produces: https://github.com/brianlheim/simplegain. You can even download the release binaries from https://github.com/brianlheim/simplegain/releases and test out the plugins right now!

The main project consists of a cookiecutter repository and some scripts that I’d like to track in the main repo; cookiecutter is a Python package that lets you quickly set up a project from a template by answering a few simple customization questions. (Thanks to Scott Carver for the recommendation!)

I just opened up a PR for adding the scripts to the main SuperCollider repo here: https://github.com/supercollider/supercollider/pull/4055.

Thanks for reading!

3 Likes

Looks very useful. Thanks!
It could be useful to have a similar template for starting new quarks as well.