[CM] Reconfigurable DSP patches

Anders Vinjar anders.vinjar@notam02.no
18 Oct 2002 12:33:26 +0200


>>> "cpe" == cristopher pierson ewing <cewing@u.washington.edu> writes:


    cpe> out = (dsp1 (dsp2 (dsp3 smp1))) +
    cpe>       (dsp2 (dsp1 (dsp3 smp2))) +
    cpe>       (dsp3 (dsp2 (dsp1 smp3)))
    cpe> etc.

    cpe> Currently, I have been exploring the use of (sound-let*) which allows me
    cpe> to write the output of each dsp to a temp file that is then used as the
    cpe> input of the next dsp.  This is great stuff, and works well, but is really
    cpe> slow.

    cpe> I'm wondering what might be another way of doing this so that I don't have
    cpe> to rewrite the entire soudfile between each dsp iteration.

This kind of flexibility could be extremely useful.  Would it be
(is it already?) possible to control and communicate through
non-file streams/pipes/sockets - or whatever the right word would
be - in clm?  Having clm-instruments and clm-macros, maybe also
clm-ugs, sending their output to some buffer/stream or something,
and having that buffer/stream read by some other instrument or
some external programs stdin or something.  Say:

   (with-sound (:output "result.aiff")
     (mix
      (filter-sound
       (pvocins
        (mix "swany.aiff" :ampba 0.4)
        :scramble-bins 1.2)
       :xcoeffs xc)
      :amp 0.4))

or (possibly dreaming here):

   (let ((ug (arbitrary-gen 220.0 1024 :base 1.7)))
     (with-sound (:output "result.aiff")
       (mix
        (filter
         (ug
          (mix "swany.aiff" :ampba 0.4)
          :scramble-bins 1.2)
         :xcoeffs xc)
        :amp 0.4)))

or:

   (multiple-value-bind (to from errors pid)
     (some-shell
          "mpg123 -s -"
          :wait nil
          :input :stream
          :output :stream
          :separate-streams t)
    (with-sound (:output to)
       (filter-sound from :amplitude 0.3)))

or:

   (with-sound (:output "mpg123 -")
     (mix myfile))


I guess all this could be done with normal io in lisp, just
reading buffers with samples at certain times, but it would need
clmification to speed up normal sound handling.

'sound-let, defpinstrument, 'with-current-sound and such are
possibly handling parts of this already?

-anders