Time scaling curiosity

Negative curve values use y = x^n1
When curve = 0, the fade is linear
When curve = 0.5, the fade is Hann
When curve > 0.5, the fade is Hann^n2

This is the relevant part of the code:

(defun simple (g0 g1 curve)
  (cond 
    ((= g0 g1) g0)                    ; amplify
    ((and (> curve 0)(< curve 0.5))   ; +ve curve less than 0.5, lin to cosine
      (let ((curve (* curve 2)))
        (sim 
          (mult (- 1 curve)
            (scale-curve g0 g1 (linear g0 g1)))           ; linear
          (mult curve
            (scale-curve g0 g1 (cosine-curve g0 g1))))))  ; cosine curve
    ((> curve 0)
      (cos-curve g0 g1 (- 1.5 curve)))                    ; +ve curve > 0.5
(t (simple-curve g0 g1 (- 1 (* 2 curve)))))) ; -ve curve

From a user perspective, all that you really need to know is:

  • The more negative the curve value, the more “concave” the curve is
  • The more positive the curve value, the more “convex” the curve is
  • When curve = 0, the fade is linear.

In this respect it is similar to the “Curve” slider found on many DJ mixers, but with a much greater range of possible settings than found on most mixers.

What? There’s no “curve” slider thing at all. There’s no intermediate option between Triangle and Hann. Mid–fade Adjust, which is what I’m asking about, is from -100.0% to 100.0%. Triangle (called Fade Up/Down) and Hann (called S–Curve Up/Down) are two separate options in the Fade Type dropdown. You must be using some version newer than 2.2.2.

https://i.imgur.com/W8MKbnl.png

Yes there is. It’s called “Mid-fade Adjust
This is the relevant line of code in the current 2.3.0 development version of Audacity:

$control curve (_ "Mid-fade Adjust (%)") real "" 0 -100 100

In the Audacity 2.2.2 release version, the code is:

;control curve "Mid-fade Adjust (%)" real "" 0 -100 100

Here is the full code in the development version: https://github.com/audacity/audacity/blob/master/plug-ins/adjustable-fade.ny

As I said, I don’t see any intermediate between Triangle and Hanning. The choice between these two is not in the Mid–fade Adjust slider.

Sorry, but the most accurate explanation I can give of how it works, is the code, and I’ve given you links to that twice.
Other than that, please refer to the use documentation: https://manual.audacityteam.org/man/adjustable_fade.html The user documentation is less precise / detailed, but easier to understand.

On the subject of time scale/pitch shift, some sample–level procedures can cause an effect that pitch shifts some sounds. For example squaring all samples, for a centered sine wave, produces a quieter, double frequency, non–centered sine wave. However on a combination of 2 sine waves it distorts by adding another sine wave, so it isn’t a reliable pitch shift. It’s some parameter of the Even Harmonics distortion, I guess. Other procedures may similarly triple sine wave frequency, but also causing distortion on other sounds than single sine waves. That’s because they are just functions that happen to transform sine waves like this. True pitch shift algorithms shift the samples in time.