Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_wave_seekbar (Read 799376 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

foo_wave_seekbar

Reply #1450
First off: great component for fb2k. Thanks, Zao!

Having said that: I've tried moving to Direct3D from GDI (for normalization support), but every time I do, I end up hunting for shaders that have already been written, disliking their look and going back to GDI.

I'd propose either adding normalization support for GDI, or instating some kind of repository for example shaders (or even just a preset dir).
In any case, it might be worth it to mandate an explicit split of the shader code into elements responsible for different parts of the rendering process. Complete control over the shader code is nice, but it's not very accessible or convenient.

foo_wave_seekbar

Reply #1451
All you need is a time machine to download the non-existent v2.

If I implement something composable going forward, it'll probably be in the form of simple layers achieving a single thing, which can be stacked and blended together.

Modularisation as it stands is hard, as I'd have to interpret the contents of the blocks and compose them into unified HLSL that wouldn't blow the instruction limits.
The default effect is already very close to the limits of some of the 2.x shader models.

As for a looks repository, I've pondered it but it would involve web-dev, which makes my eyes bleed.
Stay sane, exile.

foo_wave_seekbar

Reply #1452
Hey, I'm pretty new to editing the foobar interface so sorry if this is a dumb question, but is there some way to replace the normal seekbar with the waveform seekbar or at least put it up on/near the toolbar?

foo_wave_seekbar

Reply #1453
urutapu:In the Default UI, I do not currently have the capability to add any custom toolbars, it can only go where UI elements can go.
In Columns UI, the component works both as an UI panel and an UI toolbar.

The closest you can get to having it a toolbar is making a top/bottom split, putting the seekbar in the upper half and the rest of your UI in the lower half.
Stay sane, exile.

foo_wave_seekbar

Reply #1454
For you people who for some strange reason listen to .1 content and display it mixed down to stereo or mono, there are changes coming up in 0.2.39.3 where I now include the LFE channel in the mixdown result after consulting relevant documentation and mindmelding with testers.
Quote
LFE mixdown factor is now 0.5 per channel.
Removing the LFE channel completely from mixdowns is a bit of a lie, as
the content, even while purely supplemental, has some meaning in the
context of a track.

As every mixdown is a reinterpretation of the data, having an effect
over-represented is better than completely omitting it, particularly as
there is now shader parameters to adjust the displayed range of a
waveform.

ITU recommendation BS.775 specifies a choice of four mixin factors for
LFE content: 0.7071, 0.5, 0.0 and 'reserved', to be specified by the
broadcaster. As any such information is not available, I've selected 0.5
as the coefficient due to it being the lowest non-zero choice, avoiding
over-attenuation while still representing the content somehow.
Stay sane, exile.

foo_wave_seekbar

Reply #1455
Modularisation as it stands is hard, as I'd have to interpret the contents of the blocks and compose them into unified HLSL that wouldn't blow the instruction limits.
The default effect is already very close to the limits of some of the 2.x shader models.

I wasn't aware that anybody still cared about 2.x shader model limits. 3.0 was introduced 9 years ago

Concerning the modularisation: you could also create more of an implicit social contract between people who write shader code. That is: just have several designated text editors for different parts of the shader code, but simply concatenate their contents. This would not break flexibility nor should it be a lot of work, but it would stimulate more segmented customization.

foo_wave_seekbar

Reply #1456
I wasn't aware that anybody still cared about 2.x shader model limits. 3.0 was introduced 9 years ago

The machines people use to play music tend to more often than not be considered 'vintage'. There's lots of bending over in the Direct3D9 component to support all kinds of odd texture formats and GPU quirks.
Concerning the modularisation: you could also create more of an implicit social contract between people who write shader code. That is: just have several designated text editors for different parts of the shader code, but simply concatenate their contents. This would not break flexibility nor should it be a lot of work, but it would stimulate more segmented customization.

The optimal solution would be one that has a minimum amount of GUI work needed for me in the component itself. The sane solution would probably be a standalone effect designer, either using some weirdo GUI toolkit like Qt, or driven via the browser or something. The current scintilla component as I use it is ... not good, and tends to be slightly unstable.
Stay sane, exile.

foo_wave_seekbar

Reply #1457
Hey, I'm pretty new to editing the foobar interface so sorry if this is a dumb question, but is there some way to replace the normal seekbar with the waveform seekbar or at least put it up on/near the toolbar?


You can use top/bottom splitter in Default UI (as Zao said), and additionally you can turn off regular seekbar when you rightclick on toolbar. I turned off regular seekbar, but I placed waveform one at the bottom of my layout.

foo_wave_seekbar

Reply #1458
0.2.39.6 is out now. If you've installed any of the 0.2.39 series, please upgrade to this one, it resolves a bug where the foobar2000 installer will not finish due to my component being stupid.
Changelog 0.2.39.6
Stay sane, exile.

foo_wave_seekbar

Reply #1459
Zao, one question - could coefficients for downmixing display of multichannel tracks to mono/stereo be made as user editable values? For example in that script window or somewhere in foobar's "Advanced Preferences"?

foo_wave_seekbar

Reply #1460
A core problem with making things configurable is that anything is made configurable, it's set in stone forever. You cannot distinguish between a user-selected value and one that was the default in the past, which makes it quite a bother for changing the defaults for a reason.
Stay sane, exile.

 

foo_wave_seekbar

Reply #1461
OK, but do you see such possibility in future or is it just impossible from your point of view? I know that I can't force you and I understand that you can simply don't have enough time. If you don't plan it at any time then just say "no"

foo_wave_seekbar

Reply #1462
The machines people use to play music tend to more often than not be considered 'vintage'. There's lots of bending over in the Direct3D9 component to support all kinds of odd texture formats and GPU quirks.

I doubt the 'more often than not' part of that, but it is noble that you choose to support such hardware nonetheless (and endure all the pain that comes with it ;-).

Quote
The optimal solution would be one that has a minimum amount of GUI work needed for me in the component itself. The sane solution would probably be a standalone effect designer, either using some weirdo GUI toolkit like Qt, or driven via the browser or something. The current scintilla component as I use it is ... not good, and tends to be slightly unstable.

I'd say that 'adding some extra textareas' is about the least amount of GUI work definable within the realm of GUI work ;-)

Anyway, I've switched back to GDI rendering again. Although it sounds awesome, I really can't justify spending several hours on 'programming shaders for a static waveform visualization in my music player' ;-)
Still a thankful user of your component, of course.

foo_wave_seekbar

Reply #1463
Where can I find old versions? L O L.

foo_wave_seekbar

Reply #1464
That depends on why you need them. If there's something that is inferior or unacceptable in a newer version, I'd rather work in public towards resolving that than to have a bunch of people staying on versions with eternal bugs.
Stay sane, exile.

foo_wave_seekbar

Reply #1465
i would also like to know where i could find an older version of your plugin. the reason for that is, that i'm running foobar2k with wine on ubuntu linux. starting with some version which i don't exactly remember, foobar started crashing when waveform seekbar was installed. unfortunately, i couldn't find a workaround yet, but i'd love to continue using the plugin.

foo_wave_seekbar

Reply #1466
How do I achieve this effect, with the grayscale seekbar becoming colored with time?


foo_wave_seekbar

Reply #1467
i would also like to know where i could find an older version of your plugin. the reason for that is, that i'm running foobar2k with wine on ubuntu linux. starting with some version which i don't exactly remember, foobar started crashing when waveform seekbar was installed. unfortunately, i couldn't find a workaround yet, but i'd love to continue using the plugin.

The only way I can ever find out about these kinds of problems is if I'm told about them, as wine is explicitly ignored by the crash reporting system.
Stay sane, exile.

foo_wave_seekbar

Reply #1468
How do I achieve this effect, with the grayscale seekbar becoming colored with time?


Open settings, select Direct3D, then open Frontend settings, and paste this code:
Code: [Select]
Texture1D tex : WAVEFORMDATA;

SamplerState sTex
{
Filter = MIN_MAG_MIP_LINEAR;
AddressU = Clamp;
};

struct VS_IN
{
float2 pos : POSITION;
float2 tc : TEXCOORD0;
};

struct PS_IN
{
float4 pos : SV_POSITION;
float2 tc : TEXCOORD0;
};


float4 backgroundColor : BACKGROUNDCOLOR;
float4 highlightColor : HIGHLIGHTCOLOR;
float4 selectionColor : SELECTIONCOLOR;
float4 textColor : TEXTCOLOR;
float cursorPos : CURSORPOSITION;
bool cursorVisible : CURSORVISIBLE;
float seekPos : SEEKPOSITION;
bool seeking : SEEKING;
float4 replayGain : REPLAYGAIN; // album gain, track gain, album peak, track peak
float2 viewportSize : VIEWPORTSIZE;
bool horizontal : ORIENTATION;
bool shade_played : SHADEPLAYED;

PS_IN VS( VS_IN input )
{
PS_IN output = (PS_IN)0;

float2 half_pixel = float2(1,-1) / viewportSize;
output.pos = float4(input.pos - half_pixel, 0, 1);
if (horizontal)
output.tc = float2((input.tc.x + 1.0) / 2.0, input.tc.y);
else
output.tc = float2((-input.tc.y + 1.0) / 2.0, input.tc.x);

return output;
}

float4 bar( float pos, float2 tc, float4 fg, float4 bg, float width, bool show )
{
float dist = abs(pos - tc.x);
float4 c = (show && dist < width)
? lerp(fg, bg, smoothstep(0, width, dist))
: bg;
return c;
}

float4 evaluate(float4 bg, float4 fg, float factor)
{
return saturate(lerp(bg, fg, factor));
}

float4 played( float pos, float2 tc, float4 bg, float factor)
{
float4 c = bg;
if (pos > tc.x)
{
c = evaluate(backgroundColor, highlightColor, factor);
}
return c;
}

float RMSfactor( float2 tc, float border )
{
// alpha 1 indicates biased texture
float4 minmaxrms = tex.Sample(sTex, tc.x);
if (replayGain.g != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 1.8; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 1.8; //use album gain
} else {
minmaxrms.rgb *= 0.9 + minmaxrms.a;
}

float belowWave = tc.y + border - minmaxrms.r;
float aboveWave = tc.y - border - minmaxrms.g;
float factorWave = min(abs(belowWave), abs(aboveWave));
bool insideWave = (belowWave > 0 && aboveWave < 0);

float diffRms = abs(tc.y) - border - minmaxrms.b;
float factorRms = abs(diffRms);
bool insideRms = diffRms < 0;

float factor = insideRms ? (1.0 - 0.5 * saturate(factorRms / border / 2)): 1.0;
factor = insideWave ? (factor * saturate(factorWave / border / 2)) : 0.0;

return factor;
}

float4 PS( PS_IN input ) : SV_Target
{
float dx, dy;
if (horizontal)
{
dx = 1/viewportSize.x;
dy = 1/viewportSize.y;
}
else
{
dx = 1/viewportSize.y;
dy = 1/viewportSize.x;
}
float seekWidth = 2.5 * dx;
float positionWidth = 2.5 * dx;

float factor = RMSfactor(input.tc, 2.5 * dy);

float4 c0 = evaluate(backgroundColor, textColor, factor);
if (shade_played)
c0 = played(cursorPos, input.tc, c0, factor);
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos, input.tc, selectionColor, c0, seekWidth, seeking );
return c0;
}

technique10 Render10
{
pass P0
{
SetGeometryShader( 0 );
SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetPixelShader( CompileShader( ps_4_0, PS() ) );
}
}

technique Render9
{
pass
{
VertexShader = compile vs_2_0 VS();
PixelShader = compile ps_2_0 PS();
}
}

then apply, and set up colors (here is preview with my colors (red / dark red / black)


...its a code someone mentioned here earlier, and it isnt the only one solution...

I have a question myself though... Could someone give me a hint how to edit this code so that it would show the waves as are on Soundcloud?
 

I am talking about the mirror effect on L/R output

foo_wave_seekbar

Reply #1469
That depends on why you need them. If there's something that is inferior or unacceptable in a newer version, I'd rather work in public towards resolving that than to have a bunch of people staying on versions with eternal bugs.
Sorry for late answer. D3D mode worked fine few versions back. But now it is displayed wrong.

I admit, it is an old laptop, maybe it lacks some new hardware features. :/

foo_wave_seekbar

Reply #1470
nesvariigi: Is this a custom effect? Could you put your D3D effect code in a post with a codebox, as well as mention what graphics card and OS this is running on. I haven't seen that look since 2009
Stay sane, exile.

foo_wave_seekbar

Reply #1471
nesvariigi: Is this a custom effect? Could you put your D3D effect code in a post with a codebox, as well as mention what graphics card and OS this is running on. I haven't seen that look since 2009
I have no custom effects (default code). Graphics adapter is Trident CyberALADDiN-P4  v6.4612.22ICD_SE_NP. OS is WinXP Pro SP3 x86. As I mentioned, it is old laptop used mainly for music listening. I added pictures with D3D features support.


foo_wave_seekbar

Reply #1472
Amazing. The code must be falling into some sort of software rasterisation mode, or the driver for that card does some extreme magic.
It's also possible that all this time it has been falling back onto GDI mode transparently and _something_ changed enough to make the frontend kind of load.
Stay sane, exile.

foo_wave_seekbar

Reply #1473
So you say, it is impossible to run D3D mode on this hardware?

foo_wave_seekbar

Reply #1474
Older versions are available for testing purposes, so if you can find the version change where it stops working it would help me find out if it's something I did and what the reason might be. Make sure you look at the console and see if it succeeds at loading the Direct3D9 frontend or if it's falling back to GDI mode.
Code: [Select]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.15.fb2k-component]foo_wave_seekbar-0.2.15.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.16.fb2k-component]foo_wave_seekbar-0.2.16.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.17.fb2k-component]foo_wave_seekbar-0.2.17.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.18.fb2k-component]foo_wave_seekbar-0.2.18.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.19.fb2k-component]foo_wave_seekbar-0.2.19.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.20.fb2k-component]foo_wave_seekbar-0.2.20.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.21.fb2k-component]foo_wave_seekbar-0.2.21.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.22.fb2k-component]foo_wave_seekbar-0.2.22.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.23.fb2k-component]foo_wave_seekbar-0.2.23.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.24.fb2k-component]foo_wave_seekbar-0.2.24.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.25.fb2k-component]foo_wave_seekbar-0.2.25.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.26.fb2k-component]foo_wave_seekbar-0.2.26.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.27.fb2k-component]foo_wave_seekbar-0.2.27.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.28.fb2k-component]foo_wave_seekbar-0.2.28.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.29.fb2k-component]foo_wave_seekbar-0.2.29.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.30.fb2k-component]foo_wave_seekbar-0.2.30.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.30.1.fb2k-component]foo_wave_seekbar-0.2.30.1.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.31.fb2k-component]foo_wave_seekbar-0.2.31.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.32.fb2k-component]foo_wave_seekbar-0.2.32.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.33.fb2k-component]foo_wave_seekbar-0.2.33.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.34.fb2k-component]foo_wave_seekbar-0.2.34.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.35.fb2k-component]foo_wave_seekbar-0.2.35.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.fb2k-component]foo_wave_seekbar-0.2.36.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.1.fb2k-component]foo_wave_seekbar-0.2.36.1.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.2.fb2k-component]foo_wave_seekbar-0.2.36.2.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.36.3.fb2k-component]foo_wave_seekbar-0.2.36.3.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.37.fb2k-component]foo_wave_seekbar-0.2.37.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.38.fb2k-component]foo_wave_seekbar-0.2.38.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.fb2k-component]foo_wave_seekbar-0.2.39.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.1.fb2k-component]foo_wave_seekbar-0.2.39.1.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.2.fb2k-component]foo_wave_seekbar-0.2.39.2.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.3.fb2k-component]foo_wave_seekbar-0.2.39.3.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.4.fb2k-component]foo_wave_seekbar-0.2.39.4.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.5.fb2k-component]foo_wave_seekbar-0.2.39.5.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.6.fb2k-component]foo_wave_seekbar-0.2.39.6.fb2k-component[/url]
[url=https://www.acc.umu.se/~zao/foo_wave_seekbar-0.2.39.7.fb2k-component]foo_wave_seekbar-0.2.39.7.fb2k-component[/url]
Stay sane, exile.