[CM] Beginner's tutorials?
kennethflak at protonmail.com
Wed Jul 8 06:57:22 PDT 2020
Fantastic! Thanks so much :-)
Roosna & Flak - Contemporary Dance & Music
On Wed, Jul 8, 2020 at 00:37, Juan Reyes <juanig at ccrma.Stanford.EDU> wrote:
>> 2. extract mono channel from stereo/multichannel file
> Just found code to extract a channel from a soundfile. Hopefully this
> would give you a start on Snd's interface.
> --* Juan
> ;; instrument or function definition on S7 to be loaded on Snd's
> (definstrument (extract file
> (start 0.0)
> (att 1.0)
> (chan 0))
> (let* ((in-file-sr (mus-sound-srate file))
> (in-file-dur (/ (frames file) in-file-sr))
> (out-start-time 0)
> (out-duration (- in-file-dur start))
> (readA (make-readin :file file :channel chan))
> (beg (seconds->samples out-start-time))
> (end (seconds->samples in-file-dur))
> (do ((i beg (1+ i)))
> ((= i end))
> (let* ((sample (readin readA)))
> (outa i (* att sample)))))
> Once this code has been saved, load it on Snd's listener by typing
> something like:
> ;; (load "extractch.cms")
> - Function or instrument call on the listener (in order to get the
> channel extracted):
> ;; (with-sound () (extract "eight-channels.wav" :chan 2))
> ;; This instrument call will open a new window in Snd.!!
> ;; and will extract channel 3 from file "eight-channels.wav"
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cmdist