INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4 5 ... 9   Go Down

Author Topic: Expression functions [HELP WANTED]  (Read 63466 times)

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Expression functions [HELP WANTED]
« on: March 17, 2020, 07:49:25 am »

Hi all,

I'm just spending a little time looking at the expression language and wondered if anyone has any ideas for functions they've wanted?

I just added a ListShuffle(...) function.  I would love to hear any other suggestions.

Thanks.
Logged
Matt Ashland, JRiver Media Center

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: Expression functions [HELP WANTED]
« Reply #1 on: March 17, 2020, 09:39:51 am »

I'd really love a mode function for the ItemCount function.  Something like mode 0, count all files that match the given values.  Mode 1, count all unique values that match the given values.

So, if I have a show that has two seasons, each season has 10 episodes

Code: [Select]
ItemCount(/[series/]/[season/],0)Would return 20

Code: [Select]
ItemCount(/[series/]/[season/],1)Would return 2
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Expression functions [HELP WANTED]
« Reply #2 on: March 17, 2020, 11:20:11 am »

We have:
round(x)    Returns x rounded to the nearest whole number.

Could we also/instead have:
round(x,n)    Returns x rounded to n decimal places.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #3 on: March 17, 2020, 11:48:21 am »

We have:
round(x)    Returns x rounded to the nearest whole number.

Could we also/instead have:
round(x,n)    Returns x rounded to n decimal places.

Take a look at FormatNumber.

I think it already does this.  For example: FormatNumber(3.1415926, 2) outputs 3.14.
Logged
Matt Ashland, JRiver Media Center

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Expression functions [HELP WANTED]
« Reply #4 on: March 17, 2020, 12:02:24 pm »

Take a look at FormatNumber.

I think it already does this.  For example: FormatNumber(3.1415926, 2) outputs 3.14.
Ah ok, only been looking this from math() section. Thanks for fulfilling the request  8)
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Expression functions [HELP WANTED]
« Reply #5 on: March 17, 2020, 09:37:27 pm »

a loop function   ;)

i really like the expression language and it's quite powerful as is, the only thing i would like (only semi-related) is to be able to refer to an album as an object, so we could make expressions over albums like average DR and junk
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Expression functions [HELP WANTED]
« Reply #6 on: March 17, 2020, 10:54:21 pm »

Thanks Matt for soliciting this feedback...

I have a couple of small suggestions, conveniences really...

First, to make the GroupSummary function easier to use:
Add an optional MODE to GroupSummary, ex: GroupSummary(Rating, 1)
Mode 0 would be the default if the option is omitted, and would function as GroupSummary does now.
When mode 1 is specified, GroupSummary would provide "clean" output.  For example, it would output "3.4" instead of "3.4 avg" or "12" instead of "12 total".  This would make it easier to integrate in expressions.

Second, although a lot of things, like the above, can be done with regex, it's just a reality that too many users find regular expressions too difficult or unapproachable.  So it would be nice if there were a function, perhaps called Number(), that performed the function of the following:
regex([String], /#(\d+\.?\d+?)#/, -1)

That would make things easier for a lot of people...
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9140
Re: Expression functions [HELP WANTED]
« Reply #7 on: March 18, 2020, 12:47:34 am »

The only thing I've bumped into on several occassions, is requiring "&DataType=[Date]" for sorting correctly when using the "FormatDate" functions.

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Expression functions [HELP WANTED]
« Reply #8 on: March 18, 2020, 03:54:53 am »

Second, although a lot of things, like the above, can be done with regex, it's just a reality that too many users find regular expressions too difficult or unapproachable.  So it would be nice if there were a function, perhaps called Number(), that performed the function of the following:
regex([String], /#(\d+\.?\d+?)#/, -1)
+1 It is really tedious to do any math() in country where comma is a decimal point as MC only understand period. If I could just use something like Number([field]) instead of Replace([field],/,,.) it would be really helpful.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #9 on: March 18, 2020, 07:28:50 am »

First, to make the GroupSummary function easier to use:
Add an optional MODE to GroupSummary, ex: GroupSummary(Rating, 1)
Mode 0 would be the default if the option is omitted, and would function as GroupSummary does now.
When mode 1 is specified, GroupSummary would provide "clean" output.  For example, it would output "3.4" instead of "3.4 avg" or "12" instead of "12 total".  This would make it easier to integrate in expressions.

I can do that one.  Thanks!

Second, although a lot of things, like the above, can be done with regex, it's just a reality that too many users find regular expressions too difficult or unapproachable.  So it would be nice if there were a function, perhaps called Number(), that performed the function of the following:
regex([String], /#(\d+\.?\d+?)#/, -1)

What would the Number(...) function take and what would it output?  Is it just digging through a big string like "abc 34 def" for the 34?

Thanks.
Logged
Matt Ashland, JRiver Media Center

Mike Foran

  • World Citizen
  • ***
  • Posts: 212
Re: Expression functions [HELP WANTED]
« Reply #10 on: March 18, 2020, 07:43:53 am »

Matt, I was just discussing in another thread how I would like a function that would act like search, but could be used as an expression. Ideally it would be two functions, but both working on the same principle.

[Anything] would check against a particular string and return a boolean result. So [Anything]="Bob Dylan" would return a 1 if ANY tag, custom or not (that has search keywords enabled), contained Bob Dylan. This would enable automatically populated and broad scoping playlists and views, from rules or expressions.

[Tags] would check against a particular string and return a list of any tag containing the string. So inputting "Kanye West" would return a list of the name of every tag, custom or not, that the name Kanye West appears in, so something like "Artist/ Producer/ Musician" This would enable users to more fully explore connections within their library, and might even be fed into Play Doctor to create more interesting automatic playlists.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #11 on: March 18, 2020, 08:08:27 am »

[Tags] would check against a particular string and return a list of any tag containing the string. So inputting "Kanye West" would return a list of the name of every tag, custom or not, that the name Kanye West appears in, so something like "Artist/ Producer/ Musician" This would enable users to more fully explore connections within their library, and might even be fed into Play Doctor to create more interesting automatic playlists.

I liked that one.  So next build:
NEW: Added a SearchTags(...) expression function that takes a value and returns all the fields that have a match.

Keep in mind that it's not a real fast function to search every field on all the files, so use it sparingly.

Thanks!
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #12 on: March 18, 2020, 08:32:15 am »

Thought more about it and think I can add a parameter to SearchTags to make it only return true or false (your other idea).
Logged
Matt Ashland, JRiver Media Center

Mike Foran

  • World Citizen
  • ***
  • Posts: 212
Re: Expression functions [HELP WANTED]
« Reply #13 on: March 18, 2020, 11:29:53 am »

I'm not sure I thought through things properly. Ideally, the [Anything] (or SearchTags) would work as a rule for a view or playlist. So the rules would look something like:

[Media Type]=[Audio] [Anything]="Kanye West"

and that would populate the view or playlist with audio tracks that have Kanye West in *any* tag.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #14 on: March 18, 2020, 11:39:13 am »

You can use expression functions in the search language.  Check the wiki.
Logged
Matt Ashland, JRiver Media Center

Mike Foran

  • World Citizen
  • ***
  • Posts: 212
Re: Expression functions [HELP WANTED]
« Reply #15 on: March 18, 2020, 11:51:54 am »

I am unaware of a search expression that will search all tags with one command. The best I can figure, I would have to make a long list of specific search queries, one for each field (which is basically how I have been doing it). The problem with that approach is that I have to manually input each field I want included in the search, so if I introduce new fields, or forget a field, I have to go through and update all of the playlists that use that set of rules. This is a cumbersome situation. I'm hoping for a more dynamic solution that wouldn't need me to predict where a string might appear and build custom search parameters around it. I could just say "If this string is in any tag at all, include it here."
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #16 on: March 18, 2020, 11:56:14 am »

This search finds all my files with Jewel anywhere in them:
[=SearchTags(Jewel, 1)]=1
Logged
Matt Ashland, JRiver Media Center

Mike Foran

  • World Citizen
  • ***
  • Posts: 212
Re: Expression functions [HELP WANTED]
« Reply #17 on: March 18, 2020, 12:03:59 pm »

I'm confused. You just added this to the new build or this is something that is already in the program?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #18 on: March 18, 2020, 12:07:09 pm »

I'm confused. You just added this to the new build or this is something that is already in the program?

Sorry, that's the function I added today based on your idea.  It will be in a coming build.  It seems to be working great.
Logged
Matt Ashland, JRiver Media Center

Mike Foran

  • World Citizen
  • ***
  • Posts: 212
Re: Expression functions [HELP WANTED]
« Reply #19 on: March 18, 2020, 12:11:22 pm »

AWESOME!!  ;D ;D ;D
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Expression functions [HELP WANTED]
« Reply #20 on: March 18, 2020, 12:30:55 pm »


What would the Number(...) function take and what would it output?  Is it just digging through a big string like "abc 34 def" for the 34?

Thanks.

Number() would dig through a string like "abc 34.1avg def" and return 34.1 including the decimal point.

It would be nice to accommodate users in other parts of the world if Number() respected the system-wide default radix character.  Some places use a . in decimal numbers while others use a comma.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #21 on: March 18, 2020, 12:56:03 pm »

Number() would dig through a string like "abc 34.1avg def" and return 34.1 including the decimal point.

It would be nice to accommodate users in other parts of the world if Number() respected the system-wide default radix character.  Some places use a . in decimal numbers while others use a comma.

Next build:
NEW: Added the expression function Number(...) that takes a string and finds the number (plus decimal) in the string.

Thanks for the idea!
Logged
Matt Ashland, JRiver Media Center

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Expression functions [HELP WANTED]
« Reply #22 on: March 18, 2020, 01:45:04 pm »

Awesome, Matt, thanks!

Did you do the GroupSummary one too?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #23 on: March 18, 2020, 01:46:58 pm »

Awesome, Matt, thanks!

Did you do the GroupSummary one too?

Sure did.

Here's the history:
Changed: Added a second parameter to the GroupSummary(...) expression function that when set to one, does not output things like "avg" or "total".

This thread has yielded some really nice fruit.  Please keep the ideas coming!
Logged
Matt Ashland, JRiver Media Center

BigSpider

  • Galactic Citizen
  • ****
  • Posts: 352
Re: Expression functions [HELP WANTED]
« Reply #24 on: March 18, 2020, 05:42:55 pm »

an instr([field],"character to find") would be a useful addition to locate a specified character in a string which could then be used with the left() right() functions.
Logged
English spiders are kind of small, but when I was living in the African rain forest well ......

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119
Re: Expression functions [HELP WANTED]
« Reply #25 on: March 18, 2020, 06:00:08 pm »

an instr([field],"character to find") would be a useful addition to locate a specified character in a string which could then be used with the left() right() functions.

+1

Should be expanded to find a sub-string in a string and also to start at a particular position in the string. Regex is just too complicated for many to do this simple search.

For example,

InStr([ start ], string1, string2, [ compare ])
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Expression functions [HELP WANTED]
« Reply #26 on: March 18, 2020, 06:04:45 pm »

Yeah, thanks Spider, I can't believe I forgot this.  We've needed that for a long time.

You can do a substring search with IsEqual() but it does not return the position of the string, it only returns a boolean.

So to modify what BigSpider said, what we really need is:

Instr(target, substring, start, mode) where:
 target is any string or field to be searched
 string is any arbitrary string or field we're looking for, not just a single character
 start is the optional 0-based starting position, defaulting to 0
 mode (optional) is 0 (the default) for case insensitive, 1 for case sensitive

And Instr returns the zero-based position of the substring in the target (to be compatible with Mid).

[Edit: I see dtc responded along similar lines while I was typing]
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #27 on: March 18, 2020, 06:10:29 pm »

Good ideas.  Thanks 😊
Logged
Matt Ashland, JRiver Media Center

SkGe

  • Galactic Citizen
  • ****
  • Posts: 433
Re: Expression functions [HELP WANTED]
« Reply #28 on: March 18, 2020, 06:38:46 pm »

Doing some cleaning in my lyrics i hit a problem.
Code: [Select]
=FixSpacing(RemoveCharacters(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace([lyrics], [Refrain], *), [Outro], *), [Chorus], *), [Bridge], *), [Verse 1], *), [Verse 2], *), [Verse 3], *), [Pre-Chorus], *), [Post-Chorus], *), *), 4)When using this type of expression, everything is clear on the lyrics but it adds additional empty line instead. Can we have something similar like notepad++ has with duplicate lines, where it just remove/add them.
RemoveLines(), wheres default remove lines is 0, 1 removes consecutive lines, 2 adds lines above or below, etc..
Logged

BigSpider

  • Galactic Citizen
  • ****
  • Posts: 352
Re: Expression functions [HELP WANTED]
« Reply #29 on: March 18, 2020, 07:20:26 pm »

Yeah, thanks Spider, I can't believe I forgot this.  We've needed that for a long time.

You can do a substring search with IsEqual() but it does not return the position of the string, it only returns a boolean.

So to modify what BigSpider said, what we really need is:

Instr(target, substring, start, mode) where:
 target is any string or field to be searched
 string is any arbitrary string or field we're looking for, not just a single character
 start is the optional 0-based starting position, defaulting to 0
 mode (optional) is 0 (the default) for case insensitive, 1 for case sensitive

And Instr returns the zero-based position of the substring in the target (to be compatible with Mid).

[Edit: I see dtc responded along similar lines while I was typing]
Yea, what Wer said, I was only asking for the basics but this would make it super useful.
Logged
English spiders are kind of small, but when I was living in the African rain forest well ......

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Expression functions [HELP WANTED]
« Reply #30 on: March 19, 2020, 04:15:31 am »

Yeah, thanks Spider, I can't believe I forgot this.  We've needed that for a long time.

You can do a substring search with IsEqual() but it does not return the position of the string, it only returns a boolean.

So to modify what BigSpider said, what we really need is:

Instr(target, substring, start, mode) where:
 target is any string or field to be searched
 string is any arbitrary string or field we're looking for, not just a single character
 start is the optional 0-based starting position, defaulting to 0
 mode (optional) is 0 (the default) for case insensitive, 1 for case sensitive

And Instr returns the zero-based position of the substring in the target (to be compatible with Mid).

[Edit: I see dtc responded along similar lines while I was typing]
+1 This has been a headache plenty of times and yet I forgot it now when asked...
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Expression functions [HELP WANTED]
« Reply #31 on: March 19, 2020, 06:55:09 am »

I'd like a List processing function that would take each member and transform it in a given way. This would simplify many expressions:

transform(template, delimiter, list1, list2, ...)
- given a Template (expression) and one or more lists;
- for each element N of the first list, apply the given template using element N of each provided list;
- return list of transformed values

Example:
[Actors]=Daisy Ridley;Adam Driver;John Boyega;Oscar Isaac;Mark Hamill
[Roles]=Rey;Kylo Ren;Finn;Poe Dameron;Luke Skywalker

transform(<img src="tooltip:[L1]-[L2].png"> ,;,[Actors],[Roles])

output (list):
<img src="tooltip:Daisy Ridley-Rey.png"> ;<img src="tooltip:Adam Driver-Kylo Ren.png"> ;<img src="tooltip:John Boyega-Finn.png"> ;<img src="tooltip:Oscar Isaac-Poe Dameron.png"> ;<img src="tooltip:Mark Hamill-Luke Skywalker.png"> 

- For iteration N, [L1] refers to element N of list1 (Actors), [L2] refers to element N of list2 (Roles); in general [Lx] refers to element N of list X
- For simplicity when transforming just a single list, [L] can be the same as [L1]
- The current index N itself could be used as well with [N]
- it lists are of different size and [Lx] doesn't exist for a given N, its value is blank

This should be named ListSomething() for consistency - ListApply / ListBake / ListTransform / foreach ...
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Expression functions [HELP WANTED]
« Reply #32 on: March 19, 2020, 07:01:34 am »

Function to create a numbered List:
Range(start, step, count, delimiter=;)

Range(1,1,10)   => returns 1;2;3;4;5;6;7;8;9;10
Range(5,-1,6)   => returns 5;4;3;2;1;0

This could also be used with the above ListTransform() to create a sort of loop to generate a list:
transform(some expression,,Range(1,1,10))  => same as transform(some expression,,1;2;3;4;5;6;7;8;9;10) , returns a list of 10 elements where each element is Transformed.

Example:
transform(#[L1]: [L2],,Range(1,1,5), [Actors])

output (list):
#1: Actor1 Name;#2: Actor2 Name;#3: Actor3 Name;#4: Actor4 Name;#5: Actor5 Name
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Expression functions [HELP WANTED]
« Reply #33 on: March 19, 2020, 07:05:50 am »

Function to handle a List as a List of Pairs (sort of Dictionary<string,string>), and return the "value" of a given "key":

ListPair(pairList,key,default=,separator=;)
- pairList: list of paired values, like "key1;value1;key2;value2;key3;value3;..."
- key: key to search for - key search should only be done on even indexes (0, 2, 4 ...)
- default: default value returned if key is not found

returns: List value on the position immediately after where the Key is found.

Example:
[pairs]=DTS;DTSLabel;AAC;AACLabel;AC3;AC3Label;MP3;MP3Label
ListPair([pairs],AAC)                          => returns AACLabel
ListPair([pairs],someValueNotInList,Other)     => returns Other
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Expression functions [HELP WANTED]
« Reply #34 on: March 19, 2020, 07:08:03 am »

Last one :)

ListIndex(value, list, delimiter,mode)
Return 0-based index of value within list, -1 if not found.
mode=0 for case-insensitive (default), 1 for case-sensitive.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Expression functions [HELP WANTED]
« Reply #35 on: March 19, 2020, 07:43:46 am »

Bonus one ;D

chr(x) => insert char X, with Unicode support please. X is a number, or unicode codepoint (decimal or hex? up to you)
Alternatively, just adding a unicode codepoint directly to the expression could also work, like \u25CF/ directly in the text.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #36 on: March 19, 2020, 08:14:49 am »

Thanks for all the ideas!

Next build will have these enhancements based on the feedback:
NEW: Added the expression function Find(...) to search for a substring in a string.
NEW: Added the expression function Trim(...) to trim non-printable characters and newlines from a string.
NEW: Added the expression function ListFind(...) to search a list for a value (takes a final parameter to decide if it should return the value or the index).
NEW: Added the expression function Range(...) to create a numbered list.

Cheers.
Logged
Matt Ashland, JRiver Media Center

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Expression functions [HELP WANTED]
« Reply #37 on: March 19, 2020, 08:30:52 am »

Thanks Matt.

Another example of how powerful the list Transform function could be:
transform(trim([L]),, [Keywords])      - trim all items in the [Keywords] list
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Expression functions [HELP WANTED]
« Reply #38 on: March 19, 2020, 08:46:34 am »

Quote
NEW: Added the expression function Trim(...) to trim non-printable characters and newlines from a string.

I like Trim() as it's standard naming, but I just want to point out that you could also add it as a new mode to Clean()
Clean([Director],4)
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #39 on: March 19, 2020, 08:48:47 am »

I like Trim() as it's standard naming, but I just want to point out that you could also add it as a new mode to Clean()
Clean([Director],4)


I thought about that, but the Clean(...) function thinks about articles and the like so I thought a new function would be a little neater.
Logged
Matt Ashland, JRiver Media Center

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Expression functions [HELP WANTED]
« Reply #40 on: March 19, 2020, 12:24:42 pm »

Matt,

I really want to say thank you for this thread.  Not just the work you're doing, but the thought behind it.

Asking for suggestions from users, and then actually implementing them, even if they're small things like this, goes a long way towards building good-will/restoring faith in JRiver.

Thank you!

-Will

Logged

Mike Foran

  • World Citizen
  • ***
  • Posts: 212
Re: Expression functions [HELP WANTED]
« Reply #41 on: March 19, 2020, 12:26:46 pm »

Hear Hear!
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #42 on: March 20, 2020, 08:27:23 am »

Bonus one ;D

chr(x) => insert char X, with Unicode support please. X is a number, or unicode codepoint (decimal or hex? up to you)
Alternatively, just adding a unicode codepoint directly to the expression could also work, like \u25CF/ directly in the text.

Next build:
NEW: Added the Char(...) expression function to output a character from the numeric code of the character.

Thanks!
Logged
Matt Ashland, JRiver Media Center

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3119
Re: Expression functions [HELP WANTED]
« Reply #43 on: March 20, 2020, 09:20:42 am »

Next build:
NEW: Added the Char(...) expression function to output a character from the numeric code of the character.

Thanks!

Awesome!
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #44 on: March 24, 2020, 08:57:27 am »

Still hoping for more good ideas!  Thanks.
Logged
Matt Ashland, JRiver Media Center

SkGe

  • Galactic Citizen
  • ****
  • Posts: 433
Re: Expression functions [HELP WANTED]
« Reply #45 on: March 26, 2020, 03:45:43 am »

Right now we have fixspacing() which is used for some of fixing space between text. What if we have a nex expression like FixLines() where you can remove/add lines inside a text.
You can see a post i've made here about how to fix a possible solution. An ideea, hope so. Thanks.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #46 on: March 26, 2020, 01:17:05 pm »

Right now we have fixspacing() which is used for some of fixing space between text. What if we have a nex expression like FixLines() where you can remove/add lines inside a text.
You can see a post i've made here about how to fix a possible solution. An ideea, hope so. Thanks.

I added the expression Trim(...) thinking it would remove leading and trailing stuff from the expression.

If you still need FixSpacing(...) can you explain in a little more detail how it would work?  Thanks!
Logged
Matt Ashland, JRiver Media Center

SkGe

  • Galactic Citizen
  • ****
  • Posts: 433
Re: Expression functions [HELP WANTED]
« Reply #47 on: March 26, 2020, 07:30:07 pm »

As i add example FixSpacing() where i believe you know that it has 3 value where you can workaround
(1-convert camel case to spaced words; 2-convert double spaces to single spaces; 4-remove leading and trailing space)
What i want if it is possible to be added, a way to deal with double lines in a text (lyrics). Because when i'm doing some cleaning in lyrics, at the end of expression i have double lines which i can't find a way to remove them. So i come with an idea to add something similar to FixSpacing(), where the value for the next expression, ex. FixLines() is, add/remove lines.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42376
  • Shoes gone again!
Re: Expression functions [HELP WANTED]
« Reply #48 on: March 27, 2020, 08:03:03 am »

Thanks for the information.

Next build will have this:
NEW: Added the expression function TrimLines(...) to standardize and consolidate newlines.

It takes a mode like this:
Mode (or together): 1 trims double newlines, 2: trims starting and ending newlines (optional: defaults to 3)

If there's anything more you're looking for from TrimLines(...), just let me know.  Thanks again.
Logged
Matt Ashland, JRiver Media Center

SkGe

  • Galactic Citizen
  • ****
  • Posts: 433
Re: Expression functions [HELP WANTED]
« Reply #49 on: March 27, 2020, 06:57:57 pm »

Well thanks for this Matt! For now im waiting to see implemented.
Logged
Pages: [1] 2 3 4 5 ... 9   Go Up