On Tue, 30 Dec 2008, Carlos Pita wrote:

> Hi all,
>
> I'm very new to snd and I'm having an annoying ui problem that i'm not
> sure how to solve.
>
> I'm mainly using snd to analyse different outputs from csound, each
> with a number of channels. My workflow is: modify the instrument
> and/or orchestra, run csound, update the output file in snd, analyse
> it.
>
> To update the graph I press Home or execute update-sound at the
> listener, of course. Multichannel graphs are using the default
> 'combined' layout. After each update, the graph height is
> automatically reset to a very short default and I have to manually
> readjust it. This doesn't happen with one-channel graphs or
> multichannel ones for the 'separate' layout.
>
> Is there any workaround to avoid this quirky behavior?
>

Below is code from snd_conffile.scm for fixing this. It
usually works, but it's not perfect.


(let ((width 800)
       (height 600)
       (num-retries 0)
       (isretrying #f))


   (define (dotheretry)
     (if (> num-retries 0)
        (begin
          (if (not (= (window-width) width))
              (set! (window-width) width))
          (if (not (= (window-height) height))
              (set! (window-height) height))
          (set! num-retries (1- num-retries))
          (in 2 dotheretry))
        (set! isretrying #f)))

   (add-hook! open-hook
             (lambda (filename)
               (set! height (window-height))
               (set! width (window-width))
               (set! num-retries 250)))

   (add-hook! close-hook
             (lambda (snd)
               (set! height (window-height))
               (set! width (window-width))
               (set! num-retries 250)))

   (add-hook! graph-hook
             (lambda (snd chn y0 y1)
               (if (not isretrying)
                   (begin
                     (set! isretrying #t)
                     (dotheretry))))))

_______________________________________________
Cmdist mailing list
[email protected]
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist

Reply via email to