preenfm Forum
PreenFM => preenfm2 and preenfm3 => Topic started by: Toltekradiation on April 23, 2021, 10:48:58 PM
-
hi guys,
i lately did some code in the fx department,
it lead to something i quite like, so i thought i should share it.
First, there is a fx bus on Mix page 3, one can send each timbre to the bus with a send parameter.
Then the bus is send in a "harmonic tremolo" effect, which does soft modulation, hard to explain.
Then it goes in a comb filter, which has an envelope follower and a lfo.
These two filters can be tuned with 2 new Global pages in the Mix section.
it is quite inspired by the mighty fl-201, which do wonderful 3d things to a mix.
https://www.eventideaudio.com/products/legacy/fl-201-instant-flanger
i'm aware that it suffer from aliasing, but right now, the only cure i know for this is oversampling, which would use much more cpu and memory.
So, yes, it is what it is : a crude digital attempt for an instant phlanger, but i found it quite nice if carrefully tuned :D
for more details, here is the readme :
https://github.com/pvig/preenfm3
find the .bin as attachment : it is build over the 0.107 code.
(edit : found bug, updated .bin)
-
Awesome idea! I'll try your code out later this weekend.
Can you post an audio file example?
Regarding aliasing, is it possible that some judicious use of a one pole LPF could ameliorate the aliasing?
-
ok, here are two quick snippets :
https://www.dropbox.com/s/fzdxoqjvf0r4ml8/comb_snippet1.mp3?dl=0
https://www.dropbox.com/s/07bxiohnd05jh1o/comb_snippet2.mp3?dl=0
About aliasing, there is already some low pass filters in the feedback loop, and an hermite interpolator as well.
I fear it's not enough to get hi quality audio.
There is also different kind of artefact that are not aliasing, but glitch !
Fortunatelly, it may be good enough, depending on your needs ;)
-
here is another, more useful, audio file example :
https://www.dropbox.com/s/q8mh1cw088fkhkx/comb_snippet6.mp3?dl=0
in this one, focus is made on audio triggering envelope, which is the point in this effect imo.
-
Oh Cool. that's great you could make some progress with those global FX :)
Thanks a lot for sharing.
I'll have a look at your code a bit later when i have more time.
-
the code is now gone in a mutation state again :
i'm removing the feedforward path of the comb to get closer to the fl-201 design.
i did not really feel usefulness of it anyway,
so it allow to double the time of the feedback path : the comb can be more used as a delay.
-
Let me know when you have something ready to try :)
Thanks
-
Hello Xavier,
I'm still trying to get a good FL201 emulation for the preenfm3: it gets closer but it will remain an approximation anyway.
Anyway, here's the current .bin, usable for some weird chorus reverb :D
The code is also a bit cleaner than before.
-
Tried out the global FX. very cool. I am having fun with the tremolo.
-
glad you like it ! :)
for the delay part of the fx : i'm still trying to figure out how to make it sound nice, lately i tried with some ping pong effect but with not too much satisfaction.
i keep digging out.
-
After many time tweaking the fl-201 attempt ...
... i had to make something more useful ::)
So, with the help of the internet, i did an adaptation of the Jon Dattoro reverb algorithm!
(https://ccrma.stanford.edu/~dattorro/EffectDesignPart1.pdf)
My implementation is a bit noisy when you modulate it, but it's quite low on the cpu usage :)
So here is the .bin if one want check it out.
-
WOW....
That's super interesting and really a great job.
Congrats ! :)
That would be great to have that in the firmware.
Current implementation as you said is noisy even if i don't modulate the params.
Do you think there may be some saturation somewhere ?
I may have time in july to take a look at your code :)
-
hello Xavier,
thanks for the kind word ! :D
i thought that saturation problem was fixed, i will try to make it better.
i had some troubles getting the levels right in the reverb tank loop.
To solve this issue, i use to lower the timbre volume when saturation happen, but it's not an ideal solution.
It seems i have to learn something more..
Hopefully, there is great help on the internet : there is the valleyaudio Plateau code, which use the same algorithm :
https://github.com/ValleyAudio/ValleyRackFree/tree/v1.0/src/Plateau
It sound great ! https://valleyaudio.github.io/rack/plateau/
-
Nice! I am super excited to try this out. Any warnings/suggestions re: the settings?
-
Are the two Master FX in series or Parallel? and how would I control the mix between the two? I see the wet/dry option in the Mix page, but was not sure if it was both FX or just the reverb. seems like both...
-
the previous fl-201 implementation has been melt into the new one.
there is only one left.
It remains in the envelope section though :)
i updated the readme for the knob overview :
https://github.com/pvig/preenfm3
-
here is a version with the output level of the reverb a bit lower, as it could clip sometimes..
There is also different interpolation in this one : i could finaly find the allpass interpolation formula in the part2 of the Dattoro paper !
https://ccrma.stanford.edu/~dattorro/EffectDesignPart2.pdf
it sounds smoother when modulation is applied.
-
@Xavier, you were right, there were a nasty bug in one of the allpass filters which did distord in an ugly way :-[
sorry for that, i had some serious earing fatigue ::)
fortunately, it's fixed now :
the reverbaration is much clearer and sound quite close to the vst :D
the decay is also much longer.
-
@Xavier, you were right, there were a nasty bug in one of the allpass filters which did distord in an ugly way :-[
sorry for that, i had some serious earing fatigue ::)
fortunately, it's fixed now :
the reverbaration is much clearer and sound quite close to the vst :D
the decay is also much longer.
Wow... now that sounds GOOD ! very very good !!!
That really adds something great to the preenfm3.
I really don't know how you did that, i have to look at the code !
Not sure I understand all the 12 tweakable params ;)
-
:) happy to hear you like it too !
the Dattoro Reverb blocks are :
input > lp & hp > pre delay > input diffuser > reverb tank ( (allpass>delay>lp>allpass>delay) > (allpass>delay>allpass>delay) ) > output from various point in the tank
Global page 3 : Master Fx 1
Pre delay : Time of pre delay
Pre delay Mix : the input diffuser is fed with a mix of audio input and the pre delayed input.
Diffusion : set the input & tank diffuser allpass coefficient
Decay : tank feedback
Size : size of the tank delay
Damping : cut off of the tank lowpass
Global page 4 : Master Fx 2
Mod Speed : lfo speed (4 of them)
Mod Depth : lfo mod depth, modulate the 4 delay allpass in the tank
Env Mod : envelope mod depth, make the tail pitch shifting up or down
Threshold : audio level at which envelope trigger
Input Tilt : input filter from lowpass ~0 to high pass ~1
Env Feedback : feedback (decay) modulation with the envelope
the envelope release rate is relative to the decay param.
About the envelope, there is an annoying glitch while in the envelope attack phase, i will try to find a workaround for it..
-
Very excited about this reverb.
-
Too bad i don't have time to take a deep look in the next weeks.
I would really like to include it in the firmware, but may be with less parameters, maybe one page.
Would be great also that it does not use CPU if all signals are 100% dry.
That's my plan for when i have time :)
-
That would be awesome!
-
hello,
ok, i will try my best to keep only 6 parameters.
Maybe with some kind of presets or something.
-
Here it is !
- Most of the bugs are gone (should be)
- Auto bypass of most of the reverb code when there is no send set and the reverb tail is over (if any).
- One parameter page :
* Preset select
* Input Tilt
* Pre delay
* Pre delay Mix
* Mod Speed
* Mod Depth
For now there is still a second page to handle the preset parameters if one want to make new preset.
* Size
* Diffusion
* Damping
* Decay
The current list of preset go from extra small to extra large volumes, each in dark, warm and bright version, and then some more..
-
Dude, this is amazing work!! You never fail to impress.
-
8) Thanks!
-
@Toltekradiation I noticed on boot, if I go to the 4th screen for Global (Master fx 2) that items 5 and 6 in the list show a 214748 (instead of a text label like decay or something) with a value of 214748. However, if I turn knob 5 or 6 and cycle thru the Global pages, the text next to 5 and 6 on Master fx 2 go blank and the value shows a normal number (between -1 to +1).
I think that some variables for sets 5 and 6 in the Master fx 2 are not initialized with a zero ro something on startup. Note, it does not seem to affect the sound when its weird. The reverb sounds normal.
-
it does not matter anymore : i added two more parameters on the Master fx 2 page ;)
this page is not supposed to live forever anyway : it's only to allow making presets easier.
Here is another .bin with a different set of parameters for the presets, the main parameters (Master fx 1 page) now are :
Preset
Group of parameters :
Size
Lfo speed
Lfo Depth
Decay
Diffusion
Notch Base
Damping
Pre delay
Time of pre delay
Pre delay Mix
the input diffuser is fed with a mix of audio input and pre delayed input.
Filter Base
Input filter hp/lp
Filter Width
Notch Spread
Input is filtered with a 4 pole allpass filter
I hope it's a more useful combination :)
-
cool. Just installed and played with it a little and it seems to work well.
-
it has some flaws, i fear ; the reverb saturate too easily (depending on the sound used).
i'm working on this issue, but with not much luck so far.
-
I was coming across the saturation, I just dial down the sends or the instrument levels.
Maybe insert a limiter before the reverb.
Feature request: If you ever get a chance to add a pitch shifter in a feedback loop to the reverb with variable attenuation and pitch (Shimmer), that would be cool.
-
i did improve the reverb headroom with different kind of hp&lp filters, same as made by Valley audio, i think it's ok now (attached file).
@matrix12x, sorry for the feature request, i think i will let it as it is, my attempt for shimmer effect was not very convicing.
But if you wish, don't hesitate to set a reverb preset while all parameters are there, i would add yours to the list.
Last step is to allow saving the reverb parameters in the mixer file format, but i have troubles making it work...
-
Thanks for the reverb work !
I'll have a look on friday (day off :) ).
-
Thank you Xavier.
There is a problem with code structure : the FxBus class is not in the right place, there is some refactoring to be done...
-
here is a version with complete reverb parameters, for preset design ( sorry for that, there were 3 missing parameters ) + reverb main level adjustment.
-
Thanks :)
Is the latest version available from your git repo ?
-
i did not sync my repo: it's now done :)
-
Thanks a lot !!
I played with the reverb today and that's really awesome to be able to have a reverb inside the preenfm3.
Congrats and thanks for the hard work :)
I worked on your modification with the idea to integrate it in the firmware.
The branch is here, and you can have a look at the latest commit (https://github.com/Ixox/preenfm3/commit/e4dd2368f32a85fb755c74c9a9a091cfadf791c8?w=1) to see the difference with your repo.
https://github.com/Ixox/preenfm3/commits/FXGlobalFX-PVig
I hope you won't be disapointed but for the moment, i only kept the preset in the global param.
I added a volume and an output slection.
These 3 values as well as the send for each instrument are saved with the Mixer on the SD card.
-
I changed my mind a little.
I plan to have an option in MENU>CONFIG : "Reverb param".
If set to "All", all params will show up in the global settings.
And i will save all params with the mixer and not the preset.
-
hello Xavier,
many thanks for the code integration :)
your additions are very useful !
But, yes, i agree that linking all reverb parameters to the mixer does make sense.
cheers !
;D
-
I had some time today and there's now an option to show all params :
MENU>Config>Reverb params : Show or Hide.
Default value is Hide.
So out of the box, you only see the reverb preset.
But all params are available for users who wants that, after modifying the config.
My commit is here :
https://github.com/Ixox/preenfm3/commits/FXGlobalFX-PVig
Let me know if you see anything strange.
Thanks :)
-
The hide/show solution is a great idea but some troubles so far :
well, no luck, the reverb do not produce any sound on my pmf3, i could not spot the problem so far :P.
About the preset param, i think it may be confusing for users :
one may not understand that changing preset will change some, not all, parameters of page 2 & 3 (if in display all mode).
I would separate clearly the two modes : no preset choosing in user mode.
If you wish to go this way i can redefine the presets, with all parameters.
-
Yes there's a sound problem with the current version !!! :o
What did i change at the last minute ?? Will try to find out.
When changing the preset, i apply all default values before the preset specific param.
So all params are reset if they were all changed.
-
I pushed a fix.
I moved where the fxBus.init() is called, it works better :)
-
I did a pull request with some fix for the parameter value change.
while i'm at it, i found a bug on config save : it freeze the synth on save, i could not get much information on what happening : in debug mode, the error stack is :
Thread #1 [main] 1 [core: 0] (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)
HardFault_Handler() at stm32h7xx_it.c:106 0x80351f6
<signal handler called>() at 0xffffffe9
dir_find() at ff.c:2 482 0x806719a
0x0
-
Thanks for the PR.
The error is when you save the config ?
It works here.
Do you have a pfm3/settings.txt file on your SD ?
Can you save preset and mixers without problem ?
the dir_find in the stack is weird.
-
yes i can save mixer, default mixer, presets without problem.
I did not have pfm3/settings.txt on the SD,
so i made an empty one to test : freeze on config save
after reading the SD card again, the settings.txt is gone ???
so i got a working setting.txt from a pfm2, put it to the SD, reboot, save the config again : freeze again, and the settings.txt disappeared..
yes, quite weird.
-
The settings file is removed than save again.
https://github.com/Ixox/preenfm3/blob/master/firmware/Src/filesystem/ConfigurationFile.cpp#L90
So i assume it fails when saving after having removed the file.
But i don't know why.
-
You can try with windows to copy your all pfm3 directory on your SD card.
Then rename the old one "pfm3.old", and the new one "pfm3".
Just to see if that's not the SD where it tries to save the file.
Or backup your SD card, format it and copy back your files.
Would be interesting to see if that makes any change.
-
thanks for the ideas.
i tried but it did not solve the issue, even with deep formatting with the official SD formater.
I will try again tomorrow with a minimal SD card content.
-
hmm, this problem is really weird :
i took another SD card, deep formated it, then put the official SD content (pfm3_SD.zip) on it.
With this SD, i could save every kind of files without any problem, ... but not the config ???
if i follow the action in debug mode, it crash on line 89 in ConfigurationFile.cpp
well, i can still edit the SETTINGS.TXT by hand, so it's not such a big deal ::)
-
2 things i have in mind :
1. Make sure you have correctly merged Menu.h and Menu.cpp files.
2. Clean the project & Rebuild ALL so that you don't have old enum in some object file.
I'll make a firmware binary tomorrow to make sure we use the same.
-
Thanks for the support :D
you found the problem : i have some trouble with the cleaning of my project :
with the latest v0.107 build from github, everything work perfectly.
but with my local sources, even if i clean before building (Project>Clean in STM32CubeIde), i get the issue.
I work currently on a copy of your branch FXGlobalFX-PVig, which i only slightly modified.
Maybe I have a small drift in my project configuration, i will try to find out what's wrong.
Thanks !
-
I built a release with the reverb : v1.08
See more details here :
https://github.com/Ixox/preenfm3/releases
Feedbacks are welcome,
-
Hello Xavier,
i think there is some bugs.
In the preset recall :
In my version, some values were smoothed on preset change ; that part of the code was called continuously to make it happen.
In your integration, you do call FxBus::paramChanged() once on preset change, so the smoothing code should be removed.
here is my commit about it :
https://github.com/pvig/preenfm3/commit/fa6be48fb8f49bd753005f473e1220ad24f88ff9
About the predelay time, lfo speed values,
i did some stupid code mistakes :-X, so these value change does not work anymore.
here is the commit :
https://github.com/pvig/preenfm3/commit/1ebce476547bbc72352021a21a66d388d906fc7a
While i was at it, i changed the order of some parameters in the reverb pages, i think it does more sense :
https://github.com/pvig/preenfm3/commit/bd56ea39c794f8f8ec84d0795f42096f0f69b2a6
-
No problem ;)
I'll make an other one with your bug fix.
Thanks a lot for the feedback !
Do you think you can get the latest master branch and make a pull request with your bug fix ?
If not i'll integrate myself, no problem.
-
ok, pull request done :)
-
Haha... That was quick.
Thanks a lot :)
-
1.08a is available with those fixes.
Don't worry if you find others , this reverb is a big feature ;)