Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: calcsndbytes , Previous: byte->midi , Home: Overview

Clamps Dictionary

C

calc-vbap

Function

(calc-vbap vbap)

Non consing calculation of the gains in the vbap-ls-gains slot of vbap, taking azimuth, elevation and spread from the vbap-azi, vbap-ele and vbap-spread slots of vbap and using the precalculated matrices in the vbap-data slot.

Examples

;;; 2D 8-channel circle:

(defparameter *my-vbap* (init-vbap '(-45 0 45 90 135 180 -135 -90)))

(setf (vbap-azi *my-vbap*) 0)     ;;; set azimuth
(setf (vbap-ele *my-vbap*) 0)     ;;; set elevation
(setf (vbap-spread *my-vbap*) 10) ;;; set spread
(calc-vbap *my-vbap*)             ;;; calc gains

(vbap-ls-gains *my-vbap*)  ; => #(0.07054434 0.9950111 0.07054434 0.0 0.0 0.0 0.0 0.0)

;;; 3D 8-channel circle with every second speaker at 45 degree elevation:

(defparameter *my-vbap* (init-vbap (mapcar #'list
                                           '(-45 0 45 90 135 180 -135 -90) ;;; azimuths
                                           '(0 45 0 45 0 45 0 45) ;;; elevations
                                           )))

(setf (vbap-azi *my-vbap*) 0)     ;;; set azimuth
(setf (vbap-ele *my-vbap*) 25)    ;;; set elevation
(setf (vbap-spread *my-vbap*) 10) ;;; set spread
(calc-vbap *my-vbap*)             ;;; calc gains

(vbap-ls-gains *my-vbap*) ; => #(0.44656235 0.7753477 0.44656238 0.0 0.0 0.0 0.0 0.0)

Author: Orm Finnendahl

Created: 2025-08-17 So 16:52

Validate