Skip to content

giang17/winesynth

Repository files navigation

WineSynth

Demo synthesizer (mono oscillator) built as a VST3 plugin to showcase the MinGW cross-compilation toolchain for VSTGUI/VST3 on Linux, running in DAWs under Wine.

WineSynth Screenshot

Prerequisites

  • MinGW-w64 (x86_64-w64-mingw32-g++)
  • CMake 3.25+
  • VST3 SDK with VSTGUI
  • VSTGUI Fork for MinGW cross-compilation: giang17/vstgui (branch feature/mingw-cross-compilation)

For the full toolchain setup see vstgui-vst3-wine-toolchain.md.

Build

cd winesynth
mkdir build-mingw && cd build-mingw
cmake .. -DCMAKE_TOOLCHAIN_FILE=../mingw-w64-toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build . --target winesynth -j$(nproc)

Note: attrib errors (Error 127) during the build are harmless -- the DLL is linked successfully regardless.

Deploy

# Create VST3 bundle
mkdir -p "WineSynth.vst3/Contents/x86_64-win"
mkdir -p "WineSynth.vst3/Contents/Resources"
cp VST3/winesynth.vst3 "WineSynth.vst3/Contents/x86_64-win/"
cp ../resources/moduleinfo.json "WineSynth.vst3/Contents/Resources/"

# Copy to Wine VST3 directory
cp -r "WineSynth.vst3" ~/.wine/drive_c/Program\ Files/Common\ Files/VST3/

The moduleinfo.json is required for DAW plugin discovery. Without it, hosts may not recognize the plugin.

Wine-specific Fixes

Several workarounds are needed for VSTGUI plugins running under Wine:

  • DirectComposition enabled -- Wine now implements IDCompositionDesktopDevice; VSTGUI uses DComp surfaces with dirty-rect clipping (BeginDraw/EndDraw + BitBlt presentation) for efficient partial redraws
  • WM_ERASEBKGND subclass on parent HWND -- prevents white flash when opening the plugin in a DAW (the parent window's background brush shows through before VSTGUI's child window finishes its first paint)
  • Deferred initial redraw -- D2D1 RenderTarget is not ready on the first WM_PAINT under Wine; a delayed invalid() after 100ms forces a clean repaint
  • Deferred display updates -- Simultaneous invalidation of knobs and the waveform display causes black rectangles under Wine; a CVSTGUITimer (66ms) buffers updates
  • Explicit background clear -- Custom CControl views must fill their background on every draw() call to avoid black artifacts

Tested with

  • REAPER under Wine 11.0/11.1
  • FL Studio under Wine 11.0/11.1
  • Wine's custom DComp implementation (IDCompositionDesktopDevice with dirty-rect clipping)

License

MIT

About

WineSynth - Demo Mono Oscillator VST3 Plugin (MinGW cross-compiled for Wine)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors