NodeProxy seti method?

Hello

Why is there no analogue of Synth#seti method in NodeProxy class? Or I missed something?

Hey,

Iā€™ve noticed that too a while ago. So I wrote my own implementation. Give it a try if you like.
https://github.com/nuss/NodeProxy-enhancements

4 Likes

Great, thank you! Apparently, it should be in core classes.

hmm, not sure it should necessarily in core. But maybe I should make it a quark. The seti method seems to be working reliably. Also the corresponding seti NodeProxy role. The setp NodeProxy role is an experiment, not sure if itā€™s the best way to do it. Anyway, anyone more experienced in the internals of NodeProxy and NodeProxy roles is welcome to review my work!

But maybe I should make it a quark.

Done. Iā€™ve improved the seti method a bit and made a quark that you
should be able to install through

Quarks.install("https://github.com/nuss/NodeProxy-enhancements-SN.git");

Iā€™ve also made a pull request for the repo to be added to the official
supercollider quarks to make it available through the Quarks GUI in SCIDE.

Hope itā€™s going to be useful for some of youā€¦

Stefan

1 Like

Thatā€™s great! Thank you!

Thatā€™s great! Thank you!

Youā€™re welcome :wink:

I think the seti methods could go to common. Do you want to make a pull request?

Note that

if (offset.isInteger) {
				offset = [offset]
			};

			if (value.isNil or:{ value.isNumber }) {
				value = [value]
			};

mayb can in this context be simplified as:

offset = offset.asArray;
value = value.asArray;
1 Like

I think the seti methods could go to common. Do you want to make a pull request?

Thanks for the review, Julian! When you say ā€˜methodsā€™ do you mean the seti method as well as the seti NodeProxy role? (Itā€™s not really a method but I think it might be convenient to have a related NodeProxy role as well).
Iā€™ll prepare a pull request as soon as I find time.

mayb can in this context be simplified as:

offset = offset.asArray;
value = value.asArray;

Ah, yes, of course. Thatā€™s better!

Thanks again,

Stefan

Yes, both the role and the method, and the test can be added to the unit tests.

offset = offset.asArray;

it will return [] for nil ā€“ but just from looking at the code, that seems ok.

Arrays in NdefGui could also use some love. One reason I wrote my mangle extension is that instead of using arrays that have poor support in NdefGui, I can just mass-generate controls called ā€œxLā€, ā€œxRā€, ā€œxCā€ etc. from the same function code. And those get sliders in NdefGui, being single-channel each. I know that writing quality Gui code is a lot of work, so I substitute it with compiler-like tricks :stuck_out_tongue: