LMMS / LMMS/lmms

Allow chaning ZynAddSubFX internal buffer size per instrument

Open
#3,091 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

compatibility enhancement
Dominant language
C++
Stars
10.4k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
7

Description

One problem I have with Zyn is that I can now clearly hear the low resolution of it's envelopes and LFOs.

I requested a HQ mode for these in the Zyn issue tracker. if you want to see the proof and undertand what I mean, read there:
https://sourceforge.net/p/zynaddsubfx/feature-requests/83/

**A quick workaround however is to change the Zyn's internal buffer size.**
Zyn updates LFOs and ENVs once every buffer, with no interpolation. This produces clicks and "zipper noise" especially when you have a big buffer and a rapid ENV of LFO action.

I measured that LMMS's implementation of Zyn uses about 5ms of internal buffer (that's 256 samples for 48 kHz).

Mark McCurry said this about the Zyn's internal buffer in above issue:

> the plugin version defaults to 32 samples or less

Thats' 8 times smaller, giving 8 times better envelope and LFO resolution.
When you need an oscillator to go down 2 octaves in 50 ms - that's a difference between an acceptable sweep and a really poor one. And I do this all the time with drums.
Funny is I have released 3 full-length albums with drums synthesized with this low buffer and I didn't notice.

**The problem is - there's no way to change Zyn's buffer within LMMS!**

I can still live with that, and hopefully make good sounds, but it's a limitation I'm aware of now, and it makes some sounds impossible to create.

This is one area where digital synthesizers are performing worse than analogue ones. Analogue would never produces a stairsteppy envelope/LFO signal.

I'd love to be able to set this per-instrument in the Instrument tab - because I'd only change it for drum sounds that need a smooth envelope response to create real pitch slides, not a 5-starstep approximation. If I could get a 40-step approximation, I'd be very happy, no matter the CPU usage :)

PS:

I actually realized this problem after using TAL NoizeMak3r for a while (working on a Mac where I didn't have access to Zyn). That synth makes perfect sweeps, and the LFO resolution is (by my ear) as high as the sampling rate. This along with great filters and nice envelope curves makes it sound like an analogue synth (even though I never owned one). I never understood why people praise analog gear so much - but I have one good reason now (and still 5 better reasons to keep using the digital emulations).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by locating the ZynAddSubFX instrument-tab implementation and the internal buffer handling, then determine how buffer size is currently fixed; done means each instrument can configure its internal buffer size independently.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
audio-video-rtc
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.