If you want to be totally without restriction, then all things must be allowed, and it is the matter of defining the specific thing that you want that is arduous.jamesadrian wrote:It need not be arduous.
For example, It is common for synthesizers to offer a selection of simple cyclical waveforms, such as Sine, Triangle, Square, Sawtooth. All cyclical waveforms may be defined in terms of a series of pure (sine) waves, their frequency, amplitude and phase. For example, a square wave can be defined as a series of odd harmonics of decreasing amplitude:
So let's take away the restriction and say that we allow 'any' series of sine waves that have frequency, amplitude and phase related (or not) by any rules that the composer wants.
That takes us from a simple 4 way choice betwee Sine, Triangle, Square, Sawtooth, to defining an arbitrary algorithm for generating any number of sine waves of any amplitude and any phase (and there are of course an infinite number of different waveforms that could be generated).
For example, try running this code in the Nyquist Prompt effect:
Code: Select all
(setf pitch C4) ; Note pitch
(setf dur 3.0) ; Duration seconds
;; Define waveform
(setf *table* (sum (mult 0.5 (build-harmonic 1 2048))
(mult 0.25 (build-harmonic 2 2048))
(mult 0.125 (build-harmonic 3 2048))
(mult 0.0625 (build-harmonic 4 2048))))
(setf *table* (list *table* (hz-to-step 1.0) t))
;; Generate tone
(abs-env
(osc pitch dur *table*))