• 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

    [SOLVED] Math for Modulating parameters with Audio

    How To... ?
    2
    4
    843
    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?

      Isadora 4.0.2, W11 PRO 13700K (in a 4U case), 128GB RAM, 4 Lane M.2 Storage, RTX 3090, Ultraleap Motion 2, Behringer UMC404HD audio interface, Streamdeck XL, Streamdeck+, KorgNano Kontrol2.
      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.

        Isadora 4.0.2, W11 PRO 13700K (in a 4U case), 128GB RAM, 4 Lane M.2 Storage, RTX 3090, Ultraleap Motion 2, Behringer UMC404HD audio interface, Streamdeck XL, Streamdeck+, KorgNano Kontrol2.
        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.

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

          Woland 1 Reply Last reply Reply Quote 2
          • Woland
            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: 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
            • First post
              Last post