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: REACT 2 Released (Read 1280125 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

REACT 2 Released

Reply #1050
SOLVED! It was so easy and near that I almost would like to cry how stupid we can sometimes be.

Here's the whole code with solves:
Code: [Select]
SET trackCueFile="$cdartist$ - $album$.cue"
IF NOT EXIST "%trackCueFile%" (
    COPY "@albumfile@.[mg].cue" "%trackCueFile%"
    ECHO CHCP 1252 ^| PROMPT>>update-cuesheet.bat
)
ECHO @tools@\GSAR.EXE "-s@basename@.wav" "-r%TrackName%.wv" -o %trackCueFile%>>update-cuesheet.bat

AND
Code: [Select]
"@Tools@\gsar.exe" -s%% -r%%%% -o update-cuesheet.bat
CALL update-cuesheet.bat
DEL update-cuesheet.bat

REACT 2 Released

Reply #1051
SOLVED! It was so easy and near that I almost would like to cry how stupid we can sometimes be.

Here's the whole code with solves:
Code: [Select]
SET trackCueFile="$cdartist$ - $album$.cue"
IF NOT EXIST "%trackCueFile%" (
    COPY "@albumfile@.[mg].cue" "%trackCueFile%"
    ECHO CHCP 1252 ^| PROMPT>>update-cuesheet.bat
)
ECHO @tools@\GSAR.EXE "-s@basename@.wav" "-r%TrackName%.wv" -o %trackCueFile%>>update-cuesheet.bat

AND
Code: [Select]
"@Tools@\gsar.exe" -s%% -r%%%% -o update-cuesheet.bat
CALL update-cuesheet.bat
DEL update-cuesheet.bat


If you feel this is a 100% conclusive, no-bugs method to amending the cuesheet, would you mind putting together/editing the wiki to reflect the fix in its entirety, start to finish?

I'd be super appreciative

REACT 2 Released

Reply #1052
If you feel this is a 100% conclusive, no-bugs method to amending the cuesheet, would you mind putting together/editing the wiki to reflect the fix in its entirety, start to finish?

I'd be super appreciative

Done. Buy me a beer if we ever meet.  (EDIT: @nago, Sam Adams is perfectly fine. Thanks. (saving forum space answering here)

EDIT: So if somebody missed; I edited the REACT:Amending Cuesheet File References wiki page. I also added a new header named "Using GSAR to other needs". It contains my instructions to escape certain characters when using GSAR. I tried to make it simple and understandable. Which is hard since english is not my mother tongue.. please correct it if it's rubbish.


REACT 2 Released

Reply #1054
SOLVED! It was so easy and near that I almost would like to cry how stupid we can sometimes be.
Excellent work Akkurat.

Now I've woken up, and have a (almost) clear head I finally realise the issue.  REACT would escape @basename@ and %TrackName% when used in the config.  But by being used in the config they "use up" their escaping, and are therefore written to "update-cuesheet.bat" unescaped.  This is always going to be a problem when creating another batch file on the fly, and should be a consideration for future.

Hopefully we can all sleep well at night again.
I'm on a horse.

REACT 2 Released

Reply #1055
Akkurat, et all,

I have updated the "Using GSAR to other needs" (now called "Using GSAR For Other Requirements") section in the wiki article.

Aside from the English language thing, I found it confusing that the % replacement was mixed in with the " and : replacement.  They are really two completely separate issues.  I also found the example code confusing.

If you are interested, take a look at the article.  You may want to use the diff viewer to compare, or, for ease, I have uploaded screen shots of the section before and after my changes.

Of course, feel free to make further changes, or revert my changes if you think they stink.
I'm on a horse.

REACT 2 Released

Reply #1056
Wow, are you all quite done! 

SS came up with the SED suggestion to help me out back in March 07 I believe.  It certainly kept me happy.  You could not use ampersands then (so his own mod has caused this problem!)  Also I don't think I had square brackets in my names even for various artists.

To be honest I only used the corrected cuesheets for burning with burnnnnn (so I can get the negative numbers on my CDP, there is little other need for a cuesheet with a track extraction).  As I do not burn all my rips I have not noticed problems but I am going to have a look

It seems like you have worked quite well together to get this improved solution in the end and that all the heat was quite productive.

Everyone playing nicely together?

On a technical matter, the replacement of sedlist.txt with a batchfile is because GSAR wont take a list of commands so you make a series of GSAR commands?  I have not taken in all the technicalities of the code page and escaping details just yet

REACT 2 Released

Reply #1057
I have updated the "Using GSAR to other needs" (now called "Using GSAR For Other Requirements") section in the wiki article.

Good teamwork. I changed two characters in it. (wow, a big edit ) One was crucial; there were too many " chars in one of the escape examples.

Back to configuring REACT. Anyone care to bet that how many days will pass until I'm back here with a brain teaser?  (I would like to guess n days. (=never))

It seems like you have worked quite well together to get this improved solution in the end and that all the heat was quite productive.

Everyone playing nicely together?

Yes I think so. Good teamwork from Synthetic Soul, nago & me like I said.

On a technical matter, the replacement of sedlist.txt with a batchfile is because GSAR wont take a list of commands so you make a series of GSAR commands?  I have not taken in all the technicalities of the code page and escaping details just yet

Correct. GSAR had that functionality but it was dropped by the authors. However, it doesn't matter, we have a working solution currently.

REACT 2 Released

Reply #1058

Everyone playing nicely together?

Yes I think so. Good teamwork from Synthetic Soul, nago & me like I said.


Good because at some points it looked a bit adversarial when from I could see you were all trying to reach the same conclusion.  Another example of how wires can get crossed on internet forums!

On that note, don't misunderstand me.  Its just that I think this thread should win an award for being the most helpful and friendly thread around, without wanting to sound to cheesy about it!

REACT 2 Released

Reply #1059
Good teamwork. I changed two characters in it. (wow, a big edit  ) One was crucial; there were too many " chars in one of the escape examples.
Good find!  That could have been the cause for some confused users!  Muchos gracias.
I'm on a horse.

REACT 2 Released

Reply #1060
To be honest I only used the corrected cuesheets for burning with burnnnnn (so I can get the negative numbers on my CDP, there is little other need for a cuesheet with a track extraction).  As I do not burn all my rips I have not noticed problems but I am going to have a look

How does that work?

I still haven't got round to ripping one of my CDs as it has music that plays whilst the CDP negative numbers appear.  What is the best way to rip these kinds of CDs, and does the music playing come out as a separate track or part of the following or previous tracks.

Also can anyone advise me of a way to rip tracks that have multiple indexes in them such as some Rush and ELP tracks.  (I want to be able to have separate tracks for each part, and if possible have the subtrack info incorporated  i.e the track "Karn Evil 9 a) 1st Impression b) 2nd Impression c) 3rd Impression", made into 3 tracks : Karn Evil 9 - 1st Impression, Karn Evil 9 - 2nd Impression", Karn Evil 9 - 3rd Impression"

I am still ripping to FLAC and letting winamp transcode when updating my iPod.  What is the best way to produce iPod compatible AAC files, with artwork?

REACT 2 Released

Reply #1061
Here's one thing I discovered about GSAR yesterday (I was too annoyed to post it until now). It's a undocumented (shame on you authors) limitation of GSAR.

The next code is almost the same as in "amending cuesheet...":
Code: [Select]
SET EscapedSourcedir=@sourcedir@
SET EscapedSourcedir=%EscapedSourcedir::=::%

ECHO "@Tools@\gsar.exe" "-sFilename %EscapedSourcedir%\@basename@.wav" "-r%TrackName%.flac" -o "@LogName@.log">>update-log.bat

I'm trying to amend the EAC log a bit to my liking. The following shows what the command expanded and run tells us:
Code: [Select]
"C:\PROGRA~1\REACT2\tools\gsar.exe" "-sFilename D::\Music\RIPPED\EAC\Various - AnotherLateNight - Tommy Guerrero - 01 - Can't Get Up If You Can't Get Down (US Navy Port Authority Soul Band).wav" "-rVarious - AnotherLateNight - Tommy Guerrero - 01 - Can't Get Up If You Can't Get Down [US Navy Port Authority Soul Band].flac" -o "Various - AnotherLateNight - Tommy Guerrero.log"

gsar: command error, length of search or replace buffer must not exceed 128 chars

I know I could do this same with splitting the GSAR command a bit BUT it's still a could-be-a-problem to long filenames in "amending cuesheet...". Any thoughts on this?

This finding puts the GSAR author's comment about the removed @ functionality into a new light; the comment was: "The @ is not really needed anymore on Win32 due to the length of the command line.".

EDIT: forgot the GSAR error message.

REACT 2 Released

Reply #1062
I haven't read this thread for months until now - still trying to digest it all.  Synthetic Soul, I was the first person that asked for help in converting my cue files to replace <filename>.flac to .cue within the cue file.  You figured out the very first SED syntax.  I've been using it ever since and it works fine with hundreds of CD's so far.  I'm not sure why there has been so much discussion recently to change it to GSAR (although admittedly I probably haven't run into any "&" names).  I create FLAC images with "corrected" cue sheets (using .wav, not .flac within it) and keep a copy of the cue sheet outside the image too.

I'm still using EAC 0.95 b4 because I've had no reason to upgrade.  External FLAC support through REACT works great.  I've been using REACT + Arcue for months.

Here is the snippet of my FLAC image code:

Code: [Select]
IF NOT @ImageExt@==flac GOTO end_flac_image
    SET dest="@ImageDir_Flac@"
    IF NOT EXIST %dest% MKDIR %dest%
    IF %embed_cover%==1 SET Cover_tag=--picture="|image/jpeg|||@cover@"
    @tools@\SED.EXE s/".flac"/".wav"/g < "@cuesheet@" > "@ImageDir_Flac@\@basename@.cue"
    @tools@\flac.exe @Opt_Flac@ %RG_Flac% %Cover_tag% -T "%ArtistField%=@cdartist@" -T album="@album@" -T totaltracks="@numtracks@" -T date="@year@" -T genre="@genre@" -T comment="@comment@" -T encoding="Flac @Ver_Flac@ @Opt_Flac@" --tag-from-file="cuesheet=@ImageDir_Flac@\@basename@.cue" --tag-from-file="eaclog=@eaclog@" %ar_tag% "@source@" -o "@image@"
    MKDIR %dest%\covers
    MOVE /Y "@image@" %dest%
    IF %have_cover%==1 MOVE /Y "@cover@" %dest%\covers\"@basename@.jpg"
    PAUSE
    MOVE /Y *.jpg %dest%\covers
    IF %ar_copy%==1 COPY /Y @arlog@ %dest%
:end_flac_image



Is there an advantage to upgrading to the latest EAC beta or GSAR over my SED method?  Am I missing something I don't know about?

-Robert

REACT 2 Released

Reply #1063
... SED syntax.  I've been using it ever since and it works fine with hundreds of CD's so far.  I'm not sure why there has been so much discussion recently to change it to GSAR (although admittedly I probably haven't run into any "&" names).

Have you manually checked all your cuefiles? If one of the SED commands "fails" (no match in search&replace, or wrong replace string) because of the unescaped chars, the cuefile is just not amended for that filename.. there's no indication whatsoever that something went wrong (you can't catch anything from the fast proceeding console window).

Also I do again have to stress out that it's not just the & char that could cause problems. At least these could (my tests are incomplete) cause problems: []\&^$.|?*+(). Rarely used or not in filenames but still you have to count these in.

Is there an advantage to upgrading to the latest EAC beta or GSAR over my SED method?  Am I missing something I don't know about?

Well, I don't know about the EAC upgrade but this I can say; I wouldn't use SED (without proper escapes), and the GSAR is something we still need to think about because of the limitation I discovered yesterday (look my last post).

EDIT:
Code: [Select]
@tools@\SED.EXE s/".flac"/".wav"/g < "@cuesheet@" > "@ImageDir_Flac@\@basename@.cue"

Ok, I missed this. This line doesn't do anything to your cuefiles. I fail to see what you're trying to do here. Your SED code tries to find ".flac" strings (WITH quotes) and replace them with ".wav" string  (WITH quotes). There's no such strings in cuefiles unless you have modified them earlier.

REACT 2 Released

Reply #1064
I know I could do this same with splitting the GSAR command a bit BUT it's still a could-be-a-problem to long filenames in "amending cuesheet...". Any thoughts on this?
Two:
  • 128 characters is pretty limiting.
  • I can only suggest the two techniques in the wiki article REACT:Using Short Filenames to solve the problem.  Using SUBST is probably the tidiest, but for your example - where the root path is actually quite short - using the DOS 8.3 path may be the only relevant solution.
I'm on a horse.

REACT 2 Released

Reply #1065
sadly, all of this talk has made me feel justified for the workaround I came up with months ago...

I made a small command line tool with AutoIt to do the replacement. Seriously not the most efficient fix, but judging by the fact that we still don't have a proper working fix, it seems like it certainly was the easiest.

REACT 2 Released

Reply #1066
Code: [Select]
@tools@\SED.EXE s/".flac"/".wav"/g < "@cuesheet@" > "@ImageDir_Flac@\@basename@.cue"

Ok, I missed this. This line doesn't do anything to your cuefiles. I fail to see what you're trying to do here. Your SED code tries to find ".flac" strings (WITH quotes) and replace them with ".wav" string  (WITH quotes). There's no such strings in cuefiles unless you have modified them earlier.


All my cue sheets are fine.  The quotes are not used in the replace parameter.  It replaces

FILE "Queen - (1991) Greatest Hits II.flac" WAVE
with
FILE "Queen - (1991) Greatest Hits II.wav" WAVE


I'll have to go back 10 pages to see what you guys are trying to do, but IIRC, REACT 2.0 was working fine for everybody until EAC 0.99 came out then discussion started happening again.  I was just hoping somebody could catch me up the latest state of REACT.  How come there is no "official" version 2.1?

-Robert

 

REACT 2 Released

Reply #1067
Two:
  • 128 characters is pretty limiting.
  • I can only suggest the two techniques in the wiki article REACT:Using Short Filenames to solve the problem.  Using SUBST is probably the tidiest, but for your example - where the root path is actually quite short - using the DOS 8.3 path may be the only relevant solution.

It's very limiting.. and at the moment I'm not going to do any bubblegum fixes.

I sent the authors email.. I'm going to wait what they have to say about this.. hell, I'm in no hurry; I've been modifying REACT to my likings for about 2 months already (on and off). 

I made a small command line tool with AutoIt to do the replacement. Seriously not the most efficient fix, but judging by the fact that we still don't have a proper working fix, it seems like it certainly was the easiest.

Can we see it?

REACT 2 Released

Reply #1068
Can we see it?

It's sort of embarrassing that I couldn't whip up something similar with perl or C, but... :sigh: it does seem to be working, so...
CueFix.au3

I replace by index number only, and I stop after the first replacement. It's a system that seems to work, though I suppose if you are doing replacements only on one track or a series of tracks that doesn't start at track #1 you could run into some issues, but you can tweak the regex within to your liking, it's fine.

Since I do the replacement in AutoIt, though, perhaps you can just bang out the replacement from straight in REACT? This was really only a 5 minute effort after I gave up with sed, so maybe someone can expand if they'd like to.

REACT 2 Released

Reply #1069
Code: [Select]
@tools@\SED.EXE s/".flac"/".wav"/g < "@cuesheet@" > "@ImageDir_Flac@\@basename@.cue"

Ok, I missed this. This line doesn't do anything to your cuefiles. I fail to see what you're trying to do here. Your SED code tries to find ".flac" strings (WITH quotes) and replace them with ".wav" string  (WITH quotes). There's no such strings in cuefiles unless you have modified them earlier.

All my cue sheets are fine.  The quotes are not used in the replace parameter.  It replaces

FILE "Queen - (1991) Greatest Hits II.flac" WAVE
with
FILE "Queen - (1991) Greatest Hits II.wav" WAVE

Well... what can I say, I'm shocked. That's not how it should work, if I'm reading the manual correctly. One more reason to NOT use SED.. at least to me it's.

I'll have to go back 10 pages to see what you guys are trying to do, but IIRC, REACT 2.0 was working fine for everybody until EAC 0.99 came out then discussion started happening again.  I was just hoping somebody could catch me up the latest state of REACT.  How come there is no "official" version 2.1?

Maybe somebody could... I'm little hesitant to bring you up to speed with my limited knowledge about this subject.. I might miss out something important.

Why no 2.1 version? Well, original REACT is Tycho's masterpiece and Synthetic Soul has only released a mod to address some bugs and fixes (+some new functionality) to problems created by EAC changing it's functionality. I think we all agree that the next "proper" version should be a complete rewrote of the REACT... and I think that we're waiting somebody to do that.

REACT 2 Released

Reply #1070
It's sort of embarrassing that I couldn't whip up something similar with perl or C, but... :sigh: it does seem to be working, so...
CueFix.au3

Oh, it was only to amend cuesheets.. I thought that you have made a general "search&replace" tool.

OT: I had the weirdest and strongest déjà vu I can remember; have you used the following comment somewhere else? (";SHAAAAAAAAAAAAAZZZZZZZZAAAAAAAAAAAAAAAAAAAAAAAAM! I'm really sorry if you were hoping these comments to be useful.") 

REACT 2 Released

Reply #1071
Question. Out of the formats Flac, tak, wv, mp3, aac and ogg, the only one which needs an amended type is MP3? all five others can use 'wave' correctly?

REACT 2 Released

Reply #1072
Yes.  The three (audio) options are WAVE, MP3 and AIFF.  As you can see, MP3 and AIFF are pretty specific, so WAVE covers everything else.

I have no idea what applications do, or do not, pay attention to this file type value.  It's very possible you could use WAVE for MP3 files and get away with it.  IIRC foobar is quite strict though.


RE: A F'n'R utility: it is very possible that we could just add it into the REACT EXE.  It seems a little overkill to call an app of REACT's size and purpose to do a find and replace, but it would at least be tidy/convenient.

I already adapted REACT so that it behaves differently if it only receives a cuesheet as a parameter.  We could expand that further so it will look for switches, or just make it so simple that you just give it "needle", "haystack", and "file" as three parameters.

If no-one has any reason not to use the 8.3 path we may just be OK using that with GSAR though.
I'm on a horse.

REACT 2 Released

Reply #1073
If no-one has any reason not to use the 8.3 path we may just be OK using that with GSAR though.

It just occurred to me that where would we actually use that in GSAR? The limitation is: "...length of search or replace buffer must not exceed 128 chars". And of course we can't truncate the search or replace strings. Am I missing something?

As for the other points, your suggestion to embed this feature to REACT sounds good to me... but I'm still waiting for the GSAR authors to reply.. shouldn't take too long since they responded very quickly to my last query.

EDIT: Just in, a response from GSAR author. You need to recompile gsar to get longer buffer support. And a very short and easy instructions to change the code. So, what should we do?

REACT 2 Released

Reply #1074
The perl solution I came up with can be gotten Here, it's just a measly 1KB, but will only work if you have perl installed. Akkurat tested it and said it worked pretty well, so I'll have faith in it.

Unfortunately, if you compile it' it's going to take up 1.8MB. Still, the solution does appear to work 100%, so if you're in a jam, this will work.

Syntax is:
Code: [Select]
cuefix.pl "cuesheet.cue" "@basename@" "%TrackName.flac"

or .wv .mp3 .m4a, etc etc etc.