INTERACT FORUM

Please login or register.

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

Author Topic: How to fill some fields given others (eg Period and Genre given Composer)?  (Read 4080 times)

8139david

  • Galactic Citizen
  • ****
  • Posts: 345

For classical music, I use fields like the following:
Composer, eg: Albéniz
Composer detailed [custom field], eg: Albéniz, Isaac (1860-1909)
Period, eg: Romantic
Genre, eg: Classical
Is it possible to define some rules or scripts that, given the field Composer, automatically fill the fields Composer Detailed, Period (perhaps filling two periods if appropriate), and Genre?
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #1 on: February 13, 2016, 04:38:20 pm »

Not really, at least not inside MC

That info has to come from somewhere of course so you'd have to read it from...?

Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #2 on: February 13, 2016, 04:54:27 pm »

Maybe something like an external tabbed text file (with implication rules):
Composer; Composer detailed; Romantic; Classical
Albéniz; Albéniz, Isaac (1860-1909); Romantic; Classical
The interest would be that once this is set-up one could automatically fill the missing values in MC, without having to do it manually.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #3 on: February 13, 2016, 05:34:48 pm »

Not really, at least not inside MC

That info has to come from somewhere of course so you'd have to read it from...?

Not true at all.

You'd just need to make the auto-filling fields into custom Calculated Fields, and build your automatic values into the expression. I don't have time to build an example now, but certainly possible.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #4 on: February 13, 2016, 05:53:31 pm »

A while back I was experimenting with custom programming (external to MC) to do this kind of thing.  But I never got all the way to doing lookups and inserts.  I got the linkage working so I could export from MC and import back into MC, but didn't get a lot else working... just some simple stuff like changing dates, converting from UTF8 to ASCII, etc.

Of course you could also use Panes tagging to help you out.  It won't be automated in any way, but if you insert new music, by a composer that's already in MC, you can just select by composer and then click the check boxes next to all of the other fields.  I do this kind of thing for Genre tagging now.

When I import a new album by The Allman Brothers, I go to my tagging Panes view.  Then I select Allman Brothers to show all albums.  When I select all of the files, it then shows me, in the Panes, the Genres of all of the selected files.  Since the new files don't have the same values as the old files, it shows me highlighted, but open check boxes next to the Genre.  If I just click the check box, it applies the Genre to the new files and keeps the old files as they were.  I use this for my Styles tags too.

You could definitely do this with Classical periods, composers, etc.  Not automated, but pretty quick when adding a few albums at a time.

Brian.
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #5 on: February 13, 2016, 05:57:53 pm »

I see. So one could use a long IfElse to define a custom field Compositeur:
ifelse(isequal([composer], Bach), /#Albéniz, Isaac (1860-1909)#/, isequal([composer], Beethoven), /#Beethoven, xxx#/, ...)

This needs to be modified, I think, for cases were several composers are given.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #6 on: February 13, 2016, 06:21:34 pm »

Not true at all.

You'd just need to make the auto-filling fields into custom Calculated Fields, and build your automatic values into the expression. I don't have time to build an example now, but certainly possible.

i said "not really" because...how many composers etc. would it take for you to get tired of ifelse() statements
or how many variable fields would you want to build
etc.

it's only practical if you could do it with some outside help (text, xml, something like that).  

blgentry's solution is best IMO if one considers practicality and keeps internally to MC. 
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #7 on: February 13, 2016, 06:37:52 pm »

I've done the tagging for this on my main hard drive. But I still have another hard drive to go.
So it would be nice to implement an automatic solution with IfElse.
It's easy to copy the values of a field to a text file. For instance (shortened):
Code: [Select]
Albéniz, Isaac (1860-1909)
Bach, Johann Sebastian (1685-1750)
Beethoven, Ludwig van (1770-1827)
Chopin, Frédéric (1810-1849)
Debussy, Claude (1862-1918)
Dvorák, Antonín (1841-1904)
Handel, George Frideric (1685-1759)
Haydn, Joseph (1732-1809)
Liszt, Franz (1811-1886)
Mahler, Gustav (1860-1911)
Mozart, Wolfgang Amadeus (1756-1791)
Rachmaninov, Sergei (1873-1943)
Ravel, Maurice (1875-1937)
Satie, Erik (1866-1925)
Scarlatti, Domenico (1685-1757)
Schumann, Robert (1810-1856)
Scriabin, Alexander (1872-1915)
Shostakovich, Dmitri (1906-1975)
Sibelius, Jean (1865-1957)
Tchaikovsky, Piotr Ilyich (1840-1893)
Likewise, I could recover the list of family names automatically.
Then some text manipulation in excell, or using a language like powershell or autohotkey, should build the ifelse condition easily.

A better solution would be to do the calculation externally.
Among the options, one would be to use MrC's pscriptor plugin. I will try that.
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #8 on: February 14, 2016, 04:16:59 am »

Just done so using pscriptor and the CSVLookup scriptlet, it works! :)
Here is the command I used:
Code: [Select]
C:\Scripts>perl pscriptor.pl -E CSVLookup -v -f composer -a "C:\Users\David\Documents\Composers.csv"Cf. http://yabb.jriver.com/interact/index.php?topic=100449.msg716783#msg716783
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: How to fill some fields given others (eg Period and Genre given Composer)?
« Reply #9 on: February 14, 2016, 06:32:12 am »

well I'm glad you figured that one out. Congrats. It took me years before I started using them. I have been using external scripts to make fields more consistent, but not to automatically fill out the fields. It is a nice way to clean up big libraries. But I use these over multiple fields ... not just composer or composer "detailed". Or composer to period. In other words IF I have X Composer doesn't mean I get Y genre or a Z period. Its just not possible for me, too many exceptions too many sub-genres. My problem originally is  I started having way too many subgenres and styles, and lots of them were redundant (like folk-pop and pop-folk. These script things and especially editing via Excel using CSV files and then reimporting is pretty powerful stuff!  Where a pane view with 500 plus styles had become too unwieldy.

As Glynor said it  is possible and relatively easy to use expressions via calculated fields.  Like if you have an original performance date field. The "period" could be filled out using the IsRange(...) function, and it would probably be more accurate than filling it out using some expression linked to the composer field.

Often IMO though its just as fast and more accurate to use Brian's pane work flow for individual Artists or Composers  (I use a combination of Views and the custom tag window and "magic arrows" (linkable columns) to flip between pane views. but regardless, it works the same.  Select all for X, see if "varies" shows up (or multiple boxes in pane tagging) choose what you want. and its done.

However, just a warning that you can take with a grain of salt ... consistency doesn't mean it necessarily right. A Classical Music collection based on a "given" composer against Period has just too many exceptions. Beethoven is not just a Romantic composer; but also has key works in the "Classical" period. All key transitional composers, would normally need to have their works marked separately and there are debates as to what constitutes the period -- like is it only a date or is it also the music itself (eg Mahler, even Bach or Handel). So when using these scripts, I need to double check their output. Backup your library :)

This happens also in Jazz if you are really geeky about your tags (Miles Davis is a good example ... Be-Bop, Hard-Bop, Cool, Post-Bop, up to Fusion. He has played them all. Depends on the Album)
Logged
Pages: [1]   Go Up