Realtime digital audio processing using VST Plugins in programs without VST support

Notice! Please note that the software in this guide is closed source donationware/freeware.

An instructional how-to guide

Please scroll down a bit for the guide to configure and set it all up.

Why?

If you have sensitive hearing like me and enjoy listening to high fidelity music with high dynamic range its pretty annoying when the source quality of a track is poorly mastered. Usually it’s compressed to sound louder so it overshadows background noise when listening with open headphones, on the radio or on television. This compression phenomenon when referring to music media is commonly referred to as the loudness war.

Now, this post isn’t going to be about the loudness war but IT IS the main reason why I run some digital signal processing (DSP) using VST plugins. Basically a desperate attempt to save my poor ears from fatigue after long listening.

The Plugins?

VST Plugins use an open framework initially developed by Steinberg makers of Steinberg Cubase. The interface was released openly and is used by many different kinds of software in the digital audio processing field.

You might want to run VST plugins that simulate equalizers, reverb, pitch, chorus, expanders or any other kind of audio filter for that matter. In order to run these plugins in general software usually you need some kind of Wrapper.

Wrappers?

Wrappers are “plugins for the plugins”. Although there are only a few media players that have them.

For the music player Foobar2000 I’ve been using a VST wrapper for my needs. As you may know Foobar2000 is designed to only play audio. How do we run our VST plugins when watching video as well as audio?

The solution to signal processing using (almost) ANY program on Windows is to simulate a virtual soundcard device.

Sound card device (virtual cable) simulation

Properly referred to as “virtual cable simulation” is when you create a passthrough virtual sound card between the software playing the audio, the software processing the audio and the device playing back the audio.

Here is a workflow chart describing the process

workflow

Unfortunately there is no completely open source solution for simulating a sound device as far as I know. If you find one please leave a comment!

There is a very good free “donationware” closed source driver named VB-Audio Virtual Cable. This will be the software refered to in this guide/tutorial.

When VB-Audio Virtual Cable is installed and you’ve rebooted your computer you should notice two new audio devices named CABLE Input and CABLE Output in your windows audio settings. The left image shows the playback tab and the right image the recording tab.

sounddevices sounddevices_rec

Audio signal processing software VST Host

VSTHost is a free program that used to be open source. It’s currently closed due to the author disliking it being included without attribution. It’s still very much free to use and great for running your collection of VST plugins.

It can be a very complex program to use at first but hopefully I will manage to describe it easily for the purpose of running one simple example VST plugin.

Here is an image of VSTHost running a single simple VST plugin called ReLife V1.42 (C) by Terry West.

vsthost1

This plugin applies a phase shift, equalizer and a declipping algorithm to improve dynamics in overcompressed music. Of course if the audio source file is horribly overcompressed don’t expect it to perform miracles. Still it’s a great band aid to make listening to modern music easier on the ears.

Step by step setup instructions

Here is how you put it all together.

1. Download VB-Audio Virtual Cable Driver

The version I’ve installed and tested doesn’t contain any adware or malware and according to my firewall doesn’t attempt to connect to the internet for any reason. It’s named the following:

Virtual Audio MME, DX, WDM Device Driver (XP, VISTA, WIN7, WIN8 32/64 bits).
VBCABLEDriver_Pack42b.zip (1.01 MB – JUL 2013).

MD5 VBCABLEDriver_Pack42b.zip: 09b90461ea6f3d15f52bfff1a00e6690

2. Unpack the zip archive

Choose a folder that you wish to keep the control panel application. For example C:\Program Files\VBCable\

3. Run the setup corresponding to your operating system.

I.e. VBCABLE_Setup_x64.exe if youre running 64 bit. If you aren’t sure which you’re running check this guide.
After installing make sure to reboot.

4. Check the sample rate for VB-Audio Virtual Cable Driver

Start up the control panel by starting VBCABLE_ControlPanel.exe and note the output sample rate. In this case 44100 Hz.

The VB-Audio control panel looks something like this:
vbaudiosamplerate

Note!Β  If you’re only using the VST plugin for listening to music you don’t need to worry about anything other than the output sample rate. For video and audio “lip sync” check the bottom of this article.

5. Download VSTHost

I’m using version 1.54 and have tested it safe from adware and malware.
Choose vsthostx86.zip or vsthostx64.zip depending on your OS.
MD5 vsthostx86.zip: 7eb6fd861c976ea393875e85981a67ac
MD5 vsthostx64.zip: f51441c48c73bbd2dfd202ea7c51bcb1

6. Unpack the zip archive in the folder you wish to run it from.

For example C:\Program Files\VSTHost\

7. Get copies of the VST Plugin DLL files that you wish to use.

For example put all plugin DLL files in C:\Program Files\VSTHost\Plugins\
If you already have the VST Plugin files that you intend to use you can skip the next step.

8. Example VST plugin – Terry Wests ReLife utility V1.42.

If you don’t have any VST Plugins I will be using this as an example.
MD5 relife142.zip: 0d431c5dc7ac207e387835752a2fc380
EDIT: After I wrote this guide Terry has removed the download link for ReLife. It now costs money to download (still confusingly called donationware). As such this is a bad VST example and I apologize for that. You can find other free VST plugins here or here.

9. Run vsthost.exe and Click on Devices -> Wave to set your devices.

vsthost-device1

Here you want to set Input port to:
DS: CABLE Output (VB-Audio Virtual Cable) which we installed previously

Output port can be set to your playback device of choice. If you choose:
MME: Microsoft Sound Mapper
This means it will playback on your default Windows DirectSound output device which is probably what you wish to do.

10. [EDIT: Added this 2014-10-11] – Change process priorities to high

Depending on your sound card performance you should increase the process priority to high to avoid accidental random jitter.
Go into Engine -> Configuration and set the following:

engine

11. Choose the correct sample rate and buffer size for your needs

Make sure to select the same sample rate as in VB-Audio control panel in step 4. In this case set the sample rate to 44100 Hz

For the buffer chooseΒ  2100 samples (21 b/s) for now. This value is beneficial to be as low as possible with regards to audio delay but if it’s too low you will hear noise interruptions caused by the computer keeping up to such a small buffer. If you hear clicking noise increase this.

Note! Same note as in step 4, if you’re only using the VST plugin for listening to music you don’t need to worry about anything more. For audio and video “lip sync”, see the bottom of this article.

12. Drag and drop the plugin DLL files that you wish to use on the vsthost window

In this example just drag and drop ReLife.dll

13. Arrange the plugins in the order you want them to work in a workflow sheet.

Here you can link together several VST plugins in the order that you want. Feel free to play around and make this as simple (or complex) as you wish!
Here are examples of a more complex setup.

14. Configure ReLife

Click on the small meter icon to show the VST interface

vsticon

After clicking on ReLife you should see this. I prefer to use peak algorithm number 3.

relife

15. Save your settings!

When you are done it should look something like this:

vsthost1

Click on Performance -> Save to save your current configuration.

Left click on each plugin to select it. Then right click it and make sure that the following is checked. This will ensure that VSTHost remembers settings for each VST plugin:

  • PlugIn -> Autosave bank
  • PlugIn -> Reload bank
16. Set default playback device in the program

Locate the option in your playback program to change output device (also called audio renderer) to specifically use “Cable Input”.

Here are examples of how to change it in VLC:

Changing it from this menu is only temporary:

vlc audio device

You want to change it here for VLC to remember the settings:

vlcdevice

And Media Player Classic:

mpc audio device

Some programs don’t support changing the default output device. Unfortunately you won’t be able to use this solution with those.

17. Startup automatically with windows

If VSTHost isn’t running you won’t hear any audio so you may want it to start automatically with windows. Here is how:

    • Click on View -> Minimize to system tray in VSTHost, check it.
    • Create a shortcut to VSTHost.exe and place it in your Start Menu – > Startup folder
    • Right click the shortcut and select Properties
    • Change “Run Normally” to “Minimized

Microsoft also have some instructions.

18. Complete!

You are complete, the remaining steps are optional and only required if you intend to playback both video and audio together.

19. [Optional] Minimizing latency and “lip syncing”

The more latency you have for processing audio, the more delayed it will be when also watching video. To correct the delay between audio and video you need to manually specify the amount of delay for the video. This is also called “lip syncing” referring to the voices not moving accordingly to lips of people in video.

To calculate the “lip syncing” we need to get the size of the buffers created by VSTHost and VB-Audio. Unfortunately the delay must be calculated since buffer is sized in “samples” and not in time “seconds”.

To translate samples into seconds we need to divide the buffer sample size with the total sample rate.
Millisecond delay * Sample rate = Buffer sample size

When we know the delay in milliseconds for both VB-Audio and VSTHost we can add them together to get the total audio delay. This is the value we enter into the video player like VLC.

VSTHost latency

The buffer and sample rate is visible in Devices – > Wave where we previously set input/output devices.

vsthost-device

To calculate the delay in time (seconds)
Example: 2100 / 44100 = 0.0476… seconds

VB-Audio latency

The buffer and sample rate is visible in the VB-audio Control panel.

vbaudiosamplerate

To calculate the delay in time (seconds)
Example: 7168 / 44100=0.1625… seconds

Total latency

This gives us a total latency of 0.0476… + 0.1625… =Β  0,2101 seconds
Which is 210 milliseconds total.

20. [Optional] Configuring VLC audio delay to fix lip syncing

Go into Tools -> Preferences and select to Show All settings. Then Select Audio in the left tree menu and set Audio desynchronization compensation to -210 milliseconds

vlc-delay

Known Issues (2014-04-28)

The audio delay may sometimes be delayed more than it should. I’ve noticed this a couple of times. Restarting VSTHost or changing the buffer rate temporarily and then back appears to fix it. I’ve done a lot of testing but am unsure of what’s actually causing it. If you have any ideas be sure to leave a message.

Thanks!

I hope this instructional guide was helpful to you πŸ™‚

If you have any questions, anything more to add or if I made a mistake please don’t hesitate to leave a comment!

Advertisements

21 Comments on “Realtime digital audio processing using VST Plugins in programs without VST support”

  1. Dave says:

    hey, I just would like to say thanks for the pointers to those software. Never knew this could be done. YOU DA REAL MVP.

  2. vstHost doesn’t works correctly in windows 8;so u can use pedalboard2 instead of vsthost.it also easily configurable.Mac version of pedalboard2 also available.Website link:-http://www.niallmoody.com/apps/pedalboard2

    • Mike Kintsakis says:

      VSTHost worked fine for me on Windows 8.1, whereas Pedalboard2 recognized VST plugins but it has always failed to load them.

  3. nirklars says:

    EDIT: 2014-10-11
    Added section 10 – Change process priorities to high

    Depending on your sound card performance you should increase the process priority to high to avoid accidental random jitter.

  4. Petersen says:

    Please note that for VSTHost any commercial (in your studio?) or public (a public performance?) use is strictly forbidden by the licence. I also don’t see any way to buy a commercial license. An excerpt from the license:

    This free VSTHost is intended exclusively for private use. You may copy the complete program package and pass it on to others for private use only.

    The free VSTHost may not be used for commercial or professional purposes.

    • nirklars says:

      Hello Petersen

      The license.txt file appears to be contradictory to the program documentation, the manual and the website which states it is free and donationware. Here is an exempt from it:


      Nevertheless if you do find the program useful I encourage donating to him! πŸ™‚

      Best Regards

  5. Iam Nemo says:

    You can also consider DDMF’s http://www.virtualaudiostream.com/ which has VST support. I used it for example with IK’s ARC2 room correction.

  6. Carin says:

    Thank you so much, it’s better, faster, and less buggy than winamp + VST Bridge + ffdshow. I’m using Izotope Ozone 5 with MPC-BE. Best.

    • Iam Nemo says:

      OT : Carin : you must take a look at Ozone 6 and check the excellent tutorial on Groove3.com.

  7. cdonts says:

    Thanks. It worked for real-time AutoTune. Sadly it has some delay.

  8. andrea says:

    Hello!
    what a great guide here thanks was looking for it! πŸ™‚
    However while it works great for 2ch im struggling to get more then 2ch in a home theater enviroment running KODI and Coneq vst plugin which is a very powerful DRC (above Dirac)
    The culprit could be the hdmi audio path from my geforce card?
    Basically only the left and right channel are passing trough and I found no way on getting sub , centre and surround playing under vst host (tried with both VBaudio and VAS cables)
    Do you know if its possible to send 5.1 PCM signal or 2 channels is the limit of vst host and\or the cables? any workaround (ie going asio or other programs)?
    thanks!
    andrea

    ps
    OS win7 64bit

    • Iam Nemo says:

      Hi Andrea!

      I’m not quite sure of your exact configuration but you could try another DDMF product called Metaplugin http://ddmf.eu/metaplugin/ which is multi-channel enabled. At least you could see how it displays your sound card’s and VSTs’ I/Os and maybe report here?

      Also check under Windows Control Panel>Sound your Nvidia HDMI output properties are not set to “L R HDMI Digital Jack”. You have to connect your Nvidia HDMI to a surround-capable receiver otherwise you will default to stereo mode (e.g. if you connect to a TV). Also check the Nvidia Control Panel under “Surround”. You might also try to go through a S/PDIF (coax) or TOSlink out of your PC to your receiver.

      Last: search Google for “how to send surround sound through nvidia card hdmi”.

      • andrea says:

        Hi Nemo!
        thanks for the input πŸ˜‰
        last weekend after a night of experiments πŸ™‚ I managed to solve as luckily ASIO drivers do permit multichannel input\output
        If anyone is interested my “mistake” was in part to follow strictly the guide by selecting the virtual cable output in vst host which is ok but for 2 channels only.
        For multi channel audio in movies select ASIO driver instead then in the asio control panel: enable virtual cable playback only (disable the recording cable) + enable the output card (in my case hdmi ), that’s it!.
        You still need the input virtual cable as that is what you ‘ll select as the audio interface in the media player (KODI in my case).
        Last in KODI make sure to use PCM with no pass trough option enabled as that would trigger DTS\Dolby decoding not supported by the chain
        Some tweakings are then necessary regarding latency\buffer settings (currently using 256 samples) and I try to keep all settings @48khz which is what most of the video material is without oversampling.
        Amazingly there’s not even audio delay so no correcton is required
        I must say everything works like a charm with DRC correction (provided by the Coneq vst plugin in my case) completely transforming the movie experience!
        if it was not for this guide I would not even know that it was possible!
        really thanks a lot guys
        andrea

  9. Iam Nemo says:

    Good news Andrea! BTW you’re the only person that I know who is using the Coneq plugin, especially the multi-channel version. How did you come across it? Did you see a review comparing it to other DRC solutions?

  10. andrea says:

    Correct i know it is an almost unknown brand which I (luckily) came accross with an italian online retailer (now coneq it is no longer listed) but from a tech point of view it remains unbeatable, just check they’re website and the technology behind is precisely on spot of what have to be done to get good sound
    Main difference from any other solution is that it measure acoustic pressure by moving the mic all around the speaker; compared to the dirac solution which i tried the trial version, no match in sound quality (but already a lot better then without, dirac is indeed a very good product)
    Its only compared to coneq that differences are remarkable and it doesn’t even hurt that is also cheaper.
    Didn’t see any review I trusted the idea behind and first tried/purchased the 2ch for my small jvc desktop speakers, first time i was like ..holy sh..t fell of the chair
    Then the 8ch plugin for the home theater setup was just consequential to try (actually im running thru a 30 days trial and the guide helped me a lot to asset a working configuration!)
    i dont own any high end product but for me is just audio porn heaven πŸ™‚
    best money spent (IMHO)
    take care ciao!
    andrea

  11. andrea says:

    ouch! probably spoke to soon..using asio4all Im now facing a new issue which might not be possible to solve. Since asio4all merges 2 devices (nvidia hdmi audio and virtual cable) it appears after 20/30 minutes they go out of sync which brings gradually building up distortion.
    Just opening\closing the asio control panel is enough to apparently reset the clock and the distortion but then again after x minutes it starts all over again.
    All different buffer settings brings no benefits (if not only delaying when the issue start but so far nothing has been able to keep reasonable clock for at least 2 hours); all settings @16 bit 48khz
    As it is not convenient to stop the movie to do the above not sure what to do at this point
    Nothing found on google seems to provide a solution which is a pity as the system sounds fabolous…any idea would be great !
    thanks
    andrea

    ps
    issue occurs also without coneq vst under vst host, as stated in the asio4all instruction its related to multi device clock drifting

  12. Iam Nemo says:

    Hi Andrea! Maybe you could try Steinberg’s multi-client ASIO wrapper ?
    http://www.pgmusic.com/forums/ubbthreads.php?ubb=showflat&Number=237170

    Also :

    “If you are set on a multi-card setup then you want to use the WDM/WASAPI APIs on Windows”

    “Do you have the two audio interfaces clock-sync’d?
    If not, tracks recorded on each will eventually drift apart.
    FWIW, Using ASIO4ALL or the Steinberg generic ASIO driver really isn’t an ideal solution.”

    Source : http://forum.cakewalk.com/Is-there-an-alternative-to-ASIO4All-m3058287.aspx

  13. andrea says:

    Hi Nemo

    thanks for the input πŸ˜‰
    In the end I probably found the culprit @ the source >> KODI
    Since asio4all as stated doesn’t work well with multiple devices and I really didnt want to give up the room correction I looked around for alternatives and stumbled upon Jriver which among other things has native vst support!
    This way i bypassed both vst host and the virtual cable
    Preliminary test has shown that even after 2 hours there’s no sync drift mostly because this time asio4all output directly to the nvidia card
    Well I wont say any more than this at the moment but looks like i might have found the final enviroment πŸ˜›
    Jriver > vst coneq 8ch > asio \nvidia > popcorns & beer > projector
    Too good to be truth ? only time will tell πŸ™‚
    ciaoo
    andrea

  14. Iam Nemo says:

    Hi Andrea! Good to know. JRiver is also my playback. I insert DDMF Metaplugin in the DSP Studio so I can see each of my plugins (such as Izotope Ozone 6 advanced, ARC2 and others) each in its own separate window at the same time on my screens.

  15. Comet315 says:

    It works well for me but the VST host programme doesn’t seem to save the configuration….It loads up when I start windows but the VST plugin isn’t there, and all the settings are lost (e.g. minimise ot tray, high priority, wave settings etc) which means I have to perform steps 9,10,11 and 12 each time I start windows…am I missing something?

  16. Thank you for help!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s