<?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: multi observer with js</title>
		<atom:link href="http://cycling74.com/forums/topic/multi-observer-with-js/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/multi-observer-with-js/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 22:30:25 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/multi-observer-with-js/#post-64361</guid>
					<title><![CDATA[multi observer with js]]></title>
					<link>http://cycling74.com/forums/topic/multi-observer-with-js/#post-64361</link>
					<pubDate>Fri, 14 Sep 2012 19:07:48 +0000</pubDate>
					<dc:creator>def1</dc:creator>

					<description>
						<![CDATA[
						<p>hi.<br />
my js knowledge is very little but i figured how to observe multiple ids already .<br />
i´d like to have an js object / observer thats capable of getting large lists of ids in its input, store those in an array, observe them and spit out the changed value and its id .got pointed in the right direction already but the script i wrote is crashing ableton when using track send ids and moving a send. maybe its also some inefficiency in the script i wrote . does not happen if i feed it with track_activator ids .<br />
could someone else please have a look at that ?</p>
<p>here´s what i did:</p>
<pre><code>inlets=1;
outlets=2;

function list()
{
var input;
if(inlet==0)
input=arrayfromargs(arguments); // makes an array called "input" from the input list
post("the list contains",arguments.length, "elements"); // how many elements ( ids ) has our input list
post(input[0]); // post the first element (id) just to check its working

var api = new Array();

for (n=0;n<input .length;n++)

{
api[n] = new LiveAPI(callback, "id "+input[n]);
api[n].property = "value";
api[n].id = "id";
}
}
function callback(args)
{
  outlet(0,args[1]);
  outlet(1,this.id);
}</code/></code></pre>						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/multi-observer-with-js/#post-232143</guid>
					<title><![CDATA[Re: multi observer with js]]></title>
					<link>http://cycling74.com/forums/topic/multi-observer-with-js/#post-232143</link>
					<pubDate>Fri, 14 Sep 2012 20:27:25 +0000</pubDate>
					<dc:creator>def1</dc:creator>

					<description>
						<![CDATA[
						<p>Never mind . Thank you apask. !!!<br />
Works with all ids you feed it with ( as a list )</p>
<p>Here it is:</p>
<pre><code>inlets = 1;

outlets = 2;

sendids = new Array();

prev = -1;

function list() {

    if (arguments.length) {

        nids = arguments.length;

        if (prev > nids) {

            sendids.length = 0;

            post("nids =", nids, "n");
        }

        prev = nids;

        for (i = 0; i < nids; i++) {
            sendids[i] = new LiveAPI(callback, "id "+arguments[i]);
            sendids[i].property = "value";
            sendids[i].id = "id";
        }
    }
    function callback(args)
    {
        outlet(0, args[1]);
        outlet(1, this.id);
    }
}</code></code></pre>						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

