It is currently April 20th, 2024, 12:08 pm

[Suggestion] Bézier spline on Curve Shape

Report bugs with the Rainmeter application and suggest features.
User avatar
Jeff
Posts: 327
Joined: September 3rd, 2018, 11:18 am

[Suggestion] Bézier spline on Curve Shape

Post by Jeff »

print("Hello, world.")

Suggestion: Have more than quadratic and cubic bézier on the Curve Shape, add bézier spline

Story on what happened and why I want it: Well, I wanted to recreate the IOS 6 Hey Siri visualizer that appears at the bottom when you call for Siri. At first I though it would be easy, just use the Curve shape and add many points for the bézier (just like Ilustrator, Gravit and Inkscape have) and make the Y value of them be the number value from a AduioLevel bar multiplied by some number to have it be useful as a Y value, except... my memory lied to me, the Curve shape is not like the Path Shape where you can have a million paths, the Curve Shape can only have a beginning point and an end point, HOWEVER the shape can be beatifically modified to have a smooth points, but only two of them :/
After seeing the word bézier, I went on the Wikipedia article for Bézier curve and I've have found this, B-Spline, it has multiple points on which it can curve, just like what I wanted with my Siri skin to archive those smooth cliffs between some points
While I have no idea how B-Spline works (if not apparent from my language) and only understood it from the image, I believe it can be added to the Curve Shape, in what shape of form, mostly your work, not mine :P

Proposal on how it should be added or at least how it should look like:
Let's not complicate the Curve shape that much, let's create another one :D
There are some ways of implementing it, but here is how I would like to have it
We'll name it BezierSpline, on the manual we'll copy paste stuff from the Curve shape, for the Shape we'll have the usual StartX, StartY, EndX, End Y, ShapeEnding and here instead of a million CurveTo, we'll do it in a similar way to gradients, the code should look like

Code: Select all

[BezierSpline]
Meter=Shape
Shape=BezierSpline StartX,StartY,EndX,End Y,ShapeEnding SplineDefinition | Other Attributes
SplineDefinition = x, y | x, y | x, y | x, y | ...
right now which, looks attractive... yeah I have nothing more to add, used all my brain for this.

What I can do until then: Combine all the Curve shapes but the result won't be as accurate, use the Path Shape but then it would look like a graph, use the CurveTo argument, which I guess is okay but it doesn't have that cliff smoothness OR I can copy what Frost (by the same guy who made Fountain Color) does and try to incorporate the lua in my skin, have over 300 roundline like his skin does... ehhhhhhh

Here's an image to only make my post look rich and catch the eye of whoever reads, even though it's trash
Image
Last edited by Jeff on September 29th, 2018, 11:45 pm, edited 1 time in total.
User avatar
Jeff
Posts: 327
Joined: September 3rd, 2018, 11:18 am

Re: [Suggestion] Bézier spline on Curve Shape

Post by Jeff »

Here is some sample code of how it would look like

Code: Select all

[Rainmter]
Update=50

[Siri]
Meter=Shape
Y=10
Shape =BezierSpline 0,0,600,0,1 SiriSplines1 | Fill Color 255,0,0,85  | StrokeWidth 0
Shape2=BezierSpline 0,0,600,0,1 SiriSplines2 | Fill Color 0,255,0,85  | StrokeWidth 0 
Shape3=BezierSpline 0,0,600,0,1 SiriSplines3 | Fill Color 0,0,255,85  | StrokeWidth 0 
SiriSplines1=100,[AduioMultiply10] | 200,[AduioMultiply20] | 300,[AduioMultiply30] | 400,[AduioMultiply40] | 500,[AduioMultiply50]
SiriSplines2=100,[AduioMultiply11] | 200,[AduioMultiply21] | blah blah so forth you understand this if you have a functioning brain
DynamicVariables=1

[SiriInversed]
Meter=Shape
Y=11
.........................
;here will be the same meter as above but with TransformationMatrix applied to make it be from UP to DOWN

[MeasureAudio]
Measure=Plugin
Plugin=AudioLevel
Port=Input
;Port=Input to test it, I seriously have no idea why people who make visualizer always do it with Port=Output, it's stupid
FFTSize=1024
FFTAttack=15
FFTDecay=100
Bands=14

;N is the number of measures there will be, it will be from 10 to 52, you would understand better if you look at the Shape above
[MeasureBandN]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Type=Band
BandIdx=N

[AudioMultiplyN]
Measure=Calc
Formula=MeasureBandN * 100
IN THEORY, this should work

EDIT: Another wall on the road
Image
Made a few shapes to see if the White parts would work and... Rainmeter uses Multiplicative Blend (doesn't use it, just happens because of the way Rainmeter is), on a matrix it would probably make sense how it happens and why it happens.

https://docs.microsoft.com/en-us/windows/desktop/direct2d/blend
Oh would you look at that (me just seraching microsoft blend d2d on goggle), seeing an Additive Effect gives me hope that the skin can be done

Send me a message on my inbox in 2 years when all of Direct2D gets added to Rainmeter (which I hope it would, all these effects here seem great, but not only effects, EVERYTHING ON THE MICROSOFT WIKI that works with Win 7 as well, see you in 6 years when you guys drop support for Win 7 and finally uncomment in the source code all the effects that aren't available on the inferior 7)