HydrogenAudio

CD-R and Audio Hardware => CUETools => Topic started by: boombass on 2013-06-19 18:13:45

Title: CUETools template help
Post by: boombass on 2013-06-19 18:13:45
Can someone please help me with my formatting? I want CUETools to output a CUE file with a name like this:

    Eric Clapton - Crossroads (disc 1).cue

If and only if there are 2 or more discs in the set. If there is one disc, it should read:

    Dire Straits - Love Over Gold.cue

This is what I have for a formatting string, used in the Template box of the main window of CUETools:

D:\%artist%\[%year% - ]%album%\%artist% - %album%[$ifgreater(%totaldiscs%,1, '('disc %discnumber%')',)].cue

Where am I going wrong? Thanks!
Title: CUETools template help
Post by: korth on 2013-06-19 18:37:02
$ifgreater(x,y,a,b) is already conditional, you don't need the brackets [] around it.
Title: CUETools template help
Post by: boombass on 2013-06-19 20:38:39
Thanks korth! I've got things just about perfect now.

Thank you for your kind help!
Title: CUETools template help
Post by: boombass on 2013-06-20 04:01:15
Is it possible to remove templates from CUETools and CUERipper? I'd like to get rid of the ones that I don't use...
Title: CUETools template help
Post by: korth on 2013-06-20 13:42:24
You can't get rid of the 'stock' templates but you can delete ones you added. This can be done by editing the settings file(s) but you need to use caution. I'd suggest making a backup copy of each file before editing.

CUETools and CUERipper save the last state on exit so to avoid accidental re-saving make sure you don't have a template you want to get rid of selected. Exit both programs.

Run (Windows key + r)
%appdata%\CUERipper\settings.txt
%appdata%\CUE Tools\settings.txt

Find (might be easier if you turn 'word wrap' off.)
OutputPathUseTemplate

Delete the lines that contain the templates you no longer want.
Fix the numbering (important). Numbering starts with zero but may be listed in reverse order.
Adjust the total in OutputPathUseTemplates=

Save the file.

Code: [Select]
(The templates I no longer want I marked in [color=#FF0000]red[/color] for this example. Numbering is in [color=#A0522D]brown[/color].)

[color=#000000][b]before[/b][/color]
OutputPathUseTemplates=[color=#A0522D]6[/color]
OutputPathUseTemplate[color=#A0522D]5[/color]=mytemplate6.cue
OutputPathUseTemplate[color=#A0522D]4[/color]=mytemplate5.cue
[color=#FF0000]OutputPathUseTemplate[color=#A0522D]3[/color]=mytemplate4.cue[/color]
OutputPathUseTemplate[color=#A0522D]2[/color]=mytemplate3.cue
[color=#FF0000]OutputPathUseTemplate[color=#A0522D]1[/color]=mytemplate2.cue[/color]
OutputPathUseTemplate[color=#A0522D]0[/color]=mytemplate1.cue

[color=#000000][b]after[/b][/color]
OutputPathUseTemplates=[color=#A0522D]4[/color]
OutputPathUseTemplate[color=#A0522D]3[/color]=mytemplate6.cue
OutputPathUseTemplate[color=#A0522D]2[/color]=mytemplate5.cue
OutputPathUseTemplate[color=#A0522D]1[/color]=mytemplate3.cue
OutputPathUseTemplate[color=#A0522D]0[/color]=mytemplate1.cue
Edit: added color to example
Title: CUETools template help
Post by: boombass on 2013-06-20 18:47:25
Thanks again, korth. I really appreciate your clear answers.

I am also quite amazed and pleased that an amazing piece of software like CUETools is free. Now that I've got it configured the way I want, it is saving me quite a lot of time in my project. Very happy to have this.

Hopefully future releases will make it easier to delete unused templates. One more thing, I use different naming schemes for folders and tracks depending on if they are single artist (or predominantly single artist) CDs or various artists. Although CUETools allows me to change templates, I have found through experimentation that other settings are not template specific. So my custom naming scheme for tracks does not carry through. My fix is to have multiple copies of CUETools on my hard drive, one configured for single artists, and one for multiple artists. Not a bad workaround, but it would be much nicer to have this built in.

Nevertheless, I am very happy and grateful for this software!
Title: CUETools template help
Post by: korth on 2013-06-20 18:57:35
You can use 'profiles (http://www.cuetools.net/wiki/CUETools_Settings#.281.29_Profile_.7Bdrop-down_list.7D)' in CUETools that will store an alternate 'settings' file. New settings are saved in the profile on exit so you may need to restart CUETools several times (with that profile selected) to get the new profile setup.
Title: CUETools template help
Post by: ChronoSphere on 2013-06-20 19:13:56
Since this thread is about output templates, is it possible to do the following per templates?

- input: M:\some\folders\file.wav
- output: z:\some\folders\file.flac

Basically convert keeping folder structure but to a different drive/path prefix.
Title: CUETools template help
Post by: korth on 2013-06-20 19:46:34
Not that I'm aware of. String functions in the Foobar2000 Title Formatting Reference (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Titleformat_Reference) aren't used by CUETools and %directoryname% in CUETools is actually the same as %path% (the complete path to file including drive letter).
Title: CUETools template help
Post by: Gregory S. Chudov on 2013-06-20 21:43:59
Basically convert keeping folder structure but to a different drive/path prefix.

The best it can do is copy a certain amount of levels _up_ from the file, which can be kind of useless, but might work if your folder structure is very predictable.
Try something like
Z:\$directory(%path%,1,3)/%filename%
or
Z:\$directory(%path%,1,2)/%filename%
Title: CUETools template help
Post by: ChronoSphere on 2013-06-20 23:10:56
Yes, that does exactly what I want in my case, thanks.
Title: CUETools template help
Post by: boombass on 2013-06-20 23:49:18
I see the profiles setting now, and that works exactly as I hoped. Very similar to EAC profiles, and just what I need. Thanks again, korth, for teaching me how to configure CUETools!

Might as well try my luck with one more question. If I don't want to specify the output directory, but choose it at the time of conversion, how would I do that? How would I change my template string?
Title: CUETools template help
Post by: korth on 2013-06-21 14:47:44
The best it can do is copy a certain amount of levels _up_ from the file, which can be kind of useless, but might work if your folder structure is very predictable.
Try something like
Z:\$directory(%path%,1,3)/%filename%
or
Z:\$directory(%path%,1,2)/%filename%

Thanks for correcting me. I admit I hadn't tried string functions since 2.1.2 and didn't work for me then. Apologies to ChronoSphere for the misinformation.

Might as well try my luck with one more question. If I don't want to specify the output directory, but choose it at the time of conversion, how would I do that? How would I change my template string?

Sorry, I can't help other than suggest 'Browse' or 'Manual' output (no template string).
Title: CUETools template help
Post by: boombass on 2013-06-21 19:52:27
Sorry, I can't help other than suggest 'Browse' or 'Manual' output (no template string).


Not a problem. Thanks for all of your help!
Title: CUETools template help
Post by: Claudio Marcio on 2014-01-25 17:07:14
You can't get rid of the 'stock' templates...

CUETools and CUERipper save the last state...

Run (Windows key + r)
%appdata%\CUERipper\settings.txt
%appdata%\CUE Tools\settings.txt

...


Hi,
I run windows + r and type  %appdata%\CUE Tools\settings.txt ... Windows
asked to choose a program to open the file. I choose Notepad but it shows only the lines:

List of interfaces
   1 ........................... Software Loopback Interface 1
  13 ... 00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface


Why I do not see OutputPathUseTemplates command?

thank you
Claudio
Title: CUETools template help
Post by: korth on 2014-01-25 17:48:12
Sounds like you are using Windows 8? That shortcut works on XP-Win7.
You can try entering just %appdata% and navigate to \CUE Tools\settings.txt
Or to navigate to the file directly "C:\Users\{YourUserName}\AppData\Roaming\CUE Tools\settings.txt", you will need to have 'Show Hidden Files & Folders' ticked in the Folder Options of Windows Explorer.
Title: CUETools template help
Post by: Claudio Marcio on 2014-01-25 20:24:03
Sounds like you are using Windows 8?...
You can try entering just %appdata% and...
Or to navigate to the file directly "C:\Users\....


Hi korth,

My Windows is Win 7 ...
The problem is '%' character, e.g '%appdata%' don't work ... but
'appdata' works fine.


My cuetools not write files with the repair option ... he only checks
files and not write anything in the output folder. Why?

Appreciate your help
Claudio
Title: CUETools template help
Post by: korth on 2014-01-25 22:44:00
You've changed topics ([a href='index.php?showtopic=3974']TOS#5[/a])
Quote
My cuetools not write files with the repair option ... he only checks
files and not write anything in the output folder. Why?
Either the source could not be repaired or a non-supported Input (http://www.cuetools.net/wiki/CUETools#Known_issues) type was used. (2.1.5 is a little more flexible and allows you to repair from batch modes provided only one image is selected.)
Title: CUETools template help
Post by: Claudio Marcio on 2014-01-26 03:34:08
You've changed topics ([a href='index.php?showtopic=3974']TOS#5[/a])
Quote
My cuetools not write files with the repair option ...
Either the source could not be repaired or a... non-supported Input (http://www.cuetools.net/wiki/CUETools#Known_issues) type was used. (2.1.5 is a little more flexible and allows you to repair from batch modes provided only one image is selected.)


I use EAC with CTDB plugin to rip my CDs

I read an article on the internet saying that CUETools does not repair a second time because
of CTDB considers the file has been repaired, is this true?

what is batch modes?

I'll detail my situation:
1 - In the EAC, only TWO tracks are incorrect:
       7 | (1/1) Differs in 4880 samples @ 00:00:27 to 00:00:32
       9 | (1/2) Differs in 20 samples @ 01:28:44,01:28:57,01:36:13,01:37:06 ...

       which means (1/1) and (1/2)?

2 - How can I do to create a Cue Sheet in EAC only these two tracks
      to fix them in cuetools?

Can you help me again?
Claudio
Title: CUETools template help
Post by: korth on 2014-01-26 04:30:40
Quote
I read an article on the internet saying that CUETools does not repair a second time because
of CTDB considers the file has been repaired, is this true?

That depends on how many repair records are present for that disc in the database. If there is only one repair record then there is nothing to repair a second time. If more than one repair record exists and you think you selected the wrong one for repair, you can run repair again and select a different one. Note: You shouldn't discard the original files until you are satisfied with the repair result.

Quote
what is batch modes?

Did you follow the link?[blockquote]On discs with multiple entries, Repair function needs to display a window asking confirmation and presenting you with a choice of available repair targets. This window is currently only visible when Input: is set to Folder browser mode with a single file (or file grouping) selected. Batch modes (Multiselect Browser mode, Drag'n'drop mode or selecting an entire folder in Folder Browser mode) not supported.[/blockquote]Batch modes are also described in this section (http://www.cuetools.net/wiki/CUETools_Settings#.286.29_CUE_Paths_.7Bsection.7D) of the wiki.

Quote
I'll detail my situation:
1 - In the EAC, only TWO tracks are incorrect:
      7 | (1/1) Differs in 4880 samples @ 00:00:27 to 00:00:32
      9 | (1/2) Differs in 20 samples @ 01:28:44,01:28:57,01:36:13,01:37:06 ...

      which means (1/1) and (1/2)?

(1/1) 1 record out of 1. (1/2) 1 record out of 2. There is only one record in the database for track#7 but there are two different versions of track#9.

Quote
2 - How can I do to create a Cue Sheet in EAC only these two tracks
      to fix them in cuetools?

You can't repair with CUETools that way. You need input the entire CD for CUETools to find the record in the database.
Title: CUETools template help
Post by: Anakunda on 2014-01-26 07:27:24
Hi!!
Can anyobody provide me a resource describing what exactly macros cuetools support. The homepage says something about template syntax being exactly same as fb2k but that's not quite true as I encountered some macros working in foobar don't get parsed at all. For example %date% is never triggered or assigned the year value from album properties dialog. Don't know why but it's always interpolated as %date% to output structure. Thanks for help!
Anyway a complete overview of all macro bindings to album info dialog and functions supported would be much appreciated!
Title: CUETools template help
Post by: Claudio Marcio on 2014-01-26 17:09:13
Quote
2 - How can I do to create a Cue Sheet in EAC only these two tracks
      to fix them in cuetools?

You can't repair with CUETools that way. You need input the entire CD for CUETools...


OK korth... I created this new topic, as you warned me ... sorry
The topic title is: EAC Cue Sheet for repair in the CUETools   

Thanks for help!
Claudio
Title: Re: CUETools template help
Post by: hydrogenate on 2017-06-30 14:47:30
Hello Everyone

Could you please help me to construct a naming template to use when CUETools (CT) has to create a cue sheet from the album name? I file my albums in Windows, where the folder name of each album is preceded by the year the album was issued, for e.g. "1995. Album Name". Now, when CT creates the cue sheet, I wish that it should remove the portion preceding the album name, i.e. "1995._", so that the album name only is displayed in the cue sheet description, thus: "album name.cue".

Lastly, where do I find the cue sheet template in the settings file to edit, or do I have to add a new line? Is there anything that I should watch out for?

Thank you.
Title: Re: CUETools template help
Post by: korth on 2017-06-30 15:14:43
Not sure what template you're using now. A partial template for "\Year. Album Name\Album Name.cue" could be
\[%year%. ]%album%\%album%.cue

cue sheet template? Please provide more info on what you're trying to edit.
Title: Re: CUETools template help
Post by: hydrogenate on 2017-06-30 15:46:13
Not sure what template you're using now. A partial template for "\Year. Album Name\Album Name.cue" could be
\[%year%. ]%album%\%album%.cue

cue sheet template? Please provide more info on what you're trying to edit.


Hello, and thank you for responding Korth.

My bad about the "cue sheet" template. I meant the cue filename template.

Please ignore my message for the time being, while I try your suggested template.
Title: Re: CUETools template help
Post by: hydrogenate on 2017-07-01 18:31:51
I am sorry Korth,  have tried to do this on my own, but I just do not seem to grasp the basic principle to apply to get the desired result. Please allow me to try to explain again what I want to achieve: 

1. I want CUEtools to produce a cue file named after the album-folder. Usually, not always, the album (%year%) date precedes the album name. For example: the folder name is "2013. Album Name".

2. Using the above example, the folder name "2013. Album Name" should produce produce a cue sheet named "Folder Name" without the "2013._"

3. Is it possible to exclude any portion of a derived name in the final cue-file name, as described, and how is that achieved ? Is it by enclosing the portion to be excluded in the cue-file name, in square brackets, for e.g. [2013. ] ?

4. Where do I find to edit the applicable template to execute the foregoing ?

Thank you very much for you patience. I very thankful too, for your ongoing assistance.
Title: Re: CUETools template help
Post by: korth on 2017-07-01 21:58:01
The action 'Create CUE Sheet' is a simple tool that has no optional settings or template. A program such as Advanced Renamer (https://www.advancedrenamer.com/) can be used to batch rename files to the pattern desired.
If you're trying to create an output template for the action 'Encode', I will continue to try to help.
Title: Re: CUETools template help
Post by: hydrogenate on 2017-07-02 07:07:54
The action 'Create CUE Sheet' is a simple tool that has no optional settings or template. A program such as Advanced Renamer (https://www.advancedrenamer.com/) can be used to batch rename files to the pattern desired.
If you're trying to create an output template for the action 'Encode', I will continue to try to help.

I thank you very much- you have answered my question completely.  :)
Title: Re: CUETools template help
Post by: Cellfish on 2017-08-04 21:29:52
Hi!  I just signed up here and thought I'd tack on a template question I had.  On the first tab of "advanced settings", there is a "track format" template section.  I believe it defaults to: %tracknumber%. %title%
When an album has more than one disc, I've been changing it to: %discnumber%%tracknumber%. %title%
Is it possible to make %discnumber% conditional, so that it only appears in albums with >1 disc?
Example - I want my files to look like "201. Hey You.flac", in multiple disc albums, but no preceding disc number in single disc albums.

I was also curious whether it is possible to customize the "replacement character" used for invalid characters in filenames (\, /, :, *, etc.)  It replaces everything with a _ now.  I have taken a liking to using similar characters from the UTF-8 set such as ː instead of :, and  ̸ instead of /)
Title: Re: CUETools template help
Post by: korth on 2017-08-04 22:48:37
$ifgreater($max(%discnumber%,%totaldiscs%),1,%discnumber%,)%tracknumber%. %title%
This will add a discnumber of 1 only if totaldiscs = 2 or more and will add a discnumber of 2 or more even if totaldiscs is empty.

Character replacements would be nice.
Title: Re: CUETools template help
Post by: Cellfish on 2017-08-06 05:58:08
Thanks korth, that worked a treat! :)
Title: Re: CUETools template help
Post by: hydrogenate on 2017-08-07 09:12:36
Hi Everyone,

If indeed possible, how is CUETools set so that the individual tag track numbers contain a leading zero i.e. 01-09, whenever a single album track is being split into its components?