REACT: Difference between revisions

From Hydrogenaudio Knowledgebase
m (@destbase@)
(Update from v0.997 to 0.999)
Line 5: Line 5:
REACT integrates with [[Exact Audio Copy]], adding some hotkeys combinations to access often used functions more quickly.  It will also alter the default name for image files according to your INI settings, and close the extraction dialogue in order for the logfile to be created and used from within your script.  It can auto-configure [[Exact Audio Copy|EAC]], updating the external compression options so that [[Exact Audio Copy|EAC]] is ready to run REACT immediately.  This feature is extremely useful for novice users.
REACT integrates with [[Exact Audio Copy]], adding some hotkeys combinations to access often used functions more quickly.  It will also alter the default name for image files according to your INI settings, and close the extraction dialogue in order for the logfile to be created and used from within your script.  It can auto-configure [[Exact Audio Copy|EAC]], updating the external compression options so that [[Exact Audio Copy|EAC]] is ready to run REACT immediately.  This feature is extremely useful for novice users.


REACT is configured using an INI file.  The INI file consists of named sections for both single and image file ripping.  The commands used within the INI file are command line/DOS commands, with the addition of numerous variables which REACT makes available.  For example, any instance of '''@artist@''' in the script will be replaced by the [[freedb]] artist name, while '''$artist$''' will be replaced with a ''filename-friendly'' version of the artist name (with illegal characters replaced according to your requirements).
REACT is configured using an INI file and config files.  The commands used within the config files are command line/DOS commands, with the addition of numerous variables which REACT makes available.  For example, any instance of '''@artist@''' in the script will be replaced by the [[freedb]] artist name, while '''$artist$''' will be replaced with a ''filename-friendly'' version of the artist name (with illegal characters replaced according to your requirements).




Line 41: Line 41:
| @image@ || The path to the final image file, when used in '''Copy Image''' mode
| @image@ || The path to the final image file, when used in '''Copy Image''' mode
|-
|-
| @sourcecuesheet@ || The path to the source [[Cuesheet|cuesheet]], when used in '''Copy Image''' mode
| @sourcecuesheet@ || The path to the (temporary) source [[Cuesheet|cuesheet]], when used in '''Copy Image''' mode
|-
|-
| @cuesheet@ || The path to the final [[Cuesheet|cuesheet]], when used in '''Copy Image''' mode
| @cuesheet@ || The path to the final [[Cuesheet|cuesheet]], when used in '''Copy Image''' mode
|-
|-
| @eaglog@ || The path to the log file created by [[Exact Audio Copy|EAC]]
| @eaclog@ || The path to the log file created by [[Exact Audio Copy|EAC]]
|-
| @trackscuesheets@ || (from v0.999) The path to the cuesheet files without extension, created by [[Exact Audio Copy|EAC]] when hitting F4 and SaveAllCuesheets=1 in the INI file. E.g, "@trackscuesheets@.[mg].cue" is the multiple wav files cuesheet with gaps.
|-
|-
|  ||  
|  ||  
Line 87: Line 89:
=Global INI Variables=
=Global INI Variables=


The first section of the REACT INI sets some global variables, which can be used in any or all encoder sections.  These variables refer to high level settings, like the path to [[Exact Audio Copy|EAC]], rather than encoder-specific settings.
The first section of the REACT INI sets some global variables, which can be used in any or all encoder configs.  These variables refer to high level settings, like the path to [[Exact Audio Copy|EAC]], rather than encoder-specific settings.


Here is an example:
Here is an example:
Line 100: Line 102:
MinimizeCompressionWindow=1
MinimizeCompressionWindow=1
ProcessPriority=1
ProcessPriority=1
TracksHotkey={F4}
SaveTracksCuesheets=0
ImageHotkey={F10}
ImageHotkey={F10}
ImageNaming=$artist$ - $album$
ImageNaming=$artist$ - $album$
KeyRemap1={F4}|+{F5}
KeyRemap2=|
KeyRemap3=|
Sla_Bks_Col_Qst_Bar_Quo_Ast_Lt_Gt=-|-|-||!|'|#|[|]
Sla_Bks_Col_Qst_Bar_Quo_Ast_Lt_Gt=-|-|-||!|'|#|[|]
Version=0.996
Version=0.999
Debug=0
Debug=0
</pre>
</pre>
Line 127: Line 128:
| ImageNaming || This variable detirmines how image files, and their cuesheets, will be named when REACT is used in image mode.  You can use meta data variables here, e.g.: "$artist$ - $album$" to name the image using the artist and album name (filename-friendly values).
| ImageNaming || This variable detirmines how image files, and their cuesheets, will be named when REACT is used in image mode.  You can use meta data variables here, e.g.: "$artist$ - $album$" to name the image using the artist and album name (filename-friendly values).
|-
|-
| Sla_Bks_Col_Qst_Bar_Quo_Ast_Lt_Gt || Some characters cannot be used in file or folder names.  This variable allows you to specify what these characters should be replaced with.  Slash; Backslash; Colon; Question Mark; Bar (Pipe); Quotes; Asterisk; Less Than; Greater Than.
| Sla_Bks_Col_Qst_Bar_Quo_Ast_Lt_Gt || Some characters cannot be used in file or folder names.  This variable allows you to specify what these characters should be replaced with.  Slash; Backslash; Colon; Question Mark; Bar (Pipe); Quotes; Asterisk; Less Than; Greater Than. It is also possible to convert Space to e.g. _ by appending a Bar and a _ (after the Gt convert character).
|-
|-
| Debug || If you are having problems with your INI file setup set this value to 1.  REACT will then pause before exiting, so you can examine the console output to attempt to detirmine where your process fell down.  
| Debug || If you are having problems with your INI file setup set this value to 1.  REACT will then pause before exiting, so you can examine the console output to attempt to determine where your process fell down.  
|}
|}




=The Encoder Sections=
=The Encoder Config Files=


The initial REACT INI contains one global settings section, and many encoder sections.  There are two encoder sections for each codec; one section for ripping to track files, and one for ripping to an image with cuesheet.
The initial REACT INI contains a global settings section. This contains a key named Config=<ENCODER> which refers to configuration files in the Config folder.  There are two config files for each encoding; one for ripping to track files, and one for ripping to an image with cuesheet.


The sections are named:
The config files are stored in <REACT dir>\Config folder, and are named:


*ENCODER-tracks
<ENCODER>-tracks.txt
*ENCODER-image


The first part, '''ENCODER''', is simply a unique name which indentifies the section; however it makes sense to use the name of the encoder being used, like "FLAC" or "WAVPACK".  This part of the section header is referred to by the global variable, '''[[REACT#A_Few_Of_The_Important_Ones|Config]]'''.
<ENCODER>-image.txt


The second part identifies the section as being the processes to perform when ripping to '''tracks''', or to an '''image'''.
The first part, '''ENCODER''', is simply a unique name which indentifies the encoder tasks; however it makes sense to use the name of the encoder being used, like "FLAC" or "WAVPACK".  This part of the section header is referred to by the global variable, '''[[REACT#A_Few_Of_The_Important_Ones|Config]]'''.
 
The second part (tracks or image) describes whether to perform when ripping to '''tracks''', or to an '''image'''.


The encoder section consists of two parts:
The encoder section consists of two parts:
Line 150: Line 152:
==Variable Initialisation==
==Variable Initialisation==


In the beginning of each section you should set variables relative to that section.
In the beginning of each config file you should set variables relative to that config.


{| border="0" cellpadding="0" cellspacing="4"
{| border="0" cellpadding="0" cellspacing="4"
! style=padding-right:24px;| Variable || Description
! style=padding-right:24px;| Variable || Description
|-
|-
| Description || A description of the processes within the section.
| !Description || A description of the processes within the section.
|-
|-
| ImageExt || The file extension of the image file, e.g.: "wv".  Image sections only.
| !ImageExt || The file extension of the image file, e.g.: "wv".  Image sections only.
|-
|-
| CuesheetExt || The extension given to the cuesheet by [[Exact Audio Copy|EAC]], e.g.: ".wv.cue".  Image sections only.
| !CuesheetExt || The extension given to the cuesheet by [[Exact Audio Copy|EAC]], e.g.: ".wv.cue".  Image sections only.
|}
|}


Line 192: Line 194:
Obviously the values of $track$ and $title$ will change per track.  Remember, $track$ will zero-pad the track number.
Obviously the values of $track$ and $title$ will change per track.  Remember, $track$ will zero-pad the track number.


==Task List==
==Config Tasks==
 
Each line '''not''' starting with a "!" will be part of the config task script.


Each line in your task list will begin with a number, e.g.: line one will begin '''1=>'''.
The task script is simply a list of command line statements, utilising the variables that REACT exposes within the code.


The task list is simply a list of command line statements, utilising the variables that REACT exposes within the code.
As an example, here is the default LAME-tracks.txt file.  Notice that all REACT variables are surrounded by two ampersands (@), or two dollar signs ($); all other code is standard DOS command line syntax.  With this in mind you will find working with REACT a lot easier if you are happy executing applications from the command line, more so if you have an understanding of batch files or command line scripting (what I think of as 'DOS scripts').


As an example, here is the LAME-tracks section from the default INI. Notice that all REACT variables are surrounded by two ampersands (@), or two dollar signs ($); all other code is standard command line syntax.  With this in mind you will find working with REACT a lot easier if you are happy executing applications from the command line, more so if you have an understanding of batch files or command line scripting (what I think of as 'DOS scripts').
LAME-tracks.txt:
<pre>!Description=LAME -V2 mp3 track files, RG album gain, APE2 and id3v1 tags
!destdir1=@musicdir@\MP3\$cdartist$\($year$) $album$
!dest1=@destdir1@\$track$ - $title$
!Various-dest1=@destdir1@\$track$ - $title$ ($artist$)


<pre>[LAME-tracks]
echo.> "@dest1@.mp3.tmp"
Description=LAME -V2 mp3 track files, RG album gain, APE2 and id3v1 tags
@encdir@\Tag.exe --nocheck --ape2 -t "ARTIST=@artist@" -t "ALBUM=@album@" -t "TRACK=@track@" -t "TITLE=@title@" -t "YEAR=@year@" -t "GENRE=@genre@" -t "TOTALTRACKS=@numtracks@" -t "FREEDB=@freedbid@" -t "CRC=@crc@" "@dest1@.mp3.tmp"
destdir1=@musicdir@\MP3\$cdartist$\($year$) $album$
move "@source@" "@dest1@.wav"
dest1=@destdir1@\$track$ - $title$
if @islast@==0 goto end
Various-dest1=@destdir1@\$track$ - $title$ ($artist$)
  cd /d "@destdir1@"
1=>echo.> "@dest1@.mp3.tmp"
  move "@eaclog@" "EAC_log.txt"
2=>@encdir@\Tag.exe --nocheck --ape2 -t "ARTIST=@artist@" -t "ALBUM=@album@" -t "TRACK=@track@" -t "TITLE=@title@"
  @encdir@\WaveGain.exe -a *.wav --exec @encdir@\lame.exe -V2 --vbr-new --scale %%ALBUM_SCALE%% --tc "AG appl:%%ALBUM_GAIN%%,TG:%%TRACK_GAIN%% dB" "%%INPUT_NAME%%.wav" "%%INPUT_NAME%%.mp3"
-t "YEAR=@year@" -t "GENRE=@genre@" -t "TOTALTRACKS=@numtracks@" -t "FREEDB=@freedbid@" -t "CRC=@crc@" "@dest1@.mp3.tmp"
  for %%i in (*.mp3) do @encdir@\Tag.exe --force id3v1 --force ape2 --fromfile "%%i.tmp" "%%i"
3=>move "@source@" "@dest1@.wav"
  del "*.mp3.tmp" "*.wav"
4=>if @islast@==0 goto end
:end</pre>
5=>  cd /d "@destdir1@"
6=>  move "@eaclog@" "EAC_log.txt"
7=>  @encdir@\WaveGain.exe -a *.wav --exec @encdir@\lame.exe -V2 --vbr-new --scale %%ALBUM_SCALE%%
--tc "AG appl:%%ALBUM_GAIN%%,TG:%%TRACK_GAIN%% dB" "%%INPUT_NAME%%.wav" "%%INPUT_NAME%%.mp3"
8=>  for %%i in (*.mp3) do @encdir@\Tag.exe --force id3v1 --force ape2 --fromfile "%%i.tmp" "%%i"
9=>  del "*.mp3.tmp" "*.wav"
10=>:end</pre>





Revision as of 17:30, 28 April 2006

REACT (Run EAC Tasks) can be used in conjunction with Exact Audio Copy (EAC), as an external compressor.

It is, however, not an encoder, but an interim application that provides a scripting facility to call muliple encoders or pre-/post-encoding applications to process the WAVE files created by EAC, or the files created by the script itself. In short, REACT allows you to run multiple tasks on the audio extracted, instead of only one.

REACT integrates with Exact Audio Copy, adding some hotkeys combinations to access often used functions more quickly. It will also alter the default name for image files according to your INI settings, and close the extraction dialogue in order for the logfile to be created and used from within your script. It can auto-configure EAC, updating the external compression options so that EAC is ready to run REACT immediately. This feature is extremely useful for novice users.

REACT is configured using an INI file and config files. The commands used within the config files are command line/DOS commands, with the addition of numerous variables which REACT makes available. For example, any instance of @artist@ in the script will be replaced by the freedb artist name, while $artist$ will be replaced with a filename-friendly version of the artist name (with illegal characters replaced according to your requirements).


Available Variables

Variable Description
PATHS
@reactdir@ The path to the directory in which REACT resides
@encdir@ The path to the directory in which the encoders reside. Set within the INI file
@mydocumentsdir@ The path to your My Documents folder
@musicdir@ The path to your music folder. Set within the INI file. Used as a root for other paths
@sourcedir@ The path to the folder in which the source files are located (WAV/LOG/CUE)
@basename@ The name of the file being created, excluding extension
@destbase@ @destbase@ was deprecated in 0.997. Use @sourcedir@\@basename@ instead
@removabledriveN@ The path to your removable drive number N. Set within the INI file
@destdirN@ Directory path N used within your script. Set within the INI file
@destN@ File path N, used within your script. Set within the INI file (encoder track section)
@Various-destN@ The file path to use if it is a Various Artists CD. Set within the INI file (encoder track section)
@source@ The path to the temporary source WAVE file
@image@ The path to the final image file, when used in Copy Image mode
@sourcecuesheet@ The path to the (temporary) source cuesheet, when used in Copy Image mode
@cuesheet@ The path to the final cuesheet, when used in Copy Image mode
@eaclog@ The path to the log file created by EAC
@trackscuesheets@ (from v0.999) The path to the cuesheet files without extension, created by EAC when hitting F4 and SaveAllCuesheets=1 in the INI file. E.g, "@trackscuesheets@.[mg].cue" is the multiple wav files cuesheet with gaps.
METADATA
@cdartist@ The name of the CD artist. Use $cdartist$ in paths
@artist@ The name of the track artist. Use $artist$ in paths
@album@ The name of the album. Use $album$ in paths
@title@ The song title. Use $title$ in paths
@track@ The track number. Use $track$ to zero-pad the track number, i.e.: turn 9 into 09
@numtracks@ The total number of tracks
@islast@ Whether the current track is the last, for track mode
@genre@ The album genre. Use $genre$ in paths
@year@ The album year
@comment@ The comment. Use $comment$ in paths
@freedbid@ The freedb ID
OTHER
@crc@ The CRC of the file
@bitrate@ The value of the Bitrate dropdown on EAC's External Compressor dialogue
@curdate@ The current date


Global INI Variables

The first section of the REACT INI sets some global variables, which can be used in any or all encoder configs. These variables refer to high level settings, like the path to EAC, rather than encoder-specific settings.

Here is an example:

Config=FLAC
EAC=C:\Program Files\Exact Audio Copy\EAC.exe
musicdir=C:\My Music
encdir=C:\Program Files\REACT\Encoders
LogFile=react.txt
CodePage=1252
MinimizeCompressionWindow=1
ProcessPriority=1
TracksHotkey={F4}
SaveTracksCuesheets=0
ImageHotkey={F10}
ImageNaming=$artist$ - $album$
Sla_Bks_Col_Qst_Bar_Quo_Ast_Lt_Gt=-|-|-||!|'|#|[|]
Version=0.999
Debug=0

A Few Of The Important Ones

Some of the variables are obvious, and some you really don't need to bother with unless you are a REACT Ninja, but here's a few to watch out for:

Variable Description
Config The encoder section that REACT should process. This will only be effective if the EAC command line begins with the parameter "REACT". You could, instead, amend the command line parameter to the section prefix, e.g.: "FLAC".
musicdir The root directory for all your music. If you are encoding to "C:\My Music\WavPack" and "C:\My Music\MP3" then you can set musicdir to "C:\My Music" and use this variable when setting your @destdirN@ variables. this helps maintain clarity within your INI file.
encdir REACT installs many encoders in a folder called "Encoders". Again, this variable can be used when referencing these applications, to maintain clarity.
LogFile If you set a value to this variable a REACT log will be created with that name, e.g.: react.txt. If left blank no log will be written. This does not affect EAC's log file.
ImageNaming This variable detirmines how image files, and their cuesheets, will be named when REACT is used in image mode. You can use meta data variables here, e.g.: "$artist$ - $album$" to name the image using the artist and album name (filename-friendly values).
Sla_Bks_Col_Qst_Bar_Quo_Ast_Lt_Gt Some characters cannot be used in file or folder names. This variable allows you to specify what these characters should be replaced with. Slash; Backslash; Colon; Question Mark; Bar (Pipe); Quotes; Asterisk; Less Than; Greater Than. It is also possible to convert Space to e.g. _ by appending a Bar and a _ (after the Gt convert character).
Debug If you are having problems with your INI file setup set this value to 1. REACT will then pause before exiting, so you can examine the console output to attempt to determine where your process fell down.


The Encoder Config Files

The initial REACT INI contains a global settings section. This contains a key named Config=<ENCODER> which refers to configuration files in the Config folder. There are two config files for each encoding; one for ripping to track files, and one for ripping to an image with cuesheet.

The config files are stored in <REACT dir>\Config folder, and are named:

<ENCODER>-tracks.txt

<ENCODER>-image.txt

The first part, ENCODER, is simply a unique name which indentifies the encoder tasks; however it makes sense to use the name of the encoder being used, like "FLAC" or "WAVPACK". This part of the section header is referred to by the global variable, Config.

The second part (tracks or image) describes whether to perform when ripping to tracks, or to an image.

The encoder section consists of two parts:

Variable Initialisation

In the beginning of each config file you should set variables relative to that config.

Variable Description
!Description A description of the processes within the section.
!ImageExt The file extension of the image file, e.g.: "wv". Image sections only.
!CuesheetExt The extension given to the cuesheet by EAC, e.g.: ".wv.cue". Image sections only.

It is likely that you will also need to set file and folder path variables, like @destN@ and @destdirN@. E.g.:

destdir1=@musicdir@\FLAC\$cdartist$\($year$) $album$
dest1=@destdir1@\$track$ - $title$

The above will set the folder path @destdir1@ using the global variable @musicdir@, and artist, year and album meta data. It then sets the file path @dest1@ using @destdir1@ and the track and title meta data. So, considering the following values for those variables:

Variable Description
musicdir C:\My Music
albumartist Ben Folds Five
album Whatever and Ever Amen
year 2000
track 03
title Brick

... we end up with:

destdir1=C:\My Music\FLAC\Ben Folds Five\(2000) Whatever and Ever Amen
dest1=C:\My Music\FLAC\Ben Folds Five\(2000) Whatever and Ever Amen\03 - Brick

Obviously the values of $track$ and $title$ will change per track. Remember, $track$ will zero-pad the track number.

Config Tasks

Each line not starting with a "!" will be part of the config task script.

The task script is simply a list of command line statements, utilising the variables that REACT exposes within the code.

As an example, here is the default LAME-tracks.txt file. Notice that all REACT variables are surrounded by two ampersands (@), or two dollar signs ($); all other code is standard DOS command line syntax. With this in mind you will find working with REACT a lot easier if you are happy executing applications from the command line, more so if you have an understanding of batch files or command line scripting (what I think of as 'DOS scripts').

LAME-tracks.txt:

!Description=LAME -V2 mp3 track files, RG album gain, APE2 and id3v1 tags
!destdir1=@musicdir@\MP3\$cdartist$\($year$) $album$
!dest1=@destdir1@\$track$ - $title$
!Various-dest1=@destdir1@\$track$ - $title$ ($artist$)

echo.> "@dest1@.mp3.tmp"
@encdir@\Tag.exe --nocheck --ape2 -t "ARTIST=@artist@" -t "ALBUM=@album@" -t "TRACK=@track@" -t "TITLE=@title@" -t "YEAR=@year@" -t "GENRE=@genre@" -t "TOTALTRACKS=@numtracks@" -t "FREEDB=@freedbid@" -t "CRC=@crc@" "@dest1@.mp3.tmp"
move "@source@" "@dest1@.wav"
if @islast@==0 goto end
  cd /d "@destdir1@"
  move "@eaclog@" "EAC_log.txt"
  @encdir@\WaveGain.exe -a *.wav --exec @encdir@\lame.exe -V2 --vbr-new --scale %%ALBUM_SCALE%% --tc "AG appl:%%ALBUM_GAIN%%,TG:%%TRACK_GAIN%% dB" "%%INPUT_NAME%%.wav" "%%INPUT_NAME%%.mp3"
  for %%i in (*.mp3) do @encdir@\Tag.exe --force id3v1 --force ape2 --fromfile "%%i.tmp" "%%i"
  del "*.mp3.tmp" "*.wav"
:end


Links

Ask REACT questions in this thread : http://www.hydrogenaudio.org/forums/index.php?showtopic=35158

Download REACT from this thread : http://www.hydrogenaudio.org/forums/index.php?showtopic=36261