Re: SynthDefs, synthDefDir
[email protected] Sun, 30 May 2021 09:28:10 +0800
| Newsgroups | gmane.comp.audio.supercollider.user |
|---|---|
| Message-ID | <CAFniQ7Wxx9fvWrRQt-F7zCFbMdhvTbibKfL2M+=qVSrkdyskyg@mail.gmail.com> |
On Sat, May 29, 2021 at 4:48 PM <clfest-f/[email protected]> wrote: > I am having problems understanding how the SynthDescLibs gets loaded when SCLang is booted The SynthDesc class includes code to read binary .scsyndef files and extract relevant information from them -- most importantly the list of control names and default values, but it also tries to build a list of UGens (though this is not quite complete -- there's currently no way to go from a binary SynthDef on disk to a fully functioning SynthDef object). At startup, it does this automatically for all scsyndef files in the default synthdef directory. It's not really important to know how it works, just that: SynthDefs can be packed into a binary format for the server, and if it can be packed, then it can also be unpacked. d = SynthDef(\test, { |freq = 440| Out.ar(0, SinOsc.ar(freq, 0, 0.1).dup) }); e = d.asBytes; // note, there is no reason for you to do this by hand ;-> // this is done internally by '.add' // just for demo purposes here f = SynthDesc.readFile(CollStream(e)); f[\test].controls -> [ ControlName P 0 freq control 440.0 ] > how you delete scsyndefs written to disk that you don't want anymore or more generally manipulate them. `SynthDef.synthDefDir.openOS` and delete them in the file browser. (There is nothing special about these files -- so, no harm in just deleting them.) Or you could use `File.delete(path)` in SC. hjh _______________________________________________ sc-users mailing list info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx archive: http://www.listarc.bham.ac.uk/marchives/sc-users/ search: http://www.listarc.bham.ac.uk/lists/sc-users/search/