Create ID3 Template to Apply to Brand New Recordings

derwardian


Posted Jul 10, 2015, 1:34 pm
In Windows 7x64, I'm trying to utilize the command line from a batch file.

The intended result is that I can set up a template of some sort (which includes a pre-populated Title, Album, Year, URL, Copyright info, folder picture, etc.), and it will create tags on .MP3 recordings that I make.

I will usually have more than one recording at a time that I'd like to inject with these pre-populated tag fields.

How do I do this? I read a thread here that said you could provide assistance with scripting in this scenario.
jamesrae


Posted Jul 14, 2015, 10:26 am
The simplest way would be to use a batch file with a folder (which contains the required files) as an argument. The batch file below is an example of this set up:

SetDefaults.bat
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@echo off

IF "%1"=="" (
echo No folder name passed.
goto END
)

REM Default details required
SET TITLE=My title
SET URL=www.company.com

REM Move to the passed folder
CD /D %1

set "FOLDER=%CD%"
echo Iterate through %FOLDER% (for MP3 files)...
for %%f in ("%FOLDER%\*.mp3") do (
"C:\Program Files\Pa-software\Windows ID3 Editor\id3edcmd.exe" -ti "%TITLE%" -ur "%URL%" "%FOLDER%\%%f"
)

:END


Please note that this is just a quick and simple example and is not intended as best solution to your problem.
derwardian


Posted Jul 20, 2015, 5:29 pm
Thanks, James! I will give this a shot.
derwardian


Posted Aug 6, 2015, 2:37 pm
James,

How would I append the last 9 characters of filename to the end of the title, using the batch file?

As example:
filename = "Smith, Jim - 150806.mp3"
title = "Session Audio"

to yield title name of "Session Audio - 150806"

??
jamesrae


Posted Aug 7, 2015, 11:22 am
Sub strings in batch files can be performed using '~start,length' notation e.g.:
%var:~13,6%
Where 6 characters from position 13 in the environment variable %var% will be extracted. Please note that the index of the strings is zero based.

One caveat is for argument variables such as %0 or %1 where you will have to assign them to a variable using set first e.g.:
set var=%1
echo %var:~13,6%

derwardian


Posted Aug 11, 2015, 5:38 pm
So, if I'm understanding correctly, you wouldn't be able to script it unless all filenames had the same number of characters.

For instance, "Smith, Joe - 150811.mp3" and "Smithenheiser, Josephine - 150811.mp3" would both pick up starting at a certain position, but not relative to the overall lengths which are different.

Is this correct?

It would be better then to have the filename (if possible) to begin with the part I want to extract. For instance "150811 - Smith, Joe.mp3" and start extraction from position zero, always, and take the first 6 characters or whatever.

Am I understanding this correctly?

Many thanks for the help.
derwardian


Posted Aug 20, 2015, 7:28 pm
Many thanks to James Rae for the off-forum support.  I'm posting this here as a template for others.

I make recordings of sessions and create file names for client using the following format "Last, First - MMDDYYYY.mp3"

I wanted the Title of the track to be "Session Audio - MMDDYYYY" (with the date pulled from the filename)

Below is the working template on Windows 7 (x64) to accomplish this and set the tagged parameters that show up well in modern computers and mobile devices.

Instructions for beginner level people on a Windows machine...

1. copy and paste the code below into a new text file, and rename it to end with .bat instead of .txt, which will make it a batch file (program).
2. edit the code below wherever it says "My..." and fill in with whatever details you want script, and save your batch file. 
3. place your batch file, your cover art file, and the .mp3's to tag in the same folder.
4. double-click on the batch file to batch process all the .mp3's and tag them with your info.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
REM Remember to set the directory to operate in the script below.

@echo off

setlocal enableextensions enabledelayedexpansion

SET YEAR=%date:~-4%

FOR %%f in ("MyDirectory-like-C:\Users\x\Desktop\Testing\*.mp3") do (
SET TEMPFN=%%f
SET LASTNUMBER=!TEMPFN:~-10,6!

"C:\Program Files\Pa-software\Windows ID3 Editor\id3edcmd.exe" -ti "Session Audio - !LASTNUMBER!" -ar "MyArtist" -al "MyAlbum" -yr "%YEAR%" -gn "MyGenre" -co "MyComments" -cp "MyCopyrightBy" -or "MyOrchestra-Which-is-Shown-As-Artist-on-
Some-Devices" -ur "MyWebsiteAddress" -ir "MyCoverArtFileName.jpg" "%%f"
)

:END


Hope this helps someone or gives them someplace to start.

Back