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

MIDI PB/MW mapped to Scene Pitch, accurate in 12-equal, but not with loaded SCL files... #2125

Closed
ghost opened this issue Jun 16, 2020 · 8 comments
Labels
Feature Request New feature request Modulation Modulation related issues Tuning Non-standard tuning extensions
Milestone

Comments

@ghost
Copy link

ghost commented Jun 16, 2020

Hybrid, bug-like behavior observation / FR to follow.

Surge-NIGHTLY-2020-06-16-e79664b | Win-10, VST3i
MIDI PB/MW mapped to Scene Pitch, accurate in 12-equal, but not with loaded SCL files...

Attached are two presets, one with a rational pentatonic mode embedded, the other without. Since the mode is rational, and not an equal-temperament, there will be different intervals on each starting point in the scale.

Both of these have the MIDI Pitch-Wheel, and Mod-Wheel mapped to modulate pitch-bend, and vibrato, with the former set for an interval of 151 cents (12/11) and the latter at 55 cents (32/31).

With, DX EP without SCL.fxp, which is essentially in 12-tone-equal-temperament, the cents intervals for pitch-bend and vibrato are rendered perfectly accurately, and one can bend up/down a precise 12/11 @151 cents, and when pushing the Mod-Wheel forward, introduce vibrato up to a depth of 32/31 @55 cents.

However, with, DX EP with SCL.fxp, the pitch-bend and vibrato range are rendered sharp when there is a SCL file loaded, the offset, which is likely due to some unforeseen interaction with the way Oscillator Pitch works with loaded SCL files.

If possible, and won't conflict with the way the microtuning implementation currently works, it would be helpful to be able to make these MIDI controller mappings, and have them be able to accurately render the pitch-bend and vibrato intervals in terms of (semi)cents, when SCL files are loaded.

The application here, is being able to setup arbitrary microtonal pitch/vibrato ranges at the Scene Pitch level (global pitch-modulation), and are added (multiplied actually) with the Oscillator Pitch that interact with loaded SCL files.

Presets-PB-MW-issue.zip

Surge-NIGHTLY-2020-06-16-e79664b

@baconpaul
Copy link
Collaborator

So pitch bend is in key space. If you load a scale where the interval between key 60 and 61 is a whole step, press key 60, and have pitch bend 1, and bend up, you will go up a whole step, not a semitone. Is that what you are seeing? When you say 'rendered sharp' do you mean 'rendered sharp compared with the tuning' or 'rendered sharp compared with 12TET`? See what I mean!

@mkruselj mkruselj added Modulation Modulation related issues Tuning Non-standard tuning extensions labels Jun 16, 2020
@baconpaul
Copy link
Collaborator

My comments from Slack on this:

So
7:17
The way surge works is we pass modulated pitch to the oscillator
7:17
The oscillator is responsible for turn in that into the appropriate internal representation of frequency using the tuning tables
7:17
So the oscillator just sees a single number (pitch) and the bend wheel is happened way way way outside (in the synthesizer controls)
7:19
to make it work like you say, Jacky, we would either have to basically re-write the entire modulation infrastructure to do modulation inside the oscillator (which would be a nightmare); pass a vector of pitch modulators which we treat differently based on which modulator property it is (which would be a big change) or ‘reverse’ solve the frequency from the pitch bend into a note to modualate. (So ‘151cents is 1.2 keys from C4 but 3.7keys from G4, in your particular tuning, say)
7:19
The later we actually do to handle absolute mode in a couple of spots. Basically we reverse-lookup the note shift to get the desired frequency shift.
7:20
We could do that with pitchwheel also (edited)
7:20
and that’s what I’d recommend
7:20
But it is not a small change indeed

inline float noteShiftFromPitchParam( float note0 /* the key + octave */, int oscNum /* The osc for pitch diffs */)

src/common/dsp/SurgeVoice.h:61
inline float noteShiftFromPitchParam( float note0 /* the key + octave /, int oscNum / The osc for pitch diffs */)
https://github.com/surge-synthesizer/surge|surge-synthesizer/surgesurge-synthesizer/surge | Added by GitHub

7:22
There’s the reverse solve for oscillator pitch being absolute with a tuning table in place

@baconpaul baconpaul added this to the Currently Unscheduled milestone Jun 17, 2020
@ghost
Copy link
Author

ghost commented Jun 17, 2020

Shall we close this now after the discussion yesterday?

@ghost ghost closed this as completed Jun 17, 2020
@baconpaul
Copy link
Collaborator

nah lets leave it open. I pasted the comments above since it is possible to have the pitchbend work both ways using the solve like I suggested. Just it is a bit of far reaching work.

@baconpaul baconpaul reopened this Jun 17, 2020
@baconpaul
Copy link
Collaborator

So lets keep it on the 'idea we had and might do one day' list! We would need a 'pitchbend mode parameter' though which is another obstacle in our way.

@ghost
Copy link
Author

ghost commented Jun 17, 2020

OK - agreed.

@mkruselj
Copy link
Collaborator

mkruselj commented Jul 9, 2020

We would need a 'pitchbend mode parameter' though which is another obstacle in our way.

Right-click, absolute mode? 🙂

@mkruselj mkruselj added the Feature Request New feature request label Nov 9, 2020
@mkruselj
Copy link
Collaborator

mkruselj commented Feb 8, 2021

This issue is now resolved by adding "Tuning applies to modulation" option @baconpaul did the other day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature request Modulation Modulation related issues Tuning Non-standard tuning extensions
Projects
None yet
Development

No branches or pull requests

2 participants