Skip to content

Instantly share code, notes, and snippets.

@dermusikman
Last active December 28, 2017 21:38
Show Gist options
  • Save dermusikman/a654f7747a2dff7c78073fbdb57dd1e9 to your computer and use it in GitHub Desktop.
Save dermusikman/a654f7747a2dff7c78073fbdb57dd1e9 to your computer and use it in GitHub Desktop.
Unsuccessfully loading synthdef into Sonic Pi 3.0.1

Unsuccessfully loading synthdefs into Sonic Pi 3.0.1

I'm diving back into Sonic Pi after a long absence, and I'd like to load an old synth that was abandoned, the haunting dark_sea_horn. The Overtone definition is here; its original binary is here; and it sounds like this.

Old binary doesn't work

I downloaded the old binary linked above, ran load_synthdefs "/path/to/my/synthdefs" and attempted synth :dark_sea_horn. I get the following error:

Runtime Error: [buffer 2, line 2] - RuntimeError
Thread death!
 Unknown synth :dark_sea_horn

It works in Overtone

I copied the definition linked above and evaluated it into the Overtone REPL (overtone.live, of course). It works beautifully! (demo 12 (sonic-pi-dark_sea_horn :note 60 :sustain 10))

Saving my own binary

I had quite a bit of difficulty saving my own synthdef with the provided instructions. (In fact, it seems to be hard-coded for Sam Aaron's machine. sonic-pi.synths.core/save-synthdef also tries to save other forms I don't think I need.

So, I ended up saving my synthdef in the following way:

; evaluated a functioning (defsynth) with name sonic-pi-dark_sea_horn
(overtone.sc.machinery.synthdef/synthdef-write (:sdef sonic-pi-dark_sea_horn)
   "/path/to/sonic-pi-dark_sea_horn.scsyndef")

That successfully writes to a file the given path, which looks like a proper binary to my inexperienced eye.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment