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

the default "pitch wheel -> fine tune" modulator can't be removed #154

Closed
derselbst opened this issue Feb 28, 2016 · 9 comments · Fixed by #590
Closed

the default "pitch wheel -> fine tune" modulator can't be removed #154

derselbst opened this issue Feb 28, 2016 · 9 comments · Fixed by #590

Comments

@derselbst
Copy link
Member

The default modulators are normally "turned off" by adding an identical instrument-level modulator and setting the amount to 0. This works in FluidSynth for the other default modulators I have tested (although I haven't tested all of them). However, for the "pitch wheel -> fine tune" modulator, this isn't working correctly.

I have created a test SoundFont (attached) containing three notes, each with a different modulator setup:

Note: F#6
Local modulators: none
Resulting pitch bend:
Audigy 2 ZS: normal
FluidSynth: normal

Note: G6
Local modulators:
1. Source1=Pitch Wheel (Linear, Bipolar, +)
Source2=Bend Range (Linear, Unipolar, +)
Destination=Fine Tune
Amount=0
NOTE: this should "turn off" the default "pitch wheel -> fine tune" modulator, resulting in pitch bend having no effect.
Resulting pitch bend:
Audigy 2 ZS: none
FluidSynth: normal <-- should be "none"

Note: G#6
Local modulators:
1. Source1=Pitch Wheel (Linear, Bipolar, +)
Source2=Bend Range (Linear, Unipolar, +)
Destination=Fine Tune
Amount=0
NOTE: this should "turn off" the default "pitch wheel -> fine tune" modulator, resulting in pitch bend having no effect.
2. Source1=Pitch Wheel (Linear, Bipolar, -)
Source2=Bend Range (Linear, Unipolar, +)
Destination=Fine Tune
Amount=12700
NOTE: this should create an inverted pitch bend (i.e., pitch wheel up will cause the pitch to bend down, and vice versa).
Resulting pitch bend:
Audigy 2 ZS: inverted
FluidSynth: none <-- should be "inverted"

The attached MIDI file and OGG recordings feature all three of the above notes played in succession with the pitch wheel bending downward, back to 0, upward, and back to 0. You can hear the aforementioned differences clearly when comparing the Audigy 2 ZS and FluidSynth recordings.

Reported by: mrbumpy409

Original Ticket: fluidsynth/tickets/156

@derselbst
Copy link
Member Author

So apparently you can't use leading spaces on a line in these bug reports. Sorry if the report looks a little messy as a result.

Original comment by: mrbumpy409

@derselbst
Copy link
Member Author

Hi, Christian

Inside FluidSynth,default 'Pitch Wheel modulator have a destination generator called 'Initial Pitch' (and not
'Fine tune' generator as you assume). This generator is
internal to FluidSynth.

This default modulator is specified in 'SF2.01 p 57 section 8.4.10'. The issue is this 'Initial Pitch' generator is
not enumarated as generator in the specification 'SF2.01'.
Therefore it is actually impossible to substitute this default modulator by another modulator comming from a soundfont.
This default 'pitch Weel' modulator remains always active.
I agree this isn't a correct situation.

In the above test, both modulators modulate pitch note at the same time; i.e the default 'Pitch Wheel to initial Pitch' and
'Pitch Wheel to Fine tune'. Probably in last test G#6 both modulators cancel each other.

Possible acceptable patch to FluidSynth:
I think FluidSynth needs to handle 'Pitch wheel soundfont modulator' to disable the default 'pitch wheel modulator' when the destination of this 'Pith wheel soundfonts modulator' is a generator related to pitch.

regards

Original comment by: jjceresa

@derselbst derselbst removed the 1.0 label Jul 3, 2017
@derselbst derselbst added this to the 1.1.7 milestone Aug 11, 2017
@derselbst derselbst modified the milestones: 1.2, 1.1.7 Sep 1, 2017
@derselbst derselbst modified the milestones: 2.0, 2.0-post Dec 29, 2017
@derselbst derselbst removed this from the 2.0-post milestone Jul 8, 2019
@jjceresa
Copy link
Collaborator

jjceresa commented Nov 4, 2019

Be able to cancel default modulator (sfspec24- p44 - 8.4.10 MIDI Pitch Wheel to Initial Pitch ) is legitimate and useful when one wants to use the MIDI Pitch Wheel controller to modulate another generator.
Actually in fluidsynth this is impossible to do. This would be possible if the soundfont spec. had not forgotten to enumerate properly this Initial Pitch generator in the table (sfspec24 - p44 - 8.1.2 ).

To fix this issue, I see 2 solutions:

1)We decide that Initial Pitch generator actually internally assigned (GEN_PITCH) to number 59, must be documented and published as a valid generator usable in soundfont File.

2)We change the default modulator destination Initial Pitch to destination fine tune (i.e GEN_PITCH replaced by GEN_FINETUNE).

Solution 2 seems preferable but it isn't obvious because GEN_FINETUNE unit and min max range values aren't the same as for Initial Pitch.

Opinions ?.

@derselbst
Copy link
Member Author

useful when one wants to use the MIDI Pitch Wheel controller to modulate another generator.

Unconventional, but with the benefit that pitchwheel is the only controller with 14 bit precision.

To fix this issue, I see 2 solutions:

Solution 2) has the benefit it will be usable with existing (and unmaintained) soundfont editors. However, using "fine tune" as destination generator whereas the spec requires "initial pitch" isn't obvious indeed. So I think, whatever solution we agree on, it must be correctly documented anyway.

GEN_FINETUNE unit and min max range values aren't the same as for Initial Pitch.

... and fortunately for fluidsynth this doesn't seem to matter (?).

In any case, JJC you are welcome to draft a PR :)

@jjceresa
Copy link
Collaborator

jjceresa commented Nov 7, 2019

Unconventional, but with the benefit that pitchwheel is the only controller with 14 bit precision.

Yes, unconventional, but really useful as many MIDI controller keyboard have natively this hardware
immediately accessible (by hand) when playing performance. A skilled pianist (not necessarily professional) have frequently his 2 hands and at least one foot busy while playing. Ease access to these CC device, and ease routing of these devices, while playing is a very important aspect.

Solution 2) has the benefit it will be usable with existing (and unmaintained) soundfont editors.

Yes, conversely solution 1) which is straightforward, have the boring drawback to force soundfont designer (having the habit to designate 'fine tune') to maintain two set of soundfont , because of the new generator '59'.

Also, for (unmaintened) soundfont editor that only presents to the designer named generator (eg "Fine tune") instead of numbered one ; solution 1 will never be useful !

GEN_FINETUNE unit and min max range values aren't the same as for Initial Pitch.
... and fortunately for fluidsynth this doesn't seem to matter (?).

Assuming solution 2 option, I haven't yet look if extending max,min of GEN_FINETUNE to the actual values of GEN_PITCH will cause an issue. For now the only relation I see with GEN_FINETUNE is RPN_CHANNEL_FINE_TUNE which have 14 bit values.

I am torn between solution (1) and (2)....!

@mawe42
Copy link
Member

mawe42 commented Nov 7, 2019

I would vote got go with option 2., mainly because that way Fluidsynth would behave just like the Audigy 2 ZS (according to the original bug report by Christian Collins). As the soundfont spec doesn't help us here, I think taking the actual hardware implementation as a guideline is the next best thing.

@jjceresa
Copy link
Collaborator

jjceresa commented Nov 8, 2019

Option 2 seems a good choice. It is compatible with RPN_CHANNEL_FINE_TUNE which have 14 bit values (like Pitch Wheel). Also, I don't see that this will break something in FluidSynth.

Also, I realized that option 1 isn't not good because actually internally Initial Pitch (GEN_PITCH) isn't intended to be modulated. May be this is why Initial Pitch isn't enumerated in the SF specification.

@jjceresa
Copy link
Collaborator

jjceresa commented Nov 8, 2019

Assuming solution 2 option, I haven't yet look if extending max,min of GEN_FINETUNE to the actual values of GEN_PITCH will cause an issue.

I have looked this. It looks fortunately that max,min ranges for both GEN_PITCH and GEN_FINETUNE aren't used.

@derselbst
Copy link
Member Author

derselbst commented Nov 8, 2019

Attaching Christians original test file.

pitch bend modulator test.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants