Analogue Synth Tool

The Analogue Synth Tool can generate an assortment of tempo locked clock and LFO waveforms which can be saved as audio files and then played back from a DAW for the purpose controlling analogue synthesisers and sequencers when dedicated plugins and hardware to do so are unavailable.

V1.1 - Bug Fix: Entering a non-valid integer in the Span box would cause Audacity to hang. (379 KB)
V1.0 - Do Not use (379 KB)

Looks good.
Interesting method to create the pulse waveform. I guess you’ve been looking in nyquist.lsp (because AFAIK the “compare” function is not documented, or have I just missed it somewhere?)

There’s a problem with your “string-to-integer” function.
I’ve not got time to look at it right now, but it hangs if you enter an invalid string such as a letter or a decimal for the number of notes.

Actually very simple.
It’s the “return” function that is causing the problem.

Try this:

;;; safely convert a string into an integer - sets to 0 if if it doesn't parse
(defun string-to-integer (string)
  (setf n (read (make-string-input-stream (format nil "(~a)" string))))
  (if (and (= 1 (length n)) (integerp (first n)))
    (first n) 0))

That is rather odd as it seemed to run OK when I tested it on V1.3.12 on my windows XP machine but I have to say I did experience the same hanging issue where return was used in something else I was working on.

I’ve updated it with your suggested fix (thank you).


I have indeed been poking around under the hood. Best way to learn I’ve found. I don’t think the compare function is documented anywhere either.

I chose that method as it is a clone of osc-pulse that uses a saw as it’s base rather than a triangle thus making the pulse start with the rising edge and finish just before the next rising edge rather than starting and ending half way through a pulse as osc-pulse does.