SynthDescLib and other magic - debugging tricks

Dear all

I just learnt about SynthDescLib - I wonder: can anyone share a resource to learn about such magic? I’m interested in a sort of tutorial to show how to troubleshoot the tree (cmd.shift.T helps here) and ideally the order/structure of the inard of a synth (I try to be clever and use a lot of multichannel expension so I find my mistake (and fun) by ear but I was hoping for a more systematic poking)

I don’t remembering the fantastic tutorials by @elifieldsteel or the essential book by @vanderaalle covering this topic - they were the resources that finally got me to move to SC, but (eternal) intermediate SC with imcomplete knowhow is what I am, and any intermediate method of troubleshooting and poking are welcome. I’m relying way too much on poll :slight_smile:

thanks

p

Now, it might be a second language English thing, but I stupidly didn’t think of searching the helpfile for snooping and debugging. Google helped me, and @vanderaalle pointer to the ‘internal snooping’ help, which then open the gateway to the 4 magic guides below.

I’m writing this here in case someone like me is lost and cannot find the map to get unlost. I will search this forum for the same keywords now that I know them…

1 Like

ok the documents need updating. I’ll see if I can do a PR with all the out-of-date info in the code after I deliver the current project.

these guides are still a great read to get my head around it all. thanks to whoever wrote them. The in-lining example at the bottom of ‘Understanding Errors’ is a particularly good example of an intermediate subject

ok going verbose here, in order to maybe help someone else once I figure it out.

Until now, I didn’t understand the difference between SynthDef.add and SynthDef.send - I am not sure I completely get it, but adding it to the global SynthDescLib is a big one.

Now I can see/examine/troubleshoot/test all my declared synths by doing magic:

SynthDescLib.global.browse

This has opened a gate to the next level for me.

The difference is:

(
SynthDef(\demo, { |out, gate = 1, freq = 440, ffreq = 2000, rq = 0.8, amp = 0.1|
	// too lazy to write a real synth today
	Out.ar(out, DC.ar(0));
}).send(s);
)

s.dumpOSC(1);

(instrument: \demo, freq: 800, ffreq: 5000, rq: 0.2).play;

// ffreq? rq? missing...
[ "#bundle", 16721616572538664294, 
  [ 9, "demo", 1000, 0, 1, "freq", 800, "amp", 0.1, "pan", 0, "out", 0 ]
]

Event.default.parent[\args]
-> [ freq, amp, pan, trig ]
// these ^^ *and only these* get sent in the absence of a SynthDesc

(
SynthDef(\demo, { |out, gate = 1, freq = 440, ffreq = 2000, rq = 0.8, amp = 0.1|
	// too lazy to write a real synth today
	Out.ar(out, DC.ar(0));
}).add;
)

(instrument: \demo, freq: 800, ffreq: 5000, rq: 0.2).play;

// there they are!
[ "#bundle", 16721616697506507118, 
  [ 9, "demo", 1001, 0, 1, "out", 0, "freq", 800, "ffreq", 5000, "rq", 0.2, "amp", 0.1 ]
]

e = (instrument: \demo, freq: 800, ffreq: 5000, rq: 0.2).parent_(Event.default.parent);
e.use { SynthDescLib.at(\demo).msgFunc.valueEnvir };
-> [ out, 0, freq, 800, ffreq, 5000, rq, 0.2, amp, a Function ]

(The amp Function is resolved when the event is .play-ed.)

hjh

1 Like

hi @tremblap! Btw I think I used the synthdesclib in that old quark (broken), autogui, that automatically generates gui from synthdefs, etc. That was a good idea, I should rework on in sooner or later

1 Like

does that for you - it is fantastic - you can instantiate plugs, and the params have little boxes. I have not tried extensively so I’ll need to poke a little more but I’m excited!