INTERACT FORUM

Please login or register.

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

Author Topic: surname of the field [Artist] in alphabetical order - comma with swap function  (Read 2777 times)

millicio

  • Member
  • *
  • Posts: 4

Good morning
I read the previous topics and I wanted to ask if it is possible to put the surname of the field [Artist] in alphabetical order, leaving the name in front of the surname.

In this way:
I create a new field called [Artist Swap Toggle]
(Data type: Integer - Relational: Store one value for each artist - Edit type: Check - Acceptable value: 0.1)

Now, instead of creating a new field called [Artist (smart)] for the swap function, I wonder if there is another expression that alphabetizes the word after the space (word_a word_b) for names with a value of 0

Artist                    |           Artist Swap Toggle
Whitney Houston                          0
Pink Floyd                                    1
Talking Heads                               1
Stevie Wonder                              0
Paul Young                                   0

If, for now, this is not possible...  I wanted to know how to use the swap function in the new field [Artist (smart)] without adding the comma:

Whitney Houston -> Houston, Whitney
Whitney Houston -> Houston Whitney

To edit many names, now I do:

I add another field called [New Artist name]
Library Tools -> Move / copy fields [Artist (smart)] -> [New Artist name]
Library Tools -> Find and replace (I remove the comma in the [New Artist name] field)

I would like to avoid all these steps
Thank you
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732

your post is somewhat confusing to me, but i think....if you do something like this, it will work

Code: [Select]
if(isequal([Artist Swap Toggle], 0),removecharacters(swap([artist]),/,,0),[artist])
this will give you Houston Whitney if artist swap toggle is 0, and whitney houston if it is not.  if there is a , in the artist name on purpose than it won't work but for the few artists that use a , in their name i think you could sort those out manually

if i'm missing something let me know and we'll get there.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3097

The toggle works fine. The other option is to create a string field (like Artist Manual) in which you put  the name you want. You only do that if you do not want the swap to occur. It is like your toggle of 1, but with a value. Then, you use an expression to do the SWAP if Artist Manual is blank, otherwise use the value in Artist Manual. That gives you the flexibility to do the swap or override it with the exact name you want to use.
Logged

millicio

  • Member
  • *
  • Posts: 4

Thanks for the reply, but that's not what I meant
My question comes after I read glynor's answers in the topic: Sort Artist by Family Name
https://yabb.jriver.com/interact/index.php?topic=104077.0

Currently if I order the [artist] column from a to z I get:
-----------------------
Artist (a-z)
-----------------------
Paul Young
Pink Floyd
Stevie Wonder
Talking Heads
Whitney Houston

and there is no way to sort the name of bands and surnames of persons

I think it would be nice if in future jriver would be able to order the [Artist] column in this way from a to z:

-------------------------------------------------------
Artist (a-z)                        | Artist Swap Toggle
------------------------------------------------------
Whitney Houston                           0
Pink Floyd                                     1
Talking Heads                                1
Stevie Wonder                               0
word_a word_b                              1
word_a word_b                              0
Paul Young                                     0

[Artist Swap Toggle] with value 0 -> first word
[Artist Swap Toggle] with value 1 -> Second word (after space)

Therefore I would like to use only one field called [Artist Swap Switching] which allows jriver to know which of the two words should be used in alphabetical order (if the first or second word which appears in the [Artist] field).
In this way I do not have to add another field with the swap function, where the name of the artist appears inverted (word_b word_a)

Do you think this will be possible in the next versions of jriver?



If I use your function if(isequal([Artist Swap Toggle], 0),removecharacters(swap([artist]),/,,0),) I get:

-------------------------------------------------- --------------------------
Artist                           Swap Toggle                   My field (a-z)
-------------------------------------------------- --------------------------
Whitney Houston                    0                        Houston Whitney
Stevie Wonder                        0                        Wonder Stevie
Paul Young                             0                        Young Paul
Pink Floyd                              1
Talking Heads                         1

The value 1 does not return any name

I hope my question is clearer and thanks for the support.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3097

The idea is to have 2 artist fields - one for display and one for sorting. You create an Artist Sort field which is either the manual name you enter (or the unswapped name) or the swapped name. So  you would have Artist Sort entries like

Houston, Whitney
Pink Floyd
Wonder, Stevie
Talking Heads

You sort on those entries and you can use those for display or you can use the original Artist field for display.

There are old threads on this if you need them. I can find them if needed.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732




If I use your function if(isequal([Artist Swap Toggle], 0),removecharacters(swap([artist]),/,,0),) I get:

-------------------------------------------------- --------------------------
Artist                           Swap Toggle                   My field (a-z)
-------------------------------------------------- --------------------------
Whitney Houston                    0                        Houston Whitney
Stevie Wonder                        0                        Wonder Stevie
Paul Young                             0                        Young Paul
Pink Floyd                              1
Talking Heads                         1

The value 1 does not return any name

I hope my question is clearer and thanks for the support.

see my post again, i modified.  it will now output the normal artist name if there is a 1
Logged

millicio

  • Member
  • *
  • Posts: 4

Can you also send me the opposite function ?, where the value 1 inverts the name with surname

-------------------------------------------------- ----
Artist (a-z) | Artist Swap Toggle
-------------------------------------------------- ----
Whitney Houston  1 -> Houston Whitney
Pink Floyd            0 -> Pink Floyd
Talking Heads       0 -> Talking Heads
Stevie Wonder      1 -> Wonder Stevie


in fact the value 0 does not automatically appear in the tag of the file and therefore I have to put and remove the flag in all the traces


You sort on those entries and you can use those for display or you can use the original Artist field for display.

There are old threads on this if you need them. I can find them if needed.

I have read the old topics, but using a new field with the swap function I still have some little problems to put in alphabetical order the artist in the panes or categories, especially when they are 2 subdivided by the semicolon       ;     as an example
--------------------------------------------------
Name                        Artist
--------------------------------------------------
All for Love                Bryan Adams; Rod Steward; Sting

If jriver was able to recognize the space that is present between two words in a single tag and then be able to alphabetize the first or second word in that tag, there would be no need for a third field for the swap function and it would be simpler and more versatile to put the names from a to z

maybe mine is an idea that is not feasible
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732

Code: [Select]
if(isequal([Artist Swap Toggle], 1),removecharacters(swap([artist]),/,,0),[artist])
The problem is many band names (and artist names) have more than 2 words.  Then, which one do you sort on - bryan Adams, or rod Stewart, or sting (with only 1 name!)

The long answer is you can maybe do what you want with a regex function or a variable but that is a complex problem...
Logged

AndrewFG

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3392

Not to mention Wolfgang Amadeus Mozart or Ludwig van Beethoven..
Logged
Author of Whitebear Digital Media Renderer Analyser - http://www.whitebear.ch/dmra.htm
Author of Whitebear - http://www.whitebear.ch/mediaserver.htm

timwtheov

  • Galactic Citizen
  • ****
  • Posts: 354

For the latter (i.e., Ludwig van Beethoven or Wolfgang Amadeus Mozart), someone (ferday? blgentry?) wrote an expression a year or two ago that I use in a custom field called [Composer Name Swap]:

Code: [Select]
if(!regex([Composer], /#^([^,]+)\s+([^,]*?)$#/),
   [Composer],
   regex(listclean([Composer], 2, / ),
         /#^(?:(I+|[JS]r\.?)\s+)?(\S+)(.*)$#/, -1)[R2]/,/ listclean([R3], 2, / )[R1]
)

Seems to always work for me! That is, I get "Beethoven, Ludwig van" or "Mozart, Wolfgang Amadeus" to display. Maybe the OP could use this for [Artist] rather than [Composer]? Or some variation of it?
Logged

~OHM~

  • Citizen of the Universe
  • *****
  • Posts: 1825
  • "I Don't Play The Music The Music Plays Me"

off topic but...as long as his name was mentioned....what happend to blgentry is he on sabbatical or what?
Logged
“I've Reached A Turning Point In My Life. I Now Realize I Have More Yesterdays Then Tomorrows”

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72380
  • Where did I put my teeth?

I think he won the lottery.
Logged

MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796

Long ago I "solved" my similar desire by adding a custom field.

In standard field Artist I put the performer name exactly as it appears on the original recording.

In custom multi-value field Artists I put as many names as I wish to identify for the recording, LastName, FirstName for a person, BandName for a group. This lets me easily locate a recording by any of the major participants.

For instance:
Artist = The Beatles
Artists = Beatles; Lennon, John; McCartney, Paul; Harrison, George; Starr, Ringo

A custom view Artists spawns the multi-value field into multiple virtual entries -- 5 for the above example.

Because each field has a dedicated purpose, I don't have to do any tricks, it is 100% stable and reliable. This has worked wonderfully for many years.
Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.

stanzani

  • Galactic Citizen
  • ****
  • Posts: 463
  • Music and Audio enthusiast

For the latter (i.e., Ludwig van Beethoven or Wolfgang Amadeus Mozart), someone (ferday? blgentry?) wrote an expression a year or two ago that I use in a custom field called [Composer Name Swap]:

Code: [Select]
if(!regex([Composer], /#^([^,]+)\s+([^,]*?)$#/),
   [Composer],
   regex(listclean([Composer], 2, / ),
         /#^(?:(I+|[JS]r\.?)\s+)?(\S+)(.*)$#/, -1)[R2]/,/ listclean([R3], 2, / )[R1]
)

Seems to always work for me! That is, I get "Beethoven, Ludwig van" or "Mozart, Wolfgang Amadeus" to display. Maybe the OP could use this for [Artist] rather than [Composer]? Or some variation of it?
thnk you very much
anyway this does not work with fields like 'Actor' or soloist having multiple entries with check boxes
Logged
Stereo:
DAW: Fanless Case Streatcon 7 with MSI A97I mobo, 2 x 8G RAM (Hynix) with Intel I5 CPU.
NAS: QNAP TS-531 with 5x4TB HDDs
DAC/ADC: RME ADI2 PRO
Speakers (active): 2 x ATC SCM50ASL
Subs (active): 2 x REL 528 Signature
Pages: [1]   Go Up