HISE Logo Forum
    • Categories
    • Register
    • Login

    Make one combobox control the waveform choice on 3 different LFOs

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 237 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.
    • M
      maxtownsley
      last edited by

      Im sure this is a simple solution but I've been banging my head against the wall. Im a coding novice, been learning from tutorials and chat gpt helps a bit. Thanks for any help!
      Max

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

        @maxtownsley

        You need to script it, don't use the "Property Editor" to connect the combobox to the LFOs

        If you put the 3 LFOs in an array and then iterate though them and apply the value from the combobox

        
        // this is grabbing the references to all LFOs with "LFO Modulator" inside their id's
        const LFOs = Synth.getAllModulators("LFO Modulator");
        
        inline function onWaveFormCmbControl(component, value)
        {
        	for (w in LFOs)
        		w.setAttribute(w.WaveFormType, value);
        };
        
        Content.getComponent("WaveFormCmb").setControlCallback(onWaveFormCmbControl);
        

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

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

          @ulrik That worked like a charm, thank you so much! The array is what I've been missing. many thanks

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

          44

          Online

          1.7k

          Users

          11.7k

          Topics

          101.8k

          Posts