Skip to content

Instantly share code, notes, and snippets.

@Demiu
Created September 2, 2019 20:51
Show Gist options
  • Save Demiu/6af800f45a7db67b1a30a1f8d4f9b470 to your computer and use it in GitHub Desktop.
Save Demiu/6af800f45a7db67b1a30a1f8d4f9b470 to your computer and use it in GitHub Desktop.
Simple labeling by clips for audacity
;nyquist plug-in
;version 4
;type tool analyze
;name "Simple Clips Label"
;get data from audacity
(setf clips
(get '*TRACK* 'CLIPS))
(setf time
(get '*SELECTION* 'START))
(setf iterator 0)
(defun label-clip
(clip)
(setf clip
(list
(first clip)
(first (rest clip))
(format nil "~a" iterator)))
(setf iterator
(+ iterator 1))
clip
)
(defun fix-time-values
(clip)
(setf (nth 0 clip)
(-
(nth 0 clip)
time))
(setf (nth 1 clip)
(-
(nth 1 clip)
time))
clip
)
(if
(arrayp clips)
(mapcar #'fix-time-values
(mapcar #'label-clip
(aref clips 0)))
(mapcar #'fix-time-values
(mapcar #'label-clip
(first clips)))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment