IPB

Welcome Guest ( Log In | Register )

69 Pages V  « < 35 36 37 38 39 > »   
Reply to this topicStart new topic
foo_wave_seekbar, pretty accelerated seekbar
Andreasvb
post Oct 29 2011, 06:27
Post #901





Group: Members
Posts: 1330
Joined: 6-March 04
From: Sweden
Member No.: 12509



Are you using the latest version (0.2.14) and Direct3D?


--------------------
Windows 8.1 Pro x64 Media Center // foobar2000 1.3.1
Go to the top of the page
+Quote Post
ledge
post Oct 30 2011, 23:06
Post #902





Group: Members
Posts: 59
Joined: 13-February 06
Member No.: 27735



Sure am. Everything works fine except bringing up the frontend settings, so I can't alter the waveform code, which makes me sad.
Go to the top of the page
+Quote Post
Jac74
post Nov 8 2011, 02:17
Post #903





Group: Members
Posts: 27
Joined: 9-May 09
From: Buenos Aires
Member No.: 69639



QUOTE (Zao @ Oct 12 2011, 11:13) *
Apart for multipass scanning, I have no way of knowing the true length of a track.
I trust the metadata they provide to me, and here, it seems that they blatantly lie.


Zao, I've detected the same problem as eevan & RAZOR87. When I use foo_input_sacd with an .iso file (or .dff) together with a .cue file.

When I play the first song (or any other) I only get 11 seconds of the waveform. I wouldn't say it's a reporting problem, since the properties of that song show the correct duration and number of samples:

General
-------------------------------------------------
Duration: 3:03.000 (516 499 200 samples)
Sample rate: 2822400 Hz
Channels: 2
Bits per sample: 24
Bitrate: 5645 kbps
Codec: DSD64
Encoding: lossless

Same happens with DST64 encoding (losslessly compressed DSD). Any chance you take a look into this?

BTW, I'm using foo_wave_seekbar 0.2.14, foo_input_sacd 0.4.1 and fb2k 1.1.7. Great component!

Regards
Go to the top of the page
+Quote Post
lvqcl
post Nov 8 2011, 15:18
Post #904





Group: Developer
Posts: 3214
Joined: 2-December 07
Member No.: 49183



QUOTE (Jac74 @ Nov 8 2011, 05:17) *
I wouldn't say it's a reporting problem, since the properties of that song show the correct duration and number of samples:

General
-------------------------------------------------
Duration: 3:03.000 (516 499 200 samples)
Sample rate: 2822400 Hz

Yes, but it outputs 32†281†200 samples with 176400 Hz samplerate.
Go to the top of the page
+Quote Post
Zao
post Nov 8 2011, 17:24
Post #905





Group: Members (Donating)
Posts: 884
Joined: 25-September 03
From: UmeŚ, Sweden
Member No.: 9001



There's several places to look for information about a track, including dynamic and static metadata. I've got no idea which fields are the "right" ones for your kind of input, as I do not have access to any source media for this format. Whatever free .DSD files I tested with before generated proper waveforms.


--------------------
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.
Go to the top of the page
+Quote Post
Zao
post Nov 8 2011, 23:28
Post #906





Group: Members (Donating)
Posts: 884
Joined: 25-September 03
From: UmeŚ, Sweden
Member No.: 9001



The file scans properly with kode54's DSDIFF component. Consider using that, until I can bother to determine why the (apparently redundant) SACD one misbehaves.


--------------------
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.
Go to the top of the page
+Quote Post
BASGTA
post Nov 9 2011, 02:22
Post #907





Group: Members
Posts: 14
Joined: 1-September 09
Member No.: 72832



I don't mean to look like a noob, but where can I download the latest? I have 0.2.12 atm.
Go to the top of the page
+Quote Post
Zao
post Nov 9 2011, 08:39
Post #908





Group: Members (Donating)
Posts: 884
Joined: 25-September 03
From: UmeŚ, Sweden
Member No.: 9001



As with any component in the official repository - on its component page or through the update functionality inside of foobar2000 itself.


--------------------
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.
Go to the top of the page
+Quote Post
Jac74
post Nov 11 2011, 00:12
Post #909





Group: Members
Posts: 27
Joined: 9-May 09
From: Buenos Aires
Member No.: 69639



QUOTE (lvqcl @ Nov 8 2011, 11:18) *
QUOTE (Jac74 @ Nov 8 2011, 05:17) *
I wouldn't say it's a reporting problem, since the properties of that song show the correct duration and number of samples:

General
-------------------------------------------------
Duration: 3:03.000 (516 499 200 samples)
Sample rate: 2822400 Hz

Yes, but it outputs 32†281†200 samples with 176400 Hz samplerate.


176400 Hz is a samplerate when DSD (or DST) is transformed into PCM for playback. In any case, 32 281 200 samples / 176 000 samples / sec = 183 s, which is equal to 3.03 min for the duration. I tend to agree with Zao in that the problem might be in which field the duration is looked for (which I don't know which they are, BTW, except what fb2k reports).

@Zao,

If you have any free DSD file that can be shared, I'd gladly give it a try and report what happens if that's helpful.

Regards,
Go to the top of the page
+Quote Post
Zao
post Nov 11 2011, 01:02
Post #910





Group: Members (Donating)
Posts: 884
Joined: 25-September 03
From: UmeŚ, Sweden
Member No.: 9001



The files I tried with are the ones under special formats on 2L.

In any way, a solution has already been presented, which is to use the dsdiff component instead of the SACD component, as no-one has yet to enlighten me why they keep sticking with a component that doesn't work properly. If there's a concrete reason to use the SACD input component, then I'll bother investigating why it feeds me bogus values.


--------------------
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.
Go to the top of the page
+Quote Post
Jac74
post Nov 14 2011, 22:39
Post #911





Group: Members
Posts: 27
Joined: 9-May 09
From: Buenos Aires
Member No.: 69639



QUOTE (Zao @ Nov 10 2011, 21:02) *
The files I tried with are the ones under special formats on 2L.

In any way, a solution has already been presented, which is to use the dsdiff component instead of the SACD component, as no-one has yet to enlighten me why they keep sticking with a component that doesn't work properly. If there's a concrete reason to use the SACD input component, then I'll bother investigating why it feeds me bogus values.


Zao, I'll try with these files to see what happens. I don't think this is about enlightening anybody, and I use foo_input_sacd since I like it better and it has many more options for the decoding (and didn't have any issue regarding sound quality, btw). If you want to take a look at this issue, then great! If you don't have enough time or don't want to spend your time solving this issue, it's also OK. I never meant anything else than collaborate and make all components work together. I just found something that didn't work as expected and reported it.

Regards
Go to the top of the page
+Quote Post
Zao
post Nov 14 2011, 23:42
Post #912





Group: Members (Donating)
Posts: 884
Joined: 25-September 03
From: UmeŚ, Sweden
Member No.: 9001



Try 0.2.14.1, see if it does the right thing.

foo_input_sacd gives me a quite useless raw sample rate when queried statically and a more correct sample rate while decoding. When using the correct sample rate, I get correct waveforms but with roughly half the amplitude compared to DSDIFF.


--------------------
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.
Go to the top of the page
+Quote Post
DarkScythe
post Nov 15 2011, 06:14
Post #913





Group: Members
Posts: 26
Joined: 9-November 11
Member No.: 95037



Hello everyone,

First off, thank you Zao for this great seekbar.
I upgraded from XP to Win7 and decided to give my foobar a facelift while I was at it, and I love your seekbar component.

I'm using v0.2.14 with foobar 1.1.9 and CUI 0.3.8.8 and no bugs to report as of yet.

However, I spent some time browsing this thread for some way to make the waveform look a bit nicer, and came across people sharing code for what used to be the seekbar.fx file (but it seems it's not needed anymore?)
I'm using some code from many pages back that allowed multiple channels plus replaygain. However, it also changed the highlighting. While I'm not necessarily annoyed at having only a grayscale and sepia option, I do miss the "original" seekbar behavior that highlighted the entire bar as it was progressing (though seemingly somewhat transparent) while leaving the waveform colors alone. Is there any way to combine these two things?

I've tried to do it myself, but every code snippet is different, so I'm having a heck of a time figuring it out. If there's a snippet of code I can simply drop in, that would be great. I'm still trying to figure out how to modify these colors and such from the existing code. I don't know if I should post the code I'm currently using though, as it's from like 20 pages ago, so I'm not sure if there's a more updated/configurable version of it now. (Mainly because I compared with a more recent link and the replaygain handling seemed completely different.)

Thanks!
Go to the top of the page
+Quote Post
Anomalous
post Nov 15 2011, 06:27
Post #914





Group: Members
Posts: 105
Joined: 22-December 07
Member No.: 49766



If you mean the script foosion posted back on page 4, I made some modifications which might suit your needs.

http://pastebin.com/q6qLaQ18
Go to the top of the page
+Quote Post
DarkScythe
post Nov 15 2011, 06:33
Post #915





Group: Members
Posts: 26
Joined: 9-November 11
Member No.: 95037



Thanks for the quick response!

I believe your code was actually the last one I checked, and why I said it seemed the replaygain check (among other things) changed drastically. I wasn't using foosion's but rather the one someone updated a few pages later of foosion's to support multiple channels, instead of only mono.

However, your code changes the waveform itself to the highlight color which is not quite what I was looking for. (I set my highlight color to pure green, 0,255,0.) With the default behavior (if I click on load default) this green is somewhat transparent and not as neon/radioactive, covers the entire bar, and leaves the waveform color alone (though tinted slightly green.) I tried looking through the default effect code, but I couldn't find anything that called for the highlight color, so I was unable to copy it over.
Go to the top of the page
+Quote Post
Zao
post Nov 15 2011, 09:10
Post #916





Group: Members (Donating)
Posts: 884
Joined: 25-September 03
From: UmeŚ, Sweden
Member No.: 9001



Here's the contents of the played() function in my source:
CODE
float4 played( float pos, float2 tc, float4 fg, float4 bg, float alpha)
{
    float4 c = bg;
    if (pos > tc.x)
    {
            c = lerp(c, fg, saturate(alpha));
    }
    return c;
}

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

Here, I interpolate between the highlight color passed in and the computed waveform image (including background), with the factor 'alpha'. A lerp(a, b, v) is a linear interpolation on the form (b*v + a*(1-v)), that is, when v is 0, it's all a, when v is 1 it's all b, when v is 0.3 it's 0.7*a and 0.3*b.

Compare that with the function in foosion's source:
CODE
float4 played( float pos, float2 tc, float4 bg, float factor)
{
        float4 c = bg;
        if (pos > tc.x)
        {
                if (shade_played)
                        c = evaluate(backgroundColor, highlightColor, factor);
                else
                        c = evaluate(highlightColor, textColor, factor);
        }
        return c;
}

{
        float4 c0 = evaluate(backgroundColor, textColor, factor);
        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;
}


While I compute the waveform up-front and then tint it, foosion computes two different things based on whether we're in the shaded area or not.


--------------------
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.
Go to the top of the page
+Quote Post
Jac74
post Nov 15 2011, 10:41
Post #917





Group: Members
Posts: 27
Joined: 9-May 09
From: Buenos Aires
Member No.: 69639



QUOTE (Zao @ Nov 14 2011, 19:42) *
Try 0.2.14.1, see if it does the right thing.

foo_input_sacd gives me a quite useless raw sample rate when queried statically and a more correct sample rate while decoding. When using the correct sample rate, I get correct waveforms but with roughly half the amplitude compared to DSDIFF.


Works as a charm! It gives the complete waveform for the .dff files. I can't try the .cue/.iso files till the weekend, but it seems that the issue is nailed. I'll let you know.

Thanks for your prompt response!

Regards
Go to the top of the page
+Quote Post
DarkScythe
post Nov 15 2011, 17:30
Post #918





Group: Members
Posts: 26
Joined: 9-November 11
Member No.: 95037



Thanks, Zao!
I didn't expect the two functions to be so completely different, so I guess that's what threw me off.

After a bit of trial and error, I've managed to get it working. I took Anomalous' latest version to use as a base.

I ended up replacing the entire played() function
CODE
float4 played( float pos, float2 tc, float4 bg, float factor)
{
        float4 c = bg;
        if (pos > tc.x)
        {
                if (shade_played)
                        c = evaluate(backgroundColor, highlightColor, factor);
                else
                        c = evaluate(highlightColor, textColor, factor);
        }
        return c;
}


With the original code.
I ran into an odd situation trying to insert the c0 thing as it complained about converting from float2 to float4, but I noticed the existing line was very similar, so I made a quick change
CODE
c0 = played(cursorPos, input.tc, c0, factor);
Became:
c0 = played(cursorPos, input.tc, highlightColor, c0, 0.3);


It started working immediately!

I made a few other changes while I was at it using tips throughout this thread; switched RG mode to album gain, changed 0.3 to 0.15 for a lighter highlight, made the vertical bar thinner, and added the faded bar as per this post.

The faded bar gave me a bit of trouble, but it seems it was due to a small typo; the function is set as fade_bar, but then it tries to call faded_bar. Removing the extra 'd' worked.

I tried to add a border around the shaded region outlined in this post, but it gave me an error saying there were too many arithmetic functions (66 out of an allowed 64 or something.) I guess it's not a big loss, but in either case, thank you both of you for the help, and keep up the great work!

At some point I may try to merge in the code from foosion's effects script just to have more options available if I change my mind.

For now though, I'm quite happy with it.
Go to the top of the page
+Quote Post
Zao
post Nov 15 2011, 17:42
Post #919





Group: Members (Donating)
Posts: 884
Joined: 25-September 03
From: UmeŚ, Sweden
Member No.: 9001



The number of instructions available are governed by what shader model your effect is compiled as. In the technique section of your effect you can change the pixel shader model by replacing ps_2_0 with ps_2_a or ps_3_0, assuming that your graphics card supports those shader models.

They have much higher minimal limits on instruction count, the reason that the default is SM2.0 is because some of the graphics cards I target do not support anything higher, and the default effect is crafted to fit within the limits of 2.0.


--------------------
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.
Go to the top of the page
+Quote Post
DarkScythe
post Nov 15 2011, 18:25
Post #920





Group: Members
Posts: 26
Joined: 9-November 11
Member No.: 95037



Thank you for the tip, Zao!
I have an 8800GT so it should support everything up to pixel shader 4. I'll give it a shot when I get home since I'm at work right now.
Go to the top of the page
+Quote Post
Zao
post Nov 15 2011, 20:57
Post #921





Group: Members (Donating)
Posts: 884
Joined: 25-September 03
From: UmeŚ, Sweden
Member No.: 9001



Note that the reason I stopped at SM3.0 is because that's the highest supported in Direct3D 9. For SM4.0 you need Direct3D 10.0; SM4.1 needs Direct3D 10.1; SM5.0 needs Direct3D 11.0.


--------------------
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.
Go to the top of the page
+Quote Post
DarkScythe
post Nov 16 2011, 00:45
Post #922





Group: Members
Posts: 26
Joined: 9-November 11
Member No.: 95037



Ah, that's great to know.

Changing the pixel shader version to ps_3_0 (and I thought I'd bump vs to vs_3_0 while I was at it) worked like a charm.
Replaced the played() code with the snippet to add the border and it added them without changing the highlights.
A quick experiment showed that changing the number "1" would change the thickness of the borders, so I've set it to 0 for now until I have more time to muck with it.

Only thing I can say now is Process Explorer is tracking 20% CPU utilization while the seekbar is displayed, regardless of it playing a track or not. Switching to another layout without it drops CPU back to idle, but am I safe to assume this is simply the seekbar passively scanning the other tracks in my playlist? I don't have any library set up yet since I'm still tweaking everything.

This post has been edited by DarkScythe: Nov 16 2011, 00:45
Go to the top of the page
+Quote Post
colagen
post Dec 2 2011, 20:45
Post #923





Group: Members
Posts: 18
Joined: 2-December 11
Member No.: 95540



I wanted to share my use of this component with the developer, thanks to him, my foobar look good (and is easy to use) smile.gif

(I would like to go further with skinning, but that's too harsh for me, i had to stop somewhere)
Go to the top of the page
+Quote Post
Canar
post Dec 3 2011, 15:23
Post #924





Group: Super Moderator
Posts: 3327
Joined: 26-July 02
From: princegeorge.ca
Member No.: 2796



That's a rather attractive skin, colagen. Props.


--------------------
∑:<
Go to the top of the page
+Quote Post
San_dr
post Dec 4 2011, 15:30
Post #925





Group: Members
Posts: 8
Joined: 4-December 11
Member No.: 95581



I like this component. Refreshing design. Thank You.


CODE
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 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);
output.tc = float2((input.tc.x + 1.0) / 2.0, input.tc.y);
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)
{
if (shade_played)
c = evaluate(1.2*selectionColor, .5*highlightColor, factor);
else
c = evaluate(highlightColor, textColor, 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) * 2; //use track gain
} else if (replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2; //use album gain
}
minmaxrms.rgb -= 0.5 * minmaxrms.a;
minmaxrms.rgb *= 1.0 + 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 ? (- 18* saturate(factorRms / border)): 0.7;
factor = insideWave ? factor / saturate(factorWave / border /4) : 0.2;
return factor;
}
float4 PS( PS_IN input ) : SV_Target
{
float dx, dy;
dx = 1/viewportSize.x;
dy = 1/viewportSize.y;
float seekWidth = 1.5 * dx;
float positionWidth = 1.5 * dx;
float factor = RMSfactor(input.tc, 2.5 * dy);
float4 c0 = evaluate(backgroundColor+.2*selectionColor, textColor, factor);
c0 = played(cursorPos, input.tc, c0, factor);//selectionColor textColor highlightColor
c0 = bar(cursorPos, input.tc, selectionColor, c0, positionWidth, cursorVisible);
c0 = bar(seekPos, input.tc, highlightColor, 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();
}
}


This post has been edited by Canar: Dec 6 2011, 20:28
Reason for edit: Please use [codebox] for long chunks of code.
Go to the top of the page
+Quote Post

69 Pages V  « < 35 36 37 38 39 > » 
Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st April 2014 - 12:45