Re: NamedControl and Ndefs, and NamedControl example issue
[email protected] Fri, 8 Jan 2021 11:38:57 +0000
| Newsgroups | gmane.comp.audio.supercollider.devel |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_85AB4144-76D9-4149-8AD7-6BA093CD8BF1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 8 Jan 2021, at 10:32, adcxyz-A2/[email protected] wrote: >=20 > Hi Scott :-) Hi! >=20 >> On 04/01/2021, at 16:39 , [email protected] <mailto:[email protected]> = wrote: >>=20 >> Hi All, >>=20 >> Just musing: It=E2=80=99s very convenient in an Ndef to do something = like this >>=20 >> \coef.kr <http://coef.kr/>(0, spec: [-0.99, 0.99]); >>=20 >> Unfortunately the NdefGui doesn=E2=80=99t pick up the spec from this. = Not sure if NamedControl should store any specs in the global spec = dictionary (probably not?) or if the NodeProxy should pick up any local = specs defined in NamedControls (probably yes as this would allow for = local override of defined specs, which seems rather desirable?) >=20 > That is exactly why JITLibExtensions has addSpec for adding specs to = all Xdefs: > Ndef(\x).addSpec(\coef, [-0.99, 0.99]); >=20 > What is the best logic for including implicitly added specs?=20 > (as in:) > \coef.kr <http://coef.kr/>(0, spec: [-0.99, 0.99]);=20 >=20 > NodeProxy could have its own getSpec method;=20 > if there is not an explicit spec yet,=20 > look if there is one in NodeProxy.objects ... metadata,=20 > and if yes, use that, else guess (as now).=20 >=20 > This could become confusing when you rewrite the ndef source: > should it keep the last found one (which is now in ndefs specs),=20 > or take the new one? > Not sure what the best precedence order would be here, >=20 > Scott, what are your ideas for this? I think it should follow normal scope rules, i.e. local first. So: 1 NamedControl or addSpec (I think these should be treated as equivalent = in precedence, so if you supply a spec for a NamedControl that replaces = a previous spec added by either method ) 2 [Maybe intermediate levels?] 3 Global Specs Dict 4 Guess This seems least surprising to me. (At 3 we might actually improve the = heuristics a bit, i.e. freq2 could reasonably be matched with \freq = assuming the val is within range, though of course that=E2=80=99s not a = JITLib issue!) 1 answers the question of what happens when source is = redefined. In keeping with existing practice though, I think it = shouldn=E2=80=99t change the value unless it=E2=80=99s now outside the = spec range? What do you think? Thanks, S. --Apple-Mail=_85AB4144-76D9-4149-8AD7-6BA093CD8BF1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br = class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On 8 Jan 2021, at 10:32, <a href=3D"mailto:adcxyz-A2/[email protected]" = class=3D"">adcxyz-A2/[email protected]</a> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" = class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: = space; line-break: after-white-space;" class=3D""><div dir=3D"auto" = style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;" class=3D"">Hi Scott :-)<br = class=3D""></div></div></div></blockquote><div><br = class=3D""></div>Hi!</div><div><br class=3D""><blockquote type=3D"cite" = class=3D""><div class=3D""><div style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div = dir=3D"auto" style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; = line-break: after-white-space;" class=3D""><div class=3D""><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">On = 04/01/2021, at 16:39 , <a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""> <div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; = line-break: after-white-space;" class=3D"">Hi All,<div class=3D""><br = class=3D""></div><div class=3D"">Just musing: It=E2=80=99s very = convenient in an Ndef to do something like this</div><div class=3D""><br = class=3D""></div><div class=3D"">\<a href=3D"http://coef.kr/" = class=3D"">coef.kr</a>(0, spec: [-0.99, 0.99]);</div><div class=3D""><br = class=3D""></div><div class=3D"">Unfortunately the NdefGui doesn=E2=80=99t= pick up the spec from this. Not sure if NamedControl should store any = specs in the global spec dictionary (probably not?) or if the NodeProxy = should pick up any local specs defined in NamedControls (probably yes as = this would allow for local override of defined specs, which seems rather = desirable?)</div></div></div></blockquote><div class=3D""><br = class=3D""></div>That is exactly why JITLibExtensions has = addSpec for adding specs to all Xdefs:</div><div = class=3D"">Ndef(\x).addSpec(\coef, [-0.99, 0.99]);</div><div = class=3D""><br class=3D""></div><div class=3D"">What is the best logic = for including implicitly added specs? </div><div class=3D"">(as = in:)</div><div class=3D"">\<a href=3D"http://coef.kr/" = class=3D"">coef.kr</a>(0, spec: [-0.99, 0.99]); </div><div = class=3D""><br class=3D""></div><div class=3D""> NodeProxy could = have its own getSpec method; </div><div class=3D"">if there is not = an explicit spec yet, </div><div class=3D"">look if there is one in = NodeProxy.objects ... metadata, </div><div class=3D"">and if yes, = use that, else guess (as now). </div><div class=3D""><br = class=3D""></div><div class=3D"">This could become confusing when you = rewrite the ndef source:</div><div class=3D"">should it keep the last = found one (which is now in ndefs specs), </div><div class=3D"">or = take the new one?</div><div class=3D"">Not sure what the best precedence = order would be here,</div><div class=3D""><br class=3D""></div><div = class=3D"">Scott, what are your ideas for = this?</div></div></div></div></blockquote><div><br class=3D""></div>I <i = class=3D"">think</i><span style=3D"font-style: normal;" = class=3D""> it should follow normal scope rules, i.e. local first. = So:</span></div><div><span style=3D"font-style: normal;" class=3D""><br = class=3D""></span></div><div>1 NamedControl or addSpec (I think these = should be treated as equivalent in precedence, so if you supply a spec = for a NamedControl that replaces a previous spec added by either method = )</div><div>2 [Maybe intermediate levels?]</div><div>3 Global Specs = Dict</div><div>4 Guess</div><div><br class=3D""></div><div>This seems = least surprising to me. (At 3 we might actually improve the heuristics a = bit, i.e. freq2 could reasonably be matched with \freq assuming the val = is within range, though of course that=E2=80=99s not a JITLib issue!) 1 = answers the question of what happens when source is redefined. In = keeping with existing practice though, I think it shouldn=E2=80=99t = change the value unless it=E2=80=99s now outside the spec = range?</div><div><br class=3D""></div><div>What do you = think?</div><div><br class=3D""></div><div>Thanks,</div><div><br = class=3D""></div><div>S.</div><div><br class=3D""></div></body></html>= --Apple-Mail=_85AB4144-76D9-4149-8AD7-6BA093CD8BF1-- _______________________________________________ sc-dev 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-dev/ search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/