AudioToMidi Plugin

Hello everyone,

I have an idea: I want to convert an audio signal into MIDI CC so that I can control MIDI instruments—like strings or piano—using my guitar. Here is where I stand so far:

Audio, MIDI, and MOD are all new to me. When I saw the MOD Desktop environment, I wanted to give it a try. I don’t yet know how to compile the code for the MOD device itself; right now, I’m still experimenting with pitch detection, guitar attack sensitivity, and determining exactly when to trigger “note-off” messages.

If anyone has ideas on how to improve this process, or advice on compiling and installing it for the MOD platform, I’d really appreciate the input.

1 Like

You should use mod-plugin-builder to build plugins for mod devices. Once your docker image is built with a local folder linked, type “source local.env moddwarf-new” (or another available target), then build your plugin.

Mod plugin builder on Wiki

1 Like

Thanks, I’ll give that a try sometime soon.
If anyone has any other ideas on how to debug a plugin, that would also help me fix my remaining bugs (related to detection and transmission). It runs on an external device—or as a plugin instance—so I unfortunately can’t use IDE debugging the way I’m used to with standard programs. Or am I mistaken about that?

Take a look here, for example—you might find some resources, ideas, etc.:

Envelope follower

2 Likes

Im the author of guitarmidi (GitHub - geraldmwangi/GuitarMidi-LV2: A concept for guitar to midi as an lv2 plugin · GitHub).

GuitarMidi-lv2 can do this, its currently available for linux. Im looking into getting it on the dwarf but it is a very hard task

2 Likes

you can check out my youtube channel to see it in action https://www.youtube.com/@JDriftAudio

I just looked at your repo. Years ago I also used aubio until i developed my own approach. If you want you can contribute to my guitarmidi-lv2. It its fully polyphonic and realtime down to the lowest string/note. Thats where aubio fails

The build system is broken for me. It attempts to use a kernel version that no longer exists on kernel.org. When I have more time, I will address this issue with MOD Audio via a GitHub issue; that way, it is properly documented and helps others set up a build system.

Are you building for moddwarf-new? Please try “./bootstrap.sh moddwarf-new”

1 Like

[INFO ] Retrieving needed toolchain components’ tarballs
[EXTRA] Retrieving ‘make-4.3’
[EXTRA] Verifying SHA512 checksum for ‘make-4.3.tar.gz’
[EXTRA] Retrieving ‘linux-4.4.302’
[ERROR] linux: download failed
[ERROR]

I also haven’t yet understood the difference between moddwarf and moddwarf-new.

moddwarf-new builds a less older toolchain.

The V4 kernel branch has been removed from the kernel.org server.

If you are not using docker and are using ./bootstrap.sh, you can try this fix: edit bootstrap.sh. Go to line 136.

Replace bloc:

if [ ! -f .stamp_built2 ]; then
sed -i -e 's/.PHONY: $(PHONY)/.PHONY: build $(PHONY)/' ct-ng
./ct-ng build
touch .stamp_built2
fi

with:

if [ ! -f .stamp_built2 ]; then
sed -i -e 's/.PHONY: $(PHONY)/.PHONY: build $(PHONY)/' ct-ng
_LINUX_VERSION=$(grep "^CT_LINUX_VERSION=" "${SOURCE_DIR}/toolchain/${TOOLCHAIN_PLATFORM}.config" | cut -d'"' -f2)
_LINUX_MAJOR=$(echo ${_LINUX_VERSION} | cut -d'.' -f1)
if [ "${_LINUX_MAJOR}" -lt 5 ] && [ ! -f "${DOWNLOAD_DIR}/linux-${_LINUX_VERSION}.tar.gz" ]; then
wget "``https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot/linux-${_LINUX_VERSION}.tar.gz``"
-O "${DOWNLOAD_DIR}/linux-${_LINUX_VERSION}.tar.gz"
fi
./ct-ng build
touch .stamp_built2
fi

1 Like

The kernel part works that way, but other problems keep cropping up, and I have no idea what else might come up next. Right now, I’m stuck on Python; Python 3.12 is too new—I think I need to install an older Linux version in a VM, or how do you guys build your plugins?

Are running the bootstrap.sh directly or are you trying t build the docker image? I would recommend the use of docker, but the docker file in the mod-audio repo will also face the kernel 4.x issue.

I did bootstraping directly on a debian 12 once quite some time ago, i don’t really remember what came up, but i built the docker image for modDuoX 17 days ago (to be very precise!) on macOS and I didn’t encountered the kernel 4.x issue back then and beside a few typos in the command line given in the wiki everything went fine.

I’ve rewritten the Dockerfile so that it no longer performs a git clone and instead uses my local changes. I’ve included your Bootstrap fix, and the build is currently still running. I’ll let you know once it’s finished.

Docker Result
EDIT:
2051.6 WARNING: no hash file for kxstudio-lv2-extensions-8b5f6cb9cd75e300958c9aacac253d44c964e80b.tar.gz
2051.6 svn: E170013: Unable to connect to a repository at URL ‘svn - Revision 4625: /libgig/trunk
2051.6 svn: E000110: Error running context: Connection timed out
2051.6 --2026-07-04 16:49:44-- http://sources.buildroot.net/libgig-2855.tar.gz
2051.6 Resolving sources.buildroot.net (sources.buildroot.net)… 172.67.72.56, 104.26.0.37, 104.26.1.37, …
2051.6 Connecting to sources.buildroot.net (sources.buildroot.net)|172.67.72.56|:80… connected.
2051.6 HTTP request sent, awaiting response… 404 Not Found
2051.6 2026-07-04 16:49:44 ERROR 404: Not Found.
2051.6
2051.6 make: *** [package/pkg-generic.mk:115: /root/mod-workdir/moddwarf-new/build/libgig-2855/.stamp_downloaded] Error 1
EDIT END

1 Like

Hey @pilal, if you could eventually DM me and pinpoint the pages and the typos it would be great! So I can quickly fix that :slight_smile:

@jon Do you happen to have the SVN Trunk local? I can’t get SVN because of timeout. Does this repo still exist? Could you create a copy of GitHub if you have files locally?

Greeting

Update:
I took a closer look at the build. Regarding libgig (the SVN and download servers are either gone or broken): it is a hard system dependency, yet I couldn’t find any plugin that actually uses it. That is why I disabled it in my fork, which allowed me to set up the appropriate environment.

Since I wanted to use Docker, I made a few minor adjustments to the Dockerfile to simplify things. Now, the GitHub URL and so on can be controlled via an ENV file.

What works for me?

git clone https://github.com/knasan/mod-plugin-builder.git
cd mod-plugin-builder/docker
# create .env
# MPB_GIT_URL=https://github.com/knasan/mod-plugin-builder
# MPB_PLATFORM=moddwarf-new
# MPB_TARGET=full

docker buildx with my patches

source .env
docker buildx build
--build-arg MPB_GIT_URL="$MPB_GIT_URL"
--build-arg platform="$MPB_PLATFORM"
--build-arg target="$MPB_TARGET"
-t mpb-dev .

It’s being built locally on my machine now.
I have a few gigs coming up over the next two weeks, so I haven’t dared to test this on my own hardware yet. I’ll get around to that once the gigs are over.

Now I can check whether the plugins can theoretically be compiled.

1 Like

Great that you found a solution @Smk!

As far as I’m aware, the documentation for the development stuff on the wiki is here and there outdated. I should fix it, but as I’m not into the MOD software and plugins development (and I guess that my developer skills are too low for most of the MOD stuff), any help from you guys in order to fix the documentation would be awesome! In summary, 2 things would be great for me:

  1. point out what is written there and doesn’t work

  2. if you happen to find a solution, let me know what it was so I can update it on the wiki materials

Do you have access to GitHub?
I think the first step should be to modernize the Dockerfile.

Just like I did in my fork.

Why?
That way, anyone can set up their build environment independently and test their changes much more easily without breaking GitHub - mod-audio/mod-plugin-builder: MOD Plugin Builder · GitHub .

The problem is that, as the Dockerfile is currently written, GitHub - mod-audio/mod-plugin-builder: MOD Plugin Builder · GitHub is a hard dependency.

Okay, I couldn’t resist running a test after all.
I was feeling pretty bold today :wink:

First, I installed the alabs-mod-custom-images custom image, then compiled my plugin and transferred it to the Dwarf. After a lot of debugging, I finally got it working.

@jon @pilal

So I can say that the hard linking of libgig was the right decision. This way, the plugins can definitely be compiled and work properly.

And I can say with a clear conscience that this would be a solution, in case anyone else runs into these problems.

Thank you for your support.

1 Like

Just to see if I understood. Do you mean that, as it is currently in GitHub - mod-audio/mod-plugin-builder: MOD Plugin Builder · GitHub , everything is correct and works as supposed?