New Tool: New from Template (2.8, 3.0)

I’ve released version 0.6 of “New from Template”

Download: http://neurogami.com/renoise-tools/com.neurogami.NewFromTemplate.xrnx

Source code: https://github.com/Neurogami/renoise-ng/tree/master/lua/com.neurogami.NewFromTemplate.xrnx

How it works:

You need to set up a directory on your machine to hold template songs. (These are just Renoise songs, each set up however you like. Use descriptive names for the files so it’s easy to tell them apart.)

When you install the tool you get a Tools menu item, “Neurogami New from Template” that has two sub-menus: “Configuration”, and “New from Template”

You need to configure the tool before using it by providing the path to your song template folder and the path where new songs are to be created.

When you select “New from Template” you should see a drop-down list of the songs on your templates folder. You select one, and provide the name for the new song. You can omit the “,xrns” extension as the tool will add that automagically.

If all goes well the selected template song will be copied over to your new song folder using the file name you provided.

If a file of the same name already exists there you should be prompted to OK overwriting or canceling the operation.

After a new song is created it is then be loaded into Renoise.

If you have a song already open in Renoise with unsaved changes you should be prompted to save them before the new song gets loaded.

I’ve tried it out on OSX, Windows, and Ubuntu and it seems fine (i.e. works for me.) However, it is new and there are likely edge cases that will bork it.

Enjoy!

Update: I’ve updated the tool (now at version 0.8) so that it adds the menu under “File” instead of under “Tools”.

Update 4 May 2015: The tool has been updated (v0.9) to check the folder paths in the configuration, and show a (hopefully) nicer error message if the paths cannot be found.

Update May 5 2015: Version 9.1 has been uploaded here. It adds some configuration checks to try to warn the user when there are no templates or other data are missing.

I’ve updated the tool so that the menu item is added under “File” instead of “Tools”. Seems more sensible. (Got the idea from @Jurek’s Quick Template tool.)

Thanks very much for your scripting!

I get an error message with this script and I’m a noob. Is this normal??? Error message is in the attachment…

Thanks, that’s a nice touch to have it under the File menu.

Thanks very much for your scripting!

I get an error message with this script and I’m a noob. Is this normal??? Error message is in the attachment…

The error message you posted is for a different tool, not the “Neurogami New From Template.” But I believe you also got an error about the save-to location when you tried my tool

At the moment my tool ships with a path set for the “save to” location. Since I wrote it I set a path that works for me. : )

(In fact I was coding/testing so often I got tired of having to set the config, so I just hard-coded it to something that worked for me. And then I forgot, since it worked for me.)

Now, for public release, “Works for me” is not really the best approach, so I need to change it such that the installation has (most likely) no path, or an obviously bogus path (e.g. “YOU/MUST/CHANGE/THIS!”).

And then have the tool always check that all paths being used refer to existing locations. And if that is not the case, politely ask the user to check their configuration settings.

In the mean time such an error should be fixable using the Configuration option to change the “save to” path to a directory path that exists on your machine. (Same for the templates location.)

Appologies for the misunderstanding. I changed the full path to an existing folder. I think I’m an idiot or something because I can’t seem to save and recall templates still…

I get this Scripting Tool Error when I create and close

Both paths have to be complete paths. You cannot use just a directory name.

I get the same message. Uninstalled the other tool as well. Guess I’m just not having the best luck/skill or whatever…

I get the same message.

The same message as what?

What is the path you have for “New file folder”?

Same as “template folder”

I have to look into this. I wonder if the spaces in the path name is causing a problem.

I have to look into this. I wonder if the spaces in the path name is causing a problem.

I just hope I’m not waisting your time

I just hope I’m not waisting your time

No, I want this to work for people other than myself.

I’ve uploaded a new version (see the top post) such that it checks for the existence of the template and new file folders, and if either of them cannot be found it tells the user.

I also changed the default folder configuration to obviously bogus values.

Got this now from the “Attached File”

Got this now from the “Attached File”

I need to know the exact sequence of actions that lead to this message.

I cannot reproduce the error… Even if the configuration file is missing, or the values are empty, I get a message telling me that I need to fix my configuration. But I’m not getting an error. I need to know what you did so I can try it myself.

I need to know the exact sequence of actions that lead to this message.

I cannot reproduce the error… Even if the configuration file is missing, or the values are empty, I get a message telling me that I need to fix my configuration. But I’m not getting an error. I need to know what you did so I can try it myself.

-open renoise

-check configuations which is set to Templates Folder: C:\Users\Windows 7\Documents\Renoise 3.0\Templates and New Files Folder: C:\Users\Windows 7\Documents\Renoise 3.0\Templates

Note: the folder properties keeps resetting to read only for some reason

-Open New From Template

-Type “Test” under New File Name

-Click Create and Close

-open renoise

-check configuations which is set to Templates Folder: C:\Users\Windows 7\Documents\Renoise 3.0\Templates and New Files Folder: C:\Users\Windows 7\Documents\Renoise 3.0\Templates

Note: the folder properties keeps resetting to read only for some reason

-Open New From Template

-Type “Test” under New File Name

-Click Create and Close

When you try to create a new song, are you seeing yourtemplateslisted? Are youspecificallyselectingone?

They way it should work is that, by default, the first template listed is the one that is automatically selected. So there should never be a nil or empty template. If there are no templates then I suppose none would be shown (something I hadn’t considered).

I’m adding code to check that both the template name and the new file name are not empty before attempting to create a new song. (If either is found to be empty then the code will tell the user about it instead of trying and failing to create a new song).

Odd that your folder keeps getting reset to “read only”; there may be some folder permission thing going on that further complicates things.

I have updated the tool (see the top post) so that it tries to catch empty or missing data.

There were no templates. I copied a song to the template folder and saves templates fine now.