HISE Logo Forum
    • Categories
    • Register
    • Login

    Samplemap + Viewports

    Scheduled Pinned Locked Moved General Questions
    samplemapsviewports
    4 Posts 3 Posters 397 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.
    • trillbillyT
      trillbilly
      last edited by trillbilly

      Im trying to load my samplemaps via a viewport, check.

      The problem, all viewports (4 total = 1 for each sampler), load samplemaps for the same sampler (Sampler3). They flciker like they are changing in the correct Sampler, but they stay the same and change in Sampler3 instead.

      Can somebody spot what Im doing wrong with this script?

      //SAMPLERMAP SELECTION
      const var Sampler0 = Synth.getSampler("Sampler0");
      const var Sampler1 = Synth.getSampler("Sampler1");
      const var Sampler2 = Synth.getSampler("Sampler2");
      const var Sampler3 = Synth.getSampler("Sampler3");
      
      const var list = Sampler.getSampleMapList();
      
      const var SampleViewer0 = Content.getComponent("SampleViewer0");
      const var SampleViewer1 = Content.getComponent("SampleViewer1");
      const var SampleViewer2 = Content.getComponent("SampleViewer2");
      const var SampleViewer3 = Content.getComponent("SampleViewer3");
      
      SampleViewer0.set("useList", true);
      SampleViewer0.set("items", list.join("\n"));
      
      SampleViewer1.set("useList", true);
      SampleViewer1.set("items", list.join("\n"));
      
      SampleViewer2.set("useList", true);
      SampleViewer2.set("items", list.join("\n"));
      
      SampleViewer3.set("useList", true);
      SampleViewer3.set("items", list.join("\n"));
      
      
      inline function loadSampleFromViewport(component, value)
      {
          Sampler0.loadSampleMap(list[value]);
      }
      
      SampleViewer0.setControlCallback(loadSampleFromViewport);
      
      inline function loadSampleFromViewport(component, value)
      {
          Sampler1.loadSampleMap(list[value]);
      }
      
      SampleViewer1.setControlCallback(loadSampleFromViewport);
      
      inline function loadSampleFromViewport(component, value)
      {
          Sampler2.loadSampleMap(list[value]);
      }
      
      SampleViewer2.setControlCallback(loadSampleFromViewport);
      
      inline function loadSampleFromViewport(component, value)
      {
          Sampler3.loadSampleMap(list[value]);
      }
      
      SampleViewer3.setControlCallback(loadSampleFromViewport);
      
      DabDabD ulrikU 2 Replies Last reply Reply Quote 0
      • DabDabD
        DabDab @trillbilly
        last edited by DabDab

        @trillbilly
        Create custom callback definition

        inline function onSampleViewer0Control(component, value)
        {
         Sampler0.loadSampleMap(list[value]);
        };
        
        Content.getComponent("SampleViewer0").setControlCallback(onSampleViewer0Control);
        
        
        inline function onSampleViewer1Control(component, value)
        {
        	Sampler1.loadSampleMap(list[value]);
        };
        
        Content.getComponent("SampleViewer1").setControlCallback(onSampleViewer1Control);
        
        
        inline function onSampleViewer2Control(component, value)
        {
          Sampler2.loadSampleMap(list[value]);
        };
        
        Content.getComponent("SampleViewer2").setControlCallback(onSampleViewer2Control);
        
        
        inline function onSampleViewer3Control(component, value)
        {
          Sampler3.loadSampleMap(list[value]);
        };
        
        Content.getComponent("SampleViewer3").setControlCallback(onSampleViewer3Control);
        
        

        This will work.

        Bollywood Music Producer and Trance Producer.

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

          @trillbilly just a quick look, you get the sample map list from a sampler named "Sampler", do you have that sampler?

          const var list = Sampler.getSampleMapList();
          

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

          1 Reply Last reply Reply Quote 0
          • trillbillyT
            trillbilly @DabDab
            last edited by

            @DabDab You're right, thank you.

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

            46

            Online

            1.7k

            Users

            11.7k

            Topics

            102.2k

            Posts