It works like Mix and Render, but it multiplies instead of adding.

It’s possible to use this to generate a fade with an arbitrary envelope, or to mix a sound with a low frequency sine wave for some sort of an effect.

It works like Mix and Render, but it multiplies instead of adding.

It’s possible to use this to generate a fade with an arbitrary envelope, or to mix a sound with a low frequency sine wave for some sort of an effect.

Can be done in Nyquist Prompt, see … https://forum.audacityteam.org/t/how-do-you-get-amplitude-modulation-tremolo-based-on-a-sample/50674/13

Generally the result sounds harsh & unmusical.

There’s easier ways of doing tremolo.

Multiplying mix is meant to be used in multiple uses.

Multiply with constant = change volume

Multiply with linear function = linear fade

Multiply with cubic spline¹ = cubic spline fade

Multiply with 200Hz sine wave = “harsh & unmusical” distortion

Multiply with 1000Hz sine wave = bigger “harsh & unmusical” distortion

Multiply two different songs = undecipherable effect!!!

¹ can be achieved by generating it in a programming language, then converting to bytes, then converting to a file which can be opened raw by Audacity

Multiply with constant = change volume **[ got amplify for that ]**

Multiply with linear function = linear fade **[ got fade for that ]**

Multiply with cubic spline¹ = cubic spline fade **[got adjustable fade for that ]**

Multiply with 200Hz sine wave = “harsh & unmusical” distortion **[ got ring-modulator for that ]**

Multiply with 1000Hz sine wave = bigger “harsh & unmusical” distortion **[ got ring-modulator for that ]**

Multiply two different songs = undecipherable effect!!! **[ a very rare requirement, but achievable via Nyquist Prompt ]**

Indeed, one of the main reasons for the Nyquist Prompt is to provide a means of performing unusual effects that are otherwise unlikely to implemented. A few other audio editors have a similar feature, such as GoldWave’s “script” feature. or Cakewalk Cal scripts, but I’ve not come across any that can match Audacity’s Nyquist scripting.

I believe Adjustable Fade… only provides linear and sine/cosine fades. While it is possible to duplicate, fade, multiply (must be done with a third party plug-in; Amplify… cannot be used as it doesn’t have a direct volume factor input) by constant and mix to create any polynomial including the four pieces of the cubic spline, not all fades can be done like this and it is sometimes more convenient to multiply with an existing wave instead.

This image shows the result of multiplying by a cubic spline. This result can be stacked in intervals of 1⁄4 its length to produce a continuous tone (as long as the tone frequency is aligned). It can also be stacked in the same intervals but with linearly increasing volume, and this cubic spline has the property of a continuous linear increase in this case. It can be useful for a sample of 0.25 seconds for an audio editor where it’s possible to place notes every 0.0625 seconds.

But how to use this to divide and/or take reciprocal?

```
(div (aref *track* 0)(aref *track* 1))
(divi (aref *track* 0)(aref *track* 1))
(dive (aref *track* 0)(aref *track* 1))
(÷ (aref *track* 0)(aref *track* 1))
(/ (aref *track* 0)(aref *track* 1))
(⁄ (aref *track* 0)(aref *track* 1))
(∕ (aref *track* 0)(aref *track* 1))
```

Use the log and exponential functions s-log and s-exp

http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index559

http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index557

Note that log(0) is undefined, so you need to take care handling zero value samples.

But is it possible to directly use classic floating point division directly?

The division function “/” only works on numbers: http://www.cs.cmu.edu/~rbd/doc/nyquist/part19.html#index1616

Nyquist does provide a multiplication function that works on number, sounds and multi-channel sounds (See: MULT http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index618), which is convenient because multiplication is commonly used with sounds.

To perform division on sounds, you need to write your own function.

If you are dealing with very short sounds, then probably the easiest way would be to grab the sounds as arrays of sample values, and loop through the arrays. For longer sounds it will be more efficient to use logarithmic arithmetic operations or the RECIP function: http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index570)

or the RECIP function

Note that when using RECIP, you still have to guard against division by zero.

Division is not generally useful in itself as a sound effect, because as the divisor approaches zero, the result can become extremely large (far in excess of 0 dB).

or the RECIP function

Note that when using RECIP, you still have to guard against division by zero.

Division is not generally useful in itself as a sound effect, because as the divisor approaches zero, the result can become extremely large (far in excess of 0 dB).

So when this is used on a value of 0 it returns an error, the sample is deleted, stays 0, becomes NaN or what?

Classic floating point division says:

• a positive number divided by 0 is Infinity

• a positive number divided by -0 is -Infinity

• a negative number divided by 0 is -Infinity

• a negative number divided by -0 is Infinity

• ±0 divided by ±0 is NaN

which is what I would expect from a properly working division function. After all it’s possible for samples to be Infinity, -Infinity or NaN in Audacity, making sample views sometimes show as a big blue screen.

Division by zero is an error for computer programs because mathematically division by zero is “undefined for real numbers”.

http://mathworld.wolfram.com/DivisionbyZero.html

https://en.wikipedia.org/wiki/Division_by_zero

https://stackoverflow.com/questions/5436476/is-divide-by-zero-an-error-or-an-exception

https://www.maplesoft.com/support/help/maple/view.aspx?path=divisionbyzero

https://www.quora.com/Why-cant-you-divide-by-zero

Division by zero is an error for computer programs because mathematically division by zero is “undefined for real numbers”.

Division by Zero -- from Wolfram MathWorld

Division by zero - Wikipedia

programming languages - Is divide by zero an error or an exception? - Stack Overflow

division by zero - Maple Help

https://www.quora.com/Why-cant-you-divide-by-zero

But Nyquist is floating point arithmetic, and in floating point, all operations including division by zero have a perfectly defined result.

and in floating point, all operations including division by zero have a perfectly defined result.

No, division by zero is undefined for real numbers, whether integer or floating point. See the references in my previous post.

and in floating point, all operations including division by zero have a perfectly defined result.

No, division by zero is undefined for real numbers, whether integer or floating point. See the references in my previous post.

But floating point isn’t the same as the mathematical “𝖱𝖾𝖺𝗅 𝗇𝗎𝗆𝖻𝖾𝗋𝗌” and don’t necessarily follow the same rules. Please stop saying the same misconception about floating point division by zero.

The IEEE floating-point standard, supported by almost all modern floating-point units, specifies that every floating-point arithmetic operation, including division by zero, has a well-defined result. The standard supports signed zero, as well as infinity and NaN (not a number). There are two zeroes: +0 (positive zero) and −0 (negative zero) and this removes any ambiguity when dividing. In IEEE 754 arithmetic, a ÷ +0 is positive infinity when a is positive, negative infinity when a is negative, an...

```
The IEEE floating-point standard, supported by almost all modern floating-point units, specifies that every floating point arithmetic operation, including division by zero, has a well-defined result. The standard supports signed zero, as well as infinity and NaN (not a number). There are two zeroes: +0 (positive zero) and −0 (negative zero) and this removes any ambiguity when dividing. In IEEE 754 arithmetic, a ÷ +0 is positive infinity when a is positive, negative infinity when a is negative, and NaN when a = ±0. The infinity signs change when dividing by −0 instead.
```

No doubt you read in that exact same article:

In mathematics, division by zero is division where the divisor (denominator) is zero. Such a division can be formally expressed as a/0 where a is the dividend (numerator). In ordinary arithmetic, the expression has no meaning, as there is no number which, when multiplied by 0, gives a (assuming a ≠ 0), and so division by zero is undefined.

This discussion has diverged away from anything to do with Audacity. For discussion about mathematics and/or IEEE 754, this is not the appropriate forum.

No doubt you read in that exact same article:

In mathematics, division by zero is division where the divisor (denominator) is zero. Such a division can be formally expressed as a/0 where a is the dividend (numerator). In ordinary arithmetic, the expression has no meaning, as there is no number which, when multiplied by 0, gives a (assuming a ≠ 0), and so division by zero is undefined.

This discussion has diverged away from anything to do with Audacity. For discussion about mathematics and/or IEEE 754, this is not the appropriate forum.

Did you intentionally disapprove my reply so that you can “win the argument”?

Did you intentionally disapprove my reply so that you can “win the argument”?

No. I disapproved your post because it had nothing to do with Audacity, and this is the Audacity forum.

I had already told you that this is not an appropriate forum for discussion about mathematics and/or IEEE 754, but you decided to send another post that has nothing to do with Audacity, so I disapproved it in accordance with forum policy.