<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[ANSWERED] Ranking values Q]]></title><description><![CDATA[<p></p>
<p>Hey all</p>
<p>I'm building a patch that listens to audio input for a user defined amount of time and records the "db" as a value (0-100). </p>
<p>The audio input/microphone is "opened' with a gate actor each time and the max value is fed to a separate Hold Value actor - each time the gate is opened a new hold value is used. The gate is then closed, so the max volume over a user defined period of time is recorded.</p>
<p>In the current patch I've got 3 separate Hold Value actors, but this could go up to 10 or more. There will be a different external trigger (most likely an OSC signal) for each gate into hold value.</p>
<p>Is there an actor/setup that can then rank those values highest to lowest? Ideally I want the user to be able to see the highest value and which opened gate that corresponds to quickly - that value might then get fed elsewhere and presented as a 'winner'.</p>
<p>Hope that makes sense, any thoughts very welcome!</p>
<p>Simon</p>]]></description><link>https://community.troikatronix.com/topic/8440/answered-ranking-values-q</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 09:37:22 GMT</lastBuildDate><atom:link href="https://community.troikatronix.com/topic/8440.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Jun 2023 07:28:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [ANSWERED] Ranking values Q on Wed, 07 Jun 2023 17:45:43 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/5328">@simon100</a></p><p>As Woland mentioned, you can accomplish this in Javascript.<br />You likely want to build a 2D array (<a href="https://www.w3schools.com/js/js_arrays.asp">https://www.w3schools.com/js/j...</a>) such that the Array is made of short arrays that contain the Value &amp; the Position.. So you might have [50.33,2] where 50.33 is the max volume, and 2 the position it is in.</p><p>So your array may look like this (if it has 5 positions) &lsqb;&lsqb;50.33,1],[20,2],[10,3],[15,4],[30,5&rsqb;&rsqb;</p><p>You could then use the Array Sort feature on this array (<a href="https://www.w3schools.com/js/js_array_sort.asp">https://www.w3schools.com/js/j...</a>) to sort by the Volume level (first value in each sub-array).</p><p>This could give you this array: &lsqb;&lsqb;50.33,1],[30,5],[20,2],[15,4],[10,3&rsqb;&rsqb;</p><p>See how the value levels are now in descending order: 50.33, 30, 20, 15, 10</p><p>In this way, you can determine that the highest value came from output position 1, and the second highest volume came from output position 5</p><p>Hopefully that gets you started.</p>]]></description><link>https://community.troikatronix.com/post/51650</link><guid isPermaLink="true">https://community.troikatronix.com/post/51650</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Wed, 07 Jun 2023 17:45:43 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Ranking values Q on Tue, 06 Jun 2023 10:59:20 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/5328">@simon100</a></p><p>JavaScript would be your best bet</p>]]></description><link>https://community.troikatronix.com/post/51636</link><guid isPermaLink="true">https://community.troikatronix.com/post/51636</guid><dc:creator><![CDATA[Woland]]></dc:creator><pubDate>Tue, 06 Jun 2023 10:59:20 GMT</pubDate></item></channel></rss>