[sc-users] [CocoaCollider] question: strings in functions (or cc-responder problem?)

Stefan Nussbaumer stefanus at chello.at
Wed Mar 7 01:48:14 PST 2007


hi,

i've found, what i was looking for:

a = { |value| ("Ich bin ein"+value).postln }

a.value('Text')

... should have a closer look at the Function-helpfile, sorry (lurking 
on this list for so long, still newbee ... how embarrassing).

stefan



Stefan Nussbaumer schrieb:
> hi everybody,
>
> probably a very basic thing, though i don't know how to solve this: 
> i'm currently playing around with redfriks CocoaCollider 
> Googlemaps-piece (great! thanks ... 
> http://www.create.ucsb.edu/pipermail/sc-users/2007-February/031729.html). 
> i'd like to be able to fly over the globe and control this with my 
> pocket dial midifader.
>
> so i tried something like this:
>
> /* 
> --------------------------------------------------------------------- */
>
> // basic init
> (
> a= NSAppleScript.alloc;
> f= {|cmd|
>    {a.initWithSource_("tell application \"Google 
> Earth\"\n"++cmd++"\nend tell").executeAndReturnError_(nil)}.defer;
> };
> f.("open");
> )
>
> // then a cc-responder
>
> (
> ~cc = CCResponder({arg src, chan, num, val;
>    var control;
>    control = (val*1.3).asInteger;
>    b.value.postln; // outputs 'a Function' after assigning function b
>    b.set(\contr, control); // maps value for 'control' to arg 'contr' 
> in b
>    control.value.postln; // outputs something between 0 and 165 - ok
>    }, nil, 0, 0);
> )
>
> ~cc.remove; // just for removing the responder when no longer needed
>
> // ... and function b:
>
> (
> b = { |contr|
>        contr.postln; // outputs 'contr' => wanted to get the mapped 
> value of 'conrol' in ~cc (??)
>        f.("SetViewInfo{tilt:"++contr++"} speed 1");
>       }.defer
> )
>
> // executing these lines works seem to work (though i'm not shure 
> about the 'tilt'-value):
>
> f.("SetViewInfo{tilt:45} speed 1")
> f.("SetViewInfo{latitude:"++25.rrand(50)++", 
> longitude:"++rand(360)++", distance:1000, tilt:0, azimuth:0} speed 30");
> f.("MoveCamera{"++0.5.rand2++", "++0.5.rand2++"}");
>
> /* 
> --------------------------------------------------------------------- */
>
> can anybody give me a hint?
>
> thanks very much, stefan
> _______________________________________________
> sc-users mailing list
> sc-users at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>



More information about the sc-users mailing list