Author Topic: Preenfm3 Fx2 : some rework  (Read 40615 times)

Toltekradiation

  • Administrator
  • Sr. Member
  • *
  • Posts: 293
    • View Profile
Preenfm3 Fx2 : some rework
« on: April 11, 2026, 03:48:30 PM »
Hi,

modiying the preenfm3 firmware for the web-ui compatibility did lead to some rework on the fx2 area :

Stereo bandpass : now 3 poles
Diffuser : more diffusion to cancel some metallic artifacts
Flanger : less aliasing, sounds softer
Dim fx : expanded stereo, sounds a bit more organic
Bode fx : a little bit of saturation
Grains : softer modulation

i did a release on my github account as it's a better way to keep tracks of things :
https://github.com/pvig/preenfm3/releases/tag/v1.06


matrix12x

  • Team Member
  • ***
  • Posts: 205
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #1 on: April 18, 2026, 04:37:37 PM »
your web-ui looks nice. I'm updating the firmware later today to try out the new FX2 updates

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2270
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #2 on: November 12, 2026, 08:15:57 AM »
Nice.
I'm refactoring a bit the organization of preenfm3 files and made a migration to cmake build.
I'll need to look at your latest changes.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2270
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #3 on: November 17, 2026, 09:13:08 AM »
Hey Patrice, are you still around ?

I'm working on a big refactoring of the preenfm3 firmware:
Biggest change are :
. multi engine (3 for the moment):
      pfm3 existing one
      DX7/msfa : sound engine used by Dexed for DX7 emulation. Now DX7 import really sounds like a DX7  :)
      byos (bring your own synth) vibe coding friendly.
. dynamic voice allocation : the 16 voices are available to all Instruments/Engine and allow timbre/engine switch on the fly
. rework the folder structure and Cmake build compatible
. Lots of cleaning

I would like to include your work if you're OK with that.
The editor compatibility is a requirement for me.

Is this what i should look at to see the difference with my 1.03 firmware ? Are all your changes here ?
https://github.com/Ixox/preenfm3/compare/master...pvig:preenfm3:web-editor-adaptation

92 commits ? Wow...
I attached a IA analyses of your change. That's a lot of work .

Does anything break compatibility with current firmware ?


Thanks
« Last Edit: November 17, 2026, 09:19:32 AM by Xavier »

Toltekradiation

  • Administrator
  • Sr. Member
  • *
  • Posts: 293
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #4 on: November 17, 2026, 08:31:29 PM »
Hi Xavier,

yes i did some experiments on that git branch,
there are some compatibility break, around the midi nrpn configuration, to allow the remote edit of the new parameters, the stepseq NRPN is moved .

There is also in my code a pull from gresade, who added wrapping and phase mod for oscillators (https://github.com/gresade/preenfm3)

of course all my work is reusable as you wish, here is a summary :

Summary of improvements since PR #16:

1. FM Engine & Oscillators
- True HQ x2 mode (2x oversampling) replacing the legacy HQ mode (from gresade), with lower aliasing across waveforms (saw, square, s_q4, windowed sync, and phase warping).
- Configurable Attack/Release curve shapes on Free Envelopes 1 & 2.
- Anti-aliasing & waveforms: Added mipmap tables for saw, square, s_q4 (replacing s^2), sinZero/sinPos, windowed sync, and improved phase warping.

2. Per-Voice Filters & Effects
- Reduced aliasing on modulated filters and distortion/wrap effects.
- Reworked Oryx filter, Ap4D (true Dual Nested Allpass Phaser), Ping-Pong filter, and improved TB-303 emulation with accent circuit.
- Smoother delay interpolation in Timbre FX.

3. Dynamics & Saturation
- 6 per-timbre dynamics profiles (Off, Glue, Punch, Tube, Limit, Drive, Fuzz) combining tailored compression with matched analog-style saturation and a transparent safety limiter (Limit).
- ADAA1 on Glue & Fuzz: Exact branchless antiderivative formulation using direct hardware vsqrt.f32.

4. Voice Allocation & CPU Management
- Added Bass-Protect voice priority (alongside Last, High, Low, Cyclic) and improved held-note restoration.
- Smart CPU overload protection: cuts inaudible release tails early, purges the oldest released voice first on spikes, and falls back to Full mode on new notes when CPU is near the limit.

5. Arpeggiator & Step Sequencer
- 19 arpeggiator directions (added Down&Up, Up&Down Inclusive, Converge, Diverge, Thumb, Pinky, and Random Walk).
- Euclidean variations for factory presets (seed 0..15), step actions (Tie, Oct+, Ratchet x2, Chord strum, Slap), and new matrix destinations.
- Parametric Euclidean Swing (Swng, Hits, Len, Rot, Ghost Velocity) with a live 8-step groove display.
- Step Sequencer loop length (1..16) and per-step actions (Glide, Mute, Pass, LFO triggers, subdivisions, Alt2/Alt3).
- New matrix destinations: Arp+, ArpVl, ArpGt, ArpDv, Arp Ratchet, note+.

6. MIDI, Storage & Performance
- MIDI / NRPN: Refactored CC & NRPN mapping, fixed patch dump and MSB >= 2 routing, exposed Warp (CC 33..35, 111..113), Timbre/MFX (NRPN MSB 4, LSB 0..3), Arp Seed (4/4), Usr1..4 lengths (4/5..8), and Usr1..4 step states/modes (MSB 7..10).
- Patch format PFM3_PATCH_VERSION 1.7f: Compacted FlashSynthParams to 1000 bytes (fitting under ALIGNED_PATCH_SIZE - 5 = 1019) to fix Decim and LFO sync persistence in patch banks and mixers, with backward migration for < 1.7f patches.


It's still a work in progress, so don't hesitate to test it (fw attached) and to suggest improvements !
For example the Parametric Euclidean Swing is still at an experimental stage.

 Edit :
now that my hidden agenda is revealed, i had to update https://preen-web-ui.vercel.app as well  :)

« Last Edit: November 17, 2026, 08:48:30 PM by Toltekradiation »

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2270
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #5 on: November 18, 2026, 06:13:45 AM »
Thanks for the details  :)

It seems some stuff are work in progress and others are not.
I won't include work in progress code in the firmware.

I'm really interested in some of your improvment in the list: FX , dynamics & saturation.

Maybe we could think about a NRPN for firmware version or per supported feature. One bit-field value.
So that the nice editor can adapt in case not everything is implemented for feature that adds parameters.

Is the editor open source BTW ?

Toltekradiation

  • Administrator
  • Sr. Member
  • *
  • Posts: 293
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #6 on: November 18, 2026, 07:21:15 AM »
Yes the web-ui is open source : https://github.com/pvig/preen-web-ui
there is even a small java api for it, to handle patch sharing : https://github.com/pvig/preen-web-api

a nrpn for supported features is a good idea.


Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2270
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #7 on: November 19, 2026, 06:15:47 PM »
Thanks i'll take a look at this nice editor  :)

I'm looking into integrating some of your changes.
Why did you link compressor and saturation, and not having them independant ?

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2270
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #8 on: November 20, 2026, 09:24:54 PM »
I pushed 4 PRs to your repo for the web editor.
They're all against master and should merge without conflict.
Take the algo one first, that's the more imporant, at least the allAlhrithms.ts change.

My PR are mostly AI generated from precise plan i first make, let me know if that's a problem for you.
I can maintain a parallel fork.

I have 2 other ones :
. A quite large UI one with modiable fonts and 3 choices of page width with all component resizing correctly.
. An other one that add firmware capability as NRPN sent by the preenfm. So that your latest firmware addition can be hidden by the editor.
I'll rebase later those on your repo because it seems they have conflict with the 4 PRs above.

(A version with the 6 Prs together is available here for preview)
« Last Edit: November 20, 2026, 09:37:38 PM by Xavier »

Toltekradiation

  • Administrator
  • Sr. Member
  • *
  • Posts: 293
    • View Profile
Re: Preenfm3 Fx2 : some rework
« Reply #9 on: November 21, 2026, 10:13:19 AM »
Hi Xavier, PR merged, thanks !

next PRs are very welcome.

I have no problem with AI coding, as that's i'm doing as well these days, the web-ui was done to test the ai capabilities.
My latest modifications on the fw were done by agents too.

I linked compressor with saturation to get some useful presets and keep it simple,
but it may be better to have more control i reckon.

The mipmap tables are interesting, did you check it out ? it clean the whole preen sounds, by reducing aliasing on waveforms.