HISE Logo Forum
    • Categories
    • Register
    • Login

    CustomSampleImport - Loop Panel Visibility

    Scheduled Pinned Locked Moved Scripting
    looploop panelcustomsamplecustom samplesampler
    11 Posts 2 Posters 501 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.
    • d.healeyD
      d.healey
      last edited by

      First thing I see in on init. Might be what you're looking for.

      d12c70b4-e5aa-490d-a299-37dfb3be1788-image.png

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

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

        @d-healey Hi David,

        Yes, I removed this first thing to see if it would work but it does not. Whenever i load a new custom sample, it still removes the loop panel and forces the use of the "Loop" button to show it again. I was thinking I could call for the loop button to be engaged within the SampleLoadSave.js when a sample is imported, I just cant seem to find the right place.

        Ive placed Loop.setValue(1); in the LoadingCallback, which does enable the Loop Button, but the panel does not appear.

        I'll keep digging around the scripts to see what I can find.

        Thanks for your help!

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

          @trillbilly said in CustomSampleImport - Loop Panel Visibility:

          but the panel does not appear.

          Well you know the name of the panel control now, so you could try LoopPanel.showControl(true);

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

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

            @d-healey Yes, I've tried this as well + both functions together.

            SampleDropper.setLoadingCallback(function(isPreloading)
            {
            	 if(!isPreloading)
            	 {
            		  Loop.setValue(1);
            		  LoopPanel.showControl(true);
            		  initAfterSampleLoad();
            	 }
            
            });
            

            This script removes the Loop Panel each time a custom sample is loaded resulting in needing to use the Loop button again.

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

              @trillbilly Is Loop the loop button? If so you need to call .changed() after setting the value.

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

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

                @d-healey Yes, Loop is the Loop Button. I now have this with the same result.

                SampleDropper.setLoadingCallback(function(isPreloading)
                {
                	 if(!isPreloading)
                	 {
                			Loop.setValue(1);
                			Loop.changed();
                			
                                        LoopPanel.showControl(true);
                		     
                                        initAfterSampleLoad();
                	 }
                
                });
                

                If I remove initAfterSampleLoad(); the Loop Panel will stay visible, but, the loop functions are compromised. It will not stay within the sample range and the Loop will play at what seems like random loop points, or possibly the last saved loop points,

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

                  @trillbilly said in CustomSampleImport - Loop Panel Visibility:

                  initAfterSampleLoad()

                  Go into that function and find the part of it that is hiding the loop panel

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

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

                    @d-healey Yes I found this earlier and couldnt find anything except the Loop Button enabling the Sampler Loop Function. I tried removing that from the code but no luck. Do you see something maybe I missed?

                    I'll also check in the LoopPointDragger.js. This is from the SampleLoadSave.js

                    inline function initAfterSampleLoad()
                    {
                    	local id = Sampler1.getCurrentSampleMapId();
                    	
                    	isCustomMap = id == "CustomJSON";
                    	
                    	if(isCustomMap || id.length == 0)
                    		SampleMapLoader.setValue(0);
                    		
                    	// fetch the first sound
                    	sound = Sampler1.createSelection(".*")[0];
                    	totalSamples = 0;
                    	
                    	// if the sample map is empty, clear everything and abort.
                    	if(!isDefined(sound))
                    	{
                    		LoopPointDragger.updateLoopPoints();
                    		storeSampleMapData();
                    		return;
                    	}
                    	
                    	// We need this number for the loop point dragger.
                    	totalSamples = sound.getRange(Sampler1.SampleEnd)[1];
                    	
                    	local xf = sound.get(Sampler1.LoopXFade);
                    	local xfr = sound.getRange(Sampler1.LoopXFade)[1];
                    	
                    	// setup the non persistent UI controls
                    	local fadeValue = xfr > 0 ? xf / xfr : 0;
                    	Content.getComponent("XFade").setValue(fadeValue);
                    	Content.getComponent("Loop").setValue(sound.get(Sampler1.LoopEnabled));
                    	
                    	LoopPointDragger.updateLoopPoints();
                    	storeSampleMapData();
                    }
                    

                    EDIT: I see nothing in the LoopPointDragger.js that seems to have that function called except SampleLoadSave.initAfterSampleLoad(); which doesnt solve the problem if removed.

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

                      I just took a look at the script. Looks like you almost had it with the loading callback, but you need to turn the button on and call change, after the initAfterSampleLoad() function

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

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

                        @d-healey Ahhhh, its all about placement. Thank you. It seems that did the trick!

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

                        12

                        Online

                        1.7k

                        Users

                        11.9k

                        Topics

                        103.3k

                        Posts