Skip to main content

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

a3aan and 1 Guest are viewing this topic.
  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1250
Maybe.
I'm rejiggering a lot around waveform generation, notifications and fetching, which probably will solve many of these things.
Maybe.
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.

  • derty2
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #1251
>
> [derty2 @ Post #1249] Waveform Seekbar regularly refuses to refresh its display when there are no gaps between one track and the next.
> This problem only happens when using Direct 3D 9.0c; the problem does not exist when using GDI.
>
>
> [Dario @ Post #1250] I just played Pink Floyd "The Dark Side of the Moon" and noticed no problems whatsoever.
> Please, make sure that "Store analyzed tracks in mono" is turned off under Preferences -> Advanced -> Tools -> Waveform Seekbar.
>


SOLVED - Thankyou  Dario +++++++++++++

How in hell is a normal user supposed to know about this obfuscated behaviour?

On the subject of definitive solutions . . . . . I have one more question:

I always display one monolithic waveform and I play music in old skool hi-fi stereo/mono, i.e. I don't have anything to do with surround sound multi-speaker configs.
Which are the ONLY boxes I need to check in "Waveform Seekbar - Configuration"?
Thanks.
  • Last Edit: 02 April, 2013, 09:41:33 AM by derty2

  • zooliat
  • [*]
foo_wave_seekbar
Reply #1252
Zao, version 0.2.30.1 causes some really high CPU usage even after playing stops, i had to go back to 0.2.29 (since 0.2.33 doesn't display waveforms for me)

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1253
How in hell is a normal user supposed to know about this obfuscated behaviour?

It's a workaround for a bug by users, for users, it's not the way things are supposed to be.
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.

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1254
Zao, version 0.2.30.1 causes some really high CPU usage even after playing stops, i had to go back to 0.2.29 (since 0.2.33 doesn't display waveforms for me)

Most of the versions released in the last few weeks has tons of fun bugs, discovered by friendly people like you all.
You're probably triggering the bug that's fixed by 0.2.31's change "Rewrite scan logic to cope with tracks having strange and unpredictable lengths, once and for all."

The changelog is always available at this Github wiki page.
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.

  • marc2003
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #1255
Which are the ONLY boxes I need to check in "Waveform Seekbar - Configuration"?


if you have downmix to mono enabled, just select front centre (mono)

  • derty2
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #1256
   Thanks for replying marc, however I decided to check every box! . . . and I chose "Keep as-is" for the Downmix display field.

   For people with no interest in "Multi-Channel Super-Duper Surround Sound Technologies", all those checkboxes are a head f*ck! . . . What exactly is the official technical name for the two speakers used by a stereo afficionado?   Is it "Front Left/Front Right" or is it "Rear Left/Rear Right"?

   Having checked every box, the end result is two side-by-side waveforms in my fairly large panel. Looking at separate waveforms for each channel (if stereo) is not so bad and pretty informative so I thought I would live with this for a while . . . and play some tracks and see . . . .

   I then played/tested many tracks from many different playlists to see Waveform Seekbar display behaviour . . . . under normal circumstances one would expect a single waveform displayed for mono tracks and two SxS waveforms for stereo tracks . . . . however I discovered that Waveform Seekbar did not show consistent behaviour; sometimes it would display a single waveform when it should be showing two!

   So, am I dreaming about the problem I see here?
   Do other users notice inconsistencies with the workings of this component when display preference is "1 waveform(track is mono) or 2 waveforms(track is stereo)"?
  • Last Edit: 02 April, 2013, 10:42:32 AM by derty2

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1257
If there's a waveform already stored in the database, it's used, no matter if it agrees with the "downmix on analysis" advanced-setting.

That waveform is temporarily downmixed based on the display setting.
If "keep as-is", it's untouched.
If downmix to mono, if it's mono, it's untouched.
If downmix to stereo, if it's mono or stereo, it's untouched.

After the possible downmixing, the checkboxes matter. The channels of the waveform is tested against the checkboxes.
For all channels that are checked _and_ are present in the waveform, those channels are displayed. The rest are silently dropped.

Does this make the behaviour of the settings clearer?

tl;dr -- if you've downmixed-on-scan before and that waveform is stored in the database, that's the waveform that will be used. The whole purpose of that setting is to let people that only ever will use the mono-display functionality to save disk space and processing time when displaying.
  • Last Edit: 02 April, 2013, 10:37:55 AM by Zao
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.

  • derty2
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #1258
Thanks for explaining the workings of your component in layman's terms Zao +++++

If I were you, I would have added one final comment to my post:

> If a waveform for a particular track appears wrong, then refresh the display; right click the track(s) and choose "Utilities->Remove Seekbar Signature"
  • Last Edit: 02 April, 2013, 11:03:45 AM by derty2

  • derty2
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #1259
I am trying to change the size of the displayed waveforms relative to the panel size, specifically when using Direct 3D 9.0c and custom script . . .

How do I force EVERY displayed waveform to always fill the full width of the panel irrespective of the loudness of each track?

In my script, by changing this:  "minmaxrms.rgb *= 0.8 + minmaxrms.a;"  to this:  "minmaxrms.rgb *= 0.95 + minmaxrms.a;"  I have widened the loudest waveforms to fill the panel width.
However, I would like all tracks to do the same thing, even the quieter ones.

Does anybody here know the code for this effect? Thanks . . .  . the answer has got something to do with changing  "return factor;"  to  "if ... return <calculation> else ... return <calculation>;"



here is my complete script:
Code: [Select]
texture tex : WAVEFORMDATA;
 
sampler sTex = sampler_state
{
  Texture = (tex);
  MipFilter = LINEAR;
  MinFilter = LINEAR;
  MagFilter = 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 flipped          : FLIPPED;
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);
  }
 
  if (flipped)
     output.tc.x = 1.0 - output.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 )
{
     float4 minmaxrms = tex1D(sTex, tc.x);
 
     minmaxrms.rgb -= .1 * minmaxrms.a;

     //- - - - - CHANGES THE OVERALL WAVE SIZE IN THE PANEL - - - - - - - -
     //minmaxrms.rgb *= 0.8 + minmaxrms.a;  <<<<<backup original
       minmaxrms.rgb *= 0.95 + 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);

     //- - - - - ENABLE/DISABLE THE INSIDE WAVE - - - - - - - - !!!!!!!!!!!!! actually I'm not sure about any of this stuff here !!!!!!!!!!!!
     //  [TO DISABLE:  bool insideRms = 0;]  [TO ENABLE:  bool insideRms = diffRms < 0;  <<<<<backup original]     
       //bool insideRms = diffRms < 0;
       //bool insideRms = (belowWave > 0 && aboveWave < 0);
         bool insideRms = (diffRms > 0 && diffRms < 0);
    
     //- - - - - CHANGES LOOK OF INSIDE WAVE - - - - - - - -
     //float factor = insideRms ? ( 1 + 0.2 * saturate(factorRms / border / 2)): 1.0;  <<<<<backup original
       float factor = insideRms ? ( 6 * saturate(factorRms / border / 20)): 10.0;
 
     //- - - - - CHANGES LOOK OF OUTSIDE WAVE & PANEL BACKGROUND - - - - - - - -
     //factor = insideWave ? (factor * saturate(factorWave / border / 1)) : 0.0;  <<<<<backup original
       factor = insideWave ? (factorRms * 6.0 + 0.8 * saturate(factorWave / border / 0.5)) : 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 = 1 * dx;
     float positionWidth = 1 * 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();
  }
}



*********************************************
By the way,
for all you old school stereo heads who have nothing to do with surround-sound,
the ONLY things you need to check in 'Waveform Seekbar—Configuration' are these three items:
Front left | Front center (mono) | Front right
*********************************************
  • Last Edit: 02 April, 2013, 03:11:29 PM by derty2

  • Propheticus
  • [*][*][*]
foo_wave_seekbar
Reply #1260
Using replaygain would help...

Try changing "minmaxrms.rgb *= 0.95 + minmaxrms.a;" to something like this:

Code: [Select]
if(replayGain.r != -1000) {
minmaxrms.rgb *= pow(10,(replayGain.r) / 20) * 2; //use album gain
}
else if(replayGain.g != -1000){
minmaxrms.rgb *= pow(10,(replayGain.g) / 20) * 2; //use track gain
}
else {
minmaxrms.rgb *= 0.95 + minmaxrms.a;
}
  • Last Edit: 02 April, 2013, 03:03:10 PM by Propheticus

  • derty2
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #1261
Thanks Propheticus, but I do not use replaygain.
Does anybody here know what is the code for filling the full panel width for every waveform irrespective of replaygain?

Not that I really know what I'm doing, but . . .

In my script, if you change  "return factor;"  to  "return saturate(factorWave);"  then you get something like what I am asking for!!!
The internal wave takes over and fully fills the panel dimensions on every track! . . . however the waveform is blurry and the background has changed color.
But at least I got something positive there.
  • Last Edit: 02 April, 2013, 03:29:50 PM by derty2

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1262
Whether you apply ReplayGain or not when listening is a bit irrelevant. What matters is that there's a perfectly fine infrastructure for peak information and I don't see any point in reimplementing it, poorly.

If it's present, the component will provide it. If it's not, it will 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.

  • derty2
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #1263
Can you repeat all of that . . . Some of the things you are saying come across to me as waffle.

If I am to interpret what you said . . .
The code Phropheticus provided will do the job; the presence of replaygain is not relevant ... blah blah blah lazy English.
  • Last Edit: 02 April, 2013, 03:45:31 PM by derty2

  • Propheticus
  • [*][*][*]
foo_wave_seekbar
Reply #1264
You can scan your file for replaygain info and setup foobar2000 NOT to use this while playing the file (preferences -> playback -> replaygain setting at the top and set "source mode" and "processing" to "none").
This way the waveform can be adjusted to the peak info derived from replaygain.

It seems you're toying around with stuff you hardly understand the basics of.... All these questions start to be getting silly. Do some research of your own please.
  • Last Edit: 02 April, 2013, 03:43:39 PM by Propheticus

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1265
Well, I guess my post is not exactly accurate...

The point is, ReplayGain information is usually good enough to fit the waveform to the amplitude extents of the window.
It's still usable by things like my component, even if you've configured foobar2000 to not apply it to the song when playing. (Preferences->Playback->ReplayGain)
  • Last Edit: 02 April, 2013, 03:48:12 PM by Zao
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.

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1266
Would it be possible to think through your posts a bit before responding... edits do not show up on email, and they can often significantly change the meaning of the post.
As for editing things after someone has replied, even worse. There's probably a ToS against it, somewhere.

(yes, I do this occasionally, no need to point that out)
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.

  • derty2
  • [*][*][*][*][*]
foo_wave_seekbar
Reply #1267
> All these questions start to be getting silly. Do some research of your own please.

You are not the gatekeeper of silliness; I don't want a morality lesson from you; if you want to flex your brain muscles and help solve the problem then please do. . . else don't let the door hit you on the way out. If nothing else, the purpose of all my previous posts WAS research?

Zao
I just re-read your edited posts above, thanks for clarifying.
So, in a nutshell, is it or is it not possible to change that code to achieve the result without any reference to replaygain whatsoever?
  • Last Edit: 02 April, 2013, 03:59:44 PM by derty2

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
foo_wave_seekbar
Reply #1268
Keep replies on-topic and useful whilst avoiding squabbling and baiting. I don’t want to have to throw out the useful portions of posts as collateral damage from quenching a flamewar.

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1269
Zao
I just re-read your edited posts above, thanks for clarifying.
So, in a nutshell, is it or is it not possible to change that code to achieve the result without any reference to replaygain whatsoever?

As it currently stands, the only information about the global nature of the waveform (peaks, whatever) is the four pieces of RG info.
It would be possible with support from the frontend to have a parameter like TRACKMAGNITUDE and CHANNELMAGNITUDE to expose the "true" extents of the waveform, but that's nothing that works today.
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.

  • Propheticus
  • [*][*][*]
foo_wave_seekbar
Reply #1270
I'm sorry for my comment I made earlier, but I found similar replayGain code within a minute of googling. I'm glad to help out and find it interesting to find answers to some of the questions. However, I don't like helping out when I later find out the same info can be found by simply googling the problem for a few minutes.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
foo_wave_seekbar
Reply #1271
I wasn’t singling out you or anyone else: my comment was general. Your point about searching is valid, and I frequently make similar recommendations myself, but the way it was framed made it one of several recent comments, by various authors, that could possibly be read as being inflammatory. With all of those in close proximity, I saw potential for the thread to go rapidly downhill, and I want to avert that, as I’m sure everyone does.

  • Dario
  • [*][*][*]
foo_wave_seekbar
Reply #1272
It'd be awesome if the default front-end settings were documented. I'm still in high school and my knowledge is terribly limited, but damn it, I'd be more than eager to learn to learn the basics regarding shaders and mess around with it.

EDIT: If you have ReplayGain, you can also try:

minmaxrms.rgb *= (1.0 / replayGain.b); // 1.0 divided by the album peak
  • Last Edit: 02 April, 2013, 05:48:48 PM by Dario

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1273
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.

  • Zao
  • [*][*][*][*][*]
  • Developer (Donating)
foo_wave_seekbar
Reply #1274
Turns out that it was less work than expected to finish this up.

0.2.34 has incremental feedback (needs advanced setting, defaults to off) and exposes two semantics to an effect for you normalizing people (CHANNELMAGNITUDE and TRACKMAGNITUDE, aptly misnamed as they're actually amplitudes).
See changelog at Github, as usual.
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.