[CM] Beginner's tutorials?

Kenneth Flak kennethflak at protonmail.com
Wed Jul 8 06:57:22 PDT 2020


Fantastic! Thanks so much :-)

Roosna & Flak - Contemporary Dance & Music

https://roosnaflak.com

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
> ;;;listener::
>
> (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))
> (begin
> (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
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20200708/fd007e3c/attachment.html>


More information about the Cmdist mailing list