basic info: it's lua script for use with foo_lua foosion's plugin, which is unsupported atm (refer to text bellow for additional information)
current version: "Mazy's Tag Guesser, version 0.01, 31-12-2003", preview version available
older info: here, here and here.
screenshots: 001: before after, 002: before after, 003: before after, 004: before after
problems: it doesn't support unicode correctly (may change somewhere in the future)
what it can do:
- compute special tags with additional information about album etc. (not in realtime, you have to run it as it is now. it may become context / main menu item in the future or maybe even more ...)
- guess missing / invalid tags from other fiels, filename, directory etc.
- recognize multi-cd albums
- correct tags (this comes handy for tag-guessing and for ppl with 'scene releases')
- ... and more ;)
- much more advanced formatting strings (you know exactly number of tracks, whether artists differ or not, it adds %lasttrack% automatically for those strings that use it etc.)
- formatting strings could disable their own guessing and correcting when they detect track processed by this script (tag %mtg%) and save some processing power ;)
- you don't have to bother yourself and leave most work on it
- you can use all these tags in plugins like foo_dbsearch to select albums longer than some time etc.
latest info / development: i have been thinking about universal way of giving users way to do full path guessing, so that would be next.
from the file:
QUOTE
mazy-tag_guesser.lua
Use with foobar2000+foo_lua (made by foosion).
Runs over selected items in playlist, select whole albums.
(i.e. it's ok to select multiple albums, just select all tracks from every album)
Type: main menu command
** mazy's tag guesser, for use with mazy's formatting string **
send / post suggestions, requests, modifications, bug reports etc. to
mazy -at- centrum -dot- cz (start subject with 'mazy's tag guesser: ' or i won't see it, thanks)
or
hydrogenaudio.org forums
i would be glad to hear from you.
-- mazy
CHANGELOG:
+ directory guessing added (not a path one though), patterns used are for my naming scheme (which is 'artist - album (year) (bitrate) (..) (..) ...'). it may work for you as it is
NOTES:
1) this is focused on i) tag correction ii) tag guessing iii) album information counting / retrieval
2) my situation is that i use mostly stuff which i do not want to retag (for my reasons), however i needed
to correct issues with not properly tagged files + i wanted to have additional information (like album tracks, real
average album bitrate etc.) + i wanted some tag guessing from filename / directory
i've realized i can live without saving tags and using only database, because i'm going to make
my own album oriented tag saver / loader from additional file
3) this script tries to do many things by itself, you can fiddle with settings or correct results by hand ;)
4) right now, it desn't support guessing from more than one folder (so you can't do something like '\artist\album\'),
i may fix that for ppl who need it (send me your naming schemes)
NOTES FOR TESTING / TESTERS:
-- this is still work in progress, very experimental right now, undergoing testing and bug hunting ;)
-- for editing, you may try 'titmouse' (you would need to get some additional files for it, as described on its page)
1) get 'foo_syfm' plugin and copy my testing formatting strings to your 'configs' subfolder (files 'default-new-test-<1..3>.fb2k')
2) bind these formatting strings to shortcuts for quick changing (i use ctrl+<1..3>)
3) prepare playlist for testing:
a) add full albums, use no sort (you need them to be sorted as they should, track by track)
b) try using albums without tags, scene releases, all kinds of naming schemes etc ...
4) IMPORTANT ! - disable tag writing to files (preferences->database->don't write modified tags to files)
and maybe even remove some database context menu items (database/remove tags from file(s),
database/rewrite file tags from database) - just for better security (it's easy to click something else ;))
5) get 'foo_lua' plugin and all needed lua dlls etc.
6) copy this script and 'common.lua' someplace under your foobar folder (i use '\components\_lua stuff\scripts\my\' and edit
'script_dir' variable at the end of 'options' section bellow
7) select all the files (selection must start and end on album boundaries) and run this script using
components->scripting->run lua script...
8) switch my testing formatting strings back and forth (most important is number 1 and 3)
string 1 - disables all realtime corrections of album / title, uses 'disc' / 'dir' / 'alb_var_artist' for mode and disc selection
string 2 - doesn't disable realtime corrections, doesn't use 'disc' / 'dir' / 'alb_var_artist'
string 3 - uses 'mtg_artist' and 'mtg_album' tags (they are artist / title tags before running mtg, they are present only if they've changed),
rest is like string 2
- using string 3, you can see what i was able to do before i started with mtg (not that i won't be able to do more, ehm)
- using string 2, you can see if any of these realtime correction could help mtg
9) for testing, some 'debug' options are essential:
'debug_log' - that would enable logging of some important points in mtg to 'mtg_log__' tag (result of previous run is stored in 'mtg_log_p')
'debug_reload_info' - that would reload metadata from files on each run (so you won't need to do that by yourself when
testing results using different options etc.)
-- some problems may arise when setting it to 'false', as you may get different results on subsequent runs (though it may fix
something left out from previous run ;) )
-- when setting it to 'false', value of 'skip_processed_files' decides behaviour
10) observe the results (try using 'foo_infobox'), fiddle with options etc ;)
post your requests / findings / opinions
11) in case of wrong results etc., post full filename / album path, 'mtg_log__' tag, original tags,
settings (if you've changed anything in options etc) in this thread
TAGS BEING SAVED:
save_tags = {'album','artist','album artist','title','date',
'tracknumber','disc','disc_name','alb_discs','alb_tracks','alb_disc_tracks','alb_track',
'alb_bitrate','alb_var_bitrate','alb_length',
'cue_ref',
'alb_var_artist','alb_var_comment',
'alb_group',
'lasttrack', -- legacy tags
'divided_from',
'mtg'}
+ mtg_tracknumber, disc_track, mtg_album, mtg_artist, mtg_title, dir, mtg_log__, mtg_log_p
OPTIONS:
debug = false
debug_log = true -- saves log info tags ('mtg_log__' and 'mtg_log_p')
debug_reload_info = true -- reloads info from files (nukes database record)
version_reload_info = true -- reloads info in case that we are running newer version of mtg
skip_processed_files = false -- skips files processed with newer or this version
-- >> this could lead to some problems, should i do that?
artist_title_corrections = true
minimal_artist_title_length = 4 -- minimal length of both artist and title when separating them, applies only to 'divide_title_less_strict'
less_strict_division_undo_threshold = 40/100 -- would undo less-strict artist / title division when total percentage of files divided in album is less than this threshold
-- TODO: make this per disc operation
va_album_title_corrections = true
title_num_skip = true -- skips numbers from title, kicks in only if 'title_num_skip_threshold'% tracks in album have number in their beginning and they are not all the same
title_num_skip_threshold = 100/100
artist_title_guessing_from_filename = true
artist_title_guessing_start = 1 -- 1 - artist OR title is missing, 2 - both artist AND title is missing, (0 - always, however as it is that would affect only title)
artist_title_guessing_not_valid_test = true -- extended test for invalid artist / title
artist_num_sequence_not_various = true -- TODO: change that name ;). if we get numbers for artist and they make sequence (1, 2, ...) then we wouldn't set 'alb_var_artist' and 'same artist title corrections' could start
same_artist_title_corrections = true
same_artist_title_corrections_threshold = 90/100
-- ASK: i can't get numbers with decimal part (like 0.5) to work: ERROR malformed number near `0.1'
-- >> RESULT: lua takes into account regional system locale, so on czech systems, decimal separator is usually ','
-- numbers in 0.0 - 1.0: 0.5 means at least 50% of files have to succeed separation
-- integers > 1: 5 means at least 5 files have to succeed separation
same_artist_title_corrections_num_test = true -- tests if we got separeted numbers (or nothing else thant 2-digit numbers) in artist for all files. if we do, 'same artist title correction' doesn't succeed
same_artist_title_corrections_num_skip = true -- skips those numbers from title
group_detection_from_filename = true
groups_processing = true -- additional groups processing using 'mtg-groups.txt' etc.
skip_group_from_title = true -- important mainly when guessing from filename for filenames with '-group' end
save_legacy_tags = true -- enables saving additional tags like 'lasttrack', which aren't really needed considering the new tags ;)
-- additional things that could be done directly in foobar etc.
replace_underscores = true
title_replaces = true -- would replace strings in title using 'title_replace' table
capitalize = true
simple_capitalize = false -- ignores other settings than 'capitalize' and 'capitalize_min_capitals'. capitalizes only fields all lowercase or uppercase
capitalize_threshold = 100/100 -- when at least 'capitalize_threshold' characters out of all letters are capitals, capitalize whithout keeping capitals
capitalize_min_capitals = 5 -- keep capitals when we have at most 'capitalize_min_capitals' capitals in the string (for acronyms like LTJ)
-- TODO: add blacklist for this - for stuff like 'u.n.k.l.e.' etc.
-- TODO: maybe it would be better to count capitals / all letters ratio for every processed tag type for the whole album or cd
capitalize_roman = true -- make roman numerals capitals
-- TODO: improve roman numerals detection
script_dir = "C:\\SEC\\Audio\\foobar2000 latest\\components\\_lua stuff\\scripts\\my\\"
Use with foobar2000+foo_lua (made by foosion).
Runs over selected items in playlist, select whole albums.
(i.e. it's ok to select multiple albums, just select all tracks from every album)
Type: main menu command
** mazy's tag guesser, for use with mazy's formatting string **
send / post suggestions, requests, modifications, bug reports etc. to
mazy -at- centrum -dot- cz (start subject with 'mazy's tag guesser: ' or i won't see it, thanks)
or
hydrogenaudio.org forums
i would be glad to hear from you.
-- mazy
CHANGELOG:
+ directory guessing added (not a path one though), patterns used are for my naming scheme (which is 'artist - album (year) (bitrate) (..) (..) ...'). it may work for you as it is
NOTES:
1) this is focused on i) tag correction ii) tag guessing iii) album information counting / retrieval
2) my situation is that i use mostly stuff which i do not want to retag (for my reasons), however i needed
to correct issues with not properly tagged files + i wanted to have additional information (like album tracks, real
average album bitrate etc.) + i wanted some tag guessing from filename / directory
i've realized i can live without saving tags and using only database, because i'm going to make
my own album oriented tag saver / loader from additional file
3) this script tries to do many things by itself, you can fiddle with settings or correct results by hand ;)
4) right now, it desn't support guessing from more than one folder (so you can't do something like '\artist\album\'),
i may fix that for ppl who need it (send me your naming schemes)
NOTES FOR TESTING / TESTERS:
-- this is still work in progress, very experimental right now, undergoing testing and bug hunting ;)
-- for editing, you may try 'titmouse' (you would need to get some additional files for it, as described on its page)
1) get 'foo_syfm' plugin and copy my testing formatting strings to your 'configs' subfolder (files 'default-new-test-<1..3>.fb2k')
2) bind these formatting strings to shortcuts for quick changing (i use ctrl+<1..3>)
3) prepare playlist for testing:
a) add full albums, use no sort (you need them to be sorted as they should, track by track)
b) try using albums without tags, scene releases, all kinds of naming schemes etc ...
4) IMPORTANT ! - disable tag writing to files (preferences->database->don't write modified tags to files)
and maybe even remove some database context menu items (database/remove tags from file(s),
database/rewrite file tags from database) - just for better security (it's easy to click something else ;))
5) get 'foo_lua' plugin and all needed lua dlls etc.
6) copy this script and 'common.lua' someplace under your foobar folder (i use '\components\_lua stuff\scripts\my\' and edit
'script_dir' variable at the end of 'options' section bellow
7) select all the files (selection must start and end on album boundaries) and run this script using
components->scripting->run lua script...
8) switch my testing formatting strings back and forth (most important is number 1 and 3)
string 1 - disables all realtime corrections of album / title, uses 'disc' / 'dir' / 'alb_var_artist' for mode and disc selection
string 2 - doesn't disable realtime corrections, doesn't use 'disc' / 'dir' / 'alb_var_artist'
string 3 - uses 'mtg_artist' and 'mtg_album' tags (they are artist / title tags before running mtg, they are present only if they've changed),
rest is like string 2
- using string 3, you can see what i was able to do before i started with mtg (not that i won't be able to do more, ehm)
- using string 2, you can see if any of these realtime correction could help mtg
9) for testing, some 'debug' options are essential:
'debug_log' - that would enable logging of some important points in mtg to 'mtg_log__' tag (result of previous run is stored in 'mtg_log_p')
'debug_reload_info' - that would reload metadata from files on each run (so you won't need to do that by yourself when
testing results using different options etc.)
-- some problems may arise when setting it to 'false', as you may get different results on subsequent runs (though it may fix
something left out from previous run ;) )
-- when setting it to 'false', value of 'skip_processed_files' decides behaviour
10) observe the results (try using 'foo_infobox'), fiddle with options etc ;)
post your requests / findings / opinions
11) in case of wrong results etc., post full filename / album path, 'mtg_log__' tag, original tags,
settings (if you've changed anything in options etc) in this thread
TAGS BEING SAVED:
save_tags = {'album','artist','album artist','title','date',
'tracknumber','disc','disc_name','alb_discs','alb_tracks','alb_disc_tracks','alb_track',
'alb_bitrate','alb_var_bitrate','alb_length',
'cue_ref',
'alb_var_artist','alb_var_comment',
'alb_group',
'lasttrack', -- legacy tags
'divided_from',
'mtg'}
+ mtg_tracknumber, disc_track, mtg_album, mtg_artist, mtg_title, dir, mtg_log__, mtg_log_p
OPTIONS:
debug = false
debug_log = true -- saves log info tags ('mtg_log__' and 'mtg_log_p')
debug_reload_info = true -- reloads info from files (nukes database record)
version_reload_info = true -- reloads info in case that we are running newer version of mtg
skip_processed_files = false -- skips files processed with newer or this version
-- >> this could lead to some problems, should i do that?
artist_title_corrections = true
minimal_artist_title_length = 4 -- minimal length of both artist and title when separating them, applies only to 'divide_title_less_strict'
less_strict_division_undo_threshold = 40/100 -- would undo less-strict artist / title division when total percentage of files divided in album is less than this threshold
-- TODO: make this per disc operation
va_album_title_corrections = true
title_num_skip = true -- skips numbers from title, kicks in only if 'title_num_skip_threshold'% tracks in album have number in their beginning and they are not all the same
title_num_skip_threshold = 100/100
artist_title_guessing_from_filename = true
artist_title_guessing_start = 1 -- 1 - artist OR title is missing, 2 - both artist AND title is missing, (0 - always, however as it is that would affect only title)
artist_title_guessing_not_valid_test = true -- extended test for invalid artist / title
artist_num_sequence_not_various = true -- TODO: change that name ;). if we get numbers for artist and they make sequence (1, 2, ...) then we wouldn't set 'alb_var_artist' and 'same artist title corrections' could start
same_artist_title_corrections = true
same_artist_title_corrections_threshold = 90/100
-- ASK: i can't get numbers with decimal part (like 0.5) to work: ERROR malformed number near `0.1'
-- >> RESULT: lua takes into account regional system locale, so on czech systems, decimal separator is usually ','
-- numbers in 0.0 - 1.0: 0.5 means at least 50% of files have to succeed separation
-- integers > 1: 5 means at least 5 files have to succeed separation
same_artist_title_corrections_num_test = true -- tests if we got separeted numbers (or nothing else thant 2-digit numbers) in artist for all files. if we do, 'same artist title correction' doesn't succeed
same_artist_title_corrections_num_skip = true -- skips those numbers from title
group_detection_from_filename = true
groups_processing = true -- additional groups processing using 'mtg-groups.txt' etc.
skip_group_from_title = true -- important mainly when guessing from filename for filenames with '-group' end
save_legacy_tags = true -- enables saving additional tags like 'lasttrack', which aren't really needed considering the new tags ;)
-- additional things that could be done directly in foobar etc.
replace_underscores = true
title_replaces = true -- would replace strings in title using 'title_replace' table
capitalize = true
simple_capitalize = false -- ignores other settings than 'capitalize' and 'capitalize_min_capitals'. capitalizes only fields all lowercase or uppercase
capitalize_threshold = 100/100 -- when at least 'capitalize_threshold' characters out of all letters are capitals, capitalize whithout keeping capitals
capitalize_min_capitals = 5 -- keep capitals when we have at most 'capitalize_min_capitals' capitals in the string (for acronyms like LTJ)
-- TODO: add blacklist for this - for stuff like 'u.n.k.l.e.' etc.
-- TODO: maybe it would be better to count capitals / all letters ratio for every processed tag type for the whole album or cd
capitalize_roman = true -- make roman numerals capitals
-- TODO: improve roman numerals detection
script_dir = "C:\\SEC\\Audio\\foobar2000 latest\\components\\_lua stuff\\scripts\\my\\"
i'm looking for experienced users to test my preview version. please read the above-mentioned info carefully before requesting preview version in this thread. do not ask me how to get foo_lua.
i want to know your thoughts.
