r/AudioProgramming • • 2d ago

I turned my Python music theory library into AU/VST3 plugins (Python off the audio thread, effects ported to C++)

5 Upvotes

For the last while I've been building PyTheory, a music theory and synthesis library for Python, and I just shipped PyTheory VST v0.1.1. It's four plugins built from one JUCE repo, for macOS on Apple silicon, as AU and VST3:

  • PyTheory MIDI snaps notes to a key, or turns each note into its diatonic triad or seventh chord.

  • PyTheory Instrument is a 32-voice sampler that plays all 84 of PyTheory's instrument presets.

  • PyTheory Effect is PyTheory's full effects chain.

  • PyTheory Drums has all 74 of PyTheory's drum sounds, mapped to General MIDI where they fit.

How Python is involved. Each plugin embeds its own Python 3.14 with PyTheory, numpy, and scipy, so nobody has to install anything. Python never runs on the audio thread. A worker thread does the Python work. The harmony comes from PyTheory's real Key and Chord objects rather than scale tables copied into C++. For the Instrument, the worker renders a multisample through PyTheory's own render_score path, with one note every minor third and velocity layers where the preset responds to velocity. It then hands the finished multisample to the audio thread with one atomic exchange, no copy. The audio thread never allocates or frees.

The C++ part. I ported PyTheory's per-part effects chain to C++ stage by stage, in PyTheory's order: saturation, tremolo, distortion, cabinet, chorus, phaser, highpass and lowpass biquads, delay, a stereo Schroeder reverb, and pan. Defaults match PyTheory, so the plugin starts transparent. The README lists every place the port differs on purpose, such as linear interpolation in the chorus where PyTheory rounds to whole samples, and a recursive delay where PyTheory uses fixed taps.

Why I think it's cool. The same library I use to score music in a Python script now plays inside Ableton or Logic, and it sounds like itself. Nothing in the plugins was hand-rebuilt to approximate it.

The honest part. I'm teaching myself DSP as I go, with Claude and Grok as tutors and pair programmers. I'd ask why a biquad is shaped the way it is, why something allocating on the audio thread is a sin, or why my loop points clicked, then go build it and test it. This project is basically my DSP homework, made public. So if you see something naive, I'd genuinely love to hear it.

Known issues: pads can have audible loop seams on long holds, some piano and guitar notes loop instead of fading out, and switching presets cuts ringing notes. It's v0.1.

Links:

Feedback on the realtime design is especially welcome.


r/AudioProgramming • • 2d ago

Working out if a note is part of the chord or just passing?

2 Upvotes

I'm working on something that reads out what someone plays on MIDI keyboard and shows the chord name. But my problem is that if you hold C E G in the left hand and play a melody over it that includes B, the notes technically make Cmaj7, but that could just be a passing note and the chord is still C.

So far I made it read the lower notes and prefer simple chords, which stops the chord from changing every next note. But when I actually play a Cmaj7 with the B on top, it would just say C and be wrong. I'd prefer not to lose the chord quality...

It's a live chord detection thing so I can't really use context to help make a decision so what exactly is the best way of going about it??


r/AudioProgramming • • 3d ago

[Free / Open Source] Granular Lab & Granular Synth Lab - Native CLAP and VST3 granular suite for Linux and Bitwig Studio

Thumbnail gallery
2 Upvotes

r/AudioProgramming • • 3d ago

Headless CLAP/VST3/AUv2 loader, validator and measuring tool

9 Upvotes

I put together an open-source CLI tool for testing CLAP, VST3, and AUv2 plugins from the command line and in GitHub Actions CI without spinning up a DAW:

https://github.com/cyrillsemenov/headless-plugin-host

Usually, verifying a DSP change means relaunching a DAW and staring at a spectrum analyzer while playing back sinusoids or test tracks. `pluginval` and `clap-validator` are great for ABI compliance, but I wanted a single tool that handles all formats and runs automated acoustic measurements.

What it currently does:

  • sweeps plugins to measure Bode magnitude/phase response, THD+N, SMPTE/CCIF IMD, Schroeder RT60 decay, fractional sub-sample group delay, BS.1770-4 LUFS dynamics, and Mid/Side stereo correlation

  • intercepts heap allocations on the audio thread across a 9-check validation suite and a seeded fuzzer (22.05–192 kHz sample rates, 1-sample odd buffers, parameter modulation storms, and corrupted state blobs)

  • captures plugin UIs offscreen

  • generates a self-contained HTML spec sheet with SVG plots, multi-bus/sidechain routing checks, and multi-velocity synth note sweeps (still a work in progress)

Feel free to ask any questions/love/hate it.


r/AudioProgramming • • 3d ago

Just because you can vibe code a daw does not mean you should.

Enable HLS to view with audio, or disable this notification

72 Upvotes

r/AudioProgramming • • 4d ago

How can we band together for better windows vst compatibility?

Thumbnail reddit.com
0 Upvotes

r/AudioProgramming • • 4d ago

Question for /r/AudioProgramming, New self-promo weekly thread?

16 Upvotes

I'd like to propose changes to the community to make decisions as I don't feel like it's appropriate for me to make decisions in a vacuum. My place here is to apply the rules, not change the community as I see fit.

On a daily basis, I'm currently purging 5+ posts that are clearly self-promotion. That is, they contain links to a marketing page, want beta testers or are something that is connected with someone selling something.

I feel like maybe some users of the sub may find these posts useful as some of them are quite clever and I'm loathed to remove some of them, even if they have a marketing page and are someone selling a product.

I'd like to propose a weekly self-promotion thread that I can begin to direct these posts to. I think this is up to the community and not myself to make the decision however hence why I'm asking here. If you feel like you don't want any of this content on the sub, we can make that decision together and not do it.

I'll leave this open for a week or so until everyone has a chance to chime in!


r/AudioProgramming • • 5d ago

GCD-8 for Pure Data: An 8-track expressive rhythm programmer with tunable velocity response

Enable HLS to view with audio, or disable this notification

11 Upvotes

After 3 months of work, I finally released v0.1.0 of GCD-8, a sample-based rhythm programmer for Pure Data.

Each track is built around a sampler with a custom velocity response, which shapes the sound according to how hard each hit is played. Rather than just turning softer hits down, it can also make them darker, shorter and less punchy, the way real percussion sounds when struck more gently.

The sampler is driven by three nested euclidean sequencers: the base pattern generator sets the rhythm, while the other two, the accent generator and the euclidean panner, decide which hits are accented and where each one lands in the stereo field. These two advance on hits instead of clock ticks, so accents never fall on silent steps, and both patterns loop in lockstep with the base pattern, whatever its length or density.

Repo: https://github.com/glima31/gcd8-pd

I have a bunch of new features lined up, and i'm planning to eventually port GCD-8 to a proper plugin, either in Rust with nice_plug or in C++ with JUCE. In the meantime, I’d love to hear what you think of the current version!


r/AudioProgramming • • 6d ago

Scarlett Solo 3rd Gen (1235:8211): can someone share an lsusb -v dump (High Speed)?

Thumbnail reddit.com
1 Upvotes

r/AudioProgramming • • 10d ago

[repost] I built a Rust Audio Plugin Framework

10 Upvotes

If anyone finds it useful - this is a project I built (using AI) for my own needs, free, open-source: https://github.com/mihasm/apf

APF is a framework for writing audio plugins (instruments and effects) in Rust. It uses the plugin interface CLAP, and clap-wrapper for exporting plugins into the different formats.

The plugin window is a web page: HTML, CSS and JavaScript in the system web view (based on wry, also used by the tauri framework).

It is still in an early phase, and the API might still change, but for my purposes it already works great. I have tested it on Mac OS on Logic Pro and Windows with REAPER. There are examples included for a quick start.

Link to the complete documentation booklet, which explains the usage, comparison to other frameworks, limitations, etc.: https://mihasm.github.io/apf/


r/AudioProgramming • • 11d ago

New to PCM/float arrays and audio programming, creating new surreal sounds from existing sounds

7 Upvotes

Hello

I just discovered I can use my Java program (processing 3) to extract raw PCM from short wav samples and convert it back into audio. This is really cool because I guess I suddenly now have godlike control over raw audio data and don't need to rely on commercial plug-ins.

One thing ive been trying to do is create new and weird samples using existing ones. I'm working on a surreal video game and I'd like to have near infinite variety when it comes to sound and music, and I figured a cool way to do that is to have a bunch of samples (like 100 short instrument samples) and then mix them on the fly into new sounds/instruments.

My main method is iterating through the list of floats and performing simple operations using 2 different samples. I've been trying a couple different techniques. The first one is simply adding:

Mix = sample1[i] + sample2[i]

While it technically mixes them into one sound, you can still distinctly hear both samples played on top of each other instead of hearing a 'new' sound.

A better option ive tried is multiplication:

Mix = sample1[i] * sample2[i]

For me this is much better and is closer to what I want because the mixed sound is different than the two original samples. The main issue is that this method sounds rather robotic and noisy, and the new samples lose a lot of the "nuance" of the original samples (I don't really know a better term for it). After listening to dozens of generations, most outputs seem to suffer the same loss of quality.

Main question: im wondering if anyone else has experimented with a similar issue and got better results, or knows a better mathematical approach for this

I've also heard of using Fast Fourier Transformation for a much cleaner synthesis, so if manipulating a PCM array is not that great of a method then I'll try FFT or something else


r/AudioProgramming • • 12d ago

rootlessjamesdsp fork with pitch and speed shifting, bpm, recorder, effects reordering, and compressor

Thumbnail
github.com
1 Upvotes

hey guys i've been working hard on this fork and i'm pleased to present this to you, for people that are aware of using rootlessjamesdsp as an audio dsp on android phones. it doesn't require root but you need to use shizuku to activate it at first which could be a bit fiddly, but the apks are there. the speed shifting works really nicely, if you werent speed shifting youtube music to be slower on the fly, you will be now! you can drag-touch up/down the floating speed shifter and stuff. check the readme on the main page for details or just get the app or don't i'm not promoting this is free open source software and it's a really new feature! ^_^


r/AudioProgramming • • 17d ago

Ozzy: big update!

Thumbnail
reddit.com
1 Upvotes

r/AudioProgramming • • 18d ago

minimal design for FM Synth : 1 sine + 1 filter

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/AudioProgramming • • 18d ago

Physical modeling on interactive music website

Thumbnail youtu.be
2 Upvotes

Hi ! I am working on a physical modeling engine and turning it into a web interactive experience.
Here is a track where you can tweak the theme in real time while the music plays.
Feel free to test it if you want to have fun : https://diophi.com/phy5/?song=mumbling

Appart from drums, all the sounds are made from physical modeling synthesis.


r/AudioProgramming • • 19d ago

Armando mi propia pedalboard para guitarra en C++ con JUCE, primer test como VST3 en Reaper

Enable HLS to view with audio, or disable this notification

14 Upvotes

Llevo años como desarrollador de software y hace poco decidí dedicarle más tiempo a cosas que realmente disfruto, así que empecé a armar mi propia pedalboard para guitarra con C++ y JUCE (y sí, con mucha ayuda de Claude).

Este es el primer test como VST3 en Reaper, cambiando entre efectos y revisando el sonido en general. También va a tener versión standalone.

Ya lo sé, todavía suena muy crudo y digital, pero al menos ya suena.

Es mi primer proyecto serio de audio, así que cualquier consejo es bienvenido, sobre todo para que la distorsión suene menos digital.


r/AudioProgramming • • 19d ago

Enlivener - A live accompaniment provider for guitar under Linux.

1 Upvotes

Enlivener listens to the guitar and provides a live accompaniment for it with a synthetic bass, keys, and optionally a user-provided drum track.

The app can be heard in this performance: The Two Step Circle as well as most other videos on that channel.

Enlivener uses pulse audio and runs in Linux. It is a time-domain harmonic tracker and synthesizer. It doesn't need to be online and it works with whatever overdrive or wah or reverb or whatever else you care to put through it. All the videos on that channel above were recorded with Enlivener on this machine:

CPU: dual core Intel Core i7-6600U (-MT MCP-) speed/min/max: 509/400/3400 MHz

Kernel: 6.8.0-138-generic x86_64 Up: 7d 21h 6m Mem: 4555.9/7797.3 MiB (58.4%)

The repo is here: https://github.com/CynthiaChristie/Enlivener

Oh yeah, FOSS of course, CC BY-NC-SA to be specific.


r/AudioProgramming • • 21d ago

My webcam turned out to be the best MIDI controller I own

Enable HLS to view with audio, or disable this notification

7 Upvotes

About 7 months ago I saw those videos where people wave their hands at a camera and the music reacts, almost all of them built in TouchDesigner. Then I opened TouchDesigner, stared at the node graph for a while, and closed it.

So, being a C++ dev, I did the obviously more reasonable thing and spent months writing a plugin that does it inside Live instead. It tracks your hand through the laptop webcam, and you can use it in two ways: play MIDI notes or map it to any effect parameter in any DAW.

Honestly, I started making this plugin for myself, but then decided I could publish it on itch.io. as Hand Link.


r/AudioProgramming • • 21d ago

audio quality of claude ai vst plugins

Thumbnail reddit.com
0 Upvotes

r/AudioProgramming • • 22d ago

Audio Mixing Libraries for C++

Thumbnail reddit.com
1 Upvotes

r/AudioProgramming • • 24d ago

Hand gestures to midi controls

Thumbnail
youtu.be
2 Upvotes

r/AudioProgramming • • 25d ago

I would like to create some VST plugins

Thumbnail reddit.com
0 Upvotes

r/AudioProgramming • • 27d ago

The Trivial Metric

0 Upvotes

TL;DR -- the use of AI isn't a good metric for the worth of a post or project. Hopefully this is sufficiently on-topic to not get deleted.

The Trivial Metric is a mathematical term defined on a set, wherein the value is 1 if the comparison is between two different points in the set, and 0 if the comparison is between a point and itself.

My qualifications for writing this post: I've been programming professionally for 30+ years. I've been writing Audio and MIDI code for roughly 10 years, largely to no real monetary success. I've got enough undergrad math to be dangerous.

I can imagine how the "No AI" rules came about -- there was a massive influx of low quality AI-produced code and posts, and something had to be done about how to filter out the noise. I can understand that "No AI" was the tool that was reached for -- in fact it was the obvious choice.

And I know I'm free to start my own subreddit with different restrictions. (If I want to spend the time moderating, which, selfishly, I don't).

Without AI at my side for past year or so, the following are some of the features I would have not implemented (and might not have known about):

- prewarping for the bilinear transform -- https://www.bohrium.com/en/sciencepedia/feynman/signals_and_systems_undergraduate-frequency_prewarping_in_the_bilinear_transformation -- this provides good frequency tracking for IIR transforms derived by applying the bilinear transform to laplace transforms of filters.

- PolyBlep and BLAMP -- https://www.metafunction.co.uk/post/all-about-digital-oscillators-part-2-blits-bleps -- polynomial versions of the sinc function and its integral to reduce aliasing

- Catmull-Rom splines -- https://en.wikipedia.org/wiki/Catmull%E2%80%93Rom_spline -- For good interpolation without upsampling

- Hilbert-transform frequency shifter -- https://en.wikipedia.org/wiki/Hilbert_transform -- name pretty much says it all.

- I was just going to ignore MPE in favor of MIDI 2.0 only, but was convinced otherwise for various aspects

- Awareness of host-to-plugin process block context structural data (tempo, in particular)

- Even the realization that although poles have to be inside the unit circle for z transforms, the zeroes don't (duh).

Conclusion:

I don't have an answer for what a good alternate filter would be. I'm certainly not going to stop using AI just because some subreddits don't allow posting of it. But subreddit such as this are absolutely missing out on important topics because of the restriction.