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: File Naming Systems (Read 7016 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

File Naming Systems

While figuring out how to use replaygain.exe to recursively work through album sub-folders, and calculate title and album based gain, it finally dawned on me that my file names had to match one of a number of file naming systems as follows:

o   album -- [no] artist -- title.mpc
o   artist -- album -- [no] title.mpc
o   artist/album -- [no] title.mpc
o   artist/album/[no] title.mpc
o   album -- no -- artist -- title.mpc
o   artist -- album -- no -- title.mpc
o   artist/album -- no -- title.mpc
o   artist/album/no -- title.mpc

The “/” represents a directory (or folder) separator.

Now, as it happens, I have used the convention:

o   artist(Y) Albumartist - album – no - title.mpc

for encoding about 300 CDs. This means that replaygain.exe  will still work recursively on each sub-folder, but the album gain value will be calculated on the whole list of files, instead of grouping them by album. I must rename my files using the “ -– “ item separator to get it to work properly, or work on each sub-folder manually.

This got me to thinking why use the " -- " separator when most files shared on the internet seem to use the " - " separator, which uses less space anyway.

Frank Klemm summarises his file naming rules as follows (edited):
Quote
File Naming:

Evelyn Glennie/Drumming (1996)/[01] Entrances.mpc
Evelyn Glennie/Drumming (1996)/[02] Halasana.mpc
Evelyn Glennie/Drumming (1996)/[03] Sorbet No. 1%3A Latin American Interlude.mpc
Evelyn Glennie/Drumming (1996)/[04] Bongo-O.mpc
Evelyn Glennie/Drumming (1996)/[05] Sorbet No. 2%3A Chinese Cymbals.mpc
 
"/" stands for the directory separator. One software house on this planet
writes this in mirror writing ;-)

Some of my rules are:

Spaces can be replaced by '_'   (not done here)
Special chars which make trouble can be replaced by %XX, where XX is the hexadecimal represention ( <|>*?{}/" ... )
Characters outside ISO-8859-1 (polish, czech, russian, korean, chinese, japanese, ...) can be written as %00XXXX where XXXX is the code in ISO-10464
Items can be divided by " -- " or "/" (Windows "")
Title number can also be written as " -- [XX] " instead of " -- XX -- ", this makes less trouble with title names like "23".

If after the title number are
  0 items:  This is a pre track you can often find on CDs (and which sometimes also is not digital zero)
  1 item:   The title follows
  2 items:  The artist and the title follows

Before the title number you find the album.
If there is no artist given after the title, before the album you can find the artist.
The album can be followed by " (19XX)" or " (200X)" to describe the year
where the album was published.

Note that also:

Evelyn Glennie -- Drumming (1996) -- [01] Entrances.mpc
Evelyn Glennie -- Drumming (1996) -- [02] Halasana.mpc
Evelyn Glennie -- Drumming (1996) -- [03] Sorbet No. 1%3A Latin American Interlude.mpc
Evelyn Glennie -- Drumming (1996) -- [04] Bongo-O.mpc
Evelyn Glennie -- Drumming (1996) -- [05] Sorbet No. 2%3A Chinese Cymbals.mpc
 
would be possible if MS would allow more than 64 characters for file
names on CDs (the inventor of this 64 char limit should be stoned}.
 
Rockridge and HFS allows up to 255 chars, but this can't be read under
Windows although it is an ISO standard.


Some food for thought here.
Ruse
____________________________
Don't let the uncertainty turn you around,
Go out and make a joyful sound.

File Naming Systems

Reply #1
This a bit off topic, but my help some people

I use _ to deliminate feilds, with the proviso that _ and " are not allowed in feilds. I used to use ¬ but in a dos-box the comes up as 3/4 I think :eek:

wav-mp3.bat
lame -F --alt-preset standard --ta %1 --tc %2 --ty %3 --tl %4 --tn %5 --tt %6 %7 %8

make.bat
ls -1 *.wav  | sed s/'^(.*)_(.*)_(.*)_(.*)_(.*)_(.*).wav$'/'call wav-mp3 "1" "2" "3" "4" "5" "6" "1_2_3_4_5_6.wav" "2 6.mp3"'/ > encode.bat

Eg
The Jam_038_1979_Setting Sons_02_Thick As Thieves.wav
gives
038 Thick As Thieves.mp3 + tags

...with the use of cygnus tools

File Naming Systems

Reply #2
If you don't want to go through the hassle of redoing your naming scheme, use a set of batch files to do the recursion for you.  Below is a series of batch files I use in WinXP for this purpose:

b1.bat:

for /D %%a in (*) do b2.bat "%%a"
-----
b2.bat:

cd %1
for /D %%b in (*) do call b3.bat "%%b"
cd ..
-----
b3.bat

cd %1
replaygain --auto *.mpc
cd ..
-----

Make sure the batch files go into your path.  I don't think this exact syntax will work with Win9x because they've changed the CLI, but a similar setup should be possible.  Of course on a *nix box a real shell script should be easy to produce as well.

-Leto

File Naming Systems

Reply #3
Quote
Originally posted by Leto Atreides II
Of course on a *nix box a real shell script should be easy to produce as well.


Yep, probably not many people know that they can get all those great unix tools running on your windows machine - you even get a bash shell to - a propper unix envionment. I used this all the time, except i just use the tools from the dos box (include the /bin in your path for this)

http://sources.redhat.com/cygwin/

Happy grep, sed, awk, ...ing!


What is it?
The Cygwin tools are ports of the popular GNU development tools for Microsoft Windows. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect.

With these tools installed, it is possible to write Win32 console or GUI applications that make use of the standard Microsoft Win32 API and/or the Cygwin API. As a result, it is possible to easily port many significant Unix programs without the need for extensive changes to the source code. This includes configuring and building most of the available GNU software (including the packages included with the Cygwin development tools themselves). Even if the development tools are of little to no use to you, you may have interest in the many standard Unix utilities provided with the package. They can be used both from the bash shell (provided) or from the standard Windows command shell.

File Naming Systems

Reply #4
Just for variety's sake I figure I should mention that there's another unix environment for windows as well, cleverly named Unix for Windows:

http://www.research.att.com/sw/tools/uwin/

I've used both, and didn't really have any problems with either, but I preferred Cygwin.  Cygwin also seems to be more common.  There's also 2 other unix for windows alternatives listed at the bottom of the uwin page, so feel free to try em all out yourself and see what you like.

File Naming Systems

Reply #5
Leto Atreides II, thanks for the batch file suggestion; it sounds good. As a complete batch file novice, tho, I wouldn't mind a bit more help. You have documented the batch file code:
Quote
b1.bat: 

for /D %%a in (*) do b2.bat "%%a" 
----- 
b2.bat: 

cd %1 
for /D %%b in (*) do call b3.bat "%%b" 
cd .. 
----- 
b3.bat 

cd %1 
replaygain --auto *.mpc 
cd .. 
----- 

but how do I use this on XP; how do I set it out and run it?
Ruse
____________________________
Don't let the uncertainty turn you around,
Go out and make a joyful sound.

File Naming Systems

Reply #6
Okay, first of all, the batch files I pasted in here assume that songs are in a format such as artist/album/file.mpc.  It still won't help if you have multiple albums in one directory.  I didn't read your post closely the first time through and didn't realize you didn't have seperate album folders .  If you want to use the batch files I pasted in you'll have to seperate albums into their own directories.  But as long as the albums are seperated out, the files don't have to follow Frank's naming conventions.  This is what my problem was, and what led me to make the bat files.

But anyway, if you want to seperate your albums and use my batch files, just use notepad to make 3 files b1.bat, b2.bat, and b3.bat.  You can name the files whatever you want as long as they end in .bat, and the corresponding names are changed in the code as well.  Save the files in C:Windows or any other directory in your path.

In the first file (b1.bat) paste in:
Code: [Select]
for /D %%a in (*) do b2.bat "%%a"

in b2.bat:
Code: [Select]
cd %1 

for /D %%b in (*) do call b3.bat "%%b"

cd ..

in b3.bat
Code: [Select]
cd %1 

replaygain --auto *.mpc

cd ..

Then if your mpc files are 2 levels deep, just run b1.bat 2 folders up from where the mpc files are.

If they're only 1 level deep just run b2.bat from 1 folder up.

Hope this helps.

File Naming Systems

Reply #7
Thankyou! My files are grouped into album folders already (I've edited the original post to reflect this), so I'll give it a try and let you know.

Thanks again.
Ruse
____________________________
Don't let the uncertainty turn you around,
Go out and make a joyful sound.

File Naming Systems

Reply #8
Success!

Leto Atreides II, may much wealth fall upon you!
Ruse
____________________________
Don't let the uncertainty turn you around,
Go out and make a joyful sound.

File Naming Systems

Reply #9
Quote
Originally posted by Ruse
Success!

Leto Atreides II, may much wealth fall upon you!

Don't worry about it, I already control the spice flow throughout the known universe.  There isn't really anything else I need.

File Naming Systems

Reply #10
Ruse
____________________________
Don't let the uncertainty turn you around,
Go out and make a joyful sound.

File Naming Systems

Reply #11
Frank has sent me this replaygain recursive (album) workaround, but I don't know how to use it:

Quote
BTW you can still use your naming. There is a fall back.

decode_secure_name_mangling ();
if (fails) {
....decode_less_secure_name_mangling ();
....if (stillfails)
........decode_insecure_name_mangling ();
}

(The ....s are spaces, but spaces don't appear here at the start of a line for some reason)
Ruse
____________________________
Don't let the uncertainty turn you around,
Go out and make a joyful sound.

File Naming Systems

Reply #12
and more:

Q: Your file naming explanation intrigues me. Why do you use " -- " separator rather than " - "?
Most music files shared on the internet use " - ".

A:
Quote
I can't code machine readable names like

Album="Sting - Best of"
Album="Patricia Kaas - The Decade 1984-96"

Also I have problems with

Title="23"

A nasty solution is to write

Album="Sting- Best of"
Album="Patricia Kaas- The Decade 1984-96"

This is IMHO the wrong way. The computer is the master and dictates the limitations.
It should be vice versa.

FK
Ruse
____________________________
Don't let the uncertainty turn you around,
Go out and make a joyful sound.

 
SimplePortal 1.0.0 RC1 © 2008-2021