<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with files]]></title><description><![CDATA[A list of topics that have been tagged with files]]></description><link>https://forum.hise.audio/tags/files</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 14:39:42 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/tags/files.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[Snippet : How to filter files in a browser]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I thought about sharing something with you all, and adding my humble contribution to our snippet library.<br />
I'm currently working on a new project that will include midi files. I built a custom browser to list and play them but I needed a way to allow the user to sort these files, either by type, tempo, length, etc...<br />
So this snippet is built to sort midi files, but obviously you'll be able to modify it to sort other file types.</p>
<p dir="auto">It's not that complex but I tried (read: banged my head) to find the best and most condensed way to do this, so here's my method.<br />
If you got a better solution, feel free to share !</p>
<pre><code>const MIDIPlayer1 = Synth.getMidiPlayer("MIDI Player1");
const midiFiles = MIDIPlayer1.getMidiFileList();
const lblDisplayFiles = Content.getComponent("lblDisplayFiles");

// I'll leave you the task of handling how you want to add filters to this array... :)
// For this example you can do it manually, but you can add as many filters as you want.
const filterArray = ["2bars"];

/* --------------

We'll assume a file-naming system like this : 
"FileName_Type_Feel_Tempo_Length"
i.e.: "MidiLoop1_Groove_Straight_120bpm_2bars.mid"

What we want is to get all files that match one or more words that we'll call 'filters' 

The function goes like this : 

	1 - We'll push the midiFiles array into a local array f.
	2 - The result of each filtering iteration i will be stored into another array into f.
	3 - We'll iterate through f as many times as there are filters.
		
i.e. if there are 3 filters, we'll end up with : 

f[0] = allFiles;
f[1] = allFiles - filteredFiles_1;
f[2] = filteredFiles_1 - filteredFiles_2;
f[3] = filteredFiles_2 - filteredFiles_3;
filterResult = filteredFiles_3;

-------------- */

inline function filterFilesLoop(files, filters)
{
	// Start with f[0] = all midi files: so we begin to filter all available files.
	local f = [midiFiles];
	
	// This will contain the filtered files that we want the function to return.
	local filterResult = [];
	
	// Check: if there are no filters
	if(filters.length == 0)
	{
		filterResult = midiFiles;
	}
	else
	{
		for(i = 0; i &lt; filters.length; i++)
		{
			// Add as many empty arrays as filters
			f.push([]);
			
			// If the filter exists
			if(isDefined(filters[i]))
			{
				// Go through each file of f[i] to check if the file contains the filter
				for(j = 0; j &lt; f[i].length; j++)
				{
					// if the file contains the filter
					if(f[i][j].contains(filters[i]))
						// Add the file to the next array, which will be analyzed further to filter the files even more
						f[i+1].push(f[i][j]);
				}
			}
			// the resulting array must be the last one, no matter how much filters are used
			filterResult = f[i+1];	
		}
	}

	lblDisplayFiles.set("text", trace(filterResult));
	return filterResult;
}

// Calling the function...
const filteredFiles = filterFilesLoop(midiFiles, filterArray);
</code></pre>
<pre><code>HiseSnippet 1859.3ocsXs0aajaEdF4nsUS6VzEnO1GHzKQdiihjbtA6l1jXYGnVmDCKuaKfgg.0LbzvXNjpb3XG0Eo+P5ux9On8bHmYzL1dS85zU.9B44B+NW4g5HsJjkkozd9cNY0Rlm+ut8zURSxdITtzaxXO+eW62NY7DxAbAKiLUoMb4BuWuZIMKiE446uwaPN86bOO6m+8e50TAUFxVukm22q3grC4oby5cO5k+EtPb.MhcBOsF2O9kSBUx8TBUNfpMZOvaIM7b5B16nHasZ64+U6GwMJ8TC0vx77u2qUQqllntT53+64Y74BFtXn2TPQtsOPIhPDi65sWBWDcTo0m4AZ4n09hMb9Bvz4Q7p8W6S9sVBj0RT2e32pI71nA7FVGdCpAua.RspAoeQY3wBIAcESagxuwEdb6LrAP1KWqYRyT1eOmck.RAoSzfqsdr6PkZ49RJ.un5aiZeNv5zkrlD723VaqC+r1pGZV1bLL0XsYeOmY+MsmFp4KMqof19up8DogoiofwU2vc7505e1o8dJfCooeJ8b1AZXQkD8d5fAaQfes4tAAPFWlgfdxBGI4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4IgR5DNXck8XnRpX0+.yqx01FLqycKUBbw0ELosIZwo.H4ACOyECJPkKPfg9heAHwT0vC6v45bklCWJMmYoInv+Csn2By5fF13gh2ullW0ZLylTlCSfXC6Wod2Bicwv+mvrNHgu4E68yXvs8Fv36tEAtRAFOotJ1DAsqXoQQxtAftpJnTx2oLr2K6Y6E.jHWkTb7MRCm8PqDBX.mahLNet9yIXOYd5bldKxETQNqhQX5slSG191McXnaTnZLpjSjby6Wxj+Xiu6UL+D7ee2jwTCEFe1uXOfukL3cKHD7Gyt.dKhapxNsGyxN2nVZ4sXnKXaik5WWLy4gz4LgGOBmB8JgMuOtdX3+3KWUeAFK8ZIa09z.Bo6Obzwu+Ou+dmL6f2e338O9SXCbxECGL35yQ7jqLGwVeF4G8ruH42dzWj3O8weQh+7uHoekPbGkGmya6YSvL20h9rmeKk7IyfHu3mnfGOVmmBEQUHNIONVvlMb3feJRWf4eLgCNy6RdjIAJz7+8s77RXHBwU+KeOOpfuPlZSv+p1BVrwiAEmTa8m+F2vatfG4phxETSyW9hO2uf.zDnw6tv2VIy3lUMdh3+udN7sEheS6i3vH02LFacCXDeo8OCXr3KQ3qauebLKzrFf2q8A+sed9FC7NVkiWg8VpQygdSseWd5TUtNjAmtTBy5fYCsv1kt0Cv0nGXJL4rcw+A9TPbHt1uf3vRhdozPHKLz05G+ZJ9k1c.LIseCMcZ+VbMYnm85f59Yb1qYggMU00DbzcUvsuqB936pfO4tJ3SuqB9r6pfO++sf3qaeUtQk5Ja77d6Q6auK02u5KEBZU7eA7rNWPK
</code></pre>
]]></description><link>https://forum.hise.audio/topic/10227/snippet-how-to-filter-files-in-a-browser</link><guid isPermaLink="true">https://forum.hise.audio/topic/10227/snippet-how-to-filter-files-in-a-browser</guid><dc:creator><![CDATA[Matt_SF]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Tip for those of us hosting files on S3 - use Bunny instead]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/831">@DanH</a> said in <a href="/post/97971">Tip for those of us hosting files on S3 - use Bunny instead</a>:</p>
<blockquote>
<p dir="auto">Would you mind DM-ing me too please? Guess it possibly doesn't bode well for the future though...</p>
</blockquote>
<p dir="auto">Yeah I'll send it across. If they don't respond I'm just going to post the plugins publically (they're GPLv3). Unless Bunny changes their API or Wordpress significantly changes, there isn't much that could cause the plugin to stop working and it doesn't look like too complicated a plugin so I could probably fix it anyway.</p>
]]></description><link>https://forum.hise.audio/topic/10113/tip-for-those-of-us-hosting-files-on-s3-use-bunny-instead</link><guid isPermaLink="true">https://forum.hise.audio/topic/10113/tip-for-those-of-us-hosting-files-on-s3-use-bunny-instead</guid><dc:creator><![CDATA[David Healey]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>