INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Forcing 2 digit track numbers  (Read 1901 times)

c1c9k72

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 332
  • So many worlds, so much to do, so little done...
Forcing 2 digit track numbers
« on: May 16, 2006, 06:07:00 pm »

I'm working on an expression for complete albums, and it looks like this.

([Artist]) - [Album] - FormatNumber([Track #, 0], 2) - [Name]

Works fine, except that I can't get FormatNumber to force the single digit track numbers into double digits.  Does anyone know where I'm going wrong ?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Forcing 2 digit track numbers
« Reply #1 on: May 17, 2006, 01:31:07 am »

try:

([artist]) - [album] - if(isequal([Track #],10,3),0[Track #],[Track #]) - [name]

-marko

c1c9k72

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 332
  • So many worlds, so much to do, so little done...
Re: Forcing 2 digit track numbers
« Reply #2 on: May 17, 2006, 06:33:11 am »

Marko,

Thanks a lot.  I've got no idea why it works, but that does exactly what I wanted.  I really appreciate the help.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Forcing 2 digit track numbers
« Reply #3 on: May 17, 2006, 06:42:19 am »

you're welcome. many clever things are possible using database expressions.
http://www.jrmediacenter.com/DevZone/DBExpressions.htm


if(isequal([Track #],10,3),0[Track #],[Track #])

what this does in english:

if
[track #] is less than 10
then output 0[track #]
otherwise
output [track #]



c1c9k72

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 332
  • So many worlds, so much to do, so little done...
Re: Forcing 2 digit track numbers
« Reply #4 on: May 17, 2006, 06:50:48 am »

Yeah, I've set up a lot of internal expressions for my MC which have made things a lot simpler (for me.)  I'm surprised that an if-then routine had to be employed for this particular function.  I figured FormatNumber would do it, by definition, but this is great.

Actually, this gives me an idea for something else I've been meaning to do.  Breaking three and four digit track numbers into season/episode data for TV shows I've recorded.

Thanks again.  Back to the expressions lab.
Logged

dcwebman

  • Citizen of the Universe
  • *****
  • Posts: 2154
Re: Forcing 2 digit track numbers
« Reply #5 on: May 17, 2006, 06:55:13 pm »

try:
([artist]) - [album] - if(isequal([Track #],10,3),0[Track #],[Track #]) - [name]
I remember having to do this type of thing last year when I had some double CD's. I just tried this though and for some reason it doesn't seem necessary anymore. The above expression gives an extra 0 in front of every track number. The below expression works by putting 0's in front of the single digits.

CD[Disc #] - [Track #] - [Artist] - [Name]

Did MC change recently to not have to go through the extra steps anymore?
Jeff
Logged
Jeff

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Forcing 2 digit track numbers
« Reply #6 on: May 18, 2006, 02:06:07 am »

I remember having to do this type of thing last year when I had some double CD's. I just tried this though and for some reason it doesn't seem necessary anymore. The above expression gives an extra 0 in front of every track number. The below expression works by putting 0's in front of the single digits.

CD[Disc #] - [Track #] - [Artist] - [Name]

Did MC change recently to not have to go through the extra steps anymore?
Jeff

I don't fully understand what you mean?

by default, MC displays all track numbers less than 10 as a single digit. the expression I posted displays tack numbers less than 10 as two digit numbers (adds a leading zero), as per the request in the initial post.

the template you posted will not add a zero to anything. whether whatever you're getting at is necessary really depends on what it is you're getting at :)

-marko.

dcwebman

  • Citizen of the Universe
  • *****
  • Posts: 2154
Re: Forcing 2 digit track numbers
« Reply #7 on: May 18, 2006, 10:20:05 am »

Sorry if I wasn't clear. Let me try this. If I use MC 184 and go to an MP3 track that has the Track # field containing a single digit (1-9), select Rename Files From Properties, uncheck Directories, check Filename, have the Rule to simplify this example as:

[Track #]

and click OK, the resulting filename will be

01.mp3

It never did that before, as it would produce 1.mp3 like you mentioned and we had to create these expressions to get the leading 0 for single digits. Now it seems like you don't have to. I tried this on 2 separate machines and they both did the same thing. Double digit track #'s stay double digits.

Something must have changed in MC because I haven't changed any format with the default Track # field. Hopefully that was clearer. If not, please try it on your machine and see if you get the same results.

Jeff
Logged
Jeff

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Forcing 2 digit track numbers
« Reply #8 on: May 18, 2006, 03:22:10 pm »

ahah, i see where you're coming from now (i think)...

yes, using [track #] in the filename mask in the rename from properties tool adds a leading zero to track numbers less than 10. MC has done this for a long time, I can't actually remember a time it didn't do this.

Inside MC is a different story though. MC will always display track numbers less than 10 as a single digit. It's possible to use database expressions to enable a two-digit format display inside MC.
Pages: [1]   Go Up