[CM] Loop Selection

Kjetil S. Matheussen k.s.matheussen at notam02.no
Thu Nov 6 15:44:58 PST 2008

On Fri, 7 Nov 2008, Esben Stien wrote:

> In loop mode, I have
> (make-selection 1000 2000)
> ..so that it loops between these sample points.
> If I update the selection while playing, Snd will not loop the new
> selection, but continue with the old selection. I have to stop first
> and then hit play for the change to take effect.
> Any way to avoid this?

I think the function c-set-selection! should fix this problem:

(define* (c-set-selection! snd ch start end #:optional (dassync (c-sync? snd)))
         (c-set-selection-position! snd ch start dassync)
         (c-set-selection-frames! snd ch (- end start -1) dassync))

You can make a c-make-selection function like this:

(define (c-make-selection start end)
          (c-set-selection! (c-selected-sound) (selected-channel (c-selected-sound)) start end))

More information about the Cmdist mailing list