Discussion:
recreating a synthdef?
(too old to reply)
Jonathan Segel
2005-11-08 00:08:27 UTC
Permalink
is there any way to recreate the text of a synthdef that exists? i
seem to have lost all text files that might have a synthdef that is
currently in existence on the server....
____________________________________________________
Jonathan Segel 4014 Brookdale Ave. Oakland, CA 94619
jsegel-Qyn2XdfDzupJ6yXK/***@public.gmane.org <-----> magsatellite-/***@public.gmane.org
Till Bovermann
2005-11-08 09:38:00 UTC
Permalink
Hey,

I don't know about a way to reengineer them automagically... sorry

But I heard about the graphviz interface which I think rohan drape
has developed allowing you to visualize synthdefs as trees, but I
currently do not know if it works with synthdef files or with the
textual definition...

hope that helps
Till
Post by Jonathan Segel
is there any way to recreate the text of a synthdef that exists? i
seem to have lost all text files that might have a synthdef that is
currently in existence on the server....
____________________________________________________
Jonathan Segel 4014 Brookdale Ave. Oakland, CA 94619
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
c***@public.gmane.org
2005-11-08 14:52:34 UTC
Permalink
hallo jonathan,

if you have access to the .scsynthdef file (as placed in the synthdefs folder of the supercollider folder), you can at least find out about all the UGens and connections. you won't be able to re-create the text in its beauty (e.g. with multichannel expansion collapsed into one text phrase) however. in sclang you can use SynthDescLib to read in a def and print out inputs and outputs and control names for example. JCollider comes with a demo app that lets you drop synthdef files onto a list view and open a graphical tree representation ( http://sourceforge.net/projects/eisenkraut )

hope that helps. ciao, -sciss-
Post by Jonathan Segel
is there any way to recreate the text of a synthdef that exists? i
seem to have lost all text files that might have a synthdef that is
currently in existence on the server....
James Harkins
2005-11-08 10:12:26 UTC
Permalink
No, but it might be possible to write a decompiler that uses the
information from a SynthDesc (which contains the SynthDef in the def
variable).

One of those things I wish I had time to do... I took a quick look at
what would be involved. My thought would be to put each ugen into an
array slot, e.g.,

SynthDef(\sine1, { |freq = 440, amp = 0.2, out = 0|
Out.ar(out, SinOsc.ar(freq, 0, amp))
})

might decompile as:

SynthDef("sine1", { arg freq = 440, amp = 0.2, out = 0;
var ugens = Array.newClear(4); // 4 = theSynthDef.children.size
// there is no ugens[0] because it's a Control, automatically created
ugens[1] = SinOsc.ar(freq, 0);
ugens[2] = BinaryOpUGen.new('*', ugens[1], amp);
ugens[3] = Out.ar(out, ugens[2]);
})

Here are a couple of things I don't know that would be necessary to do
it:

1. How to determine the ControlName belonging to an OutputProxy created
by the Control ugens. That is, if you have "arg freq, gate" the Control
ugen outputs an array of OutputProxies. From the OutputProxy you can
find out which Control, and which of the Control's output channels,
corresponds to the proxy but I don't know if there's a guarantee that
the controlNames array is in a guaranteed order.

2. How to handle user-created Controls for array inputs (e.g.
Control.names(...).kr(...)).

Probably some other factors I can't think of now. It's an interesting
problem but I have too much other work to do...

hjh
Post by Jonathan Segel
is there any way to recreate the text of a synthdef that exists? i
seem to have lost all text files that might have a synthdef that is
currently in existence on the server....
: H. James Harkins
: jamshark70-***@public.gmane.org
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman

Loading...