-
Notifications
You must be signed in to change notification settings - Fork 258
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
In a modulator, "No Controller" as Src1 shouldn't cancel Src2 #1068
Comments
I made other tests and it appears that using a trick, changing "no controller" by "Note-on velocity", the CC value specified at the second input is taken into account: So maybe the previous modulator, using "no controller" as input 1 and "CC" as input 2, has badly been rejected by Fluidsynth (bug 1). And the final configuration I wanted to have is: Changing CC18 to CC20 has no impact on the fine tuning (bug 2). Maybe the linked modulators are not implemented in Fluidsynth? I read some discussions on GitHub but this is not clear to me. |
That is a very old bug that was fixed on my branch and I completely forgot to mention this. Sorry. The bug is in To fix this bug: 2)There are a dependency in fluid_defsfont.c |
More notes not related to this issue: In fluid_mod.c-fluid_mod_get_value().
|
@davy7125 My first message is related to what you call bug1.
Yes, the bug1 is: selecting
|
Oups, I made another typo mistake. 1)fluid_mod.c-fluid_mod_get_value()-Line 456: should be ( |
Thank you for your fast and detailed answer. I changed the title of this ticket to match the actual behavior: "no controller" as source 1 shouldn't cancel source 2 in a modulator.
Do you confirm that:
Maybe you are speaking of an intermediate state: in the previous example with a linked modulator, the input 1 that is "Modulator 2" in modulator 1 should have been considered to be "1" since linked modulators are not implemented, enabling thus the use of CC 18 to modify the fine tuning but disabling CC 19 and CC 20. not implemented in fluidsynth master: is it implemented somewhere else? I would be very interested. |
That is the right title. Actually "no controller" as source 2 (amount source) behaves like 1.0f enabling the use of source 1.
Confirmed. Linked modulators are not implemented in master.
I started a branch 'linked-modulators' but it is not finished. If you are interested you must be aware of lack of detail in the actual SF specs. For example if the output of a modulator 2 is connected to input 1 of modulator 1 (your example above), then the input 1 mapping stage (unipolar/bipolar, type of curve) cannot be taking account and should be bypassed. In others word only |
Please you forgot "shouldn't" in the title. |
Maybe this discussion is interesting for specifications: And possibly how I implemented it also. Here is a modulator: When the output of a modulator A is added to input 1 of another modulator M, the possible range [minA ; maxA] is also sent. This is maybe an interpretation of the specifications that needs more discussion but this system is quite handy when linking modulators: the ranges are under control. |
I just committed an incomplete fix as suggested by JJC: ef1f409 It's incomplete, because
|
I must admit that I'm lacking motivation and time to fix this properly. Couldn't we just detect this situation upon loading the SF and silently swap the first and second modulators? The worst I can think of is that someone uses the voice API to get the modulators of a voice and then finds that mod1 and mod2 have been swapped. I don't consider this to be a problem though. |
Coming back to this, because we got a related bug report. Previously, the issue observed by Davy was caused by this code: fluidsynth/src/synth/fluid_mod.c Lines 443 to 455 in ce97c6d
As JJC has explained earlier, it caused src2 to be not being processed. After digging through the spec again this behavior is incorrect. Also, there is no such special handling that it should return zero if both sources are set to "No Controller". I've created a PR. I am not entirely sure whether it would cause problems for |
FluidSynth version
Describe the bug
I wanted to create a modulator using two CC values to compute an output, this output driving the fine tuning parameter. However it wasn't working and I discovered that fluidsynth accepts CC values in the first input of a modulator only, not the second one.
With Polyphone, here is the working configuration:
This one is not ok:
This could be also a bug in Polyphone when creating the file but this is unlikely since internally, both inputs of a modulator have the same structure (SFModulator):
Steps to reproduce
Here is a minimal soundfont showing the problem, you will need a keyboard that can change value of CC20 to listen to the result:
example.zip
Changing CC20 can increase preset named "OK" by an octave, but preset named "KO" is not modified by CC20.
The text was updated successfully, but these errors were encountered: