<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I know Max has an [if] object that looks pretty much like your [if pitch... <br>etc.] example below.<br><br>-Jonathan<br><br>--- On <b>Wed, 12/15/10, Andrew Faraday <i>&lt;jbturgid@hotmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Andrew Faraday &lt;jbturgid@hotmail.com&gt;<br>Subject: RE: [PD] PD OOP?<br>To: matju@artengine.ca, jancsika@yahoo.com<br>Cc: pd-list@iem.at<br>Date: Wednesday, December 15, 2010, 1:53 AM<br><br><div id="yiv1934628744">

<style><!--
#yiv1934628744 .yiv1934628744hmmessage P
{
margin:0px;padding:0px;}
#yiv1934628744 .yiv1934628744hmmessage
{
font-size:10pt;font-family:Tahoma;}
--></style>
Hey There<div style="text-indent: 0px ! important;"><br style="text-indent: 0px ! important;"></div><div style="text-indent: 0px ! important;">You might want to have a look at Jamie Bullock's abstraction based solution(which also went out on this list). Which was quite eloquent, if a little limiting at first. It's a little way back from the dream of dropping lines of OO code into pd but it's the kind of thing, when I find a syntax I like for this, could be useful to streamline some of my patching.&nbsp;</div><div style="text-indent: 0px ! important;"><br></div><div style="text-indent: 0px ! important;">I suppose what I'd really like is embedded ruby in pd, but that's either going to be a case of some serious modification (a bit beyond me now) or possibly shell scripts, something like</div><div style="text-indent: 0px ! important;"><br></div><div style="text-indent: 0px ! important;">[loadbang]</div><div style="text-indent: 0px ! important;">|</div><div
 style="text-indent: 0px ! important;">[irb, pitch = 440, *other variables*(</div><div style="text-indent: 0px ! important;">|</div><div style="text-indent: 0px ! important;">[shell]</div><div style="text-indent: 0px ! important;"><br></div><div style="text-indent: 0px ! important;">*number*</div><div style="text-indent: 0px ! important;">|</div><div style="text-indent: 0px ! important;">[pitch = $1{</div><div style="text-indent: 0px ! important;">|&nbsp;</div><div style="text-indent: 0px ! important;">[shell]</div><div style="text-indent: 0px ! important;"><br></div><div style="text-indent: 0px ! important;">[pitch * 2{</div><div style="text-indent: 0px ! important;">|</div><div style="text-indent: 0px ! important;">[shell]</div><div style="text-indent: 0px ! important;">|</div><div style="text-indent: 0px ! important;">[osc~]</div><div style="text-indent: 0px ! important;"><br></div><div style="text-indent: 0px ! important;">Although I suspect this may
 convolute issues more than solving them. Although in theory it might simplify some logic blocks...</div><div style="text-indent: 0px ! important;"><br></div><div style="text-indent: 0px ! important;">[if pitch &gt; 10000,</div><div style="text-indent: 0px ! important;">volume = .05,</div><div style="text-indent: 0px ! important;">elsif pitch &gt; 5000,</div><div style="text-indent: 0px ! important;">volume = .1,</div><div style="text-indent: 0px ! important;">else,</div><div style="text-indent: 0px ! important;">volume = .15,</div><div style="text-indent: 0px ! important;">end(</div><div>|</div><div>[shell]</div><div><br></div><div>I'm really not sure if this is worth pursuing or not. It might lead to some impressive results, especially if I could define some methods in a ruby file and call them via shell, meaning I could write a parallel ruby library for a pd project.&nbsp;</div><div><br></div><div>The main problem I can see would be requesting live
 feedback from ruby. Would probably have to poll a whole lot of variables quite regularly for irb to deal with it.&nbsp;</div><div><br></div><div>All casting about ideas here, guys, but any ideas or guidance might be helpful.&nbsp;</div><div><br></div><div>Cheers</div><div><br></div><div>Andrew</div><div><br></div><div><br></div><br>&gt; Date: Tue, 14 Dec 2010 15:08:14 -0500<br>&gt; From: matju@artengine.ca<br>&gt; To: jancsika@yahoo.com<br>&gt; CC: pd-list@iem.at; jbturgid@hotmail.com<br>&gt; Subject: Re: [PD] PD OOP?<br>&gt; <br>&gt; On Mon, 13 Dec 2010, Jonathan Wilkes wrote:<br>&gt; <br>&gt; &gt; Jmax Phoenix does this.&nbsp; If I recall correctly it breaks the nested list <br>&gt; &gt; feature in Gridflow.<br>&gt; <br>&gt; Well, it's a bit more complicated. Back then, GridFlow's nested lists were <br>&gt; written using braces {}, but they weren't GridFlow's nested lists, they <br>&gt; were supported directly by jMax. I had to add the parentheses
 hack to <br>&gt; GridFlow so that I could port it to Pd.<br>&gt; <br>&gt; the (pitch * 2) feature of jMax does it with variables only (such as [v]) <br>&gt; (or constant-declarations, a jMax-only feature) and I think that this is <br>&gt; at creation time only, but I don't recall using it, anyway.<br>&gt; <br>&gt; for some reason that I don't remember, the * that is supposed to be a <br>&gt; multiplication only within parentheses, was also considered a <br>&gt; multiplication sign outside of parentheses, where it was considered to be <br>&gt; a syntax error instead of a symbol. This is why I decided to ditch jMax <br>&gt; completely and go for Pd as much as possible. (But ditching jMax was going <br>&gt; to happen not long after that anyway, as IRCAM cancelled the project, <br>&gt; deleted the mailing-list archives, etc.)<br>&gt; <br>&gt; &gt; But considering your [osc~ (pitch * 2)] example-- what would happen if <br>&gt; &gt; you change the value of
 pitch?&nbsp; The value of the [osc~] object's <br>&gt; &gt; argument is assigned to be the initial frequency only when the object is <br>&gt; &gt; created, so it doesn't seem like it would have an effect unless you <br>&gt; &gt; recreate the object.<br>&gt; <br>&gt; It's not currently possible to know how to update it dynamically : the <br>&gt; creation arguments are only passed to creators (constructors), not <br>&gt; assigned in any explicit way to inlets or inlet/message combinations. The <br>&gt; first argument is not even consistently assigned to the second inlet.<br>&gt; <br>&gt; As an example, if I implemented such a feature in GridFlow,<br>&gt; <br>&gt;    [# + (pitch * 2)]<br>&gt; <br>&gt; Pd would read it as :<br>&gt; <br>&gt;    $1 = +<br>&gt;    $2 = (pitch<br>&gt;    $3 = *<br>&gt;    $4 = 2)<br>&gt; <br>&gt; GridFlow would reparse it as :<br>&gt; <br>&gt;    $1 = +<br>&gt;    $2 = (pitch * 2)<br>&gt; <br>&gt; But at that point, something
 is lacking, to say that the second argument <br>&gt; is assigned to the second inlet, and that the first argument corresponds <br>&gt; to a method named "op" instead.<br>&gt; <br>&gt;   _______________________________________________________________________<br>&gt; | Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC<br>                                               
</div></blockquote></td></tr></table><br>