Forum

    • Register
    • Login
    • Search
    • Categories

    Namespace oddness

    General Questions
    3
    5
    26
    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.
    • Lindon
      Lindon last edited by

      So I have a modulator defined as:

      const var GlobalTremoloLFO = Synth.getModulator("GlobalTremoloLFO");
      

      and I have a series of callbacks like this:

      inline function onTremFadeInControl(component, value)
      {
      	GlobalTremoloLFO.setAttribute(GlobalTremoloLFO.FadeIn, value);
      };
      Content.getComponent("TremFadeIn").setControlCallback(onTremFadeInControl);
      

      I put the callback in a namespace declared in an include script: VibTremSpace.js

      If I put the modulator definition in the init then it compiles, if I put it in the namespace I get this:

      Interface:! VibTremSpace.js (162): Unknown function 'setAttribute'
      

      So for some reason the callback can not see the modulator when they are BOTH in the namespace....very odd...am I doing something silly?

      HISE Development for hire.
      www.channelrobot.com

      d.healey 1 Reply Last reply Reply Quote 0
      • d.healey
        d.healey @Lindon last edited by

        @lindon said in Namespace oddness:

        am I doing something silly?

        Maybe... Can you make a minimal snippet that fails in this way?

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        Lindon 1 Reply Last reply Reply Quote 0
        • Lindon
          Lindon @d.healey last edited by

          @d-healey I will give it a go...

          HISE Development for hire.
          www.channelrobot.com

          dustbro 1 Reply Last reply Reply Quote 1
          • dustbro
            dustbro @Lindon last edited by

            @lindon Is it possible that the function is being called in a script that initializes before the modulator is defined?

            Dan Korneff - Producer / Mixer / Audio Nerd

            d.healey 1 Reply Last reply Reply Quote 0
            • d.healey
              d.healey @dustbro last edited by

              @dustbro I think if that was the case the error wouldn't be on line in the script containing the namespace.

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

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

              5
              Online

              740
              Users

              5.4k
              Topics

              50.4k
              Posts