HISE Logo Forum
    • Categories
    • Register
    • Login

    How to control loaded samples with preset.

    Scheduled Pinned Locked Moved Newbie League
    12 Posts 3 Posters 63 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 @It_Used
      last edited by

      @It_Used said in How to control loaded samples with preset.:

      according to the idea, should be a single client with the ability to upload different sample packages to it

      You should use expansions for this. I don't quite understand what the issue is you are describing.

      @It_Used said in How to control loaded samples with preset.:

      I also don't fully understand how file search works

      Which file search are you referring to?

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

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

        @d-healey

        1. maybe I didn't quite figure it out, but I tried to use expansions, but to use them, I need to add them manually. in other words, I've already built the app, and I don't have any expansions available. Since it looks like you need to add them to AppData, that's the problem. i,m won't to use this folder all time. i need a freedom. And built-in expansions could be a solution for my problem.
          When I only used sepplers and ready-made sample maps that were embedded in my tool, everything worked the way I want it to.
          Situation with sampler state in different presets: see, i create 2 presets, before and after load sample map into sampler, and i if i change a preset - i do not see different, sampler state has no changed!

        2. i write about FileSystem.findFiles.
          my idea: find a samples by wildcard after change a sample path. if path contain nothing - see a warning message, else - load them.

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

          @It_Used said in How to control loaded samples with preset.:

          Since it looks like you need to add them to AppData

          You need to add the data files here, not the samples though.

          @It_Used said in How to control loaded samples with preset.:

          Situation with sampler state in different presets: see, i create 2 presets, before and after load sample map into sampler, and i if i change a preset - i do not see different, sampler state has no changed!

          Presets only store/restore the state of UI controls. Check out my video about changing sample maps with presets.

          @It_Used said in How to control loaded samples with preset.:

          i write about FileSystem.findFiles.
          my idea: find a samples by wildcard after change a sample path. if path contain nothing - see a warning message, else - load them.

          Can you show me an example?

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

          It_UsedI 2 Replies Last reply Reply Quote 0
          • It_UsedI
            It_Used @d.healey
            last edited by

            @d-healey

            1. Yes, that's what I meant, but maybe I'm using the wrong wording because I don't speak English. I ask you to forgive me in advance for possible inaccuracies and lack of information.
            2. I've watched almost half of your videos, but there's still a lot to come, thank you for your advice, maybe I'll change my approach and watch all your videos on the channel in full, and then I'll do something.
            3. No example, alas, this problem has stopped my progress. in the fact all is ready, samples and samplers have have the same names, or such, witch can be used in the for cycle, main work in the samples finding. The rest is not a problem to implement.
            1 Reply Last reply Reply Quote 0
            • It_UsedI
              It_Used @d.healey
              last edited by It_Used

              @d-healey
              Still, I was able to figure out how to search for files, but one thing is still not clear to me, I can't use my wildcard variables that could change, I have to search for all files, I can't make it so that only *.ch files are searched. (Hard solution are founded) and The most wonderful solution (Thanks D.Healey 💕)

              the example here is specific, but in general it turns off the buttons in real time, for vendors whose samples are not detected.

              	inline function checkSamples()
              	{
              		
              		// Declare find path.
              		local samplesPath = FileSystem.getFolder(FileSystem.Samples);
              		
              		// Declare files var.
              		local fFiles = [];
              		
              		// Resaults var.
              		local findResaults = [];
              		
              		// Find files.
              		fFiles = FileSystem.findFiles(samplesPath, "*", false);
              		
              		// Push files.
              		for (f in fFiles)
              		{
              			findResaults.push(f.toString(f.Filename));
              		}
              		
              		// Check files with wildcard
              		findResaults.every(function(arr)
              		{
              			
              			for (i = 0; i < instrType.length; i++)
              			{
              	
              				if (arr.contains(instrType[i]))
              				{
              					vSelector.btnVendor[i].set("enabled", true);
              				}
              				else
              				{
              					vSelector.btnVendor[i].set("enabled", false);
              				}
              				
              			}
              			
              		});
              		
              	};
              
              LindonL 1 Reply Last reply Reply Quote 0
              • LindonL
                Lindon @It_Used
                last edited by

                @It_Used said in How to control loaded samples with preset.:

                Still, I was able to figure out how to search for files, but one thing is still not clear to me, I can't use my wildcard variables that could change, I have to search for all files, I can't make it so that only *.ch files are searched.

                dont you need to search for .ch1 files? not .ch files...

                fFiles = FileSystem.findFiles(samplesPath, "*.ch1", false);
                

                HISE Development for hire.
                www.channelrobot.com

                It_UsedI 1 Reply Last reply Reply Quote 0
                • It_UsedI
                  It_Used @Lindon
                  last edited by It_Used

                  @Lindon no, no, for all ch in range ch1 to ch10, but i already find a solution. By move find to for cycle

                  	const fileExt = [];
                  	for (i = 0; i < 10; i++)
                  	{
                  		fileExt.push("ch" + (i + 1));
                  	}
                  
                          // Find files.
                  		for (ext in fileExt)
                  		{
                  			fFiles = FileSystem.findFiles(samplesPath, "*." + ext, false);
                  			
                  			// Push files.
                  			for (f in fFiles)
                  			{
                  				findResaults.push(f.toString(f.Filename));
                  			}
                  		}
                  
                  LindonL 1 Reply Last reply Reply Quote 0
                  • LindonL
                    Lindon @It_Used
                    last edited by

                    @It_Used yeah that would work I think.... ch10 ? - Grief how big is a single sample map ?

                    HISE Development for hire.
                    www.channelrobot.com

                    It_UsedI 1 Reply Last reply Reply Quote 0
                    • It_UsedI
                      It_Used @Lindon
                      last edited by

                      @Lindon This is still a fairly small size, when I converted all the samples to Multi-Mic, parts of the ch files there reached 10 and then the letters ADCDEF were added.

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

                        @It_Used Try *.ch*

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

                        It_UsedI 1 Reply Last reply Reply Quote 1
                        • It_UsedI
                          It_Used @d.healey
                          last edited by It_Used

                          @d-healey oh shit this work... How did I not come up with such a simple solution? 🤣
                          Thanks again! 💕

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

                          19

                          Online

                          2.0k

                          Users

                          12.6k

                          Topics

                          109.6k

                          Posts