Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Simple way to extract track times from multiple files? (Read 1958 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Simple way to extract track times from multiple files?

Hi all.

I've been digitally transferring a lot of recordings lately, and have been creating simple liner notes for future reference.

One thing I've been wanting to include in these notes is track timing - but typing in each individual track's timing by hand gets very, very tedious very, very quickly

Is there any program or plugin that will let me highlight a group of .FLAC files, maybe do some right clicking, some left-clicking, a drop down menu or whatever, and end up with a bunch of individual track times in my clipboard?

I know foobar can give a "total playtime", and I can manually go to each track one-by-one and get the track times one at a time via properties, but neither one of these methods is exactly ideal. Going through each track one at a time involves a lot of tedium (the quickest method is highlight track, alt+enter, four tabs, right arrow, tab, down arrow seven times, control-C - and after all that, you still have to manually edit "Duration : 51:25.693 (136079076 samples)" into something more tidy, and manually round up when the .HHH is > 499).

Thanks in advance for any ideas!

[—]

And before anyone asks "what kind of single song lasts for over 50 minutes", the song I used for the example is Acid Mothers Temple's "IAO Chant from the Cosmic Inferno"

Simple way to extract track times from multiple files?

Reply #1
Is there any program or plugin that will let me highlight a group of .FLAC files, maybe do some right clicking, some left-clicking, a drop down menu or whatever, and end up with a bunch of individual track times in my clipboard?

I know foobar can give a "total playtime", and I can manually go to each track one-by-one and get the track times one at a time via properties, but neither one of these methods is exactly ideal.

foo_texttools sounds like exactly what you want.

Simple way to extract track times from multiple files?

Reply #2
I am a foobar2000 user, and I wanted a solution for such a task once upon a time, and I solved it like this. . .

- Add a third-party component to fb2k named "Text Tools" (foo_texttools).
Text Tools allows you to copy formatted text info to the clipboard from the context menu in the fb2k Playlist Viewer.

- Create a title-formatting pattern for Text Tools (fb2k preferences -> Tools -> Text Tools)

Try this title-formatting pattern:
Code: [Select]
$if($and(%discnumber%,%tracknumber%),%discnumber%'.'%tracknumber%'.',$if(%discnumber%,%discnumber%'.##.',[%tracknumber%'.']))' '$if2($meta(title),%filename%)'          '$if(%_length%,$iflonger(%length%,5,$left('00:00:00',$sub(8,$len(%length%)))%length%,$right('00:00:00',$sub(5,$len(%length%)))%length%),)


Select tracks in your playlist viewer,
Right-click context menu -> Utilities -> Text Tools

Example output of 6 tracks selected in the playlist viewer,
and choosing the above title-formatting pattern from the Text Tools context menu
and pasting into a text file...
Code: [Select]
01. Fun          07:44
02. Games          08:02
03. Mercy, Mercy, Mercy          05:11
04. Sticks          03:59
05. Hippodelphia          05:51
06. Sack O' Woe          10:34

Simple way to extract track times from multiple files?

Reply #3
I am a foobar2000 user, and I wanted a solution for such a task once upon a time, and I solved it like this. . .


Oh wow, absolute genius! Exactly what I was hoping for. 

I'm not too great at parsing wildcards - how would I go about changing the output text to be "<track#>._[title]_[<time>]" (with the underscores each being a single space character) - in other words:

Code: [Select]
01. Fun [07:44]


Simple way to extract track times from multiple files?

Reply #4
So basically you want the same pattern as before but with one space between elements and square brackets surrounding the duration.

Firstly, I would like to point you to the foobar2000 title-formatting reference (fb2k main menu -> Help -> Title formatting help)
and near the bottom of the page there is info on usage of the square brackets and single quotation marks.

In a nutshell... the square bracket normally is a conditional display modifier of other syntax expressions, but it also can be modified to display itself by
surrounding it with single quotes.

Try this new title-formatting pattern:
Code: [Select]
$if($and(%discnumber%,%tracknumber%),%discnumber%'.'%tracknumber%'.',$if(%discnumber%,%discnumber%'.##.',$if2(%tracknumber%'.','##.')))' '$if2($meta(title),%filename_ext%)' ['$if(%_length%,$iflonger(%length%,5,$left('00:00:00',$sub(8,$len(%length%)))%length%,$right('00:00:00',$sub(5,$len(%length%)))%length%),'[ ... ]')']'


For learning purposes, I suggest you copy-paste the old pattern and the new pattern into a <text file> and have a look at how they are different to each other.
Take note of how I am using single quotes and the square brackets.

If you want to write complex formatting expressions yourself, then you really need to use a text editor which has syntax highlighting.
I use Notepad2-mod myself (it doesn't need installation, grab the zip package).

To see what I mean, Change your <text file> file extension from .txt to .js
run Notepad2-mod and open your <text file> ,
click next to a parenthesis bracket and notice how the brackets work in open-close pairs and change color to bold red.
remove a single quote mark and notice how the the text colors change,
..the green text is a block of text between start-end single quote marks,
..the black text is a syntax operator,
..the purple text is the syntax operator boundaries.

Good luck and goodbye.