Nyquist prompt/audio export

Hi there.

I found this post:

which did exactly what I needed so thanks for that, Steve, much appreciated. However being a programming know nothing I have no idea how to change it to do what I need now which is very similar but I just need to extend the length of the exported audio. Say my number of samples was 1000, that’s where the label markers go but I want the audio exports to be 1200 samples long meaning that 200 samples of audio would be exported twice, the last 200 of audio export A would also be the first 200 of audio export B. ‘Paging Steve, Steve to the courtesy phone please, thank you.’

To get an overlap like this:


then the labels need to be overlapping by 200 samples.
This code should do it:

(setf stepsize 1000)  ; Number of samples per step
(setf overlap 200)  ; Amount of overlap in samples

(setf maxlabels 1000)  ; Maximum number of labels

(let ((labels ()))  ; initialise an empty list
  (setf overlap (/ overlap *sound-srate*))
  (do* ((counter 1 (1+ counter))
        (ii 0 (+ ii stepsize))
        (jj stepsize (+ jj stepsize)))
       ((> jj len) labels)
    (psetq start (/ ii *sound-srate*)
           end (+ (/ jj *sound-srate*) overlap))
    (push (list start end (format nil "~a" counter))

Nice one, Steve. Much appreciated. I’ll give that a go ASAP.

This topic was automatically closed after 30 days. New replies are no longer allowed.