paolo
New Member
Posts: 42
|
Post by paolo on Jul 5, 2021 6:25:33 GMT -5
Hello! I find GMMP the best player on Android and a large part of this is this configurability which makes it possible to acknowledge that music has usually a COMPOSER. Apparently, most music systems, no matter how expensive or fancy forget this pretty basic point.... ;^) BIG THANKS!
Now, I am a bit in trouble adding the composer in a few places where it would be useful to me: - %cp% is not available in a number of places where it would make sense to be (e.g., Now Playing queue). I mentioned this some time ago and it was mentioned that this is known and reported here trello.com/c/IfsJdV77 but I do not understand if it will be addressed anytime soon. Will it? If %cp% were available for any file that has COMPOSER set, everything else below would not matter anymore.
- Yet, I recently noticed that there is a field %fp% which would help, since the file path to each of my files contains in a predictable place the composer. Alas, %fp% does not appear to be set in the Recently Added Album screen (nor %fo% nor %fn%). I'd think that the full path exists for all files and the folder for every album, by construction. Is there a fundamental reason for that? Could this be fixed--unless I am making something wrong and not seeing it?
- I do see %fp% in the Now Playing queue, and that is great since %cp% is not there. But then I am utterly confused by the functions in the interface because most of my attempts fail miserably and yet something seems to suggest that I got the gist of it. I will show a few examples below of stuff I cannot get to work. Help.... :-)
Here are a few examples I have tried in 'custom_queue_metadata.json': ["<align=left><size=16><typeface=sans-serif><wrap>%fp%"], ["<align=left><size=16><typeface=sans-serif><wrap>$substr(%fp%,$strstr(%fp%,audio/mp3/Classical/),1000000)"], ["<align=left><size=16><typeface=sans-serif><wrap>$substr(abcdefghijklmnop,5,10) should be fghil"], // ["<align=left><size=16><typeface=sans-serif><wrap>$substr(abcdefghijklmnop,5,-1) should be fghilmnop (desirable but not in the spec)"], ["<align=left><size=16><typeface=sans-serif><wrap>$right(abcdefghijklmnop,5) should be lmnop"], ["<align=left><size=16><typeface=sans-serif><wrap>$right(abcdefghijklmnop,$add($len(abcdefghijklmnop),-5)) should be fghijklmnop"], ["<align=left><size=16><typeface=sans-serif><wrap>$right(abcdefghijklmnop,$sub($len(abcdefghijklmnop),5)) should be fghijklmnop"], ["<align=left><size=16><typeface=sans-serif><wrap>$strstr(abcdefghijklmnop,fghij) should be 5"], ["<align=left><size=16><typeface=sans-serif><wrap>$right(abcdefghijklmnop,$sub($len(abcdefghijklmnop),$strstr(abcdefghijklmnop,fghij))) should be fghijklmnop"], ["<align=left><size=16><typeface=sans-serif><wrap>$right(abcdefghijklmnop,$add($len(abcdefghijklmnop),-$strstr(abcdefghijklmnop,fghij),-$len(fghij))) should be klmnop"], // ["<align=left><size=16><typeface=sans-serif><wrap>$right(%fp%,$add($len(%fp%),-$strstr(%fp%,audio/mp3/Classical/),-$len(audio/mp3/Classical/)))"], // ["<align=left><size=16><typeface=sans-serif><wrap>$right(%fp%,$sub($len(%fp%),$strstr(%fp%,audio/mp3/Classical/),$len(audio/mp3/Classical/)))"],
- The first line works and proves that %fp% works here.
- The second line gives the very same output and I would think it a bug (the string is found by $strstr, of course).
- The third line suggests that $substr simply does not work.
- The fourth line is commented out because it probably violates the spec; it would be nice if it worked, though, but it is not a big deal (a very large number is inelegant but would do).
- The fifth to the tenth line show bits and pieces of a working workaround using $right instead (a tad laborious, but ok).
- Yet, the sixth and seventh lines are commented out because apparently the cannot be parsed (while trying to select "Customize > Displayed Metadata > Custom" no preview appears).
Am I doing something wrong? Mostly I would like a confirmation that $substr is not working (could it be fixed?) and some help to understand why the last two lines above do not work (or a confirmation that there is a bug in the parser). Thanks! p.
|
|
|
Post by GoneMAD on Jul 5, 2021 11:25:47 GMT -5
"%cp% is not available in a number of places where it would make sense to be (e.g., Now Playing queue). I mentioned this some time ago and it was mentioned that this is known and reported here trello.com/c/IfsJdV77 but I do not understand if it will be addressed anytime soon. Will it? If %cp% were available for any file that has COMPOSER set, everything else below would not matter anymore."
its listed under 3.1.3 which is the next update, so i will be looking at it soon.. however that doesnt mean it'll be fixed anytime soon. If a bug that gets looked at for an update cannot be addressed in a timely manner it gets pushed off. This one in particular i dont know if its easily solvable due to how the database was built. I have not looked into it yet so i dont know if there are alternative ways to generate a query that will return results for things when the composer is not set. I cannot enable an ability that only works when the composer field is set and completely breaks when its not set
"Yet, I recently noticed that there is a field %fp% which would help, since the file path to each of my files contains in a predictable place the composer. Alas, %fp% does not appear to be set in the Recently Added Album screen (nor %fo% nor %fn%). I'd think that the full path exists for all files and the folder for every album, by construction. Is there a fundamental reason for that? Could this be fixed--unless I am making something wrong and not seeing it?"
Full path is available in smart playlists: "FULLPATH = %fp% - (Now Playing, Queue, Song/Album Details, Bookmark, Playlist, AudioFile, File, Folder)"
You'll get an error in app if the variable is used that isnt supported for that particular view
"The third line suggests that $substr simply does not work." yeah it looks like $substr with the 3rd parameter is broken.. i see the issue and i'll fix it next update
"The fourth line is commented out because it probably violates the spec; it would be nice if it worked, though, but it is not a big deal (a very large number is inelegant but would do)."
Yeah negative numbers are invalid for either value (from or to)
the second to last line gives this error: Requested character count -10 is less than zero. (for the $right function)
the last line gives this error: Requested character count -9 is less than zero.
you never said what %fp% resolves to so i really cant go any further into anything using that variable
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 5, 2021 18:28:29 GMT -5
Hi! Thanks a lot for the quick feedback. I will look into some of your answers tomorrow, but I have a quick one: you say "gives this error" and I feel dumb, because I have been debugging "blindly" by observing the results, trying permutations, etc. The question must horrify you, but... how can I see the error log?! p.
|
|
|
Post by GoneMAD on Jul 5, 2021 18:58:44 GMT -5
im looking at the logs which are mostly just available to the devs. They dont really make it easy for a standard user to get the logcats for the device
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 6, 2021 4:30:31 GMT -5
Hello. Debugging is not easy without logs, but here is the best I can think of to try to let you understand what I see (and which seems wrong in some ways to me). Here is the content of 'custom_queue_metadata.json': [ { "markupLines": [ ["<align=left><size=16><wrap>1: %fp%"], ["<align=left><size=16><wrap>2: $substr(%fp%,$strstr(%fp%,audio/mp3/Classical/),1000000)"], ["<align=left><size=16><wrap>3: $substr(abcdefghijklmnop,5,10) should be fghil"], ["<align=left><size=16><wrap>4: $substr(abcdefghijklmnop,5) should perhaps be fghilmnop (not sure what it is meant to do)"], ["<align=left><size=16><wrap>5: $right(abcdefghijklmnop,5) should be lmnop"], ["<align=left><size=16><wrap>6: $right(abcdefghijklmnop,$add($len(abcdefghijklmnop),-5)) should be fghijklmnop"], ["<align=left><size=16><wrap>7: $right(abcdefghijklmnop,$sub($len(abcdefghijklmnop),5)) should be fghijklmnop"], ["<align=left><size=16><wrap>8: $strstr(abcdefghijklmnop,fghij) should be 5"], ["<align=left><size=16><wrap>9: $right(abcdefghijklmnop,$sub($len(abcdefghijklmnop),$strstr(abcdefghijklmnop,fghij))) should be fghijklmnop"], ["<align=left><size=16><wrap>10: $right(abcdefghijklmnop,$add($len(abcdefghijklmnop),-$strstr(abcdefghijklmnop,fghij),-$len(fghij))) should be klmnop"], ["<align=left><size=16><wrap>11: $len(%fp%)"], ["<align=left><size=16><wrap>12: $strstr(%fp%,audio/mp3/Classical/)"], ["<align=left><size=16><wrap>13: $len(audio/mp3/Classical/)"], ["<align=left><size=16><wrap>14: $add($len(%fp%),-$strstr(%fp%,audio/mp3/Classical/),-$len(audio/mp3/Classical/))"], // ["<align=left><size=16><wrap>15: $right(%fp%,$add($len(%fp%),-$strstr(%fp%,audio/mp3/Classical/),-$len(audio/mp3/Classical/)))"], ["<align=left><size=14><wrap>%al%"], ["<align=left><size=10>Track %tn%", "<align=right><size=10>%du%"], ["<align=left><size=12><wrap>%tr%"], ["<align=left><size=12><wrap><i>%ar%</i>"] ] } ]
Line numbered '15' is commented out because otherwise I cannot select this as the custom format:
Once I comment '15' out, all looks good to select this format:
And here is the result:
Note the following: - Line 4 is a wild attempt to remove the third parameter of $substr, hoping that it would take the rest of the string. I see no error, but it does not do that. No big issue, but in various languages, this would be the behaviour expected.
- Lines 12 to 14 show the computations part of line 15. I have not really counted characters to check, but it seems sound, taking the 166 rightmost chars of a 222 char string. It looks like it is $right which fails, maybe at parse time?! Or I did something very stupid which I cannot see....
I will send another post with details of %fp% inside the smart lists. Thanks! p.
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 6, 2021 4:42:37 GMT -5
Now, with reference with your statement that "Full path is available in smart playlists", here is what I placed in 'custom_albumlist_metadata.json': [ { "markupLines": [ ["<align=left><size=16>fo is %fo%"], ["<align=left><size=16>fn is %fn%"], ["<align=left><size=16>fp is %fp%"], ["<align=left><size=14>al is %al%"], ["<align=left><size=12>ar is <i>%ar%</i>"] ] } ]
I can select this format without any problem:
Yet, I find %fo%, %fn%, and %fp% unpopulated:
What am I doing wrong?! Again, thanks! p.
|
|
|
Post by MotleyGord on Jul 6, 2021 7:44:32 GMT -5
I’m happy to help, but am really confused by the examples you have posted. What is the end result you are actually trying to display? Assuming your files are completed with the appropriate tags, this should be pretty straight forward. I have posted several json file examples already, some with complex nested functions.
|
|
|
Post by GoneMAD on Jul 6, 2021 7:47:28 GMT -5
ohhh you are talking about an album list view.. fn and all those are only available for viewing songs, not albums. Albums dont have filepaths associated with them in the database. Files from an album can be scattered throughout storage (although in a single folder is definitely recommended)
i have to get to work so i'll look at your other comments later
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 6, 2021 8:13:00 GMT -5
MotleyGord, Line 15 should simply work and show the path one sees under "1:" from "Dall'Abaco..." until the end. It does not and I would think something is broken with the parser. Yet, it might be I am making some syntax error I cannot see in Line 15--it has happened before, alas.... ;^)
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 6, 2021 8:40:27 GMT -5
@gonemad, life is tough.... ;^) What defines an album then? In my case the fact that all files are in a folder, but perhaps it is instead the fact that the files share the same album name. I know it is absolutely not your fault, but it is a terrible idea: I find ALBUM the only reasonable place (misnomer aside) for the opus name of a classical piece, but then I have several 'Symphony no. 7 in A major, op. 92 (1811-1812)' played by different orchestras and directed by different conductors--and in other music systems I have to append artificially some ridiculous '(1)' at the end of the name not to get all of Beethoven's 7th symphonies in the same "album". It is such a messy system because (1) there is no credible standard and (2) nobody seems to care for the needs of classical music.
I would like a clarification, though: in the album view shown above, you do show a cover image. Where do you get it from?! There are different files potentially in different folders; each file could have a different embedded image and each folder could have a folder.jpg image in it. Could you not fill %fo% with a default value using some similar heuristics? I mean, if all files *happen* to be in the same folder, this would be right. Maybe you could use the folder name of the first track for %fo%, for instance. Would that make some sense? It would not be worse, conceptually, than the heuristic you must be using today to decide what is the album cover image, I guess....
Thanks a lot for your patience!
p.
|
|
|
Post by GoneMAD on Jul 6, 2021 8:46:19 GMT -5
Could you give me an example of what %fp% resolves to? There is no way for me to manually parse any of the lines with $len, $strstr, etc without knowing waht your files paths look like.
"Line 4 is a wild attempt to remove the third parameter of $substr, hoping that it would take the rest of the string. I see no error, but it does not do that. No big issue, but in various languages, this would be the behaviour expected."
its bugged as previously mentioned. When 'to' is less than 'from', its supposed to return everything to the end of the string.. however in the code its checking for (to < from) instead (the bug) so if to is less than from.. which it should almost always be.. it returns the whole string (what u've experience).. if from is less than to (like if you provide a negative value for the 3rd param) it hits an exception and cannot parse since a negative value isnt a valid index in the string.
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 6, 2021 9:05:33 GMT -5
- I do not know how to capture the file path as a string, but it is the one in the image. I partially retyped it and imported from some other filesystem:
/storage/9C33-6BBD/home/ienne/media/audio/mp3/Classical/Dall'Abaco, Giuseppe Clemente (1710-1805)/2. Chamber/Sonata for Cello and Continuo in A major, ABV30 (1730-1760) -- Frey, Valli, Bianchi F., Pinardi/01 -- Andante.mp3 I hope it is correct but the numbers seem correct looking at the example in the screenshot I sent (string at position 36 and long 20; 166 chars from the right to get the "Dall'Abaco..." part). I hope it helps. The problem seems to be with parsing Line 15, for $right clearly works in the general case and the numbers I compute appear to be correct. Unless I am blind and I have some parentheses mismatched (but my editor is happy) or other stupidity I cannot see.... - Got your point about the $substr. Good to know that with the third parameter omitted or 0 it would return the rest of the string--it is what I wished to hear. I just need to wait for a bug fix, no problem!
|
|
|
Post by MotleyGord on Jul 6, 2021 9:15:41 GMT -5
... What defines an album then? In my case the fact that all files are in a folder, but perhaps it is instead the fact that the files share the same album name. I know it is absolutely not your fault, but it is a terrible idea: I find ALBUM the only reasonable place (misnomer aside) for the opus name of a classical piece, but then I have several 'Symphony no. 7 in A major, op. 92 (1811-1812)' played by different orchestras and directed by different conductors--and in other music systems I have to append artificially some ridiculous '(1)' at the end of the name not to get all of Beethoven's 7th symphonies in the same "album". It is such a messy system because (1) there is no credible standard and (2) nobody seems to care for the needs of classical music. Classical music has some limitations, but the concept of tagging has remained pretty consistent since the beginning. An "Album" is defined as a release. No different than buying a physical format CD, record, cassette, etc. and regardless of how many are included. Files included in a single folder will still be sorted by their metadata tags if they exist, but may not be easy to browse through otherwise and do not constitute an "Album" in this case. As a subsection of the "Album" there are also likely several tags for "Track"/"Totaltracks", and possibly additional "Discnumber"/"TotalDiscs" that may exist as well. These ultimately define the album as it was published, in the traditional design. So there is a credible standard, it just may not suit your desire. Of course there are many ways to personalize this, as you have done for your library management preferences. The "Composer" tag is somewhat helpful, and Apple recently introduced tags for "Work" and "Movement" specifically to help, but these only apply to m4a format and are not standard at this time. And I don't think GMMP uses them in the library build either. Regardless there is, as the saying goes, more than one way to skin a cat. So based on your usage of the tags, we just need to figure out how best to get the metadata to display in GMMP from what you have. I'll run through some ideas with your examples and see if I can throw out an alternative solution.
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 6, 2021 9:26:53 GMT -5
Since I finally retyped the string of %fp%, I tried to substitute it literally in Line 15 to see what happens (essentially what I think you might have wanted to do on your side). - A first issue is that %fp% contains parentheses which, when literally pasted in place of %fp% may create parsing issues. But they are matched, so they may work per chance (there is no guarantee, of course, that a file path contains parentheses matched and it is perfectly legal to have an unmatched ")" in a file path...).
- I have no clue if there is a way to protect the strings in the functions while allowing for %fp% expansion (something like double quotes in C shell or Perl). A single quote clearly does not work (it seems to be a literal) and a double quote might interfere with the JSON double quote. An escaped \" maybe? My apologies if I have not read carefully the instructions, but this is almost certainly a problem I need to handle.
- Unless I made a stupid mistake, I removed the ()'s from the literally pasted %fp% just as a test and it still seems not to work, but in a different way: it simply does not print anything. Here is the line I entered in the JSON file:
["<align=left><size=16><wrap>16: $right(/storage/9C33-6BBD/home/ienne/media/audio/mp3/Classical/Dall'Abaco, Giuseppe Clemente 1710-1805/2. Chamber/Sonata for Cello and Continuo in A major, ABV30 1730-1760 -- Frey, Valli, Bianchi F., Pinardi/01 -- Andante.mp3,$add($len(/storage/9C33-6BBD/home/ienne/media/audio/mp3/Classical/Dall'Abaco, Giuseppe Clemente 1710-1805/2. Chamber/Sonata for Cello and Continuo in A major, ABV30 1730-1760 -- Frey, Valli, Bianchi F., Pinardi/01 -- Andante.mp3),-$strstr(/storage/9C33-6BBD/home/ienne/media/audio/mp3/Classical/Dall'Abaco, Giuseppe Clemente 1710-1805/2. Chamber/Sonata for Cello and Continuo in A major, ABV30 1730-1760 -- Frey, Valli, Bianchi F., Pinardi/01 -- Andante.mp3,audio/mp3/Classical/),-$len(audio/mp3/Classical/)))"], I hope it is correct, because in such a mess it is hard to detect small typos....
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 6, 2021 9:40:53 GMT -5
Of course there are many ways to personalize this, as you have done for your library management preferences. The "Composer" tag is somewhat helpful, and Apple recently introduced tags for "Work" and "Movement" specifically to help, but these only apply to m4a format and are not standard at this time. And I don't think GMMP uses them in the library build either. Adding "Work" and "Movement" on top of "Album" seems a wise decision, and perhaps sort of the only one which truly makes sense. Regardless there is, as the saying goes, more than one way to skin a cat. So based on your usage of the tags, we just need to figure out how best to get the metadata to display in GMMP from what you have. I'll run through some ideas with your examples and see if I can throw out an alternative solution. I am sorry, but I am a firm believer that there should be only one way to skin a cat--which is, a standard. Alas, neither you nor I can change that, but it is horrific to me that professionals in this field have not understood over decades of music in electronic formats that this is the only meaningful way to go. What I would like to have is something supersimple: I would like to have %cp% with the composer for any track that has the COMPOSER field in any view I care for. I am struggling to find a workaraound to that, that's it--and, in truth, I am close to give up.
|
|