Skip to content

Instantly share code, notes, and snippets.

@peterhellberg
Last active September 26, 2024 18:42
Show Gist options
  • Save peterhellberg/956322db6f5bcad324aa69ecacae793e to your computer and use it in GitHub Desktop.
Save peterhellberg/956322db6f5bcad324aa69ecacae793e to your computer and use it in GitHub Desktop.
w4on2 under Linux

w4on2 under Linux

git clone [email protected]:JerwuQu/w4on2.git
cd w4on2
cargo build --release

Note

There has been some minor changes in Zig ⚡, such as b.path being used to get a LazyPath in build.zig

diff --git a/example/build.zig b/example/build.zig
index df31537..5418820 100644
--- a/example/build.zig
+++ b/example/build.zig
@@ -3,16 +3,16 @@ const std = @import("std");
 pub fn build(b: *std.Build) !void {
     const exe = b.addExecutable(.{
         .name = "cart",
-        .root_source_file = .{ .path = "src/main.zig" },
+        .root_source_file = b.path("src/main.zig"),
         .target = b.resolveTargetQuery(.{
             .cpu_arch = .wasm32,
             .os_tag = .freestanding,
         }),
         .optimize = .ReleaseSmall, // b.standardOptimizeOption(.{}),
     });
-    exe.addIncludePath(.{ .path = "../runtime/" });
+    exe.addIncludePath(b.path("../runtime/"));
     exe.addCSourceFile(.{
-        .file = .{ .path = "../runtime/w4on2.c" },
+        .file = b.path("../runtime/w4on2.c"),
         .flags = &.{"-D__W4ON2_WASM4_TRACEF"},
     });

Links

Tools

Carla

(INSTALL.md)

Dependencies

Note

I had to compile Carla myself in order to get VST3 support.

sudo apt install python3-pyqt5.qtsvg python3-rdflib pyqt5-dev-tools \
  libmagic-dev liblo-dev libasound2-dev libpulse-dev libx11-dev libxcursor-dev libxext-dev \
  qtbase5-dev libfluidsynth-dev

Installation

make features
make
make install

The w4on2 VST3 plugin

Important

There is a convention to have VST3 plugins in ~/.vst3/

I placed the plugin (target/release/libw4on2_plugin.so) from w4on2 in:

.vst3/w4on2.vst3/
└── Contents
    └── x86_64-linux
        └── w4on2.so

By doing something like this;

mkdir -p ~/.vst3/w4on2.vst3/Contents/x86_64-linux/
cp ~/Code/GitHub/JerwuQu/w4on2/target/release/libw4on2_plugin.so \
    ~/.vst3/w4on2.vst3/Contents/x86_64-linux/w4on2.so

w4on2 VST3 plugin

Chiptune.app

https://chiptune.app/local allows you to load and play .mid files using Web MIDI (to the Midi Through device)

Chiptune.app Local

Helvum

Installed via the Pop!_Shop

Used to patch between the Midi-Bridge, Carla and my external sound card.

Helvum

Final result

Here I've loaded a .mid into https://chiptune.app/local running in Firefox, it bridges to my local Pipewire Midi-Bridge, I've then patched it into Carla (which is my VST3 host) and then out to my external sound card.

Final result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment