INTERACT FORUM

Please login or register.

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

Author Topic: Panes - a couple of questions  (Read 3501 times)

icstm

  • World Citizen
  • ***
  • Posts: 150
Panes - a couple of questions
« on: April 06, 2012, 09:59:33 am »

Thanks all with my last question.

I would like to do a couple of things in the Panes view:

1) Change the width of certain categories at the top?

2) Create a category that has custom bit rate groups (eg <=140, 140-180, 180-250, 250-315,320,320+)

3) Similar to 2, take the album bitrate from the folder name (eg "Jagged Little Pill (1995) [845kps]" or "Jagged Little Pill Acoustic (2005) [VBR197kps]"


For 2) I can use Library Field bitrate and group by 50, but that does not really work as flac are all over the place
For 3) I have tried RemoveRight(Right([Filename (path)],9),1) that leaves [128kps] for 3 digit folder names
Can I search for text between "[" and "kps]" and strip that out?


Any thoughts?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Panes - a couple of questions
« Reply #1 on: April 06, 2012, 11:20:52 am »

1) They are auto-sized.

2) So, how do you want to handle the FLACs?

3) Use a column with the expression:

   regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 1, 1)

If you want the VBR (or other) portion included, use the same expression, but with the capture paren moved slightly left:

   regex([Filename (path)], /#\[([A-Z]*\d+)kps\]#/, 1, 1)
Logged
The opinions I express represent my own folly.

tls62dk

  • Galactic Citizen
  • ****
  • Posts: 406
Re: Panes - a couple of questions
« Reply #2 on: April 06, 2012, 11:36:08 am »

1) I think you can disable the Auto Size under options Tree & View/Auto size columns. After disabling this feature you can drag the columns to the width you like.

TLS
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Panes - a couple of questions
« Reply #3 on: April 06, 2012, 12:22:21 pm »

Those controls affect the file list views and tree views, not the Panes widths, which are auto-sized always.
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Panes - a couple of questions
« Reply #4 on: April 06, 2012, 06:06:06 pm »

2) Create a category that has custom bit rate groups (eg <=140, 140-180, 180-250, 250-315,320,320+)

I use one expression pane to show track rating, album rating and bitrate (as a measure of quality)...

Code: [Select]
Τ Mid(★★★★★,0,[Rating]); Σ [a.Rating.x]; Δ If(IsEqual([File Type], log), / Log, If(IsEqual([File Type] , flac, 8), ★★★★★, If(IsEqual([Bitrate], 256, 5), ★★★★, If(IsEqual([Bitrate], 192, 5), ★★★, If(IsEqual([Bitrate], 128, 5), ★★, ★))))&DataType=[List]
Each is labelled with a symbol to minimize the pane width. FLAC files (the only lossless type I use) are given 5 stars. IsEqual([Bitrate], N, 5) means '[Bitrate] > N'. I use LOG (dummy) files in a number of ways, so they're handled as well.

A second pane is identical, except it's set to OR the selected values, instead of AND. Together, they allow selection of these values in any relevant combination.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Panes - a couple of questions
« Reply #5 on: April 06, 2012, 07:59:15 pm »

Stars Galore!

I can never read these lengthy single-line expressions with the embedded If()'s, so I have to copy/paste/reparse w/newlines.  Here it is, with some variation for fun, in the off-chance the modified format helps reading. I believe they are equivalent:

Code: [Select]
Τ Mid(★★★★★,0,[Rating]);/
Σ [a.Rating.x];/
Δ IfElse(
     IsEqual([File Type], log),       / Log,
     IsEqual([File Type], flac, 8),   ★★★★★,
     Compare([Bitrate], >, 256),      ★★★★,
     Compare([Bitrate], >, 192),      ★★★,
     Compare([Bitrate], >, 128),      ★★,
     1,                               ★
  )/
&DataType=[List]
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Panes - a couple of questions
« Reply #6 on: April 06, 2012, 09:15:54 pm »

Actually, the stars aren't the same. The one's I use are a little more demure, but they won't display here. Nevertheless, if we are to believe our mothers, neatness and clean underwear are important too. I've updated my expression accordingly. ;)

It's to bad this format won't work in expression fields and elsewhere (like the Theatre View caption setting).
Logged

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #7 on: April 07, 2012, 02:20:51 pm »

Thanks all, it looks like these are all rather thoughtful posts!

if I wasn't spending this w/e doing DIY, I would give these a go straight away, as it is, it might have to wait a day or so then I will report back.
Logged

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #8 on: April 10, 2012, 05:30:02 am »

Hope everyone had a good Easter break.
A couple of questions:

@rick.ca 
How does album rating work? I can see track ratings.
Then if you can assign an album a rating, so that all tracks in that album are shown when you select, can the same be done with bitrate?
That was why I was writing a bitrate into the folder name, so that all tracks could be coded to the same "quality" marker.
Logged

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #9 on: April 10, 2012, 01:01:34 pm »

1) They are auto-sized.

2) So, how do you want to handle the FLACs?

3) Use a column with the expression:

   regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 1, 1)

If you want the VBR (or other) portion included, use the same expression, but with the capture paren moved slightly left:

   regex([Filename (path)], /#\[([A-Z]*\d+)kps\]#/, 1, 1)
That is fricking phenomenal! Now I just need to learn Regular expressions to know how to read that.

OK, so a couple of questions, both trying to the same thing, but first

rick/MrC - I cannot get that code to do anything. I have put in a pane as an expression and all it shows is "all expressions (1)" and "Others" in that pane

Then
1) Using your folder name stripping, how to I take that first list you generated (bold above) then truncate anything over 320 to either say "320+" or "flac"
Indeed can I treat that list as a list and process that list, so that I can group into buckets like the other code should do?

2) Assuming that I get that rating code to work, how do I ensure all tracks in an album are given the same quality rating? (ie my post above from this morning)
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Panes - a couple of questions
« Reply #10 on: April 10, 2012, 01:40:14 pm »

I'm not sure which expression you're saying doesn't work.  Can you clarify?

Here's the modified expression for filename kbs detection, and will handle cases where there is none detected:

ifelse(
   !regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 0, 1),    No KPS detected,
   Compare([R1], >, 320),                                                 320+,
   1,                                                                             [R1]
)

It should be pretty clear what it is doing.  Yes, you can group in buckets.  You'd use

  formatrange([R1], 160, 2)

instead of (i.e replace) the [R1] above.  Set the bucket size (160 used) as desired.
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Panes - a couple of questions
« Reply #11 on: April 10, 2012, 04:18:48 pm »

@rick.ca
How does album rating work? I can see track ratings.

In my library, [a.Rating] is an album-related field with the rating assigned the album by AllMusic.

Quote
Then if you can assign an album a rating, so that all tracks in that album are shown when you select, can the same be done with bitrate?

You could, if you wanted to record a per-album value in a separate album-related field. I prefer to use [Bitrate] directly. For my library, the expression I use assigns the same value all the tracks of an album. If it doesn't, I'd rather not be misled by some arbitrary value assigned to the album. I do have some old MP3 albums where I've replaced some tracks with better quality versions from subsequent compilation albums.
Logged

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #12 on: April 11, 2012, 05:08:14 am »

Thank you both for taking the time to walk me through all this!

I'm not sure which expression you're saying doesn't work.  Can you clarify?
The code I was decribing the behavior was this code
Code: [Select]
Τ Mid(★★★★★,0,[Rating]);/
Σ [a.Rating.x];/
Δ IfElse(
     IsEqual([File Type], log),       / Log,
     IsEqual([File Type], flac, 8),   ★★★★★,
     Compare([Bitrate], >, 256),      ★★★★,
     Compare([Bitrate], >, 192),      ★★★,
     Compare([Bitrate], >, 128),      ★★,
     1,                               ★
  )/
&DataType=[List]
Even if I get rid of the first 2 rating scehemes and just leave the bitrate scheme I could not get it to do anything. As I said I entered it as an expression, is that wrong? I am not sure if whatever I am doing wrong to not get this working is meaning my subsequent attempts at the things below are also failing.

I will try your other code tomorrow, as I am out tonight.


However I am not working at full speed today, so please bear with me whilst I share these thoughts.


A)
This code outputs numbers:
Code: [Select]
regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 1, 1)It is this set of numbers I want to group

B)
Taking this array I would like it formatted something like:

Code: [Select]
1 - 160 [=isrange([EXTRACTED_TEXT],1-160)]=1
161 - 320 [=isrange([EXTRACTED_TEXT],161-320)]=1
HIGH [=isrange([EXTRACTED_TEXT],321-99999)]=1
adding additional groupings (eg at 128,192,256 etc) as required

As I understand it from your new code, [EXTRACTED_TEXT] will be [R1] from the regex?



C)
You are suggesting using this code:
Code: [Select]
ifelse(
   !regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 0, 1),       No KPS detected,
   Compare([R1], >, 320),                                          320+,
   1,                                                           [R1]
)

As I understand it your first line handles the No KPS detected case.
The second line creates a >320k case
In your third line test 3, "1" is always true, so I think it outputs all EXTRACTED_TEXT values as captured in [R1] by the regex?

formatrange([R1], 160, 2) groups by 160, but for custom groupings I assume I can either create more cases before the "1" or use something like (B)?

So for example is this right? :

Code: [Select]
ifelse(
   !regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 0, 1),              No Album KPS detected,
   Compare([R1], >, 320),                                                 Lossless,
   Compare([R1], >, 318),                                                 320k,
   Compare([R1], >, 255),                                                 256k-320k,
   Compare([R1], >, 192),                                                 192k-255k,
   1,                                                                     formatrange([R1], 32, 2)
)



D)
I would be happy either adding the extracted text (eg 221), or the grouped version (161-320) to a custom field if that helps - is there any benefit to this? If there is, how would I do it.

Thank you again for your support!
Logged

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Panes - a couple of questions
« Reply #13 on: April 11, 2012, 06:54:27 am »

Quote
Even if I get rid of the first 2 rating scehemes and just leave the bitrate scheme I could not get it to do anything. As I said I entered it as an expression, is that wrong?

This works fine for me...

Code: [Select]
IfElse(
     IsEqual([File Type], flac, 8),   ★★★★★,
     Compare([Bitrate], >, 256),      ★★★★,
     Compare([Bitrate], >, 192),      ★★★,
     Compare([Bitrate], >, 128),      ★★,
     1,                               ★
 )/
&DataType=[List]
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Panes - a couple of questions
« Reply #14 on: April 11, 2012, 11:09:00 am »

The code I posted works (it was tested) before posting.  Check for extra newlines before/after the code block, or if you didn't copy/paste, try that instead.

Some responses to your A-D.

A) Yes, the regex() grabs the numeric portion of the bitrate from your filepath.  Its value is stored in [R1].

B) The code syntax your using is the Search syntax.  In these expressions, you'd just use:

   isrange([EXTRACTED_TEXT],1-160)

in place of the testing expression (for example, the Compare() below).  Using a sequence of IsRange() functions can be identical to a sequence of Compare() functions.  Use which ever suit your needs.

C) Looks like you're on top of this stuff.

D) You certainly could grab the value and stash it into a user-defined field.  You could do this with Auto-Import rules for new files being imported into MC.  Or you can make the field be an expression (Calculated data) field.  Depends entirely on how you are going to use it.  I tend to generally place raw, simple data in fields, and use expressions to perform formatting in a view.  Whatever works well for you.
Logged
The opinions I express represent my own folly.

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #15 on: April 11, 2012, 06:27:07 pm »

I'll post a screenshot of where and what I get using this code tomorrow (it is a bit late here now and I think I have to first upload the shot to somewhere other than here).
Code: [Select]
IfElse(
     IsEqual([File Type], flac, 8),   ★★★★★,
     Compare([Bitrate], >, 256),      ★★★★,
     Compare([Bitrate], >, 192),      ★★★,
     Compare([Bitrate], >, 128),      ★★,
     1,                               ★
 )/
&DataType=[List]

but basically I have put in a pane as an expression and all it shows is "all expressions (1)" and "Others" in that pane. I copied and pasted the code and there are now leading or trailing characters.

If this (or any other) code cannot run correctly on my machine, what could be causing that? Do I need a special file or runtime?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Panes - a couple of questions
« Reply #16 on: April 11, 2012, 06:57:59 pm »

I don't see how the code above could produce "Others".  That word can come from an IsRange() statement.
Logged
The opinions I express represent my own folly.

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #17 on: April 12, 2012, 04:25:29 am »

Slight error on my part when I said that any other code does not appear to correctly run.

"regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 1, 1)" that ran fine.


Thanks for your help on this MrC - Are there any other tests I could try? I am definately getting that output using the star code and an equally unhelpful output using the formatrange code you provided (though from memory rather than getting others I think it lists A-Z, but in this case it is empty, whereas Others has all albums
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Panes - a couple of questions
« Reply #18 on: April 12, 2012, 09:57:24 am »

We're probably going to have to see your actual code and some results in the errant categories (e.g. show some screenshots, or output, from each of the A-Z and Others).
Logged
The opinions I express represent my own folly.

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #19 on: April 12, 2012, 10:20:10 am »

OK, will do -
thanks in advance for your help!
Logged

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #20 on: April 12, 2012, 01:03:14 pm »

ok, this is strange but true, so might help others.
given that I had copied and pasted any of the discussed code multiple times with no luck, I simply "removed this category" then "added new category to left" and this fixed it so that in both pane views either the track based bitrate rating or the album based one now works!
However a big thank you to MrC and rick.ca

Quick final question that I think has been asked before in the equivalent of the panes view in WinAmp you see the number of tracks and/or artists in the next pane against each item.

So if you have columns for

Genre, artist, album

you can see the number of artists and tracks for each genre, the number of albums and tracks for each artist and the year and number of tracks for each album (as per screenshot)
Logged

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #21 on: April 12, 2012, 01:19:43 pm »

finally slightly OT, I have an unused library that has the "delete" option greyed out. Any ideas?
Logged

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Panes - a couple of questions
« Reply #22 on: April 12, 2012, 04:42:27 pm »

Quote
you can see the number of artists and tracks for each genre, the number of albums and tracks for each artist and the year and number of tracks for each album

The first line of each pane shows the number of unique values for that category, for the current selection. The number of files selected is shown in the status bar.

Quote
finally slightly OT, I have an unused library that has the "delete" option greyed out. Any ideas?

Delete what?
Logged

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Panes - a couple of questions
« Reply #23 on: April 13, 2012, 04:03:16 am »

Thanks rick

1)
Yes I reallise that of any given highlighted row in the first pane the subsequent panes show their totals. But what I was suggesting that this information could be shown within the first pane so that all rows can show some of this information

2)
Delete an unused library.
My current active library can be deleted, but not this other library, that is empty. The option to remove the library is shaded.
I have tried adding something to it, tried making it active, etc but it is protected somehow from being removed from the library list.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Panes - a couple of questions
« Reply #24 on: April 13, 2012, 07:16:46 am »

It sounds like that's the default library, which cannot be removed.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up