Forum

    • Register
    • Login
    • Search
    • Categories

    Count and read Modulators in Chain

    Scripting Forum
    2
    7
    44
    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.
    • ulrik
      ulrik last edited by

      Lets say I have a SimpleGain, in the first mod chain I have 3 different type of modulators, is there a way to iterate over them and read their intensity?

      Something like

      for (mod in SimpleGain.getModulatorsAtChain(0))
           local intensity = mod.getIntensity();
      

      I have a project with up to 6 different modulators on effects, detune and spread osc.

      Hise Develop branch
      MacOs 12.4, Xcode 13.0
      http://musikboden.se

      ustk 1 Reply Last reply Reply Quote 0
      • ustk
        ustk @ulrik last edited by

        @ulrik Either you added them manually or dynamically, you just have to put their references in an array and get their values in a for loop:

        const var SimpleGain1 = Synth.getEffect("Simple Gain1");
        
        const var gainMod = [Synth.getModulator("gainMod1"),
        					 Synth.getModulator("gainMod2")];
        
        
        for (m in gainMod)
        	Console.print(m.getCurrentLevel());
        

        Tired to press F5 in the forum...
        Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

        ulrik 1 Reply Last reply Reply Quote 0
        • ulrik
          ulrik @ustk last edited by

          @ustk Yes I added them dynamically, and of course I should have thought about it that I might needed the exact order of mods in each chain, when I added them but...

          I thought that maybe there was a clever function that counted them for me but I could not find any.

          I found this, but I don't understand what it does, well I could not iterate over the result anyway 🙂

          Skärmavbild 2022-01-14 kl. 22.29.32.png

          Hise Develop branch
          MacOs 12.4, Xcode 13.0
          http://musikboden.se

          ustk 1 Reply Last reply Reply Quote 0
          • ustk
            ustk @ulrik last edited by

            @ulrik This gives you the whole modulation level of the chain (delay, width, pan, etc...)

            Tired to press F5 in the forum...
            Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

            ulrik 1 Reply Last reply Reply Quote 1
            • ulrik
              ulrik @ustk last edited by

              @ustk Ok, thanks, when I Console.print(trace(it)) it showed up empty object

              Hise Develop branch
              MacOs 12.4, Xcode 13.0
              http://musikboden.se

              ustk 1 Reply Last reply Reply Quote 0
              • ustk
                ustk @ulrik last edited by

                @ulrik There's a Synth.getAllModulators(regex), that should work but I never used it myself...

                Tired to press F5 in the forum...
                Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                ulrik 1 Reply Last reply Reply Quote 1
                • ulrik
                  ulrik @ustk last edited by

                  @ustk Yes it works, I use it in this project 🙂

                  Hise Develop branch
                  MacOs 12.4, Xcode 13.0
                  http://musikboden.se

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

                  18
                  Online

                  741
                  Users

                  5.4k
                  Topics

                  50.4k
                  Posts