SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Mask Editing - Smart Length Limit/Truncate

@paultaylor I wasn’t ignoring anything, I just didn’t know what to do with that suggestion because all it did was point out something I could maybe try - but only after interrupting any progress I may have made with my original request.

Re-stated my original question because I seem to keep receiving recommendations and suggested workflow patterns in lieu of answers to my questions and suggestions on this program.

I’m sure it goes without saying, but I will anyway: users of your product are your most valuable Quality Assurance asset for fairly obvious reasons. I just want to help make this program into something on which more people will want to spend their hard-earned cash.

I understand that you have your own way of masking/re-naming things on your computer/device, and I also understand others will have their own preference.

Thank you for the recommendations; still wanting to find out if it’s possible to set up conditional functions for truncating length - as well as a sorting function which can organize the tracks by movement (I want to keep movement’s position in the end of the mask because Classical) - It would be even better if it could organize track numbers and disc numbers secondary to the movement.
e.g.
... Allegro vivace - Track 1 - Disc 1
... Largo maestose - Track 2 - Disc 2
... Finale. Allegro non troppo ma energico - Track 4 - Disc 3
in order.

After hours of messing around with this and teaching myself many things, I managed to make my mask do mostly what I originally wanted:

Only problem is the extra hyphens at the end of the filename. I have been able to stay away from single-file folder creation so far…

In searching through my mask while comparing the location of the hypens and name content, I found something with which I might need help…


Using the mask in the picture above, I always seem to get two hyphens before the movement which is at the end of the filename. Can you advise on a way to avoid these two hyphens while keeping the function alive? I’ve tried adding parentheticals with the concatenated ";" or "-" to no avail.

Thanks.

I just wanted to make it clear to you that your way of doing things is likely to cause you problems but of course it is your own choice.

Because the mask you are now using has the title after the ‘/’ and this is not the same as the mask you posted earlier with title before ‘/’, I was just trying to help you on the basis of what you posted.

I am not clear what you want to do, something like truncate title but only if total length is greater than x ?

Here is simple example that shortens title to 20 if length of title & composer & album is greater than 100, but doesn’t shorten if isn’t

(title.length + composer.length + album.length > 100 ? substring(title, 20):title)

But seems it might be quite complex to extend this in a way that would work for everything.

SongKong renames the file according to your mask, the tool that you use to view the files will usually sort them alphabetically, that is why you would usually put trackno or movementno before title. If you are viewing the songs using metadata then it should sort correctly by the trackno/movementno metadata but if you are just viewing by filename then it will usually list them alphabetically

The double hyphens occur if you have no value for mbwork or movement, this is because the line

(title.length>245 ? title.substring(0,245):title) + ' - '

will always put a hyphen after the title, and the line

(mbwork.length > 190 ? mbwork.substring(0,190):mbwork,' -')

will put a hyphen if mbwork is not set or shorter than 190, you don’t need a hyphen after title unless you have either mbwork or movement so I think you need to replace the last three lines with

+(substring(title, 245))
+(mbwork.length > 0 ? ' - ' + substring(mbwork, 190):'')
+(movement.length > 0 ? ' - ' + substring(movement, 75):'')

(The SongKong defined substring function shortens the text if too long but does nothing and doesn’t complain if not too long)

Thanks.

The reason I posted my issue is because I have a lot of music which can be considered as stories.
I wanted to make sure that the listener would always be able to listen to the next movement of the story composed by the composer. As I’m sure our composer also meant for their audience.

These songs have been renamed via the mask, but some seem to lose their place in the sequence after the rename occurs. This is why I attempted to place the title - even attempting titlesort - before Track/Movement

For the below examples, “Andante”, Song 3, needs to be shown as the second song in the same folder/work. Is there an unlisted tracksort function that I’m missing?
example, before rename:
Song 1 = Overture/Intro/ = Track 1
Song 2 = Andante = Track 2
Song 3 = Allegro vivace = Track 3
example, after rename:
Song 1 = Overture/Intro/ = Track 1
Song 2 = Allegro vivace = Track 3
Song 3 = Andante = Track 2

I want to avoid my rename mask disrupting/rearranging the sequence of songs. I want to keep the story structure so that when listening, my player auto-plays the correct next song. I placed the track and movement at the end because of this problem of songs not following correct sequence.

You are right, my masks need work and I am tweaking it and finding new things every hour. I hope this helps.

Thank you for your help.

When you say the order has changed, what are you viewing the songs with, in what application are they shown in the wrong order, perhaps post a screenshot to make it clearer.

This is essentially what I’m dealing with. Notice the Act # and Scene # are out of order. I removed the padded trackno function because of the same type of issue with track numbers being out of order.

This issue exists even after navigating to the file in file manager and clicking the Name column to sort in ascending order.

Act I, Scene V should follow Act I, Scene IV and so forth… Currently it looks reversed; which is why I asked about any potential mask functions for sorting tracks and Acts/Scenes.
I definitely don’t want the player to play Act I, Scene V before I hear it play
Act I, Scene IV. Same goes for the track numbers, I want to play the songs in order as they were arranged to be played by the composer or on a record.

What is this a screenshot from ?

Screenshot from file manager.

Perhaps this is a better view… Do you see where the Name column is sorted for alphabetical descending order. Still though, Act III is before Act II. It looks like I managed to correct the Scenes being out of order, but still I want to ensure my music player plays the songs in correct sequence.

Yes like I said it’s alphabetical because Act III comes before Act II because I comes before ,.

FileManager is not a music player it is just looking at the filename not the metadata, do you understand the difference between filename and metadata within file ?

Why don’t you use a music player to play your music, this would likely sort by movementno or at least trackno

This is the naming scheme or format I’m looking to use. See how Act 1,2,3 and their Scenes follow one-another in increasing order?

Just clarifying… So are you saying III (3) comes before II (2)…? Is this common to every operating system? This is getting weirder by the minute.

Playing the songs in VLC. It sorts the Acts and Scenes correctly, but still the ‘Overture’ is at the end of the playlist due to alphabetical sorting of Name column inside the player. An overture is the instrumental introduction that precedes the composition. It should be played first, always.

No I’m saying III comes before II, but can’t you see that on your last screenshot you have Act 1, Act 2, and in alphanumeric sorting it knows the order is 1,2,3…but in the previous screenshot using are using roman numerals, they are different things.

I can sort the music in VLC by track number which places the “Overture” at the front, but then I would run into a problem if the track doesn’t have a trackno associated with it for whatever reason.

It will have trackno if has been matched by Songkong

That last screenshot was from Discogs to provide an example of how I want it sorted.

Thank you. I didn’t know a track number would be always inserted when matched.

I would still have to go in and manually edit the trackno if the song did not match to a correct track/album/disc. But that is infinitely more simple than trying to create a JS mask to correctly name files upon match with hardly any JS experience.

Im sorry I really think I have answered this question a few times now I can’t see how to explain it to you any more simply. Most of the existing masks will correctly sort by trackno.

Well, there was more than 1 question which contributed to the confusion created by my inability to understand what you mean when you write your answers. The answers that were given did not solve the problem so I kept asking for clarification.

What we have here is a failure to communicate.

I think the trouble is you were asking me quite advanced and very specific questions without really understanding the basics. So me answering these questions didn’t help you much with the underlying problem.