Lookup Tables to convert INITIALKEY according to Camelot wheel

So I regularly use DJ software that analyses Keys.

Some display as Bm/C#m etc some as Camelot. 1A 2A 12A etc.

It would be very useful to have a look up feature that says.

If I see 1 replace with a, 2 with b etc. As we could build some really powerful tagging with that.

You can try to use the command
$replace
with parameter pairs.

Please have a look at the documentation:

You can find a perfect example for the replacement function here:

replace-a-with-b-001

Left-click on it or use [ALT]+[6] and get:

replace-a-with-b-002

The CD-R action checks filenames. Select the row (you needn't click the checkbox) and choose EDIT to get

replace-a-with-b-003

This Action replace the German umlauts with an alternative more international spelling. Create your own replacement table in a similar way :slight_smile: (copy the action and start fiddling with it?)

Nice (official/default) example.

Your 12 visible single Replace-Actions could be applied with 1 "Format Value"-Action for the Field _FILENAME:
$replace(%_FILENAME%,ä,ae,ö,oe,ü,ue,Ä,Ae,Ö,Oe,Ü,Ue,é,e,è,e,ê,e,',',_,'(',_)
Up to 30 parameter pairs are possible in one $replace command.

I assume, the other french characters like à or â, î, ô, û or ë, ï, ü are listed in the not visible part of your screenshot?

Just wanted to give an example as to what and how can be done. I've rearranged a whole music (classical) library from English "b-minor" to German "h-moll" asf. It's a powerful tool and wants to be tested on files truly backed up.

The example is from the original official release. I did not create it. But I learned from it :wink:

Please note that the $replace() function runs the pairs sequentially and executes the first hit.
So a $replace(%field%,1,a,2,b,12,l) would lead to
abA for 12A
You would have to start with the longest number to get it right:
e.g.
$replace(%field%,12,l,1,a,2,b)

To set an a instead of 1, you could also use:
$replace(1A,$num(1A,1),$char($add($num(1A,1),96)))
which takes only the number from e.g. 1A and transforms it into a.
Instead of 1A enter the fieldname into the expression.

@ianwat
Could you please tell us what exactly do you want to replace, maybe with some real current/new examples?

Do you speak about this Camelot wheel?

Do you want to replace 6B with B-Flat Major?
Or do you want to replace 7B with F♯ major?
Or something else?

Apologies for the delayed reply work has been very busy this week.

Yes, that's exactly it.

If a DJ has a problem, we ideally want some key information in the file to help us mix.

Example is this.

Dooleys - Wanted (DJB) - 11A - 123 BPM - 1979

Artist - Title (Remix) Key bpm year.

So if the dj machine has a problem, we can see from the filename, that this is 123 bpm and key 11a, so I then find a track that is similar bpm - 119-127 and either same key 11a, or 11b or 10a or 12a

The problem is, some dj software changes this.

6A to Gm for example. Which means if I every need to batch rename the files, they are renamed

Dooleys - Wanted (DJB) - F#m - 123 BPM - 1979 which then causes a duplicate file.

So what I want to be able to do is always change them over.

That way I don't have to use a harmonic tag, which is what I'm doing. but just convert if I see a problem.

If you want to be able to change back from the filename
Dooleys - Wanted (DJB) - F#m - 123 BPM - 1979
to the new filename
Dooleys - Wanted (DJB) - 11A - 123 BPM - 1979

then you can use the mentioned
$replace(%_FILENAME%,F#m,11A)

and expand it to all the possible keys and parameter pairs like this
$replace(%_FILENAME%,F#m,11A,Gm,6A)
and so on...

It's mainly the inital_key_field I want to change - so it's consitent, but I can build a replace table, up, just wondered if there was an easier/more elegant way of doing it.

Cheers for all the help.

Then just change the FIELDNAME to whatever you like to change:
$replace(%INITIALKEY%,F#m,11A,Gm,6A)

Once I've produced this action, what's the best way of sharing it, so anyone else with the same issue can use it?

I suggest to create a screenshot from your Action (to see the type of Action) and the format string.
Example

Please copy & paste the format string or regular expression separately*, so that future user don't have to type it from your screenshot.

* Enclose the format string or regular expression in backticks format string backticks to ensure that all special characters remain untouched from the forum software. You can also mark the format string and then press CTRL +e. That creates the backticks automatically around the marked text.

Ah so there is no way of sharing the whole action as it's quite a lot of repeated replaces

Did you know that you can use the scripting function $replace() which allows up to 32 pairs of search and replace parameters?
Use that in an action that allows a format string, e.g. "Format value".

You could open the configuration folder and get the action file from the folder data\actions and upload it to a thread.