;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/audio.el ;; ;; the computer: ;; https://dataswamp.org/~incal/ebchw/COMPUTER (require 'cl-lib) (defun db (d &rest ds) (let ((all (cons d ds)) (sum 0) ) (cl-loop for a in all do (cl-incf sum (expt 10 (/ a 10.0))) ) (* 10 (/ (log sum) (log 10))) )) ;; (db 15) ; 15 ;; (db 15 15) ; 18 ;; (db 15 15 15) ; 20 ;; (db 15 15 15 15) ; 21 (provide 'audio)