Tagging Presets?
-
Hey!
I’m trying to figure out how to tag my presets and am stumped.. basically, my custom preset browser is based off of a filesystem structure in the userpresets folder. There’s two levels of folders and then the actual .preset files. I was wondering how I could attract tags to these preset files. Ultimately, I’d want the tags in these oval like bubbles in the browser that when clicked on, they will show all presets with that tag, any ideas?
Thanks!
-
@Casmat Write your own tag database in a json file you read at start up...and maintain in your custom preset browser...
presetTags = [ { PresetName : "MyFavourite", PresetTags: ["Red", "Bassey", "Favourite", "Whatever"] }, { PresetName : "MyLead", PresetTags: ["Red", "Lead", "Green", "Whatever"] }, ];
-
@Lindon good idea! But wouldn’t this mean that I have to put in code that runs in every situation a user can import/save a preset? Is there a method where the tags themselves are stored within the preset file?
-
But wouldn’t this mean that I have to put in code that runs in every situation a user can import/save a preset? Is there a method where the tags themselves are stored within the preset file?
Yes, there is a built in tagging system in the preset browser, but the UI for it needs some love @Christoph-Hart any chance of opening this up more within the scripting API? Also an expansion tagging API would be nice. :)
-
@d-healey @Christoph-Hart definitely need this, in my case, I can see myself just using a addTag/deleteTag for preset files and be able to take those tags and store them in a collective database kind of like how @Lindon mentioned
-
to do this, I have included my tags in the preset name. Then, I coded a loop in the UI to display only the presets that match the selected tags. You can modify the preset name using the following code:
string.replace("someTag", " ");
This will allow you to display only the preset name. To rename a preset, you can use "file.rename."
Example :
"Godin cinematic orchestral violin.preset" -
Now that I think about it, the file API and some string manipulation could probably allow you to hack your way to tagging the presets. I'll have to try this.
-
@d-healey said in Tagging Presets?:
Now that I think about it, the file API and some string manipulation could probably allow you to hack your way to tagging the presets. I'll have to try this.
sure - but why? Isnt it easier to "just" build a database of tags/presets in some json table?
-
@Lindon Well I have two reasons, I like everything to be self contained if possible. I'm using the stock preset browser which already supports the built in preset system.
-
@Lindon hold on, with your method, are the preset files w/ tags locked into place? If a user saves a preset and chooses their tags, then its saved into that json file, if they decide to share the preset with others, the other party wouldnt be able to view the tags, right?
-
@Casmat unless you send the tags too
-
@Lindon ok!
-
@d-healey can the xml be directly modified using the write/load as xml and adding some tags that way? Thought about this but was wondering if hise would complain with the modified format
Thanks!
-
@Casmat The xml editing functionality of HISE is very limited. I'd just use regular string manipulation functions to get the tags, change them, and rewrite them back into the file.
-
@d-healey what do you mean by rewriting it back into the file?
-
-
@d-healey Never thought of using that with xml files!! Thanks Daviddddd!!!! I thought I'd have to put them in the file name haha!