New Tool (3.0): Quick Template (v0.2)

Here is a simple Template helper.

You can choose a template folder (in tools menu), were you can place template XRNS files (also outside from Renoise, adding templates in explorer or finder). These files will be simply displayed in a menu under File->Quick Template. I was not satisfied with the one-template-solution of renoise. Some code based on Neurogami’s NewFromTemplate found below.

What’s currently missing:

  • Notifier/observer on file renaming, deletion within Renoise disk browser.

UPDATE 03-May-15:

v0.2 now has proper new file naming (it saves the new song to “new project” inside the template dir. This file will not be listed).

v0.2 fixed path bug message

Attachment 5621 not found.

Also check out Neurogami’s “New from Template” Tool. It might be the better solution for you:https://forum.renoise.com/t/new-tool-new-from-template-2-8-3-0/42850

As for renaming the template after loading it:

https://code.google.com/p/xrnx/source/browse/trunk/Documentation/Renoise.Application.API.lua#120

… should do, i think.

You’ll probably have to attach a renoise.tool().app_new_document_observable before loading the template, and then save under a new name from within the observable function tho (and remove the observable).

As for renaming the template after loading it:

https://code.google.com/p/xrnx/source/browse/trunk/Documentation/Renoise.Application.API.lua#120

… should do, i think.

You’ll probably have to attach a renoise.tool().app_new_document_observable before loading the template, and then save under a new name from within the observable function tho (and remove the observable).

But then the user needs to define some default save path in the tool, right? That would complicate things.

But then the user needs to define some default save path in the tool, right? That would complicate things.

That’s how my template tool works. The user needs to config the paths for where templates are stored and where new files are put.

The renaming happens when you opt to create a new file; you provide the new file name before it gets created and loaded.

BTW, if anyone has questions about my code please drop me an email and I’ll try to explain it.

I have to look into adding a menu item under Files, too.

My tools can be found here:http://neurogami.com/code/

Hey neurogami, I didn’t want to critize any of your work which I find very helpful and awesome, I just wanted to say that I see this point different. No need for a auto pre-saved new newfile here. ( I understand there is no other way to rename the current project), since I also save projects in multiple folders. Maybe I try to build a new xml song document from a song file and then copy all stuff to the current song. No clue, if this is possible. Then only partial imports from a template would be possible, like: reverb setup from “2x3 layered ambient reverb” + drum bus 80s + master analog compressor

@Jurek is this like a quick loader? If I do a “quick template” then it opens the file and marks it as modified… and if I save it, it overwrites the original file. Is that what it’s intended to do? And I need to do a “save as” to save it as a different file?

Hey, you are right, it currently only lists the contents of the dir. Sadly there is no way to rename a project after loading using lua. The only (for me) wrong way is to save the new project to another name/path via lua. Then I would have to add a default song save dir to the prefs, which makes in my case no sense, since I always use subdirs for projects. I can add such default save to prevent template overwriting… It’s just absolutely not satisfying. A renaming function / set save path function without saving would be much better. But as someone lately wrote here, such feature requesting is like farting in the wind.

Do you think I should add a default save path, so it will be saved to path/new_project.xrns ? I guess Then neurogamis tool will work, which nearly does the same. Edit: hm no I think I will write it as “new_project” to the template dir and will prevent “new_project” from being listed. Then you won’t overwrite the template accidentily at least.

I would also then add subdir support, so the quick load submenu can have sub subs.

The best would be obviously some LUA function like “set_song_state_unsaved(true)” or “set_song_path(”")" or something, so that on pressing Apple-S / Command-S a file save dialogue would appear just like the song was completely new and never saved!

Do you think I should add a default save path, so it will be saved to path/new_project.xrns ? I guess Then neurogamis tool will work, which nearly does the same. Edit: hm no I think I will write it as “new_project” to the template dir and will prevent “new_project” from being listed. Then you won’t overwrite the template accidentily at least.

The best would be obviously some LUA function like “set_song_state_unsaved(true)” or “set_song_path(”“)” or something, so that on pressing Apple-S / Command-S a file save dialogue would appear just like the song was completely new and never saved!

I don’t think you need to add a default save path… as you say, it would then be pretty much the same as the other tool.

But yeah, what I want to see for multiple templates is what you wrote in bold: for a “new from template” project to be unsaved, and prompt for the file name upon the first save. Hopefully taktik, danoise and crew (who else is on the dev team? I only think of those two) will look into this given that it’s a common feature request.

Thanks for sharing!

updated, see 1st post

I like the idea of having the “new from template” menu under the “File” section so I’ve change my own template tool to do that as well.

https://forum.renoise.com/t/new-tool-new-from-template-2-8-3-0/42850

Thanks very much for scripting!!!

I’m getting a Scripting tool error message when I install the script. Is this normal???

Thanks very much for scripting!!!

I’m getting a Scripting tool error message when I install the script. Is this normal???

Hey, thanks for reporting! Hopefully fixed that now. Please download again from 1st post.

Installed smooth like butter now :badteeth:

But after configuration under file menu and tool menu (default folder was used) I got this message:

But that’s Neurogami’s tool. Think you can fix it by open his config.xml and edit your path there or set it to an empty string.

You have to setup a dir. Default dir is my own I think.

Installed smooth like butter now :badteeth:

But after configuration under file menu and tool menu (default folder was used) I got this message:

That’s my tool.

Did you use the tool’s configuration option to set it to an existing directory?

I need to add better error handling to tell users what to do if things are blowing up.

Or think of adding a splash screen or something.