• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    [SOLVED] Math for Modulating parameters with Audio

    How To... ?
    2
    4
    172
    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.
    • J
      jtsteph
      last edited by Woland

      Hello,

      I am in the process of rewriting some patches I did years ago. One of the functions was to use audio to modulate things like position, scale etc based on audio. I did not want simple additive amplitude modulation, I wanted the modulation to wiggle back and forth from the current value of the parameter like an audio wave.

      One method I used was a bit of math combining the amplitude with the random wave at 60hz. I think I split the random value in half, anything under 50 was - and anything over 50 was positive. Then multiplied this with the audio and scaled it with an "influence" parameter to move stuff around.

      The other was using a version of an overlay transfer but i'm not sure that was successful. 

      Edit: I found a cleaner version of this formula online:

      // For 'a' base layer, 'b' top layer.

      if (a < 0.5) { result = 2 * a * b;
      } else { result = 1 - 2 * (1 - a) * (1 - b);
      }

      It's a combination of a multiply transfer math for values under .5 and a screen transfer math for values over .5

      is there a better way to accomplish this?

      W11 PRO 13700K (in a 4U case), 128GB RAM, 4 Lane M.2 Storage, RTX 3090, Behringer UMC404HD audio interface, Streamdeck XL, Stremdeck +, KorgNano Kontrol2, Izzy 3.26 USB
      Website: http://justinstephenson.com

      J 1 Reply Last reply Reply Quote 0
      • J
        jtsteph @jtsteph
        last edited by jtsteph


        Edit: I found a cleaner version of this formula online:

        // For 'a' base layer, 'b' top layer.

        if (a < 0.5) { result = 2 * a * b; } else { result = 1 - 2 * (1 - a) * (1 - b); }

        It's a combination of a multiply transfer math for values under .5 and a screen transfer math for values over .5

        I don't think it's quite the right thing.

        W11 PRO 13700K (in a 4U case), 128GB RAM, 4 Lane M.2 Storage, RTX 3090, Behringer UMC404HD audio interface, Streamdeck XL, Stremdeck +, KorgNano Kontrol2, Izzy 3.26 USB
        Website: http://justinstephenson.com

        1 Reply Last reply Reply Quote 1
        • J
          jtsteph
          last edited by

          I figured it out. Sinusoidal modulation:


          modulatedParameterValue = parameterBaseValue + Math.sin(currentPhase) * modulationDepth * audioAmplitude;

          I use a wave generator to supply the phase and it really looks super cool. With a smoother on the other side of it I can get a tone of great audio reactive modulations.

          W11 PRO 13700K (in a 4U case), 128GB RAM, 4 Lane M.2 Storage, RTX 3090, Behringer UMC404HD audio interface, Streamdeck XL, Stremdeck +, KorgNano Kontrol2, Izzy 3.26 USB
          Website: http://justinstephenson.com

          WolandW 1 Reply Last reply Reply Quote 2
          • WolandW
            Woland Tech Staff @jtsteph
            last edited by

            @jtsteph

            I'm very interested to know what this looks like in practice.

            Also, I realized that this User Actor that I originally got from @mark and then modified might be useful for similar use cases as well (though probably not for your exact use case).

            semi-random-variance.iua3

            TroikaTronix Technical Support
            New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
            TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
            TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

            | Isadora 3.2.6 | 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
            • First post
              Last post