[CM] leviathan etc.
James Hearon
j_hearon at hotmail.com
Thu Feb 20 17:38:31 PST 2025
re: Leviathan listening.
Nice piece which is made more enjoyable by an understanding of the technique used to create it (wave sequencing).
I was intrigued by this technique, which seemed to have a basis in the Korg Wavestation.
But the description I found online read something like:
"Single-cycle waveforms in succession with cross fades etc. Place the cycle in a table and use an array of tables for the oscillator. Morph between different single-cycle waveforms (tables) while playing.Use multiple oscillators. Can use looping (forward and back), of all steps as well as individual cycles, and modulation (forward and back) as well."
I was giving this a primitive try in Snd and not sure I was on the right track. I found make-wave-train (instead of oscillator playing tables) was a bit more accurate than pure table-lookup for some reason, and therefore just wrote the waveforms directly to vectors. I couldn't understand the need for a single-cycle waveform, but maybe that's a Korg thing.
Be interested to know if there was a much better approach I probably missed.
(definstrument (mysequence start-time duration frequency size amp (amp-env '(0 0 2 .5 3 -.25 5 0)) sampling-rate )
(let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate))))
(fsize size)
(dur (/ fsize sampling-rate))
(myenv (make-env amp-env :duration dur :scaler 1.0))
(myvec (make-float-vector fsize)) ;envel vector for waveform
(fadeinout (make-env '(0 0 1 .25 3 1.0 5 0):duration duration :scaler 1.0)) ;crossfade
)
(do ((k 0 (+ k 1)))
((>= k fsize))
(set! (myvec k) (myenv k)) ;place env values in float-vector
)
(let ((gen (make-wave-train
:frequency frequency
:initial-phase 0.0
:wave myvec
:size fsize
:type mus-interp-none
)))
(do ((i beg (+ i 1)))
((= i end))
(outa i (* amp (* (env fadeinout) (wave-train gen)))))
)))
(with-sound (:play #f :srate 48000 :channels 1
:header-type mus-riff
:statistics #t)
(mysequence 0 2 440.0 128 0.5 '(0 0 2 .5 3 -.5 5 0) 48000)
(mysequence 1 2 440.0 128 0.5 '(0 0 1 1 2 -1 3 1 4 -1 5 0) 48000)
)
...by the way, there's a nice line in Moby Dick where Gregory Peck refers to the white whale as a leviathan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20250221/3870a10d/attachment.html>
More information about the Cmdist
mailing list