New: Master Volume plugin

Discussion in 'Effects and the DSP' started by Russ, Mar 30, 2007.

  1. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I created a simple plugin to add Master Volume control (using the volume multimedia keys on your keyboard, or the Master Volume slider in Windows Mixer) to the DSP when epilog is not loaded.

    The plugin has 2 outputs which only output the Master Volume levels (left and right). The way you use it, is to connect it to another plugin, that takes these levels as inputs, and uses those values to modify the level of one or more signals. This way simple Dane only plugins can be created for use with this plugin, with as many inputs/outputs as you need, and using the volume in whatever manner you want.

    It includes a basic Dane only plugin called "Master Volume Companion" to illustrate this concept. It has 4 inputs (2 for the volume inputs, and 2 for a stereo signal), and 2 outputs. It works like a basic stereo volume plugin (attenuates only), except that it is controlled by the Master Volume. To add more inputs/outputs you can edit the file in any text editor (there is already some commented out text in the plugin for 3 additional inputs/outputs, so you can just uncomment the code for each of the additional inputs/outputs that you would like to add, and/or follow the same pattern to add even more), save the changes, and the load the plugin.

    Here is a screenshot to show an example usage of the plugin(s).

    Notes:

    If you load this plugin while epilog is loaded, it will not control the Master Volume. This is intentional as the plugin is intended to be used without epilog.

    kX Mixer needs to be active/running in order for the plugin to control the Master Volume. If you quit kxmixer, control returns to epilog, until kxmixer is restarted.

    You should only ever load one instance of this plugin, or kX gets confused (since it uses the plugin name), and sends the Master Volume control to the latest instance of the plugin. This will not hurt anything, but the previous instance of the plugin will be stuck at the current volume, and will no longer be controllable. Unloading the second instance of the plugin will return control to the previous instance of the plugin (this is kX behavior). When all instances of the plugin are unloaded, Master Volume control is given to epilog.

    You can download the plugin here.

    -Russ
     
    Last edited: Nov 9, 2009
  2. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    great idea Russ - and I like your kX skin too.... ;)
     
  3. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I got bored with the blue theme... but I only did the DSP as that is what I have open the most (and I didn't feel like editing 300 buttons).
     
  4. thomasabarnes

    thomasabarnes Long Time ***** Friend

    Joined:
    Jan 7, 2003
    Messages:
    1,404
    Likes Received:
    13
    Trophy Points:
    48
    A very useful plug in Russ, especially for users who tend to use mostly ProFX DSP setups!!!!

    Thanks for another fantastic contribution to the kX community!
     
  5. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I found a bug. If you quit kxmixer, it gives control back to epilog, so you will not have control of the volume after quitting kxmixer. For some reason the IKX_UNLOAD event fires when quiting kxmixer, even though the plugin code is not unloaded, This is causing the above behavior.

    I am not sure I can fix this as it seems my only choices are to either live with it like this, or disable the code that automatically gives control back to epilog when the plugin is unloaded. Since the idea here was to automate the kX Console command to make it easier for users, I do not like the idea of not automatically giving control back to epilog, as it will force users to have to use kX Console to do it themselves (which kind of defeats the prupose of this plugin), so I am not sure what I am going to do as of yet.
     
    Last edited: Mar 31, 2007
  6. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    >For some reason the IKX_UNLOAD event fires when quiting kxmixer,

    No wonder, since all these are 'kxmixer dlls', in simple words: DSP code stays but any c++/dll code is unloaded (since it is executed just as a part of kxmixer)
     
  7. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Yeah, I was just hoping that there was some event that signaled that the plugin's DSP code was going to be unloaded, so that I am able to know when I should give control back to epilog (I thought this is what IKX_UNLOAD was for (i.e. IKX_LOAD is not signaled if the plugin is already loaded when starting kxmixer)).

    i.e.
    What I am doing is:

    IKX_LOAD:
    Check if epilog or another instance of this plugin is loaded (set flag)
    If not, re-assign Master Volume to this plugin

    IKX_UNLOAD:
    (check flag) If this plugin has control, give it back to epilog.
     
    Last edited: Mar 31, 2007
  8. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I guess my only choice (other than ditching the plugin altogther) is to make it a requirement that kxmixer is active/running for volume control via this plugin to work (nothing for me to do there other than to let people know that it will not work without kxmixer running).

    In any case, I will have to make a couple of modifications such that it re-takes control when kxmixer is restarted.
     
  9. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I updated the plugin as mentined above.

    Also, since the plugin has no GUI components I removed the MFC dependancies, and compiled the plugin in release mode.

    -Russ

    <edit>
    I re-uploaded the file (to make sure correct version is there).
    Make sure that the zip file that you download shows a modified date of March 31, 2007, 10:52:21 AM.
    </edit>
     
    Last edited: Sep 1, 2007
  10. nakamichi

    nakamichi New Member

    Joined:
    Oct 21, 2004
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    0
    This is odd.How come I can control the master volume on my 10k2 card without a need for this plugin? If I clear the DSP completely or use a basic ProFX setup,I can still control the master volume with the Multimedia keyboard if I use WaveHQ as the default sound device in the WinXP Sound properties CPL.When the DSP is cleared,the master slider is not available in the kX Mixer and for WaveHQ the master volume is grayed out in the Windows sound properties,but the MM KB (with OSD) works perfectly.
     
  11. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I do not know, but, I guess that WaveHQ is handled differently because it bypasses the DSP.
     
    Last edited: Mar 31, 2007
  12. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    Yes wave HQ is DSP independent. Theres a kX setting (Driver compatibility) 'P16V volumes follows 10K2 Epilog'. Turning that off should stop that behavior. (but I never tested, because well, I like it that ways :D)
     
  13. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I have a question for those of you with multi-card setups...

    How does Master Volume work on multi-card setups?

    I am guessing that kX uses one Master Volume for all the cards, is this correct?

    Do you know what it does if a kX device is not the default device in the Windows Control Panel?

    i.e.
    If you have kX and CL drivers (or some other dirver) installed for different cards, and the kX driver is not set as the default sound device, does changing the Master Volume with the MM keys also change the kX Master Volume (i.e. is Master Volume shared for all cards even if different drivers are used for each card?).
     
  14. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    Circumstance...
    2 kx Compatable cards + voice modem + TV card (record only device)

    With kX loaded for both cards -
    MM KB affects only the master vol on the selected card only in kX

    Then - to test the part about default sound devices in windows, and because my modem and TV card were not very good examples to test with....
    (All though I did - and found that no matter what default device selected - kX translated the MM KX for the selected kX card.)

    So - I set my CT4832 to use windows SBLive driver....
    And found that MM KB didn't affect this (CT4832) card/driver (that was now set as default in windows - for sound and voice PB & Record - btw)

    So it seems even windows driver has no MM KB > default device master Volume. In other words - kX driver is the only driver that will work with my MM KB, but I didnt try CL driver for the CT4832. (Even if one exists for XP - I dont want to deal with the bloat liveware insists on dumping into the registry.)

    So in summation and to directly answer your Q's:
    No - only the selected device in kX.
    It still only affects the kX selected card.
    But I also dont have any special software or driver for my MM KB either.. ?? maybe why windows wont recognize - or make use of MM keys.. ??

    The only thing that stops kX from translating the MM keys is to turn of the option in kX.

    Did all that make sense... ??


    Mark
     
  15. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    What I was really wondering about is the Master Volume slider in the Windows Mixer, and unfortunatley since you are using kX's MM keyboard support, I am not sure that completely answers the question.

    i.e.
    Does every card have it's own independant Master Volume slider, or is the Master Volume slider (in the Windows Mixer) a Master Volume level for the OS, that all cards use. Do you know what I mean?

    i.e.
    If you select different devices in the Windows Mixer, and adjust the Master Volume level, does it only effect that device?
     
  16. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    But if I disable kX MM KB support - nothing changes for windows default device(s) - MM KB affects nothing on CT4832. (but I didnt try re-booting after disabling kX MM KB support either.. ?? - didnt think it would be necessary)
    Its as if - the driver needs to be MM KB aware - and windows SBLive driver is not.
    If I turn off kX MM KB support - the OSD doesnt pop up - nor does CT4832 master volume get affected.

    Oh -I can't confirm anything there - as th CT4832 is the only device with playback properties (except for the TV - but record only)

    But if memory serves me - yes - each device has their own independent properties.

    If I set my modem to be default devices - the volume and properties buttons get greyed out.

    Again - with windows SBLive drivers - MMKB does not work.
    Either the driver needs to be awar of MM KB - or a MM KB driver needs to installed that would allow me to 'rout' the actions of those keys to perfom that function.

    I have to say Im suprised - because - my MM KB has other keys (email, browser and media player launch buttons) - that I was able to assign with windows Tweak UI (Explorer / Command Keys) - which has MUTE Volume - but not VOLUME keys - so I assumed windows handles these keys... ???
     
  17. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    for clarity - I'll add ' even with kX MM KB support off'
     
  18. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Ok thanks for checking it out for me. I guess it makes since that they each have there own independant Master Volume, but, it could also make sense to have an OS Master Volume level (i.e. a way to mute/adjust all audio devices without having to change devices and do each of them one at a time, etc).

    Aside from the MM keyboard stuff (BTW: Mine always worked with CL driver, using the software that came with my keyboard), can you not go into the Windows Mixer (Options -> Properties -> Mixer Device), and select which device you want to control, and then adjust the Master Volume slider for that device manually (with mouse)?
     
  19. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    Ok - I just tried re-booting with kX MM kB support turned off..
    MM Keys now adjust my CT4832..

    The only thing I cant verify is if windows will use that to affect all cards - but for some reason - I have a feeling it will only affect the default card..

    No driver exists for my KB (logitech - 'Internet Pro' - el cheapo - like $12 at new egg)

    Also - the only PB properties I get are for the CT4832 - it would seem my voice modem (which I never used for voice as theres no working driver for voice for it) has no windows mixer access - so those 'volume' and 'Advanced' buttons are grey whith the modem selected.

    If you wait a few - I'll install windows driver for my A2 and see what happens there...
     
  20. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    err - scratch that - windows isnt showing a driver for my A2...
    So I would have to install CL's driver - and um, Id rather not - sorry :(
     

Share This Page

visited