Welcome Guest

Pages: 1 2
Selecting part of text and moving it
ThijsAPostMay 23, 2023, 04:42
Newbie
Posts: 13
Registered:
August 9, 2022, 11:32
Hot topicSelecting part of text and moving it

To standardize Titles I would like to move the key of a piece, however not to the end of the title. Is this possible ? If so how could I realise this in an Action? Actually, it is selecting a specific text, then move this text to a certain place

Examples
Change
'Trio for piano, violin and cello nr.1 in g minor, Hob.XV - I. Moderato'
to
'Trio for piano, violin and cello Hob.XV, no.1 in g minor - I. Moderato'

Change
'Waltz for piano in a minor, op.12/1'
to
'Waltz for piano op.12/1 in a minor'

Thanks in advance for any help

2MR2PostMay 23, 2023, 07:19
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Hot topicSelecting part of text and moving it

It should be possible, however I need more information on the key representation. How are sharps and flats represented? Is 'major' ever indicated.

a#m could be A♯ minor. bb could be B♭ major or simply bb. There are lots of possibilities.

ThijsAPostMay 23, 2023, 10:45
Newbie
Posts: 13
Registered:
August 9, 2022, 11:32
Hot topicSelecting part of text and moving it

Thanks very much for your reply.

The representation of the key differs not just in English but also substantially between the representation in English, German or Dutch (not to mention French and Italian. See for some convenient tables here:

Unfortunately the English Wikipedia lemma does not show such table.

In my case (Dutch) the keys are represented as follows

[b]Dutch (English)[/u]

A groot (A Major)
a klein (A Minor)

Bes groot (B flat Major)
bes klein (B flat minor)

B groot (B Major)
b klein (B Minor)

C groot (C Major)
c klein (C Minor)

D groot (D Major)
d klein (D Minor)

Es groot (E flat Major)
es klein (E flat Minor)

E groot (E Major)
e klein (E Minor)

F groot (F Major)
f klein (F Minor)

Fis groot (F sharp Major)
fis klein (F sharp Minor)

G groot (G Major)
g klein (G Minor)

As groot (A flat Major)
as klein (A flat Minor)

Hope very much that this helps, since it is undoable to achieve this manually for 80.000+ tracks. Once again thanks for your effort

2MR2PostMay 23, 2023, 12:03
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Hot topicSelecting part of text and moving it

The Dutch should be pretty easy. Your original examples were in English. Do I have to handle that as well? Or other languages as well,?

ThijsAPostMay 23, 2023, 12:09
Newbie
Posts: 13
Registered:
August 9, 2022, 11:32
Hot topicSelecting part of text and moving it

For myself in Dutch would do. I constructed a simple Action for converting the German keys into Dutch (actually a set of 53 replacements). With your Action I could change these converted Dutch files

2MR2PostMay 23, 2023, 12:18
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Hot topicSelecting part of text and moving it

Okay. I'm only working with two examples here.

In the first example is the - character the separator for text to keep at the end?

The 2nd example has no - .... So the key ends up at the end????

I know that these points are assumptions on my part but as I said I only have two examples.

I can put something together for you to try.

ThijsAPostMay 23, 2023, 12:27
Newbie
Posts: 13
Registered:
August 9, 2022, 11:32
Hot topicSelecting part of text and moving it

That's correct.
In the first example the work contains several movements (f.i. a symphony). In the second example the work consists of one movement (f.i. a Chopin work for piano)

Basically these are the two variants. Of course the parts of the title in the examples "Hob.XV" and "op.12/1" vary per composer.
Once again thanks for your efforts!

2MR2PostMay 23, 2023, 15:38
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Hot topicSelecting part of text and moving it

I've written an action which works the way I understand it but there's something I'm not getting.

I divide a title into a prefix area, a start word, a key, trailing text and extra text.

The keys are specified in a list which you can edit as are the start words. For now I've specified all the Dutch keys that you gave me and the start word is 'in' which more than likely will be changed by you. All matching is case insensitive but that is easy to change.

Waltz·for·piano·in·A·groot,·op.12/1

becomes:

Waltz·for·piano·op.12/1·in·A·groot

which I think is correct.

However:

Trio·for·piano,·violin·and·cello·nr.1·in·g·klein,·Hob.XV·-·I.·Moderato

becomes:

Trio·for·piano,·violin·and·cello·nr.1·Hob.XV·in·g·klein·-·I.·Moderato

In your example you move the nr.1 to the start of the key. I cannot determine any triggers to select that text as part of the key.

As I said ... it more or less works and is easily modified by you. Let me know what to do with the 'nr. 1' sequence ... if anything.

ThijsAPostMay 24, 2023, 04:02
Newbie
Posts: 13
Registered:
August 9, 2022, 11:32
Hot topicSelecting part of text and moving it

The examples seem to work out fine. Thanks!

As concerns the "nr.1", not all works have a (correct) number. In other words, in the title the only certainty is the phrase "in g klein" the key of the work. While diving deeper into this I realise that there is another complication as concerns the place where the key is dropped.

In the library standard* the key of a work is in most cases placed at the end of the title or if applicable, before the movement indicator (as in example 2). However, if a work has a nickname or is an arrangement or is a specific version (f.i. early version or a revision) the key is placed before those indicators.

So according to these standards the works are titled as follows:

[WORK] [NUMBER] [CATALOGUE NUMBER] [KEY] [nickname or incipit] other indicators such as [ARR.] [VERSION] then - [MOVEMENT NUMBER in Roman numerals]. then [TEMPO].

For my personal use, where applicable I added
[recording type] if other than studio [Live]
[audio resolution] if higher than cd [HiRes]

Trio·for·piano,·violin·and·cello·nr.1·Hob.XV·in·g·klein·-·I.·Moderato

breaks down into
[WORK] Trio·for·piano,·violin·and·cello]·
[NUMBER] [nr.1]·
CATALOGUE NUMBER [Hob.XV]
[KEY] [in·g·klein]
·-· (separator)
[MOVEMENT NUMBER] [I.]
[TEMPO or name] [Moderato]

Example 3 with nick name
Symfonie nr.1 in Bes-groot, op.38 ('Frühlingssinfonie') - I. Andante un poco maestoso – Allegro molto vivace,
the action should change this to
Symfonie nr.1, op.38 in Bes-groot ('Frühlingssinfonie') - I. Andante un poco maestoso – Allegro molto vivace

Example 4
[WORK] [NUMBER] [KEY] [VERSION] [CATALOGUE NUMBER] [SEPARATOR] [MOVEMENT NUMBER] [TEMPO] [recording type] [audio resolution]
Symfonie nr.1 in c-klein [Wiener Fassung 1890/91], WAB101 - I. Allegro [Live] [HiRes]
no change necessary.

Hope this clarifies a bit what I would like to achieve with the action.

----
* If you would be unfamiliar with classical music let me further explain why I trouble you with my hassles. Opposed to (most) popular music, in classical music the same work of a composer is often performed by different artists (soloists, orchestras etc.) or in other settings (symphony played by small ensemble instead), therefore distinction between these is key. My goal is to standardise titles in my own collection to quickly find all versions or a specific version of a work, therefore I am renaming the titles to follow the library standards used in The Netherlands.

2MR2PostMay 24, 2023, 13:05
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Hot topicSelecting part of text and moving it

Download https://2manyrobots.com/actions/Move-Key-in-Title.zip

The zip will install the following:
Folder: Move Key in Title
Helper: Move Key in Title Main Logic (Version 1.0)
Move Key in Title - Tester (Version 1.0)
Move Key in Title (Version 1.0)

The first action is never called directly.

The tester allows you to enter a title and see the results. No audio files have to be loaded to use it. It can display a list of previously saved titles from a menu.

Move Key in Title is the real action and can be run in immediate mode or in the Batch Processor. If you use the Batch Processor make sure you enable the auto-save option. The action does not save any changes that have been made. I strongly suggest you play with the tester action first.

I wouldn't get your hopes up too high at this point. There are a lot of potential issues as the action is based on pattern matching and thus is 100% dependent on rules. I'm sure you'll find that many rules are missing. As an example, the last two examples you sent have a - between the key and qualifier. I was not previously accounting for this. All rules that I've implemented are based on four examples.

The real code to extract components from the MusicBrainz representation of classical titles is quite large and complicated. For that I had a complete list of catalog names and other lists to work with. As I said, everything in these actions is pattern based.

Play with it for awhile. Perhaps we'll be lucky 🙂

Pages: 1 2
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.026 seconds.