This code can be run in the “Nyquist Prompt” effect (in the “Effect” menu).
It will show the peak amplitude of the selected audio (in dB) accurate to 4 decimal places.
(defun printdb (sig)
(linear-to-db (peak sig ny:all)))
(if (arrayp s)
(format nil "Left Channel: ~a dB.~%~
Right Channel: ~a dB."
(printdb (aref s 0))
(printdb (aref s 1)))
(format nil "Mono Trackl: ~a dB." (printdb s)))