Generating a non-symetrical square signal

Does this do what you want?

Run this code in the Nyquist Prompt.

Select part of an audio track where you want to generate the pulses, then open the Nyquist Prompt from the Effect menu.
Copy and paste this code into the Nyquist Prompt text box.

(setq hz 440)
(setq bias 0)
(setq level 0.5)

(let ((lev (* level 0.5)))
  (sum lev (mult lev (osc-pulse hz bias))))

The first three lines set the parameters used by the code. You may change the numbers to suit.

(setq hz 440) sets the pulse frequency
(setq bias 0) sets the pulse width. Must be between +/- 1. For a symmetrical square wave set to zero.
(setq level 0.5) sets the vertical height of pulse above 0. This should be between 0 and 1

1 Like