High Quality (no alias) Tone generator

hq-tone.ny (4.07 KB)
Generates the following types of wave:

  • Sine
  • Square
  • Triangle
  • Sawtooth
  • Inverse sawtooth

This is slower than the standard Sine, Square and Sawtooth tone generators, but this plug-in produces tones without aliasing distortion.
The standard Tone generator can produce no-alias square waves, but it is very slow, particularly for lower frequencies.

Highlights:

  • All generated tones have extremely low aliasing distortion.
  • Much faster than the built-in no-alias square generator at low frequencies.
  • The starting phase of the waveform is adjustable
  • When applied to multiple tracks, all tracks have the same phase (regardless of frequency and duration)
  • Square wave is more square at low frequencies than the standard no-alias version.
  • Optimised for best waveform shape, frequency content and speed.
  • Works with Audacity 1.3.4 or later (1.3.12 or later recommended)
  • Very low memory usage on Audacity 1.3.13.

Install in the usual way.
Comments, feedback and bug reports welcome as always.
hq-tone.ny (4.07 KB)
Latest Version available on the Audacity wiki

Here’s a new version.
There are no changes to the code - the only difference is in the layout of the code.

It was brought to my attention that in some text editors the line spacing could be messed up because I used “Tab” to indent rather than spaces. If the editor is set to a large tab size (for example 8 spaces is very common) then some of the lines would be indented by an excessive amount. In this version I’ve changed the “tabs” to “spaces” so the layout should be the same on all text editors.

I’ve also made a couple of other minor changes to the layout to comply with the recommendations here: Indenting Common Lisp
hq-tone.ny (4.37 KB)

Steve,

The link in your last post appears to be dead.

I googled it and found it here.

POL

Thanks POL,
Link updated.

An updated version of this plug-in is available on the Audacity wiki: https://wiki.audacityteam.org/wiki/Nyquist_Generate_Plugins#HQ-Tone

Hi Steve…Can you add the ability to HQ-Tone to make audio files from 0.01hz? The option now available starts only from 20hz. And also, can you add the Damped Sinusoidal, Damped Square, H-Bomb Sinusoidal & H-Bomb Square waveforms to the plugin? Please bro. Thanks a million.

Additive synthesis is not a suitable technique for generating sub-sonic frequencies. Better to generate a simple on/off square wave and then apply soft clipping to smooth the polarity changes.


A damped sinusoidal wave is just a sine wave at a lower level.


According to the Internet:

Well, the Square H Bomb is simply, a custom waveform made up of square waves.

Visually it looks like an H, hence the name.

It has potency, hence the bomb nomenclature added to the end.

It is made up of 16 cycles. Since square waves have a duty cycle of 50% by default, this waveform also is on half the time, and off the other half of the time. This means 8 of the 16 cycles will be nothing.

Note the first 4 cycles and the last 4 cycles of the waveform is nothing. There is your 50% off portion of the waveform.

The 8 remaining cycles in the center are as follows:

1 square wave at full amplitude, which acts like a spike.

6 square waves at 1/4 the amplitude, this is the nominal amplitude of the waveform.

1 square wave again at full amplitude, which also acts like a spike

So it seems that it is some sort of sequence of waveforms rather than just a single cyclical waveform, thus outside the scope of this effect.

Thank you for the reply Steve. That was very helpful.