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 805894 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.


Re: foo_wave_seekbar

Reply #1977
It seems, that the option for capturing screen is removed now (0.2.45). Really? In this case, please, remove the 3 Screenshot lines from foobar's Advanced settings. I lost 90 minutes for searching of screenshots.

Re: foo_wave_seekbar

Reply #1978
Oops.
I don't remember why I removed the GUI parts of rendering screenshots, but it was probably due to some good reason. It was never really an official feature, just a quick hack to debug some issue.

If it's any help (it's not), the code to render them in D3D9 is still there, but there has never been any such functionality for the other two frontends, probably a reason why it never shipped.
Stay sane, exile.

Re: foo_wave_seekbar

Reply #1979
I could have used that option when making the screenshots of what is possible with my effect file, you've no idea how difficult it was to get the component window to a specific size so I didn't need to rescale the images.
Finally found out which versions still had it but it was lacking functionality that I needed so still couldn't use it

Re: foo_wave_seekbar

Reply #1980
I've hit a wall again crashes at startup.  As far as I can tell almost all of the sid tracks have waveform.  Is it possible to stop the background scanning somehow and keep the scanned waveforms?

Re: foo_wave_seekbar

Reply #1981
I'm only seeing one crash report from you, from the the 5th of May.

Re: foo_wave_seekbar

Reply #1982
Thanks for the quick reply!  Attached 7zip archive.

Edit:  I didn't realize how far back that archive went.  I also attached the most recent crash logs uncompressed.  On May 30th I was experimenting with the older versions of foo_sid.

Edit2: failure_00000150 is using 1.17 which is more stable than 1.35 for me.

Re: foo_wave_seekbar

Reply #1983
Out of curiosity, do you get a Send Crash Report question when you start foobar2000 after it has crashed in this way? Both me and kode54 can see those reports and minidumps then as if by magic.

For removing the job queue, you can download sqlite3.exe, drag the database onto the executable, and type select * from job; to show what tasks are queued, and delete from job; to clear the list.
Stay sane, exile.

Re: foo_wave_seekbar

Reply #1984
It's too bad there's not going to be any updates in the foreseeable future because I'm running into a nasty intermittent bug.

While working on my monster fx file it regularly happens that when I hit apply and the effect compiles without errors, the editor reverts to the previous content when opening it again from the dialog. This has caused me to lose what I've done several times already.

This wouldn't be such a problem if;
a: my memory was still good enough to fully remember all the changes I made
b: my math skills would be on the level that I just have to blink and be able to recreate what I did..and they sadly ain't

The damn thing is that I cannot pin it down to a particular chain of events. It just happens when you least expect it and always at a, for me crucial moment like after finally managing to get it to do what I wanted. And because of the mentioned handicaps it takes me about as long to get back what I had before the reset as it took me to find out how to get it to do what I want.

I've tried minimizing the risk by doing all editing outside and copy/pasting into the component editor but that sometimes leads to syntax errors which I then fix within the component editor, hitting apply, close the editor and if unlucky boom! reset on next opening...

I thought at first it might be related to having it living in a PSS frame, but I took PSS totally out of the layout (not even installed anymore) and it still happens. Also the size of the file isn't the cause as I've also had this happen with effect files roughly the size of the default effect.

Wish I could provide more info but as I said, I can't pin down the chain of events.

I also have noticed something else that causes issues in the output. When you play a 5.1 track and let the component downmix it to mono, it seems as if the magnitude values of the separate tracks get added as the resulting waveform develops some major clipping effects when I do this where if I let all 6 channels show, not even a single channel reaches the edges.

PS. PacBard says high, and wants to let you know he can now see ;)


Re: foo_wave_seekbar

Reply #1985
Latest crash is in foo_dumb, which was updated so many times since your installed version that it's not even funny.

Re: foo_wave_seekbar

Reply #1986
@Zao I did send a few initially (may 5th?) than figured it was redundant.

@kode54 That explains everything.  I'm sorry to drag you into my insanity.  I must have added all sound emulators to the render list. Thanks so much.  Solid work there kode54.  Much appreciated.

@Just_Addict Stress is the worst thing for your health.  Especially when sitting in front of a computer.  I feel you.

I'll update foo_dumb and report back Thank you all for your help and contributions to the greatest audio player of all time.

Re: foo_wave_seekbar

Reply #1987
Just_Addict: The editor is stable enough for me to not punch my monitor back when I used it. There's so much suffering in working with any form of non-trivial UI that I just stopped caring about it once it didn't crash everything. The problems of reverting and forgetting are known and nothing I'd ever want to touch again. I just write my shader code in something that has highlighting and saves to file, like Vim, Atom or Visual Studio.

When you downmix 5.1 content to mono, it's downmixed into stereo, which is then averaged into mono. The matrix for that is like this:
Code: [Select]
        case 6:
                {       //      { left , right , center    , LFE  , surr-left , surr-right }
                        T l[] = { one  , zero  , sqrt_half , half , sqrt_half , zero       }; left = l;
                        T r[] = { zero , one   , sqrt_half , half , zero      , sqrt_half  }; right = r;
                        break;
                }
Worst-case if you have full-scale signal in all channels you get 1 + 0.707 + 0.5 + 0.707 = 2.914.
You can read back into the archives if you want to see the discussion with some particular soul about the downmixing matrices to use. Anything that's not stereo or mono is going to have some rather coloured view of reality.
Stay sane, exile.

Re: foo_wave_seekbar

Reply #1988
@Zao

haha, I recognize that feeling, and like I said, I've started using an external editor myself too.

I read about that down mixing matrix before somewhere in this thread while collecting all the little titbits of useful info you've posted in the past, but must have missed the bit about the coloured view it produces.  No big deal, as I can always opt to just show a single channel instead of mixing them all down into one.

BTW, like I've mentioned before, I'm a relatively clueless when it comes to shader language, I've picked up some just enough to get by with the seekbar but to say that I know what every command does would be a lie. So forgive me if this sounds stupid, but is it possible to refer to the seekbar's output channel as if it were a 2D texture? If so, how would I need to declare this 2D texture?

Not that I have a particular idea in mind but I've been looking at some effect sample tricks to see if I could find anything that I could use for the seekbar and most of these snippets act on a 2D texture, so in my naive mind I was thinking that if I could use the output channel as a texture, it could open the road to new possibilities.

So far I've managed to brute-force a simplistic embossing effect already by running evaluate() a second time to retrieve the color value of the tc to the left, but after finding one of your examples that does an outline using mipmapping with the waveform data 'texture'  (no clue what or how it does what it does but it works) it makes me think I'm doing it the simple (i.e. stupid) and expensive way. I mean, basically what I am doing in the embossing causes the whole effect to be executed at least twice for every tc (I mean in a single pass, I know it runs multiple times per tc otherwise we wouldn't have a moving position bar).

Re: foo_wave_seekbar

Reply #1989
There is just a single pass, which directly results in the output colour. The pixel shader is run many times, once per resulting pixel.
If you want to consider other pixels than the one it's supposed to generate, you need to do the same work with slightly different coordinates to figure out what the result would be for other pixels.

The example code is essentially generating the "2D waveform image" on demand from the 1D waveform texture with a simple and reasonably cheap method:
1) figure out where in the song the pixel is on a scale from 0 to 1,
2) look up min/max values from texture at that offset,
3) figure out where the vertical position of the pixel is compared to those values,
4) make a color based on that.

The naive way to do image-based effects is indeed to produce the contents of multiple pixels and do whatever operation you want to do on them.

You can also treat the input waveform as a table and do some analytic work on it. You could load individual samples near your location and make a line equation from the slope, and figure out where you are compared to that function. You could make a spline from multiple sample points. The sky (and the instruction counts in shader model 3.0) is the limit.

If you had complete control over the program, you could generate a full 2D texture containing whatever values you want, and sample those from future draws, to combine things. I've got some foo_wave_seekbar successor prototypes that do exactly that with varying levels of success.

For the average user, a simple function sampling from the available semantic variables and the 1D waveform texture has been perfectly sufficient albeit a bit corny.
Stay sane, exile.

Re: foo_wave_seekbar

Reply #1990
Thanks, I figured as much, it's just that I began wondering if there were better ways to do what I do with the embossing after seeing the outline version. My math skill being close to non-existent made me wonder if I wasn't going about it the wrong way.

Re: foo_wave_seekbar

Reply #1991

It turns out that it's both rather easy and rather hard to make a standalone previewer for seekbar effect files. The tool teased above can compile and render any effect file dragged onto it, and monitors the filesystem for when that file is saved in any external editors.

It's also not quite the same as the actual Direct3D9 frontend, and it's surprising how such small changes in input variables and texture size can have drastic effects on waveforms. For example, I had to go down in size from 8192 to 2048 to be able to render the scrolling ones and the hanging gardens effect.

I recommend not trying sbs-v1.exe, as it's rather broken and I'll soon lose the attention span.
Stay sane, exile.

Re: foo_wave_seekbar

Reply #1992
I recommend not trying sbs-v1.exe, as it's rather broken and I'll soon lose the attention span.
Nice, even though the rapid animation annoys me.

I don't know who PacBard is but the name reminded me of my old pacman status bar title formatting script. I had created that over ten years ago together with ssamadhi97. It was insane. It was glorious. I no longer have that script.

Well, I wouldn't be writing about it here if I had not recreated it as a waveform seekbar effect.

Grab it on github. I know you want it. :D

Is there a semantic for track length? It would be nice to animate pacman's mouth at constant speed.

Re: foo_wave_seekbar

Reply #1993
it's surprising how such small changes in input variables and texture size can have drastic effects on waveforms. For example, I had to go down in size from 8192 to 2048 to be able to render the scrolling ones and the hanging gardens effect.
tell me about it... I've been working on an effect that instead of a waveform acts like a sort of minmaxrms peak meter. But depending on the length of the window in actual pixels, it's response time changes. I figured this has to do with the samples being averaged themselves (so short peaks tend to get averaged away) but have no idea how to correct for this. I suspect I have to fiddle with a virtual viewport size as big as the data set, but I do need to keep the actual viewport size for the static things to get put in the correct locations. So I've given up for now... can't wrap my head around that much math. Already took me a week or two to figure out how to get the damn scrolling effect working....

http://i.imgur.com/WxAcDRO.png


Is there a semantic for track length? It would be nice to animate pacman's mouth at constant speed.
Yes, there is... surprisingly called TRACKDURATION :) There is also TRACKTIME for the current position in the track and REALTIME for a constant ticker. (keeps running)
and  PacBard lives here.
I've already been playing with that one and given him an eye and adapted it so he also can do vertical things, but he doesn't bite at constant speed.

Re: foo_wave_seekbar

Reply #1994
Damn, thought PacBard already animated at constant speed but just discovered I'd already had changed the copy I made.
Here's what I changed in Zao's version, I took out the sampler to make him permanent yellow, gave him an eye,
added the constant animation and tweaked some numbers to make edges more sharp
the d.x is from the viewport delta calculation in PS, instead of two single floats I changed that to a float2 d.xy or d.yx depending on orientation.
same with the swizzle in the below code.
Code: [Select]
float4 pac_bar( float pos, float2 tc, float4 c0, float2 d )
{
float4 c  = float4(1.0,1.0,0,0);
float2 vp = horizontal ? viewportSize.xy : viewportSize.yx;
float2 pixel_tc = (float2(pos, 0) - tc) * float2(1, 0.5) * vp / vp.y;
float2 eye_tc   = (float2(pos+d.x*6, 0.45) - tc) * float2(1, 0.5) * vp / vp.y;
float2 pac_tc   = pixel_tc + float2(0.5, 0.5);
if (pac_tc.x >= 0 && pac_tc.x <= 1 && pac_tc.y >= 0 && pac_tc.y <= 1)
{
float2 dir       = normalize(pixel_tc);
float2 pixel_ang = acos(dot(dir, float2(-1,0)));
float2 ang       = 0.45*sin(1000*pos*(trackDuration/200));
c.a  = smoothstep(0.40, 0.45, pixel_ang - ang);
c.a -= smoothstep(0.45, 0.40, length(eye_tc)*8);
c.a *= smoothstep(0.40, 0.39, length(pixel_tc));
}
return float4(lerp(c0.rgb, c.rgb, c.a), c.a);
}

Re: foo_wave_seekbar

Reply #1995
:) saw I'm not the only one experimenting with fractals.  maybe someone can do something with this as I couldn't come up with a nice color pattern
Code: [Select]
	float maxIterations = 50;

float2 c = tc;
c.x = (c.x-0.665)*3;
float2 z = c;

float4 gl_FragColor = backgroundColor;
for (float i = 0; i < maxIterations; i += 1.0)
{
z = float2(z.x*z.x - z.y*z.y, 2.0*z.x*z.y) + c;
if (dot(z, z) > 4.0)
{
gl_FragColor = tex1Dbias(sTex, i / maxIterations);
break;
}
}
return gl_FragColor;

Re: foo_wave_seekbar

Reply #1996
Yeah, I also have a WSH panel seekbar based on the Sierpinski arrowhead curve somewhere. The hard part was the hit testing to enable seeking. ;)

TRACKTIME works nicely. By the way I managed to implement bump mapping using the ddx and ddy functions to approximate the normal vector. See drawShadedWaveform in bumpmap.txt. Too bad the *_fine variants require shader model 5.

Re: foo_wave_seekbar

Reply #1997
following your idea I made a github account and added some sample seekbar effects as gists in case they might be useful to others.

- an example of a grid (inside, outside, above or below wave) (does not work with pure colors)
- an example of a timescale along top/bottom or the center line
- an example of how to abuse the waveform seekbar as a semi minmaxrms moodbar.
- an example of a minmaxrms peakmeter display (X scale goes from -1 to +1)

https://gist.github.com/just-Addict

Re: foo_wave_seekbar

Reply #1998
@Just_Addict

Thanks a lot for your new "prototypes". I've not seen time scales implemented before, indeed interesting. And of course thanks for the set of gimmicks fx you recently published.
Sadly, I simply can't figure out how to get the time axis/scale function integrated in your gimmicks set.
It's not a problem to copy the function itself but to get the return value (c0) evaluated is beyond me.
Hopefully you would be so kind to explain how (or perhaps – if the function is 'mature' – integrate it in the gimmicks set)?

Screendump explained
The fx are running at the same time in two popup panels; fbuser's component seems ideal when comparing different waveform effects.
For illustrative purposes and as an possible appetizer for others I've activated the time scales as well as the time axis in the upper panel.
The tick sizes have been increased as well for the same reason.

Re: foo_wave_seekbar

Reply #1999
I improved the previewer slightly, now you can scrub the position indicator yourself and adjust the waveform aspect ratio.
https://zao.se/~zao/sbs/sbs-v2.exe
Stay sane, exile.