Change font size
It is currently 2020-09-24, 10:21 am


Post a new topicPost a reply Page 1 of 2   [ 17 posts ]
Go to page 1, 2  Next
Author Message
 Post subject: THE ultimate cue parser
PostPosted: 2010-11-22, 8:22 am 
Site Admin
User avatar

Joined: 2010-09-27
Posts: 133
just finished coding a killer cuesheet parser for the new cuenation.


upload a horrible cuesheet:
Code:
pe日rFo日RMER "  " ""Roger       Shah"   "
    INDEX 01
      
TITLE "Magic Island - Music for Balearic People 132 (2010-11-19) [DI.fm Streamrip]"
FILE "Roger_Shah_日本語_Magic_Island_اللغة العربية_Music_for_Balearic_People_132.mp3" FLAC

CUENATION FTW!!!
@%^&^SFGSFadfgsdf%$^$%

  T R  ACK 01 AUDIO
#%$@$&%@23456      PERFORMER "اللغة العربية"
    TI   T    LE Intro
    INDEX z01 0:hahaha   0:0
  TRA  CK 02 AUDIO
    P e R F o R m ER "7                 Skies"
            TITLE日本語 (Ben Gold Remix)"
   FILE "Roger_Shah_日本語_Magic_Island_اللغة العربية_Music_for_Balearic_People_132.mp3" MP4
    INDEX z01 1:1
  TR A CK 03 AUDIO
    PERFORMER "Markus             Schulz"
@   TIT  LE "Dark Heart Waiting ("Live" Mix)
@   IND  EX 01 5:yooo!!!06:25
  TRACK 04 AUDIO
    PERFORMER "Gregorio Styreco"
4   TITLE "The Forgotten (ReOrder Deep Remix)"
3 4   INDEX 01 12:27:70
  TRACK 05 AUDIO
    PERFORMER Matt Bukovski
    TITLE "Fresh Air (Type 41 Remix)"
IN  DEX 01 1:2:3
IND EX 01 19:2@#7:00 /// second index


let the parser do its job:
Code:
$good_cue = $cueParser->clean($bad_cue);


and we get a nice:
Code:
PERFORMER "Roger Shah"
TITLE "Magic Island - Music for Balearic People 132 (2010-11-19) [DI.fm Streamrip]"
FILE "Roger_Shah_日本語_Magic_Island_اللغة العربية_Music_for_Balearic_People_132.mp3" MP3
  TRACK 1 AUDIO
    PERFORMER "اللغة العربية"
    TITLE "Intro"
    INDEX 01 00:00:00
  TRACK 2 AUDIO
    PERFORMER "7 Skies"
    TITLE "日本語 (Ben Gold Remix)"
    INDEX 01 00:01:01
  TRACK 3 AUDIO
    PERFORMER "Markus Schulz"
    TITLE "Dark Heart Waiting ("Live" Mix)"
    INDEX 01 05:06:25
  TRACK 4 AUDIO
    PERFORMER "Gregorio Styreco"
    TITLE "The Forgotten (ReOrder Deep Remix)"
    INDEX 01 12:27:70
  TRACK 5 AUDIO
    PERFORMER "Matt Bukovski"
    TITLE "Fresh Air (Type 41 Remix)"
    INDEX 01 19:27:00


maybe i should also make it lowercase & auto-add ending period for vs/pres/feat/etc, lowercase all "van"/"de" in artist name, and delete all that (Original Mix) shyt as well :mrgreen:

PS: the class (including parser, compiler, & cleaner) is only 170 lines of code :lol:
https://github.com/frifox/cueParser/blo ... parser.php


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2010-11-22, 10:01 pm 

Joined: 2010-09-27
Posts: 11
dang! how much would it add to the code if you add the cleaning to actual tracklist (vs., pres. (Original Mix), uppercase everything, etc.)


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2010-11-23, 3:15 am 
Site Admin
User avatar

Joined: 2010-09-27
Posts: 133
1 line per fix... tho i'm still debating with myself whether we should give users freedom or impose a iron first in terms of the artist/title naming format.


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2010-11-23, 12:10 pm 

Joined: 2010-11-23
Posts: 12
If you look at the rule for when to place a full stop at the end of abbreviations you will see that "versus" and "presents" actually should not have a full stop at the end.

I do however support the idea of a parser. It will ultimately lead to more standardised cues, especially for the "van"/"de" scenarios.


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2010-11-23, 4:57 pm 
User avatar

Joined: 2010-09-27
Posts: 96
Location: Finlandia
frifox Wrote:
maybe i should also make it lowercase & auto-add ending period for vs/pres/feat/etc, lowercase all "van"/"de" in artist name

Don't! Names can be written differently, so it's not a rule. E.g. Armand Van Helden and Manuel De La Mare.


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2010-11-23, 5:00 pm 
User avatar

Joined: 2010-09-27
Posts: 96
Location: Finlandia
phool Wrote:
If you look at the rule for when to place a full stop at the end of abbreviations you will see that "versus" and "presents" actually should not have a full stop at the end.

I think that they should, at least in US English. There is also the problem with Mr Sam and Mr. Pitt. However, I would like to see DJ always as DJ, not Dj.

My crazy idea is that the vs. and pres. would be in the database as "versus" and "presents" in a separate DB table, from which the tracklists are generated according to user preference, i.e. abbreviated or not.

Edit: To clarify, if there are multiple artist it would be possible to click on them separately, as on Discogs, with the combinatorial word separated. However, not for collabs like Kyau & Albert (or "Kyau vs. Albert").


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2010-11-23, 5:04 pm 
User avatar

Joined: 2010-09-27
Posts: 96
Location: Finlandia
BTW, is this really allowed in a cue: "Dark Heart Waiting ("Live" Mix)"?


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2010-11-23, 7:53 pm 
Site Admin
User avatar

Joined: 2010-09-27
Posts: 133
lindmik Wrote:
BTW, is this really allowed in a cue: "Dark Heart Waiting ("Live" Mix)"?

i don't think so but at least the parser doesnt crash if someone really does use that

i got an idea: once the cuesheet is uploaded but is still not live (aka, drafts) we can give user a option with be a list of all fixes that we consider valid (Dj->DJ, vs->vs., versus->vs., drop Original Mix, Van->van, etc) and user can checkbox all or just some specific ones that he wants to apply to the cuesheet. this way this Cuesheet Normalization feature will be available but won't be mandatory.


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2010-11-24, 7:07 am 
User avatar

Joined: 2010-09-27
Posts: 96
Location: Finlandia
frifox Wrote:
i got an idea: once the cuesheet is uploaded but is still not live (aka, drafts) we can give user a option with be a list of all fixes that we consider valid (Dj->DJ, vs->vs., versus->vs., drop Original Mix, Van->van, etc) and user can checkbox all or just some specific ones that he wants to apply to the cuesheet. this way this Cuesheet Normalization feature will be available but won't be mandatory.

Still, it should not be change every instance of something, but if it would highlight all possible "mistakes" and then give suggestions (JavaScript popup menu or something) that would be sweet! Could also notice (at least for me) common misspellings, like "pers." "faet.".


Top
 Profile  
 
 Post subject: Re: THE ultimate cue parser
PostPosted: 2011-07-13, 7:26 pm 

Joined: 2011-03-29
Posts: 7
Location: Russia, Saint-Petersburg
frifox, Hello
recently i used your cue parser - it looks and works great!
one little notice - using formatted track number with leading zero looks nice

Code:
154: $out.= '  TRACK '.$key.' AUDIO'.PHP_EOL;
to
154: $out.= '  TRACK '.sprintf("%02d",$key).' AUDIO'.PHP_EOL;


thanks =)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 2   [ 17 posts ]
Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron