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: Autocompletion enhancement: hierarchy (Read 733 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Autocompletion enhancement: hierarchy

In many cases, not just one but at least two strings are required to define a track (the term "song" intentionally avoided).
To illustrate:
Concerto for piano nº 1
doesn’t suffice to identify a piece of music (many composers have a “Concerto for piano nº 1”); likewise,
Brahms
doesn’t suffice either (he composed many pieces). In order to unequivocally identify a piece two ordered strings are required, usually (composer, work), like this:
Brahms : Concerto for piano nº 1.

Since two tags are needed to characterize such a piece of music, foobar2000 autocompletion feature isn’t able, in its present state, to help avoiding editing errors.
For instance, although Brahms did not compose a Viola Concerto, since autocomplete only sees a work at a time, one may mistakenly write “viola” instead of “violin”.

In an ideal word, autocompletion would first help finding Brahms among composers with names starting with Br then, after one confirmed his name as the content of the %composer% tag, autocompletion would only present works by him that begin with Co that are valid:
Concerto for piano nº1
Concerto for piano nº2
Concerto for violin
.

If one has a large collection of music, one may end with a number of ambiguities, small errors like:
Brahms, Johannes | Brahms, J. | Brahms, J | ...
Concerto nº1 | Concerto nº 1 | Concerto No.1 | …

In order to circumvent foobar2000’s autocompletion limitation, I have been using for a while the method described below, which may be useful to others.

1) Define a special tag, %idx1%
2) Instead of filling separately the %composer% and %content group% tags, fill %idx1% instead.
Note that in order to allow the composer part and the content group part to be identified, a standard separator is necessary; let’s then choose “=”, a character that can’t appear in a name or a title, to be used as standard separator.
In the example, %idx1% should be filled so:
Brahms, Johannes=Concerto for piano nº 1.
Autocomplete will work, so that after typing the first letters Br a dropdown down list of valid works of Brahms will appear so that one may choose among them -- no typing errors.
3) After that, one should apply the following Masstager scripts to update both %composer% and %content group% with the right values.

Code: [Select]
[Format value from other fields]

Destination field: COMPOSER
Formatting pattern: $if($strchr(%idx1%,=),$LEFT(%IDX1%,$SUB($STRCHR(%IDX1%,=),1)))

Destination field: CONTENT GROUP
Formatting pattern: $if($strchr(%idx1%,=),$replace($replace(%idx1%,$LEFT(%IDX1%,$SUB($STRCHR(%IDX1%,=),1)),),=,),)

The method is not elegant: it implies into adding an intermediate tag IDX1 that only serves to avoid errors.
In my case, at least, this became essential given the size of the collection and the number of versions of the same music.

Nevertheless, I still dream that something (which has been suggested before as an enhancement) like the following will exist:

File | Preferences | Advanced | Display | Autocomplete fields:
GENRE; COMPOSER>CONTENT GROUP>TITLE; ARTIST; BAND; CONDUCTOR
with ">" meaning that Composer, Content Group and Title are treated as an hierarchy (they actually are).


N.B.
Title should ideally also be part of the autocompletion hierarchy because many pieces are divided in parts (in classical pieces, they’re usually called movements).
In the example used, the piece has three movements, so the tagging for each track would result:

%tracknumber% %composer% %content group% %title%
01  Brahms, Johannes  Concerto for piano nº 1  I. Maestoso - Più moderato
02  Brahms, Johannes  Concerto for piano nº 1  II. Adagio
03  Brahms, Johannes  Concerto for piano nº 1  III. Rondo. Allegro non troppo