Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effects #73

Open
10 of 15 tasks
jpcima opened this issue Feb 21, 2020 · 16 comments
Open
10 of 15 tasks

Effects #73

jpcima opened this issue Feb 21, 2020 · 16 comments
Assignees
Labels
new feature Feature additions and requests

Comments

@jpcima
Copy link
Collaborator

jpcima commented Feb 21, 2020

Let's fill in some info regarding effects as we figure out the implementation and controls, on wiki as well as here.

@jpcima
Copy link
Collaborator Author

jpcima commented Feb 21, 2020

Add image: Bitred reference vs Oversampling 2x
bitred2x

@jpcima
Copy link
Collaborator Author

jpcima commented Feb 22, 2020

Regarding the strings effect, see
Simulation of piano sustain-pedal effect by parallel second-order filters

@paulfd
Copy link
Member

paulfd commented Feb 26, 2020

For the Gibbs type effect on these, and also for LFOs synthesis, I recall something I studied at one point from this article right here. Searching back for it I found a master's thesis which might be more pedagogical in the approach. The required polynomials could possibly be tabulated.

I'll cross-post this in the LFO discussion.

@jpcima
Copy link
Collaborator Author

jpcima commented Feb 26, 2020

It seems another instance of the same processes used in music DSP, expressed in different ways.
(you know, the usual 😁)
I list you a few refs that are oriented towards this problem.
Minimum phase band limited step
Polynomial band limited step
Band limited ramp

I've also posted a plugin that contain some slightly improved implementations of these effects.
(has a basic step function and oversampling)
https://gitlab.com/jpcima/bitcrusher

@jpcima
Copy link
Collaborator Author

jpcima commented Feb 26, 2020

To elaborate on this matter of bitcrushing/lofi effects:

Anti-aliasing is not critical in these effects, they are a part of the tone. I have it, Cakewalk has it also.
The thing is that antialising behavior is not controlled in such a way that both of effects match, you can hear a very evident tone difference between both, despite the waves more or less matching visually on the scope.

For now, the "big boss" of effects is the strings one.
It'll be nice if RGC can provide info of what this one really is.

I suspect it to be in fact a convolution with a fixed IR signal. As I tested it on simple signals, the parameter strings_number did not seem to affect anything. The piano paper above links a webpage with a IR file of Steinway piano.
http://research.spa.aalto.fi/publications/papers/dafx08-pedal/

(on this topic, there exist also an IR convolver effect in the lot, that accepts a sound file.)

@jpcima
Copy link
Collaborator Author

jpcima commented Mar 2, 2020

The strings effect is a sympathetic string resonator.

To make it, one has to instantiate N waveguide string oscillators in parallel.
It's physical models which are tuned starting at the note C1 and up from there.
There are as many of them as the opcode strings_number indicates, 36 being typical.
strings_wet_onccN (0-100) sets the strength of resonance.

The dry signal is fed as excitation signal into the waveguide oscillator bank to make them generate, and then outputs are summed with the dry signal.

The harmonics have a more of less strong damping, so the input must not be applied equally, it must have its gain adapted by harmonic.
Secondly, a sound should only strongly resonate with other strings which are harmonically related to its fundamental.

Jaffe 1983
Smith 1993

@paulfd
Copy link
Member

paulfd commented Mar 8, 2020

I guess this is closed by #84 or do you want to keep it to track additional effects?
This string resonator sounds interesting.

The harmonics have a more of less strong damping, so the input must not be applied equally, it must have its gain adapted by harmonic.

If I had to and without checking the state of the art, I would do string resonance by creating a "basis" of resonance for each note in the piano using their reference frequency, interpolate this over frequency, and then use the spectrogram as a impulse to act as a gain on the basis components.

@jpcima
Copy link
Collaborator Author

jpcima commented Mar 8, 2020

do you want to keep it to track additional effects?

Yes.

If I had to and without checking the state of the art, I would do string resonance by creating a "basis" of resonance for each note in the piano using their reference frequency, interpolate this over frequency, and then use the spectrogram as a impulse to act as a gain on the basis components.

It sounds an interesting idea. Do you want to extract this information based on existing piano sample sets?

@alcomposer
Copy link
Collaborator

alcomposer commented Mar 8, 2020

srings is very much a piano resonance opcode.

It would be exciting to have in future either a custom_mode for strings or a strings_custom opcode, which would allow setting custom tuned frequencies of multiple waveguides. (To allow Sitar etc sort of resonance)

@jpcima
Copy link
Collaborator Author

jpcima commented Mar 8, 2020

Below are measurements of the disto effect for depth=0 (default) to depth=100.
This is an amplitude transfer function. (with X input signal and Y the output)

It can be seen the function is symmetric but it works like a schmitt trigger.
When the function goes over ±3/4 amplitude, it switches to the other curve.
The steepness of this curve is varied by disto_depth.

Also there's a spiral effect at the start, which may have something to do with filtering part of this effect. (disto_tone 0-100)

dataset.zip

default
depth=0
depth=25
depth=50
depth=75
depth=100

@jpcima
Copy link
Collaborator Author

jpcima commented Mar 26, 2020

I attach the disto curves, cleaned and both parts separated, to use it for curve fitting.
Link of model to use: https://en.wikipedia.org/wiki/Generalised_logistic_function

disto-separated.tar.gz

@jpcima
Copy link
Collaborator Author

jpcima commented Mar 27, 2020

An initial curve fit with 3 parameters. Not too bad for a start.
curvefit.py.gz
curvefit2.py.gz

@jpcima
Copy link
Collaborator Author

jpcima commented Mar 31, 2020

Attaching the current experimental fverb
fverb5.dsp.gz
fverb4.dsp.gz
fverb3.dsp.gz
fverb2.dsp.gz

@paulfd paulfd added the new feature Feature additions and requests label Apr 2, 2020
@jpcima
Copy link
Collaborator Author

jpcima commented Aug 6, 2020

We have 4 new entries recently

  • comp
  • gate
  • disto
  • fverb

@paulfd, feel free examining any of these if you want

Regarding fverb, there remains to do:

@ephemer
Copy link

ephemer commented Sep 7, 2021

Hi @jpcima @paulfd, could you elaborate on how these effects are to be used in sfizz?

We are building sfizz as a standalone (non-VST etc.) library and would like to use the same set of (piano) samples in two ways: one with reverb with certain parameters and one without (or with different reverb parameters).

From what I saw in #84 these effects seem to be specified in the sfz file. Is there a way to add/alter them programatically as well via the public C/C++ API? If not, are there any examples you could point me to of how to correctly set up the parameters in the sfz file(s)? (The reverb effect in particular would be extremely useful).

@paulfd
Copy link
Member

paulfd commented Nov 9, 2021

Hi, sorry I missed this comment. There is no way to add effects programmatically for now, although the OSC interface might be extended for this (if you feel like it you may do so !).

In an SFZ file, here is a very minimal example adding the fverb effect on the main bus.

<region>
    sample=*sine

<effect> 
    type=fverb
    reverb_input=100
    reverb_dry=100
    reverb_wet=10 

We could probably have better defaults for the reverb, but these will make it sound :) You can consult sfzformat.com for other effects and their opcodes. Right now there are no effect modulation but these will come.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Feature additions and requests
Projects
None yet
Development

No branches or pull requests

4 participants