[CM] Applying a function to every file in dir?

Kenneth Flak kennethflak at protonmail.com
Tue Jul 23 02:45:17 PDT 2024


OK, making some progress here... This cycles through files, but I 
only get silence in the resulting files. I also get these errors:

>;
with-sound mus-error: ("can't open /home/kf/snd/keen-007.wav: No 
such file or directory")
>;
with-sound mus-error: ("can't open /home/kf/snd/keen-017.wav: No 
such file or directory")
>;
with-sound mus-error: ("can't open /home/kf/snd/keen-015.wav: No 
such file or directory")
>;
with-sound mus-error: ("can't open /home/kf/snd/keen-006.wav: No 
such file or directory")
>;
with-sound mus-error: ("can't open /home/kf/snd/keen-009.wav: No 
such file or directory")

which is weird, as I haven't specified that directory...?

Anyway, the current code is:

(let ((stretch 8)
      (indir "/home/kf/Documents/REAPER Media/keen/")
      (outdir "/home/kf/mySamples/keen/"))
  (for-each-sound-file
   (lambda (file)
     (with-sound (:output (string-append outdir file) :scaled-to 
     (db->linear 0))
                 (open-sound (string-append indir file))
                 (sndwarp 
                  0 ; beginning
                  (* stretch (/ (framples) (srate))) ; duration
                  file
                  :stretch stretch
                  :randw 0.2
                  :rev 0.01
                  :overlaps 40
                  )))
   indir))

Grateful for any help!

Best,
Kenneth

Kenneth Flak <kennethflak at protonmail.com> writes:

> Hi guys,
>
> What is the appropriate way to apply this transformation to 
> every file
> in a directory? Can't find a way to list the files...
>
> (let ((stretch 8)
>      (file "/home/kf/Documents/REAPER Media/keen/keen-002.wav"))
>  (with-sound (:output "/home/kf/mySamples/keen/keen-002.wav"
>  :scaled-to (db->linear 0))
>              (open-sound file)
>              (sndwarp                 0 ; beginning
>                (* stretch (/ (framples) (srate))) ; duration
>                file
>                :stretch stretch
>                :randw 0.2
>                :rev 0.01
>                :overlaps 40
>                )
>              ))
>
> Best,
> Kenneth




More information about the Cmdist mailing list