<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: event-driven list interpolation- javascript solution?</title>
		<atom:link href="http://cycling74.com/forums/topic/event-driven-list-interpolation-javascript-solution/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/event-driven-list-interpolation-javascript-solution/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 14:12:51 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/event-driven-list-interpolation-javascript-solution/#post-37181</guid>
					<title><![CDATA[event-driven list interpolation- javascript solution?]]></title>
					<link>http://cycling74.com/forums/topic/event-driven-list-interpolation-javascript-solution/#post-37181</link>
					<pubDate>Thu, 24 Apr 2008 14:49:17 +0000</pubDate>
					<dc:creator>joshua goldberg</dc:creator>

					<description>
						<![CDATA[
						<p>the below is pre-posted on the big list.  the only answer came from brad garton, and while i&#8217;m grateful for his attention, i&#8217;d rather implement this in a language that i can actually understand.  </p>
<p>is there an elegant javascript solution for this?  i&#8217;d be grateful for a push in the right direction.  my procedural programming skills have drastically withered on the vine.</p>
<p>i&#8217;ve got a series of two-item lists that look like this:</p>
<p>45 67<br />
49 67<br />
52 68<br />
52 72<br />
52 74</p>
<p>etc.</p>
<p>i would like to build in interpolation for those lists. so as the new <br />
lists come in, interpolated versions of them are added. it&#8217;s ok if <br />
the lists come fast and furious. the above would be changed to</p>
<p>45 67 this is first event<br />
46 67<br />
47 67<br />
48 67<br />
49 67 here ends second event<br />
50 67<br />
51 68<br />
52 68 here ends third event<br />
52 69<br />
52 70<br />
52 71<br />
52 72 here ends fourth event<br />
52 73<br />
52 74 here ends fifth event</p>
<p>take note of the slower interpolation of the second list item during <br />
the third event.</p>
<p>anyone got a cool solution for this?</p>
<p>best</p>
<p>j</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/event-driven-list-interpolation-javascript-solution/#post-128218</guid>
					<title><![CDATA[Re: event-driven list interpolation- javascript solution?]]></title>
					<link>http://cycling74.com/forums/topic/event-driven-list-interpolation-javascript-solution/#post-128218</link>
					<pubDate>Fri, 25 Apr 2008 08:32:17 +0000</pubDate>
					<dc:creator>volker böhm</dc:creator>

					<description>
						<![CDATA[
						<p>
On 24 Apr 2008, at 16:49, joshua goldberg wrote:<br />
><br />
> the below is pre-posted on the big list.  the only answer came from  <br />
> brad garton, and while i&#8217;m grateful for his attention, i&#8217;d rather  <br />
> implement this in a language that i can actually understand.<br />
><br />
> is there an elegant javascript solution for this?  i&#8217;d be grateful  <br />
> for a push in the right direction.  my procedural programming  <br />
> skills have drastically withered on the vine.</p>
<p>this is a quick hack, so i doubt the example below is elegant.<br />
could probably be streamlined, but maybe it gets you in the right  <br />
direction.<br />
volker.</p>
<p>careful, email coding!</p>
<p>/* &#8212; start listInterpol.js &#8212;- */<br />
var a = 0;<br />
var b = 0;<br />
var a0 = 0;<br />
var b0 = 0;</p>
<p>function list() {<br />
	var incrA, incrB, x, y, dist = 0;<br />
	a0 = a;	b0 = b;	<br />
	a = arguments[0];	<br />
	b = arguments[1];		<br />
	// calc difference	<br />
	x = a &#8211; a0;	<br />
	y = b &#8211; b0;	<br />
	// max. distance	<br />
	dist = Math.max(Math.abs(x),Math.abs(y));		<br />
	if(dist != 0) {<br />
		incrA = x / dist;		<br />
		incrB = y / dist;	<br />
	}<br />
	for(i=0; i<dist ; i++) {<br></dist>
		a0 += incrA;<br />
		b0 += incrB;<br />
		outlet(0, Math.floor(a0+0.5), Math.floor(b0+0.5));<br />
	}<br />
}</p>
<p>function set(c, d) {<br />
	a = c;<br />
	b = d;<br />
}</p>
<p>/* &#8212; end listInterpol.js &#8212;- */</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P message 231 87 37 196617 52 74;<br />
#P message 187 87 37 196617 52 72;<br />
#P newex 95 190 61 196617 print outlet;<br />
#P newex 95 162 84 196617 js listInterpol.js;<br />
#P message 143 87 37 196617 52 68;<br />
#P message 95 87 37 196617 49 67;<br />
#P message 35 87 54 196617 set 45 67;<br />
#P comment 27 72 70 196617 set start list;<br />
#P connect 1 0 4 0;<br />
#P connect 2 0 4 0;<br />
#P connect 3 0 4 0;<br />
#P connect 6 0 4 0;<br />
#P connect 7 0 4 0;<br />
#P connect 4 0 5 0;<br />
#P window clipboard copycount 8;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/event-driven-list-interpolation-javascript-solution/#post-128219</guid>
					<title><![CDATA[Re: event-driven list interpolation- javascript solution?]]></title>
					<link>http://cycling74.com/forums/topic/event-driven-list-interpolation-javascript-solution/#post-128219</link>
					<pubDate>Fri, 25 Apr 2008 12:22:56 +0000</pubDate>
					<dc:creator>joshua goldberg</dc:creator>

					<description>
						<![CDATA[
						<p>thanks, volker!</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

