[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] SynthDefs, synthDefDir
On Sat, May 29, 2021 at 4:48 PM <clfest@xxxxxxxxxx> 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: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/