Skip to content
Windows based DSP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Updates q offset to center on 0 instead of 1 Mar 17, 2019
release Prepared new release Mar 22, 2019
testFiles Added source code Jan 19, 2018
.gitignore Added logger class instead of printf Feb 2, 2019
AudioDevice.cpp Added cpp files to all classes Mar 9, 2019
AudioDevice.h Added cpp files to all classes Mar 9, 2019
CaptureLoop.cpp Fixed bug where window wouldnt hide on minimize Mar 14, 2019
CaptureLoop.h Cleaned up namespace level vars in capture loop Mar 3, 2019
Channel.cpp Added new basic routing format Mar 11, 2019
Channel.h Added new basic routing format Mar 11, 2019
Condition.cpp Cleanup. Created cpp files. Removed uneccessary header includes and p… Mar 4, 2019
Condition.h Cleanup. Created cpp files. Removed uneccessary header includes and p… Mar 4, 2019
Config.cpp Fixed bug where devices was set with old format Mar 15, 2019
Config.h Added q offset to basic crossover filters Mar 17, 2019
ConfigChangedException.cpp Added cpp files to all classes Mar 9, 2019
ConfigChangedException.h Added cpp files to all classes Mar 9, 2019
ConfigParser.cpp Fixed bug where devices was set with old format Mar 15, 2019
ConfigParserAdvanced.cpp Added debug print bool to conf Mar 13, 2019
ConfigParserBasic.cpp Create parse basic crossover func Mar 12, 2019
ConfigParserFilter.cpp Renamed q to qOffset Mar 17, 2019
ConfigParserUtil.cpp
ErrorMessages.cpp Added cpp files to all classes Mar 9, 2019
ErrorMessages.h Added cpp files to all classes Mar 9, 2019
FilterType.cpp Added new basic routing format Mar 11, 2019
FilterType.h Added new basic routing format Mar 11, 2019
Input.cpp Added new basic routing format Mar 11, 2019
Input.h Added new basic routing format Mar 11, 2019
LICENSE Initial commit Jan 14, 2018
Main.cpp Prepared new release Mar 22, 2019
Output.cpp Added auto gain Mar 11, 2019
Output.h Added auto gain Mar 11, 2019
README.md Added qOffset default value to readme Mar 17, 2019
Route.cpp Added new basic routing format Mar 11, 2019
Route.h Added new basic routing format Mar 11, 2019
SpeakerType.cpp Added new basic routing format Mar 11, 2019
SpeakerType.h Added new basic routing format Mar 11, 2019
SubType.cpp Added new basic routing format Mar 11, 2019
SubType.h Added new basic routing format Mar 11, 2019
TrayIcon.cpp Cleanup. Created cpp files. Removed uneccessary header includes and p… Mar 4, 2019
TrayIcon.h Added cpp files to all classes Mar 9, 2019
Visibility.cpp Added cpp files to all classes Mar 9, 2019
Visibility.h Added cpp files to all classes Mar 9, 2019
WinDSP.ico New app icon Nov 1, 2018
WinDSP.rc Added tray icon in hidden mode Feb 28, 2019
WinDSP.sln Removed experimental asio support. Use asio bridge instead Feb 28, 2019
WinDSP.vcxproj Added new basic routing format Mar 11, 2019
WinDSPLog.cpp Added cpp files to all classes Mar 9, 2019
WinDSPLog.h new release Mar 14, 2019
resource.h Added tray icon in hidden mode Feb 28, 2019

README.md

WinDSP

Windows based DSP(Digital Signal Processor)

Features

  • Route any input to any output. Any input can be routed to zero or many outputs.
  • Add any filter to route or output.
  • Filters like crossovers, PEQ, shelf, custom biquad(IIR), FIR, delay, gain and more.
  • Uses double-precision floating-points to calculate filters.
  • Uses WASAPI(Windows Audio Session API) to capture and manipulate audio streams.
  • JSON based configuration file to easy set up your DSP.
  • User friendly error and warning messages. Warns you about digital clipping. Using missing channels and more.

Devices

Windows (as far as I know) doesn't allow manipulation of the audio stream during playback. You can however capture a playing audio stream from one device and play it back to another device. This requires two devices: one capture device and one render/playback device.

Capture device

  • Receives audio from applications. Make it the default playback device.
  • Have NO audio equipment/speakers attached.

Render device

  • Receives audio ONLY from WinDSP.
  • Have audio equipment/speakers attached.

Virtual Cable
If you don't have a spare soundcard in your computer to use for the capture device I can recommendend VB-Audio Virtual Cable which gives you a virtual audio device to use as the capture device.

ASIO support
WinDSP only supports WASAPI devices, but VB-Audio Asio Bridge can be used as render device to playback through an ASIO soundcard.

Prerequisites(To run application)

Prerequisites(To compile source code)

Install

  1. Download and install Microsoft Visual C++ Redistributable.
  2. Download and install VB-Audio Virtual Cable.
  3. Set Virtual Cable as your default audio playback device.
  4. Configure Virtual Cabel to use the same sample rate as your render device (/properties/advanced).
  5. Configure Virtual Cabel to NOT allow applications to take exclusive control (/properties/advanced).
  6. Configure Virtual Cable to use 7.1 surround (/configure).
  7. Configure WinDSP.json configuration file.
  8. Start WinDSP.exe.

JSON config file

  • Saving the config file will automatically restart WinDSP. No need to manually close and open the program.
  • If you are not used to JSON use an editor like Json Parser Online to get the format correct.

Config switching

  • If you have multiple config files you can switch between them using the 0-9 buttons.
  • Button '1' selects congfig file 'WinDSP-1.json', button '2' selects 'WinDSP-2.json' and so on.
  • Button '0' select the default config file 'WinDSP.json'.

Available channels

  • L: Front left
  • R: Front right
  • C: Center
  • SW: Subwoofer/LFE
  • SL: Surround left
  • SR: Surround right
  • SBL: Surround back left
  • SBR: Surround back right

Config layout

{
    "startWithOS": false,
    "minimize": false,
    "hide": false,
    "description": "Default config",
    "devices": {
        "capture": "CABLE Input (VB-Audio Virtual Cable)",
        "render": "Focusrite USB AUDIO"
    },
    "basic": {
        "front": "Large",
        "center": "Sub",
        "subwoofer": "Sub",
        "surround": "Small",
        "surroundBack": "Off",
        "stereoBass": true,
        "expandSurround": true,
        "lfeGain": -3,
        "lowPass": {
            "type": "BUTTERWORTH",
            "order": 5,
            "freq": 80
        },
        "highPass": {
            "type": "BUTTERWORTH",
            "order": 3,
            "freq": 80
        }
    },
    "advanced": {
        "L": [
            {
                "out": "L",
                "gain": -3.8,
                "delay": 2,
                "invert": false,
                "filters": []
            }
        ]
    },
    "outputs": [
        {
            "channels": [ "L", "R" ],
            "gain": -3.2,
            "delay": 4.5,
            "invert": false,
            "mute": false,
            "filters": []
        },
        {
            "channel": "C",
            "gain": -2
        }
    ]
}

Start WinDSP with Windows

  • Set startWithOS to true and WinDSP will start with the OS/Windows.

Hide and minimize

  • Set hide to true to hide window on startup and show tray icon.
  • Set minimize to true to minimize window on startup.
  • Hide supersedes minimize.
  • Errors will show the window again, but not warnings.
  • Double click tray icon to manually show hidden window again.
  • Minimizing the window when hide is set to true will instead hide it

Description

  • Description of the config file to be displayed at startup.
  • Optional. If not given no description will be shown.
  • Useful when using multiple config files. eg: "Default", "Night mode", "Less bass".

Devices

  • Devices contains the capture and render device names.
  • If devices are not set the user will be queried from a list of available devices. Do NOT write these names yourself.

Basic routing

  • Basic routing CAN'T be combined with advanced routing.
  • Use basic node to specify speaker types. The DSP will automatically route input signal to correct output.
  • The following speaker types are available:
    • Large: Speaker will play full range. Input will be sent to output unchanged.
    • Small: Speaker will not play bass. High frequencies will be sent to speaker and low frequencies to subwoofer.
    • Off: Speaker output is disabled. Send signal to the next best available channel. Output is disabled/silent.
    • Sub: Output is subwoofer. If not SW channel routing will be the same as Off. Difference is that the output is used for subwoofer.
  • Available speaker modes per channel. First value is default.
    • front(L/R): Large, Small
    • center(C): Large, Small, Sub, Off
    • subwoofer(SW): Sub, Off
    • surround(SL/SR): Large, Small, Sub, Off
    • surroundBack(SBL/SBR): Large, Small, Sub, Off
  • stereoBass: If true bass will be played in stereo. If false bass will be in mono.
    • Default value: false
    • Can't be used with only one subwoofer
    • Can be used with Large fronts. Bass from small channels will be sent to only one front speaker.
    • L/C/SL/SBL channels are considered left bass channels. If set to sub and stereoBass true.
    • R/SW/SR/SBR channels are considered right bass channels. If set to sub and stereoBass true.
  • expandSurround: If true and surround back input is quiet(5.1 source) surround back will play surround channels track.
    • Default value: false
  • lfeGain: Gain offset for mixing the LFE signal with other channels.
    • Default value: 0
    • Works with both subwoofers and front speakers.
  • lowPass: Filter configuration for low pass filter. Is applied to Sub channels.
    • Default value: Butterworth 80Hz 5order(30dB/oct)
  • highPass: Filter configuration for high pass filter. Is applied to Small channels.
    • Default value: Butterworth 80Hz 3order(18dB/oct)

Advanced routing

  • Advanced routing CAN'T be combined with basic routing.
  • Use advanced node to manually specify each mapping between inputs and ouputs.
  • By default all inputs are routed directly to the matching output. L to L, R to R and so on.
  • To not use an input at all just add empty brackets: "L": {}
  • One input can have multiple outputs. Including the same output twice if needed.
  • A route can have multiple filters like gain, delay, crossovers, peq and more.

Outputs

  • Outputs contains each output channel. This is the sum of all the input routes to this channel.
  • By default the output channels have no filters.
  • If basic routing is used crossovers and gain filters are applied if not specified manually in output.
  • An output can have multiple filters like gain, delay, crossovers, peq just like the input routes.
  • An output can be muted or inverted.
  • Each output node can be for one channel "channel": "L" or multiple "channels": ["L", "R"]

Filters

  • The program handles all audio manipulation as filters. A filter can be a something complex as a crossover or something simple like gain.
  • Some filters can only exist once in a route or output. eg. gain, delay, invert, mute.
  • Other filters(in the filters array) can occur multiple times. eg. crossovers, shelf, PEQ, LT, custom biquad, FIR.

References
A common user case is that multiple channels or routes share filter configurations. Instead of having to copy and paste these you can reference one JSON node from another.

"filters": {
    "myPEQ": {
        "type": "PEQ",
        "freq": 320,
        "gain": -10,
        "q": 5
    }
},
"outputs": [
    {
        "channels": [ "L", "R" ],
        "filters": [
            { 
               "#ref": "filters/myPEQ" 
            }
        ]
    }
]

Conditional routing

  • You can add conditions to a route. If the conditions is not met the route will not be active.
  • For now the only condition available is to detect if an input channel is silent or not.
  • The code below will route audio from surround(input) to surround back(output) if surround back(input) is silent.
"inputs": {
   "SL": {
      "routes": [
         {
            "out": "SBL",
            "if": {
               "silent": "SBL"
            }
         }
      ]
   }
}

Filter parameters

Delay

  • Requires: value
  • Optional unitMeter parameter to use meters instead of milliseconds.
"delay": 5.2

or

"delay": {
    "value": 4.5,
    "unitMeter": true
}

PEQ(Parametric equalizer)

  • Requires: type, freq, gain, q
{
    "type": "PEQ",
    "freq": 29.0,
    "gain": -13.0,
    "q": 4.5
}

Shelf

  • Type: LOW_SHELF or HIGH_SHELF
  • Requires: type, freq, gain
  • Q-value defaults to 0.707
{
    "type": "LOW_SHELF",
    "freq": 100.0,
    "gain": -6.0,
    "q": 0.5
}

Band pass

  • Requires: type, freq, bandwidth
  • Gain defaults to 0dB
{
    "type": "BAND_PASS",
    "freq": 100.0,
    "bandwidth": 3.5,
    "gain": 1.5
}

Notch

  • Requires: type, freq, bandwidth
  • Gain defaults to 0dB
{
    "type": "NOTCH",
    "freq": 100.0,
    "bandwidth": 3.5,
    "gain": 1.5
}

Crossover

  • Type: LOW_PASS or HIGH_PASS
  • Requires: type, subType, order, freq
  • Subtypes are: BUTTERWORTH, LINKWITZ_RILEY, BESSEL and CUSTOM
  • Butterworth is available in orders: 1 through 8
  • Linkwitz-Riley is available in orders: 2, 4 and 8
  • Bessel is available in orders: 2 through 8
  • For all subtypes except cutsom a single optional Q-offset can be given. This is an offset of the existing Q-values to tweak basic crossovers. Default value: 0
  • Subtype custom requires Q values array. One Q-value per 2nd order filter. Give Q as -1 to get a 1st order filter.
{
    "type": "LOW_PASS",
    "subType": "BUTTERWORTH",
    "order": 4,
    "freq": 80.0,
    "qOffset": 0.2
}
{
    "type": "LOW_PASS",
    "subType": "CUSTOM",
    "order": 5,
    "freq": 80.0,
    "q": [
        -1.0
        0.707,
        0.5
    ]
}

Linkwitz Transform

  • Requires: type, f0, q0, fp, qp
{
    "type": "LINKWITZ_TRANSFORM",
    "f0": 30.0,
    "q0": 1.2,
    "fp": 10.0,
    "qp": 0.5
}

Biquad

  • Create a custom biquad by giving the biquad coefficients.
  • Biquad filters are also known as IIR(Infinite Impulse Response).
  • b0-b2 are the feedforward values in the numerator and a0-a2 are the feedback values in the denominator.
  • Multiple sets of coefficients can be given to create a cascading filter.
  • Requires: type, values[b0, b1, b2, a1, a2]
  • a0 defaults to 1.0
{
    "type": "BIQUAD",
    "values": [{
        "b0": 0.2513790015131591,
        "b1": 0.5027580030263182,
        "b2": 0.2513790015131591,
        "a0": 1.0,
        "a1": -0.17124071441396285,
        "a2": 0.1767567204665992
    }]
}

FIR(Finite Impulse Response)

  • WinDSP loads a text file with the FIR parameters.
  • Use a tool like rePhase to calculate the FIR parameters.
  • FIR file is either a text(.txt) file or a wave(.wav).
  • Wave file can be either LPCM(16/24/32bit) or float(32/64bit).
  • Warning: FIR filters require much more CPU capacity then the other filters. WinDSP doesn't limit the number of taps you can input so use with care.
{
   "type": "FIR",
   "file": "fir.txt"
},
{
   "type": "FIR",
   "file": "fir.wav"
}
  • FIR text file format is one FIR tap per line as a floating point number.
  • Use "32 / 64 bits floats mono (.txt)" option in reShape to generate parameters file.
0
0.0000000000000000025148658985616801
-0.000000000000000010019981273260004
0.000000000000000022669569961523929
-0.000000000000000040502459260231708
0.000000000000000063400956715765757
-0.000000000000000091367289519079492

Output filter parameters

These are filter only available on outputs and not on routes.

Cancellation

  • Creates an inverted and delayed signal cancel out on the specified frequency. This is another way to remove peaks.
  • Requires: freq
  • Gain defaults to 0dB
"cancellation": {
    "freq": 28.0,
    "gain": -5
}

Errors and Warnings

  • An error is a problem serious enough that the program can't run. eg. missing devices, faulty config.
  • An error will output a text message describing the problem and then restart the program. If the problem is corrected the program will start normally.
  • A warning is a potential problem, but the program can still continue running. eg. Configured a route for a channel the audio device is lacking, the sum of all routes can go above 0dBFS on the output.
  • All configured input and outputs the device is lacking will just be ignored.
  • If you sum multiple inputs together and they play peak signals at the same time digital clipping will occur which creates distortion. Lower the output gain if a digital clipping warning is shown.

Disclaimer

I test all my software to the best of my ability and this is a software I personally use in my own audio setup, but bugs can still occur and due to the nature of this software being audio playback related, loud uncomfortable high or low frequency distortions may be a possibility. I haven't had any problems like that myself and if I find any I will patch them out, but just be aware that you use this software on your own accord. With that said please feel free to enjoy it! :)

You can’t perform that action at this time.