hi i have renoise.app().window:select_preset(8)
and i’m wondering, what would be the method of writing to that specific preset 8, the desired content? i.e. if i incorporate a “preset 8” saved as a file, how do i force the selection of said preset?
can i overwrite config.xml content somehow? or what’s the way to do this?
Maybe select that preset then use the API to to set property values on the device fields.
You could use the Document object to read and write the data; this get stored in the tool folder. Include the document (an XML file) with your tool.
You might want to not use a specific preset number value and instead get the number of the next unused preset slot so you don’t overwrite someone’s own settings.
did you say property values on the device fields? thing is, the Disk Browser Focus (which tab is it, Songs, Instruments, Samples or Other) cannot be set by API, which of course, is unfortunate.
the “get the number of the next unused preset slot” would kinda defeat the purpose of using presets in the first place, i.e. going “this shortcut opens this preset with these settings and this focus”. obviously the best solution would be to be able to control all of the focus + settings + tabs with API, then there’d be no need for trying to swindle in presets to enable one to get specific types of control with the UI
i’m not entirely sure where you got the “why do you need the disk browser to change device values” part of your question, i’ve tried to look at my previous writings and don’t see anything about device values…
since this, taktik has given me a nice tip, which is, i need to quit Renoise, make the modifications with a script, and restart Renoise.
For me, I need a way to swindle in specific Presets, with a script, and press a very destructive button to get those Presets back. Same as I’m doing with KeyBindings. I think I have something to the tone of 100-150 shortcuts. I want to have a KeyBindings.xml inside the script itself that i can bang out and have those shortcuts be automatically bound to the keys that “they should be in”.
One minor thing I got working today, was, a Menu Entry that runs a script, which forcequits Renoise, modifies Config.xml to enable Scripting Editor, and restarts Renoise. if I run it again, then the thing is reverted.
I’m hoping to next be able to figure out where the Config.xml is placed in Windows, Linux and macOS, and identify which OS Renoise is running in, so that can run a specific bash script or another script, and make the modifications.
Overall the concept here is to get better control over what I’m trying to accomplish with Paketti. So many people come at me going “can ya share your KeyBindings for the ImpulseTracker shortcuts?”, well, now i can go “press this button and there they are”.
My point was: don’t do this with a Renoise tool. It may be possible to kill Renoise from a Renoise tool, but that’s not something you want to do unless you’re doing it for yourself only - in a tool that only you use.
Share your key bindings file with others, so they can install/overwrite it manually, if they really want to.
Or give them a hint how you are using them (default, recommended key bindings).
i think there will be a way of adding shortcuts to keybindings.xml in a nondestructive way (not overwriting but adding). and yep i guess i’ll have to have a hidden debug tool for myself that lets me do things in a destructive way.
i’m currently incorporating the keybindings.xml file inside Paketti itself, and will i guess have some sort of pointer to it that people can press a button and access the folder where the file is. still working on the logistics of this.
i’m hoping eventually there will be a way of “adding lines” with a y/N prompt / dialog, per line, so that people can map the ones they want and not the ones they don’t want. maybe checkboxes. but before that, i gotta figure out a way of outputting all the shortcuts that are available in Paketti, into a GUI, and then have checkboxes for enabling + disabling them. and the default recommended keybindings.