Here's what my Foobar interface looks like now:

foobarui

I had a "Music" folder somewhere on disk C:/ with music files divided into categories inside:

musicfolder

And I wanted a filter column that would reflect that folder structure, as can be seen on the first screenshot:

foobartype

I couldn't find the recipe online, so I wrote one myself. Here it is if you're struggling to do something similar:

$puts(substring,$substr(%path%,$add($strstr(%path%,Music),6),60))$substr($get(substring),1,$sub($strchr($get(substring),\),1))

Let me add a short explanation. What it does is:

  1. $add($strstr(%path%,Music),6) finds the first occurence of Music in the file path (%path%) and adds 6 to the found index to account for the word and the slash that follows.
  2. $substr(%path%,$add($strstr(%path%,Music),6),60) extracts a substring from the file path, starting right after Music\ and ending somewhere at the 60th character (the exact end doesn't matter as long as it includes the folders nested one level in Music).
  3. The $puts stores that substring in a substring variable for future use.
  4. Then $substr creates a substring from that variable ($get), starting at index 1 and ending at the first found slash in the variable ($strchr part) minus one (to get rid of the slash itself.

Enjoy. :D

Functions reference