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.
- 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.
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.
# 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.
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+BitBltpresentation) 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_PAINTunder Wine; a delayedinvalid()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
CControlviews must fill their background on everydraw()call to avoid black artifacts
- REAPER under Wine 11.0/11.1
- FL Studio under Wine 11.0/11.1
- Wine's custom DComp implementation (
IDCompositionDesktopDevicewith dirty-rect clipping)
MIT
