• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Song Title Formatting
#1
Goodmorning to everyone,

in MobileSheetPro I put this statement to format the song title

% ARTISTS: $ {VALUE} $ {ALBUMS :, $ {VALUE}} | %% KEYS :, $ {VALUE} $ {SOURCE_TYPES :, $ {VALUE}} |} $ {CUSTOM%

It operates correctly if some fields are valid (not empty), but otherwise, the expression does not provide the desired result that would be simply to display the string consists of the following variables: Artists, Albums, Keys, source_type, Custom separated by ","

In order to avoid situations such as,,, Ab should be a kind of Wizard which then is nothing other than a query generator similar to that existing but also with the simulation and the request of certain conditions (as just "what if") if the condition is not realized. Can anyone suggest how to change the construction above


Thanks for the attention
Beppino - Italy
Reply
#2
I would think something like this would work better:

%ARTISTS:${VALUE},|%%ALBUMS:${VALUE},|%%KEYS:${VALUE},|%%SOURCE_TYPES:${VALUE},|%%CUSTOM%

That uses the value and ends it with a comma but only if it's non-empty

Mike
Reply
#3
(02-23-2017, 04:12 PM)Zuberman Wrote: I would think something like this would work better:

%ARTISTS:${VALUE},|%%ALBUMS:${VALUE},|%%KEYS:${VALUE},|%%SOURCE_TYPES:${VALUE},|%%CUSTOM%

That uses the value and ends it with a comma but only if it's non-empty

Mike

Thanks very much Mark, almost perfect! It is possible to avoid the string ends with a "," if it is not valued the following field?
Now, if CUSTOM is not set, each string of one or more fields ends with "," eg.
Artist, Album, Key,

Beppino
Reply
#4
I always like a challenge. This should work:

%ARTISTS%%ALBUMS:${ARTISTS:, }${VALUE}%%KEYS:${ALBUMS:, }${VALUE}%%SOURCE_TYPES:${KEYS:, }${VALUE}%%CUSTOM:${SOURCE_TYPES:, }${VALUE}%

That's not the prettiest solution though. What I really should do is add support for a conditional separator. The separator would only be visible if text was present both before and after it. This wouldn't be too hard to add, but I would need a way to distinguish a conditional separator from one that users want visible. I think some people want to see if a field is empty for a song, so I need to support both. One thought is that conditional separators could be specified using a designator such as [,] or ${,} or %,%. Then the format string would have just been:

%ARTISTS%[,]%ALBUMS%[,]%KEYS%[,]%SOURCE_TYPES%[,]%CUSTOM%

What do people think about that?
Reply
#5
The way it is works very well for me.

Title Format: %TITLE%  %COLLECTIONS%
As Collection values I am using emojiis exclusively, they´re shown in the title only when associated with the song, no separator.

Caption Format: %ARTISTS:${VALUE} ${YEARS: (${VALUE})}|%%SIGNATURES:  ☆ ${VALUE}☆|${SIGNATURES}% %KEYS%
This gives me, next to the artist, the YEAR and SIGNATURE (Capo position in my case) if applicable, with the separators () and  ☆.
No separator for KEYS, which I use just for non-standard tunings like "Drop D".

Screenshot attached.

So, I am happy with what we got!

Ben

PS: wouldn´t want to lose the option to deploy individual characters (like brackets and the star) as conditional separators.


Attached Files Thumbnail(s)
   
Reply
#6
Hi Mike and Ben,

Also for me the current solution is enough, thank you. 
I therefore support the Mark solution to facilitate the user in building the desired formatting (and the indication of conditional separator between [] certainly is), I find it just as beautiful, and particularly the use of emoticons proposed by Ben.
I'm sure Mike will find the way to coesistereentrambe features.
Greetings, Beppino
Reply




Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.