questions about bass,mid,treb and value1 value2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Starjunk
    Junior Member
    • Jan 2022
    • 11

    questions about bass,mid,treb and value1 value2

    Been using Winamp since the 90s when it was first released. Never registered here, hi to all the admins

    Was running some tests with linein:// and Milkdrop, looking at the existing presets to maybe author my own

    I noticed something odd that I'm still investigating, downloaded the Milkdrop 2.25 CPP source and going through the code there to see if I can figure this out, I'm not very familiar with CPP so it might take me a while. I used the source linked to from this post
    - http://forums.shoutcast.com/showthread.php?t=214971

    I noticed that if I use bass, mid or treb (or bass_att, mid_att, treb_att) that it seems to only respond to one of the two stereo channels.

    if I use value1 or value2 they definitely do change independently of each other, so stereo sound is definitely making its way into those two variables, but when I use bass/mid/treb only one of the channels affects those values. I'm not sure if it's the left or right channel but it doesn't matter, you can test it yourself pretty easily.

    Just wanted to be sure that I'm not misunderstanding how bass/mid/treb should work, they should change based the combined left and right channels downsampled together to mono, correct? it wouldn't make sense if they only reflected values of one of the two channels.

    or is there a way to get bass/mid/left for either left or right channels?
  • NJK
    FRISIAN
    • Sep 2003
    • 16743

    #2
    [edit]

    put original post here, others closed ~NJK[/edit]
    latest version of Winamp
    DSP Plug V2.41
    Language Packs

    Comment

    • hatecubed
      Junior Member
      • Sep 2016
      • 38

      #3
      Hi Starjunk,

      I'm far from an expert, but my understanding is that both channels do receive & forward information, but they are ultimately summed... could this line up with the results you are seeing?

      I'd assume this could be explained (corrected!) further... as long as Nitorami sees this thread

      Comment

      • Starjunk
        Junior Member
        • Jan 2022
        • 11

        #4
        Originally Posted by hatecubed View Post
        Hi Starjunk,

        I'm far from an expert, but my understanding is that both channels do receive & forward information, but they are ultimately summed... could this line up with the results you are seeing?

        I'd assume this could be explained (corrected!) further... as long as Nitorami sees this thread
        hi Hatecubed,

        yeah that was my understanding too, that bass, mid and treb get the same information as value1 and value2, but my tests don't show that.

        The only way to test this is to have two custom waves, one that uses bass,mid,treb and one that uses value1,value2, and then use linein:// with a source that has stereo sound. Then, start the visualization, and using your system's volume input balance, shift the balance from the left to the right.

        Shifting the balance to the left and right will force Milkdrop to only respond to either the right or left channels (because the opposite one would be muted) and so with the custom waves, the bass/mid/treb wave should respond to both if they are summed. Value1 and Value2 should only respond to one channel at a time if the source balance is shifted all the way left or right.

        I'll put together a simple visualization and post it up here. I'll try to make it as simple as possible so we can discuss the code and results.

        If anyone else has feedback in the meantime feel free...

        Comment

        • hatecubed
          Junior Member
          • Sep 2016
          • 38

          #5
          I'd be interested to check any uploads you may provide

          On that topic - probably going to help my research more than your own, but... do you see the same behaviour (or notice anything interesting, in your opinion) if you use Jasper's line-in plugin instead of the stock linein:// ?

          Only asking because you can use that to set the number of channels to open 'on the input side' (i.e.
          line://nch=1
          or
          line://nch=2

          Comment

          • Starjunk
            Junior Member
            • Jan 2022
            • 11

            #6
            Originally Posted by hatecubed View Post
            I'd be interested to check any uploads you may provide

            On that topic - probably going to help my research more than your own, but... do you see the same behaviour (or notice anything interesting, in your opinion) if you use Jasper's line-in plugin instead of the stock linein:// ?

            Only asking because you can use that to set the number of channels to open 'on the input side' (i.e.
            line://nch=1
            or
            line://nch=2
            I'm gonna concentrate on stock Winamp and Milkdrop for the time being, since if this is a bug with Milkdrop well anyone involved will want to eliminate all possible variables that might skew or fudge the results.

            Actually with my initial tests, it looks like the general "volume" values are only from either the left or right channels, not both combined.

            So it seems it's not even just the bass,mid,treb values that do not take both stereo channels into consideration, it seems like it's everything *other than* value1 and value2.

            As you can see in the screenshots, the blue represents one channel and red presents the other channel. The green circle is just the standard simple waveform mode 0.

            With both channels at 100% volume both red and blue have activity, green in the centre as well. Shift the balance all the way one side and the blue and green still react, however shift it all the way to the other and the green stops reacting but the red still does.

            This means whatever variable is driving the green centre loop requires there to be input from the blue channel.

            See the screenshots of my testing, and the attached .milk -- only the essential values specified, all other values removed since Milkdrop will use default values if not specified.

            Here's the milk code, we can inspect each line if necessary

            code:

            [preset00]
            fDecay=0.85
            nWaveMode=0
            fWaveAlpha=100
            fWaveScale=2
            warp=0
            wave_r=0
            wave_g=1
            wave_b=0
            wave_x=0.500
            wave_y=0.500
            wavecode_0_enabled=1
            wavecode_0_sep=256
            wavecode_0_bSpectrum=1
            wavecode_0_r=1
            wavecode_0_g=0
            wavecode_0_b=0
            wavecode_0_a=1
            wave_0_per_point1=y = sample;
            wave_0_per_point2=x = 0.25 - value1;
            wavecode_1_enabled=1
            wavecode_1_sep=256
            wavecode_1_bSpectrum=1
            wavecode_1_r=0.000
            wavecode_1_g=0.000
            wavecode_1_b=1.000
            wavecode_1_a=1.000
            wave_1_per_point1=y = sample;
            wave_1_per_point2=x = 0.75 + value2;

            Attached Files

            Comment

            • Nitorami
              Major Dude
              • Mar 2008
              • 954

              #7
              Hi

              Indeed my own tests confirm that the simple waveforms only use the right stereo channel, while bass, mid and treb only use the left channel. Surprise ! I had never noticed that, and always assumed these would be based on a mono mixdown.

              Value1 and Value2 contain the proper stereo signals, and you may use them to create your own volume signals. But note another important difference: bass/mid/treb are auto gain calibrated, which means that if your audio source only delivers a small signal, winamp will slowly increase the amplification to keep bass/mid/treb to an average of approximately 0.7...1. Vice versa for strong audio sources. Therefore you may expect decent bass/mid/treb signals to control the preset, independent of the average audio level.

              This is not the case for value1 and value2 which seem to be the raw audio signals. If your source level is 20dB below normal, value1 and 2 will be as well. While the level for commercial audio CDs is standardised, this is not the case for other sources such as youtube. So if you want to use value1/value2 in a preset, you should do something similar and calibrate them, otherwise your preset may under- or overreact depending on the audio level/source.

              Comment

              • Starjunk
                Junior Member
                • Jan 2022
                • 11

                #8
                Originally Posted by Nitorami View Post
                Hi

                Indeed my own tests confirm that the simple waveforms only use the right stereo channel, while bass, mid and treb only use the left channel. Surprise ! I had never noticed that, and always assumed these would be based on a mono mixdown.

                Value1 and Value2 contain the proper stereo signals, and you may use them to create your own volume signals. But note another important difference: bass/mid/treb are auto gain calibrated, which means that if your audio source only delivers a small signal, winamp will slowly increase the amplification to keep bass/mid/treb to an average of approximately 0.7...1. Vice versa for strong audio sources. Therefore you may expect decent bass/mid/treb signals to control the preset, independent of the average audio level.

                This is not the case for value1 and value2 which seem to be the raw audio signals. If your source level is 20dB below normal, value1 and 2 will be as well. While the level for commercial audio CDs is standardised, this is not the case for other sources such as youtube. So if you want to use value1/value2 in a preset, you should do something similar and calibrate them, otherwise your preset may under- or overreact depending on the audio level/source.
                hi Nitorami,

                Thanks for jumping in! I see you're very active and popular here so your insight, feedback and recommendations are very appreciated.

                I hadn't noticed that the "deafness" was not the same for simple waveforms vs bass,mid,treb so thank you for sharing that. When I noticed it happed with simple waveforms too I figured it was the same blockage that affected bass,mid,treb.

                Regarding proposing a fix, without knowing too much about what's involved, now that we have a few confirmations of unexpected behaviour, who do you think would have the knowledge/desire to implement a fix directly in the CPP? I had a quick look at the code but it's been a while since I touched CPP and pinpointing the lines and proposing a fix might take me forever.

                I suspect most other users would imagine it functions the way you and I expected: the signals of left and right would be downsampled/combined to mono. Or, if we're looking to improve it, we could propose synonymous bass/bass1 and add a new bass2 for example. Lots of options but translating it to code is the catch.

                Love to hear your feedback! Cheers

                Comment

                • Nitorami
                  Major Dude
                  • Mar 2008
                  • 954

                  #9
                  Hi Starjunk

                  Milkdrop has not been worked on for years, and there is no active development. If you want something changed, you'll have to do it yourself. Sorry. I don't have the skills, and I would have other priorities than these signals, e.g. making the shader sections more flexible.

                  There were discussions on making a new milkdrop version, see http://forums.winamp.com/showpost.ph...&postcount=238, but this was long ago, and I guess Litheon has long moved on to different things.

                  Cheers
                  Martin

                  Comment

                  • Starjunk
                    Junior Member
                    • Jan 2022
                    • 11

                    #10
                    Originally Posted by Nitorami View Post
                    Hi Starjunk

                    Milkdrop has not been worked on for years, and there is no active development. If you want something changed, you'll have to do it yourself. Sorry. I don't have the skills, and I would have other priorities than these signals, e.g. making the shader sections more flexible.

                    There were discussions on making a new milkdrop version, see http://forums.winamp.com/showpost.ph...&postcount=238, but this was long ago, and I guess Litheon has long moved on to different things.

                    Cheers
                    Martin
                    I'll take a look at the code again and see if I can figure out what's going on. I guess the fact that waveforms use the right channel and bass,mid,treb use the left could be helpful to understand which variables correspond to which sources.

                    Then again the next step would be to compile the code if I were able to fix it, which I'm not sure I'd be able to do. If anyone can help guide me to compile the CPP code that would also be super helpful.

                    Do you know if Ryan ever visits this forum? I see he has an active Twitter and YouTube...

                    Comment

                    • Nitorami
                      Major Dude
                      • Mar 2008
                      • 954

                      #11
                      I think Ryan occasionally visits this forum but he keeps in the background.

                      But why are you so focused on these signals ? If you desparately need them to come from both channels, you can do that in the preset code as well, and that is far easier than manipulating the source code.

                      Comment

                      • Starjunk
                        Junior Member
                        • Jan 2022
                        • 11

                        #12
                        Originally Posted by Nitorami View Post
                        I think Ryan occasionally visits this forum but he keeps in the background.

                        But why are you so focused on these signals ? If you desparately need them to come from both channels, you can do that in the preset code as well, and that is far easier than manipulating the source code.
                        Oh cool well hopefully Ryan might see this and offer some guidance! Hopefully, I'm sure he's very busy with his own career and has already given so much with Milkdrop.

                        As for fixing the code, well it's not a desperation thing since it's not my code, it's more for the community and contributing in a way that others might appreciate. I mean, if this bug does go back since Milkdrop 1.0 then it's a 20 year bug and if I can help with fixing it then that would be my way to contribute to the Winamp community.

                        I'm just getting started with editing presets, how would I fix this in the preset code? If it's that easy then absolutely that would be easier than inspecting all the CPP code

                        Cheers

                        Comment

                        • Nitorami
                          Major Dude
                          • Mar 2008
                          • 954

                          #13
                          Alright. It may be a bug or not, but it has been like this for the past 20 years, and worked well. Changing it now would break backwards compatibility, or, in simpler words, make many presets react differently than intended. This is a no go.

                          In case you want to get into preset writing, I attach a sample code which demonstrates how to calculate your own bass, mid and treb signals, audio level normalised, and even separately for left and right channel. It should give you a good idea how to do these things.

                          Cheers
                          Martin
                          Attached Files

                          Comment

                          • Starjunk
                            Junior Member
                            • Jan 2022
                            • 11

                            #14
                            Originally Posted by Nitorami View Post
                            Alright. It may be a bug or not, but it has been like this for the past 20 years, and worked well. Changing it now would break backwards compatibility, or, in simpler words, make many presets react differently than intended. This is a no go.

                            In case you want to get into preset writing, I attach a sample code which demonstrates how to calculate your own bass, mid and treb signals, audio level normalised, and even separately for left and right channel. It should give you a good idea how to do these things.

                            Cheers
                            Martin
                            oh wow this is amazing!! that's really cool of you, thanks! give me a few days to read through it and try it, I have no doubt it works as described but my own knowledge of Milkdrop preset code is quite beginner.

                            as for the backward compatibility, yes I agree changing any existing behaviour would be bad since like you said it would break functionality...

                            HOWEVER that is why I suggested synonyms bass/bass1 and adding bass2, thus by creating bass1/bass2 they would be unused variables in any existing preset and the original bass would continue to function as it did before. bass1/bass2 would thus follow the value1/value2 format and thereby be a natural continuation of the existing Milkdrop logic. I'm familiar with the importance of backward compatibility

                            Comment

                            • hatecubed
                              Junior Member
                              • Sep 2016
                              • 38

                              #15
                              Well, as usual - I've learnt a lot from all everyone's posts!

                              Starjunk, I know you said you'd like to focus on 'stock' for now (which I can understand) - plus, it would likely be more fulfilling to create and understand code based on the info & sample .milk from Nitorami - but I figured I should mention...

                              WACUP (an ongoing project by one of the original Winamp devs) - check getwacup.com
                              I suggest this as he has already fixed some long-standing Milkdrop bugs as part of the project. If you are interested, join in!; he would likely be able to fix the issue, or at a minimum, check the code and confirm if it's a possible/worthwhile/etc fix.

                              Comment

                              Working...
                              X