INTERACT FORUM

Please login or register.

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

Author Topic: how to mass edit tags using a lookup table  (Read 285 times)

baldo

  • Galactic Citizen
  • ****
  • Posts: 280
how to mass edit tags using a lookup table
« on: January 25, 2025, 02:47:41 am »

Ok, this is an odd one.

I have a tag called "comment" that is populated by a piece of software called Mixed in Key. This is a DJ mixing software that analyses the track and comes up with the Key of the track.

There is also a field called "Key" which shows the key of the song in musical format, ie C, D minor etc.

MIK had its own system for labeling the key so for example the key of D minor is 7A, E major is 12B etc.

I have a lot of track s that just have the comment with a number and a letter but nothing in the Key field.  I think that at one stage I might have gone through and populated the Key field.

Is there some way to populated the Key field based upon what is in the comment field?  Something like, If comment = 7A then Key = Dm.

Hope this makes sense.

Thanks for your help in advance.
 
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2770
Re: how to mass edit tags using a lookup table
« Reply #1 on: January 25, 2025, 04:33:55 am »

It's possible using an Expression - just select the files you want (start with just a few for testing), open the Tag side panel and and paste the expression on the Key field:

Code: [Select]
=ifcase(regex([comment],/#(\d+\w)#/,1), 1, 1A,Abm/G#m,2A,Ebm,3A,Bbm,4A,Fm,5A,Cm,6A,Gm, 7A,Dm,8A,Am,9A,Em,10A,Bm,11A,F#m,12A,Dbm/C#m, 1B,B,2B,F#/Gb,3B,Db,4B,Ab,5B,Eb,6B,Bb, 7B,F,8B,C,9B,G,10B,D,11B,A,12B,E)
This follows the Camelot Wheel for mapping (but check it for correctness as I just copy/pasted it from some website). Notice the list is a sequence of pairs of values like 2A,Ebm => this is the mapping. Feel free to change each second value to what you want to see. For instance, you can use "E flat minor" or "E♭-" instead of "Ebm".
Logged

baldo

  • Galactic Citizen
  • ****
  • Posts: 280
Re: how to mass edit tags using a lookup table
« Reply #2 on: January 25, 2025, 07:55:39 am »

Thanks for this Zybex. It looks very helpful.  This should take care of most of the unassigned tracks which have just one Key.

The next difficult one is where there are two Keys.  I suppose I need some kind of a matrix to come up with that If statement. Is there a limit to how long the If statement can be?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2770
Re: how to mass edit tags using a lookup table
« Reply #3 on: January 25, 2025, 02:47:16 pm »

This handles multiple keys:

Code: [Select]
=save(regex([comment],/#(\d+\w)#/,-2),_chords)listFormat(listMix(ifcase([L1], 1,
1A,Abm/G#m,2A,Ebm,3A,Bbm,4A,Fm,5A,Cm,6A,Gm,7A,Dm,8A,Am,9A,Em,10A,Bm,11A,F#m,12A,Dbm/C#m,1B,B,2B,F#/Gb,3B,Db,4B,Ab,5B,Eb,6B,Bb,7B,F,8B,C,9B,G,10B,D,11B,A,12B,E), 0, [_chords]),2)
Logged

baldo

  • Galactic Citizen
  • ****
  • Posts: 280
Re: how to mass edit tags using a lookup table
« Reply #4 on: January 25, 2025, 04:41:33 pm »

Thanks for this again Zybex. I'm not sure that MIK picks up Chords for a  track.  I've not really looked into how they determine the key of a track.

When I said that I had tracks that had two numbers from the Camelot wheel, I think that the first number refers to the beginning of  the song and the 2nd number to the end of the song. So something tagged as  11A/1B would be F#m/B.  And conversely 1B/11A would be B/F#m.

I thought that a table of all possible combinations would be 12 major X 12 minor keys thats 144 minus 12 (start and end being the same). That makes 132 possibilities.

Hope that makes sense. Let me know if you want me to clarify or if I am missing something.
Logged

baldo

  • Galactic Citizen
  • ****
  • Posts: 280
Re: how to mass edit tags using a lookup table
« Reply #5 on: January 25, 2025, 04:45:09 pm »

Actually I just checked. The numbers are in reverse so the first number refers to the end of the song and the last number refers to the key of the beginning of the song.  Odd.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2770
Re: how to mass edit tags using a lookup table
« Reply #6 on: January 25, 2025, 05:13:11 pm »

That expression just converts both chords one by one. No need for a 12x12 table.
Logged

baldo

  • Galactic Citizen
  • ****
  • Posts: 280
Re: how to mass edit tags using a lookup table
« Reply #7 on: January 26, 2025, 06:30:35 pm »

Quick note of thanks once again. That expression did what I need so I am very happy once again.
Logged

baldo

  • Galactic Citizen
  • ****
  • Posts: 280
Re: how to mass edit tags using a lookup table
« Reply #8 on: January 27, 2025, 05:59:55 am »

That expression just converts both chords one by one. No need for a 12x12 table.

That's great. In fact I was mistaken even with 12x12 matrix.  I would have needed a 24 x 24 matrix, 12 major and 12 minor key combos. 
Logged
Pages: [1]   Go Up