Skip to main content

Topic: foo_wave_seekbar (Read 518506 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Axon
  • [*][*][*][*][*]
  • Members (Donating)
foo_wave_seekbar
Reply #525
Cheezy pixel-shader-magnifying-glass effects, anybody?

Code: [Select]
float4 evaluate(float2 tc, float2 d, float x0)
{
   float xd=tc.x-x0,
         y=(1/2-1),
         u=-(2*xd/0.01)*(2*xd/0.01),
         E=exp(u/2);
  
   float4 minmaxrms = tex1Dbias(sTex, float4(
       tc.x + xd*y*E,
       0, 0,
       log2(2048*d.x * (1 + y*E*(1+u)))
       ));
      
// alpha 1 indicates biased texture
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + minmaxrms.a;
...

Zao, I've noticed when mucking around with LOD bias/mipmap levels that min/max levels are being averaged at lower LOD levels. As I understand the effect code, this isn't as much of a big deal with the default effect, because well, it completely ignores LOD and thus has massive aliasing issues of its own. But how possible do you think it would be to manually populate the mipmaps, by computing the max/min of the higher resolution texture samples, instead of letting DirectX average samples together?

And for the ultimate nitpick: Could you populate the .g value of minmaxrms with rms^2, so that sample averaging at lower LOD levels is meaningfully accurate?

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #526
I compute my own mipmaps. They are however just averaged as you noticed.
As for the default effect, as far as I know, sampling should pick a suitable miplevel according to size.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

foo_wave_seekbar
Reply #527
Getting to grips with HLSL a bit, after much math I realised that it should excel at vectors. An update to the seekbar.fx I posted in the CUI appearance thread.

To change the hue difference, change the number at 187,
Code: [Select]
c = hueshift(c,4.0);
If you want two particular hues, use the colour picker to find the hue values, subtract them and divide by 38.2.

foo_wave_seekbar
Reply #528
Getting to grips with HLSL a bit, after much math I realised that it should excel at vectors. An update to the seekbar.fx I posted in the CUI appearance thread.

To change the hue difference, change the number at 187,
Code: [Select]
c = hueshift(c,4.0);
If you want two particular hues, use the colour picker to find the hue values, subtract them and divide by 38.2.


I would like to make it so that my waveform is gray (or whatever the foreground color is), however, I want the played color to highlight it according to the selection color.  I can sort of get the opposite of what I want if I change your effect to grayscale.  Is there any easy way to modify it to get this effect?  Thanks.

foo_wave_seekbar
Reply #529
On line 165 under the played function change:
Code: [Select]
    if (pos > tc.x)
to
Code: [Select]
    if (pos < tc.x)

  • teohhanhui
  • [*]
foo_wave_seekbar
Reply #530
seekbar.fx is not extracted when the file does not exist but the "effects" folder already exists in the profile folder.

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #531
That's not what my source code says, but in any way, it's largely moot.
The next version will not use files at all. I expect to release it in June or so.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

  • Dandruff
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #532
The next version will not use files at all.


Sounds nice! Thanks!

  • Anomalous
  • [*][*][*]
foo_wave_seekbar
Reply #533
Here's a version of the RMS effect which uses the highlight colour instead of just grey-scaling it. http://pastebin.com/rVfuCDgy


foo_wave_seekbar
Reply #534
On line 165 under the played function change:
Code: [Select]
    if (pos > tc.x)
to
Code: [Select]
    if (pos < tc.x)


Thanks.  This was really obvious, I really should have noticed that.


So, I've been trying to play around with the seekbar.fx file, but I'm really not sure what does what in the code.  First off, what language is this written in (and where can I find some basic documentation on the syntax)?  Also, is there any form of documentation for this code specifically?  I'm having a hard time trying to determine what each variable in the code corresponds to, and how to use them.  Finally, is there any way to print a variable's value to the console for debugging?  Thanks.

  • Anomalous
  • [*][*][*]
foo_wave_seekbar
Reply #535
From what I've read here it's High level shader language, there's documentation by Microsoft here.

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #536
Printing is something that is very hard to achieve in shaders.

One fundamental concept that tends to confuse people used to normal languages is that the PS function (pixel shader) runs on each and every pixel of the display, in parallel.
Thus, you can't really return anything or affect anything outside that pixel, like some mythical console or so.
I find that one of the easier ways to output values is to set the output colour component to values you're interested in and estimate the value based on that, with the caveat that only colour components between 0 and 1 are representable.

Documentation should be available on MSDN as Anomalous linked, and you ought to be able to find decent information on post-processing elsewhere online too.
After all, this is the language that shaders for most games are written in.

As for documentation on my functions, they should hopefully be reasonably obvious based on their usage and parameters. Heh.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

foo_wave_seekbar
Reply #537
Thanks to both of you, that's helped a lot.

  • teohhanhui
  • [*]
foo_wave_seekbar
Reply #538
Here's a version of the RMS effect which uses the highlight colour instead of just grey-scaling it. http://pastebin.com/rVfuCDgy

Thanks! That's exactly what I wanted but failed to achieve after trying for many hours...

  • IvoP123
  • [*]
foo_wave_seekbar
Reply #539
My seekbar doesn't highlight played part of the song. Is this a bug or is it something wrong with my foobar (i use it in ubuntu with wine)?

foo_wave_seekbar
Reply #540
Is there any feasible way to acquire Direct2D without having to install Vista SP2?

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #541
No. None whatsoever. You need SP2 and the platform update.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

foo_wave_seekbar
Reply #542
Ah, I see. After trying to install SP2 on my system at least seventeen times, and after finally installing the Platform Update, and after finally trying Direct 2D out, I have come to the conclusion that I prefer GDI over Direct 2D. At least I have the option to switch between the two now. (I still prefer Direct 2D over Direct 3D.)

Thanks for the component, Zao. It's easily amongst my favorites.

  • MDMA
  • [*][*]
foo_wave_seekbar
Reply #543
Anyone have any idea how I can pad the wave seekbar, so that there are a few more extra pixels of background around the wave? Thanks :-)

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #544
You can either scale down the texcoords somewhat, or fade to black when near the edge of the waveform, or something similarly sneaky.

That's all for the D3D one, of course. With GDI and D2D, you're out of luck.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

  • MDMA
  • [*][*]
foo_wave_seekbar
Reply #545
No idea how to do what you just said  Some further help may be necessary! and yes I am using D3D

  • louiswain
  • [*]
foo_wave_seekbar
Reply #546
Hi
I'm trying to use your component but i cannot get it to work.
How can i activate the component so it appears in my foobar window?
I'm using winxp sp3 and i have an nforce4 gfx card, directx9 is installed too..
Please help. thank you!


update: already sorted out..
thanks for the neat plugin!
  • Last Edit: 02 June, 2010, 09:07:17 AM by louiswain

  • entsyymi
  • [*]
foo_wave_seekbar
Reply #547
Anyone have any idea why my seekbar goes like this at times:



It just stays still, doesn't react to anything, and I have no idea what causes it. Im using Windows 7 and the newest version of fb2k.

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #548
Not even clicking/dragging? Or resizing the element?
In other news, I'll be going home for summer, so I won't have any decent machine to develop on. After all my taunting of people who have GMA cards, now I have one of my own
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

  • 2E7AH
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #549
I don't understand some of above talk, so hope not to repeat, but is it possible to script frequency range roughly in HSL space?

sine sweep:


some track:


I found this when looking for some command line spectrogram script here, which btw turned nice and fast for batch processing, and it also had option for generating such waveforms