Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.19 KB

File metadata and controls

28 lines (22 loc) · 1.19 KB

How to add a Ugen

All the supported ugens are created by files in the ugens/ directory. For a good example, look at sinosc.go.

Please add a test if you implement a ugen. See sinosc_test.go (in the sc package) for an example of a test involving the SinOsc ugen.

Writing a test for a new ugen should involve:

  1. Adding an sclang synthdef to synthdefs.sc that will generate a synthdef file that uses the ugen you are working on. A good place to go to find such a synthdef is the SuperCollider documentation for the ugen.

  2. Translating the synthdef to Go. See this file for any issues you may encounter when translating synthdefs to Go.

  3. Comparing the Go synthdef to the sc synthdef. This is simplified by a utility function called compareAndWrite. This function will read the synthdef file created by sclang in step 1, create a synthdef file for your Go synthdef called NAME.gosyndef, compare the two files byte-for-byte, and fail your test if the two files differ.

Linting

Please run golint and go vet on any code you wish to submit in a Pull Request.