• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    [ANSWERED] Ranking values Q

    How To... ?
    3
    3
    461
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      simon100 last edited by Woland

      Hey all

      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). 

      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.

      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.

      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'.

      Hope that makes sense, any thoughts very welcome!

      Simon

      Woland DusX 2 Replies Last reply Reply Quote 0
      • Woland
        Woland Tech Staff @simon100 last edited by

        @simon100

        JavaScript would be your best bet

        TroikaTronix Technical Support
        New Support Ticket: https://support.troikatronix.com/support/tickets/new
        Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
        Add-Ons: https://troikatronix.com/add-ons/ & https://troikatronix.com/add-ons/?u=woland
        Professional Services: https://support.troikatronix.com/support/solutions/articles/13000109444

        | Isadora Version: all of them | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

        1 Reply Last reply Reply Quote 0
        • DusX
          DusX Tech Staff @simon100 last edited by

          @simon100

          As Woland mentioned, you can accomplish this in Javascript.
          You likely want to build a 2D array (https://www.w3schools.com/js/j...) such that the Array is made of short arrays that contain the Value & the Position.. So you might have [50.33,2] where 50.33 is the max volume, and 2 the position it is in.

          So your array may look like this (if it has 5 positions) [[50.33,1],[20,2],[10,3],[15,4],[30,5]]

          You could then use the Array Sort feature on this array (https://www.w3schools.com/js/j...) to sort by the Volume level (first value in each sub-array).

          This could give you this array: [[50.33,1],[30,5],[20,2],[15,4],[10,3]]

          See how the value levels are now in descending order: 50.33, 30, 20, 15, 10

          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

          Hopefully that gets you started.

          Troikatronix Technical Support

          • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
          • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
          • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

          Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post