[CM] portamento
James Hearon
j_hearon at hotmail.com
Wed May 11 10:48:13 PDT 2022
Hi,
I'm still pondering how best to accomplish this. I tried a couple of exs below, one adding filters.
I thought bandpass was best to try but couldn't get good high cutoff results with just one filter so I went to two overlapping bandpass filters. But I've buggered the freqs by an octave somehow. That could have been in using hz->radians as cutoffs.
I think my experiments still sound too glissy overall.
I'm wondering if there are other suggestions?
Thank you,
Jim
;no portamento.
(definstrument (noport start-time duration frequency (amp-env '(0 0 1 1 2 1 3 0)) sampling-rate)
(let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate))))
(sine-wave (make-oscil :frequency frequency))
(ampf (make-env amp-env :duration duration :scaler 1.0))
)
(do ((i beg (+ i 1)))
((= i end))
(outa i (* (env ampf) (oscil sine-wave )))
(outb i (* (env ampf) (oscil sine-wave )))
)))
;portamento. no filter.
(definstrument (myport start-time duration frequency start-freq end-freq (amp-env '(0 0 1 1 2 1 3 0)) sampling-rate)
(let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate))))
(sine-wave (make-oscil :frequency frequency))
(ampf (make-env amp-env :duration duration :scaler 1.0))
(frqf (make-env '(0 0 1 1) :scaler (hz->radians (- end-freq start-freq)) :duration duration :base 0.67))
)
(do ((i beg (+ i 1)))
((= i end))
(outa i (* (env ampf) (oscil sine-wave (env frqf) )))
(outb i (* (env ampf) (oscil sine-wave (env frqf) )))
)))
(with-sound (:srate 48000 :channels 2 :header-type mus-riff :play #t)
(myport 0 1 300 300 400 '(0 .3 .5 .1 1 .09) 48000)
(noport 1.1 .9 400 '(0 .01 1 .1) 48000)
(myport 2 1 400 400 500 '(0 .2 .5 .1 1 .09) 48000)
(noport 3.1 .9 500 '(0 .01 1 .1) 48000)
(noport 4 .3 500 '(0 .19 .3 .001) 48000)
(myport 4.2 .6 500 500 300 '(0 .001 .5 .1 1 .3) 48000)
(noport 5 1 300 '(0 .08 .3 .001) 48000)
)
;portamento adding filters.
(definstrument (myportfilt start-time duration frequency start-freq end-freq (glissamp-env '(0 0 1 1 2 0)) (amp-env '(0 0 1 1 2 1 3 0)) sampling-rate order1 flow1 fhigh1 order2 flow2 fhigh2)
(let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate))))
(sine-wave (make-oscil :frequency frequency)) ;sine osc
(ampf (make-env amp-env :duration duration :scaler 1.0)) ;overall amp env
(frqf (make-env '(0 0 1 1) :scaler (hz->radians (- end-freq start-freq)) :duration duration :base 0.67)) ;gliss
(gliss_amp (make-env glissamp-env :duration duration :scaler 1.0)) ;another amp env for the gliss
(flt1 (make-butterworth-bandpass order1 (hz->radians flow1) (hz->radians fhigh1)))
(flt2 (make-butterworth-bandpass order2 (hz->radians flow2) (hz->radians fhigh2)))
)
(do ((i beg (+ i 1)))
((= i end))
(outa i (* (env ampf) (+ (* (env gliss_amp)(flt1 (oscil sine-wave (env frqf)))) (* (env gliss_amp)(flt2 (oscil sine-wave (env frqf)))))))
(outb i (* (env ampf) (+ (* (env gliss_amp)(flt1 (oscil sine-wave (env frqf)))) (* (env gliss_amp)(flt2 (oscil sine-wave (env frqf)))))))
)))
(with-sound (:srate 48000 :channels 2 :header-type mus-riff :play #t)
(noport 0 .55 400 '(0 .03 1 .01) 48000)
(myportfilt .5 .4 200 200 400 '(0 .3 .4 .1) '(0 0.03 .9 0.06) 48000 8 100 150 8 100 200)
(noport .5 .5 800 '(0 .01 1 .01) 48000)
(noport 1 .55 800 '(0 .03 1 .01) 48000)
(myportfilt 1.5 .4 400 400 200 '(0 .3 .4 .01) '(0 0.03 .9 0.06) 48000 8 100 150 8 100 200)
(noport 1.5 .5 400 '(0 .01 1 .01) 48000)
(noport 3 1.1 400 '(0 .03 1 .01) 48000)
(myportfilt 4 .9 200 200 400 '(0 .3 .9 .1) '(0 0.03 .9 0.06) 48000 8 100 150 8 100 200)
(noport 5 1 800 '(0 .02 1 .1) 48000)
)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20220511/2df0bebd/attachment.html>
More information about the Cmdist
mailing list