Nyquist plugin for Audacity that counts syllables: I have not been able to find how to get the samples info into a text file. They are in ny:all, I need to use the fall times of the (yin (yin s-in (hz-to-step 100) (Hz-to-step 1000) for timing pictographs. Below is what I found about formatting the labels.
;control action "Preview gapless Audio" choice "Do not play,Play 10 s" 0
;control threshold "Treat as pause under... (dB)" int "" -26 -100 -6
;control pause-min "Minimum Pause Duration" real "" 0.01 0 1
;;
(defun gapless (snd)
(let* ((comp (snd-oneshot (s-abs snd) (db-to-linear threshold) pause-min)))
(snd-compose snd (snd-inverse (integrate comp) 0 *sound-srate*))))
(defun analysis (s-in)
(let* ((*sr* (snd-srate s-in))
(yin (yin s-in (hz-to-step 100) (Hz-to-step 1000) # this is the rise and fall of the signal
(truncate (/ *sr* 25.0))))
(cyclic (aref yin 1))
(*csr* (snd-srate cyclic))
(single (snd-from-array 0 *csr* (vector *csr* ))))
(trigger (slope cyclic) single)))
;(setf sig (force-srate 8000 s))
(setf total (peak (integrate (analysis (gapless s))) ny:all))
(setf output (format nil
"Syllables in total: ~a
Averaged Syllables per Minute: ~a" total (/ (* 60 total) (get-duration 1)) ))
(if (= action 1) (s-save (gapless s) (truncate (* 10 *sound-srate*)) "" :play t))
output
I found these to pieces of code in in Nyquist Functions, maybe this code is what it needed.
snd-samples(sound, limit) [SAL]
(snd-samples sound limit) [LISP]
Converts the samples into a lisp array. The data is taken directly from the samples, ignoring shifts.
snd-t0(sound) [SAL]
(snd-t0 sound) [LISP]
(snd-t1 sound) [LISP]
Returns the time of the first sample of the sound.
I hope someone can help me with this, The code above is a Nyquist plugin for Audacity to count syllables, that I want to be able to use the time of the syllable to time pictographs.
I have went through Nyquist manual for hours trying to find how to output the samples, but I am new to programing Nyquist is beyond me at this point. But I will be able to work with the times of the syllables.