Skip to main content

Topic: Simple way to extract track times from multiple files? (Read 1238 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • PaciPag
  • [*]
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"
  • Last Edit: 04 June, 2012, 01:28:41 PM by db1989

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
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.

  • derty2
  • [*][*][*][*][*]
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

  • PaciPag
  • [*]
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]


  • derty2
  • [*][*][*][*][*]
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.