From j_hearon at hotmail.com Fri Feb 9 17:43:22 2018 From: j_hearon at hotmail.com (James Hearon) Date: Sat, 10 Feb 2018 01:43:22 +0000 Subject: [CM] map-channel with dsp In-Reply-To: References: Message-ID: Hi, I'm really stuck on trying to use map-channel to replace a newly created snd file with a dsp modified version of it. I've been looking at snd-test.scm for examples but still don't have it right yet and not sure how to craft the let/map-channel/lambda to make it work. All I get is a flat line so far. I'm trying to place values in a float-vector, then modify those values and output to the editor. I know (float-vector->channel im 0 fsize 0) works, and I also tried sample (but very slow): (do ((i 0 (+ i 1))) ((= i fsize)) (set! (sample i) (im i))) Wondering if there's an example someplace I haven't found yet for how to dsp modify a vector of values and use map-channel to output to the editor? Thank You, Jim I?ve been trying something like below? but cannot seem to get the map-channel/let/lambda part right. (let* ((fsize 22050) (increment (/ (* 440.0 2.0 pi) fsize)) (im (make-float-vector fsize)) ;empy vector (current-phase 0.0) (val 0.0) );init var (new-sound "test.snd" :size fsize) ;creates a new snd in editor ;place values in a vector (do ((i 0 (+ i 1))) ((= i fsize)) (set! val (* .1 (sin current-phase))) (set! current-phase (+ current-phase increment)) (set! (im i) val) ;(format #t "~%i: ~F ~0,6F\t " i (im i) ) ) (map-channel (lambda (y) (do ((i 0 (+ i 1))) ((= i fsize)) (* (amplitude-modulation 0.5) (im i))))0 fsize)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sat Feb 10 07:35:00 2018 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sat, 10 Feb 2018 07:35:00 -0800 Subject: [CM] map-channel with dsp In-Reply-To: References: Message-ID: (map-channel func) calls func on every sample; the value returned by the function is the new sample if that value is a number, but your do loop just returns #t (the value of the multiply in the loop body is simply thrown away), so the map-channel operation quits, leaving zeros in the new sound. I think you intend: (let ((i 0)) (map-channel (lambda (y) (let ((result (* (amplitude-modulation 0.5) (im i)))) (set! i (+ i 1)) result)))) From bil at ccrma.Stanford.EDU Wed Feb 14 07:00:20 2018 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Wed, 14 Feb 2018 07:00:20 -0800 Subject: [CM] Snd 18.1 Message-ID: Snd 18.1 s7: added (*s7* 'max-heap-size) otherwise, mostly bug-fixes checked: sbcl 1.4.4 Thanks!: Mike Scholz, Kjetil Matheussen, Marty Hayman, Yuri sourceforge is undergoing maintenance of some sort, so the new tarball is not accessible there yet. From cm at jrigg.co.uk Fri Feb 23 14:14:29 2018 From: cm at jrigg.co.uk (John Rigg) Date: Fri, 23 Feb 2018 22:14:29 +0000 Subject: [CM] [snd] Font colour in Save window (Motif) Message-ID: <20180223221429.GA26119@localhost.localdomain> I'm using the Motif version of snd, set up with dark background colours (eg. white waveform on black background) as I find it easier on the eyes when working for long periods. One problem with this is that in the 'Save as' window the text field for typing in the destination filename uses white text on a dark background (which is fine) until the mouse is clicked on the field to select it for typing in. Then the background goes white and the text stays white too, so it isn't possible to see what's being typed. Is there an easy way to change the colour of the font (or highlighted background) here? If not it isn't a big deal, as I can use save-sound-as in the listener; I just wondered if it was possible as it could save a small amount of time. John From bil at ccrma.Stanford.EDU Fri Feb 23 16:28:04 2018 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Fri, 23 Feb 2018 16:28:04 -0800 Subject: [CM] [snd] Font colour in Save window (Motif) In-Reply-To: <20180223221429.GA26119@localhost.localdomain> References: <20180223221429.GA26119@localhost.localdomain> Message-ID: <18fba1b02f2be07656c49f74078459b3@ccrma.stanford.edu> It's been years since I looked at that, but I think (set! (text-focus-color) (make-color 0 0 0)) will use black instead of white (the default) for the background.