[Sc-devel] [Known issue]: SynthDesc:makeWindow uses wrong arg names

ronald kuivila rkuivila at wesleyan.edu
Sun Feb 17 16:37:01 PST 2008


Hi James,

  I would fix it, it creates a very bad side effect and the fix is  
limited to the browser.

RJK

On Feb 17, 2008, at 3:51 PM, James Harkins wrote:

> Another one for the known issues list (or is this okay to fix  
> before release?) --
>
> Sometimes a SynthDesc has control names padded by spaces. When that  
> happens, the SynthDesc window can't change any control values  
> because it sends the spaces along with the argument name, and the  
> server doesn't recognize it.
>
> [ "/n_set", 1000, "freq        ", 880.0 ]
>
> **further research** -- the SynthDescLib browser corrupts  
> ControlName objects by padding them with spaces. Whoever wrote it  
> forgot to copy strings before .extending them.
>
> Fix it (per following patch), or add it to the known issues list? I  
> vote for fixing it. The only effect it will have on other people's  
> code is that other code will work better because objects aren't  
> getting messed up.
> hjh
>
> Index: SynthDescPlusGUI.sc
> ===================================================================
> --- SynthDescPlusGUI.sc (revision 7333)
> +++ SynthDescPlusGUI.sc (working copy)
> @@ -11,7 +11,7 @@
>
>                 usefulControls = controls.select {|controlName, i|
>                         var ctlname;
> -                       ctlname = controlName.name;
> +                       ctlname = controlName.name.asString;
>                         (ctlname != "?") && (ctlname != "gate")
>                 };
>
> Index: SynthDescLibPlusGUI.sc
> ===================================================================
> --- SynthDescLibPlusGUI.sc      (revision 7333)
> +++ SynthDescLibPlusGUI.sc      (working copy)
> @@ -125,24 +125,24 @@
>                                 controlsListView.items = [];
>                         }{
>                                 ugensListView.items =  
> synthDesc.def.children.collect { |x, i|
> -                                       i.asString.extend(7, $ ) ++  
> x.class.name.asString;
> +                                       i.asString.copy.extend(7,  
> $ ) ++ x.class.name.asString;
>                                 };
>
>                                 inputsListView.items =  
> synthDesc.inputs.collect { |x|
>                                         var string;
> -                                       string = x.rate.asString;
> +                                       string = x.rate.asString.copy;
>                                         string = string.extend(9,  
> $ ) ++ " " ++ x.startingChannel;
>                                         string = string.extend(19,  
> $ ) ++ " " ++ x.numberOfChannels;
>                                 };
>                                 outputsListView.items =  
> synthDesc.outputs.collect { |x|
>                                         var string;
> -                                       string = x.rate.asString;
> +                                       string = x.rate.asString.copy;
>                                         string = string.extend(9,  
> $ ) ++ " " ++ x.startingChannel;
>                                         string = string.extend(19,  
> $ ) ++ " " ++ x.numberOfChannels;
>                                 };
>                                 controlsListView.items =  
> synthDesc.controls.collect { |x|
>                                         var string;
> -                                       string = if (x.name.notNil)  
> { x.name.asString; }{ "" };
> +                                       string = if (x.name.notNil)  
> { x.name.asString.copy; }{ "" };
>                                         if (x.rate.notNil)
>                                         {
>                                                 string =  
> string.extend(12, $ ) ++ " " ++ x.rate;
>
>
> : H. James Harkins
> : jamshark70 at dewdrop-world.net
> : http://www.dewdrop-world.net
> .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
>
> "Come said the Muse,
> Sing me a song no poet has yet chanted,
> Sing me the universal."  -- Whitman
>
> _______________________________________________
> Sc-devel mailing list
> Sc-devel at create.ucsb.edu
> http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.create.ucsb.edu/pipermail/sc-devel/attachments/20080217/3779329b/attachment-0001.html 


More information about the Sc-devel mailing list