Can't seem to use *track* more than once in an fx, even with snd-copy

Adapting Steve’s code from another thread (on s-reverse), I can make it work by creating an in-memory copy.

;version 4
;type process

(defun snd-memcpy (sig)
   (setf *MAX-MEMCPY-SAMPLES* 1000000)
   (let ((ln (snd-length sig (1+ *MAX-MEMCPY-SAMPLES*)))
         (srate (snd-srate sig)))
      (when (> ln *MAX-MEMCPY-SAMPLES*)
         (error "*MAX-MEMCPY-SAMPLES* exceeded"))
      (let ((ar (snd-fetch-array sig ln ln)))
         (snd-from-array 0 srate ar))))

(setq *track-memcpy* (snd-memcpy *track*))

(seq (mult *track-memcpy* 0.2) (mult *track-memcpy* 0.7))

That seems to do the right thing, although it still complains that

Warning: cannot go back in time to 0, sound came from (FORCE-SRATES S%RATE (MULT *TRACK-MEMCPY* 0.7))

Despite the warning, the sound is copied properly twice, I tested with an one with that has an obvious fade-in envelope pre-applied.

I’m not exactly illuminated on the difference between Nyquist’s notions of sound vs behavior, but the harmless waning can be suppressed by writing

(seq (cue (mult *track-memcpy* 0.2)) (cue (mult *track-memcpy* 0.7)))

To avoid the in-memory copy I guess I cold try writing a copy of the sound to scratch, but I’m not sure that circumvents the in-memory copy. There are some functions that write a sound to disk directly from Nyquist, but I haven’t dabbled with those insofar. I’m not sure if they’re accessible in a fx plug-in.