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:
-
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.
-
Translating the synthdef to Go. See this file for any issues you may encounter when translating synthdefs to Go.
-
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.
Please run golint and go vet on any code you wish to submit in a Pull Request.