HISE Logo Forum
    • Categories
    • Register
    • Login

    Count and read Modulators in Chain

    Scheduled Pinned Locked Moved Scripting
    7 Posts 2 Posters 321 Views
    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.
    • ulrikU
      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 15.3.1, Xcode 16.2
      http://musikboden.se

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        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());
        

        Can't help pressing F5 in the forum...

        ulrikU 1 Reply Last reply Reply Quote 0
        • ulrikU
          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 15.3.1, Xcode 16.2
          http://musikboden.se

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

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

            Can't help pressing F5 in the forum...

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

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

              Hise Develop branch
              MacOs 15.3.1, Xcode 16.2
              http://musikboden.se

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

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

                Can't help pressing F5 in the forum...

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

                  @ustk Yes it works, I use it in this project :)

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

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

                  49

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  101.9k

                  Posts