<div dir="ltr">The LiCK library has lots of functional programming tools. <a href="https://github.com/heuermh/lick">https://github.com/heuermh/lick</a><div><br></div><div><div style="color:rgb(0,0,0);font-family:Calibri;font-size:16px">...</div><div style="color:rgb(0,0,0);font-family:Calibri;font-size:16px">if (parameterName == “gain”) myUgen.gain (value);</div><div style="color:rgb(0,0,0);font-family:Calibri;font-size:16px">... etc ...</div></div><div style="color:rgb(0,0,0);font-family:Calibri;font-size:16px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri;font-size:16px"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small">You could write your own class where every parameter is accessed via an associative array using a pattern like "class.set("paramName", parameterList)"</span><br></div><div style="color:rgb(0,0,0);font-family:Calibri;font-size:16px"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><br></span></div><div style="color:rgb(0,0,0);font-family:Calibri;font-size:16px"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"> - George</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 25, 2015 at 12:19 PM, Kassen <span dir="ltr"><<a href="mailto:signal.automatique@gmail.com" target="_blank">signal.automatique@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey, Rich!<div class="gmail_extra"><br><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="FONT-SIZE:12pt;FONT-FAMILY:'Calibri';COLOR:#000000"><div>I’m pretty sure I know the answer to this already – its not a dynamic
language...</div></div></div></div></blockquote><div><br></div><div><br></div></span><div>Indeed, and not a functional one either... but let's go over it anyway :-)</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="FONT-SIZE:12pt;FONT-FAMILY:'Calibri';COLOR:#000000"><div> However, I can put a UGen method into a variable, but I cannot apply
it:</div>
<div>...</div>
<div>SndBuf2 input;</div>
<div>input.gain @=> Object f;</div>
<div>...</div>
<div> </div>
<div>This compiles, but can I apply it to an argument?</div>
<div> </div></div></div></div></blockquote><div><br></div></span><div>IMHO you have found a bug. I don't feel this should compile or parse; input.gain is a function and functions are not objects, in ChucK, and hence I feel the assignment should fail with some error message. I can see your reasoning; that if it compiles you'll want to do Useful Stuff with it, but IMHO this situation is the sad result of differences between "ChucK" as a language and the actual chuck compiler/VM.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="FONT-SIZE:12pt;FONT-FAMILY:'Calibri';COLOR:#000000">
<div>Am trying to find a way of modifying arbitrary parameters via osc that
doesn’t include writing unmaintainable code:</div>
<div>...</div>
<div>if (parameterName == “gain”) myUgen.gain (value);</div>
<div>... etc ...</div>
<div> </div>
<div><br></div></div></div></div></blockquote><div><br></div></span><div>Ok, I can see how the above would look better if we had variables of type function. We don't have those... but your illustration here looks far from "unmaintainable" to me. Indeed it is a bit longer than the alternative in -say- Scheme, but on the bright side; if you make a typo in this kind of situation the parser will likely catch it for you before it compiles at all. That has serious benefits too in how maintainable code is.</div><div><br></div><div>Hope that helps a bit?</div><div><br></div><div>Yours,</div><div>Kas. </div></div></div></div>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br></div>