Open porres opened 8 months ago
also ambisonics
steal from https://github.com/porres/pd-cicm-tools
https://ssr.readthedocs.io/en/0.6.1/renderers.html#vbap
VBAP tries to find a loudspeaker pair between which the phantom source is located. If it finds a pair whose angle is smaller than 180º it calculates the L and R gains as
φ0 is half the angle between the two loudspeakers with respect to the listening position, φ is the angle between the position of the phantom source and the direction “between the loudspeakers”.
If the VBAP renderer can't find a loudspeaker pair whose angle is smaller than 180º then it uses the closest loudspeaker provided that the latter is situated within 30ª . If not, then it does not render the source.
The Ambisonics Amplitude Panning (AAP) renderer does very simple Ambisonics rendering. It does amplitude panning by simultaneously using all loudspeakers that are not subwoofers to reproduce a virtual source (contrary to the VBAP renderer which uses only two loudspeakers at a time). Note that the loudspeakers should ideally be arranged on a circle and the reference should be the center of the circle. The renderer checks for that and applies delays and amplitude corrections to all loudspeakers that are closer to the reference than the farthest. This also includes subwoofers. If you do not want close loudspeakers to be delayed, then simply specify their location in the same direction like its actual position but at a larger distance from the reference. Then the graphical illustration will not be perfectly aligned with the real setup, but the audio processing will take place as intended. Note that the AAP renderer ignores delays assigned to an individual loudspeaker in ASDF. On the other hand, it does consider weights assigned to the loudspeakers. This allows you to compensate for irregular loudspeaker placement.
Ville Pulkki’s Vector-base amplitude panning (VBAP) is a quite robust and generic algorithm that works on nearly any surrounding loudspeaker layout. VBAP activates the smallest possible number of loudspeakers, which gives a directionally robust auditory event localization for virtual sound sources, but it can also cause fluctuations in width and coloration for moving sources.
Multiple-direction amplitude panning (MDAP) is a modification that increases the number of activated loudspeakers. In this way, more direction-independence is achieved at the cost of an increased perceived source width and reduced localization accuracy at off-center positions. As vector-base panning methods rely on convex hull triangulation, irregular loudspeaker layouts yielding degenerate vector bases can become a problem.
vamos re-escrever mtx~ e autofades... e essas coisas de como copiar as entradas.
[ ] add multichannel support to [xselect~] like [xgate~]
[ ] [xagte2~]/[xselect2~]/[mtx~] may also have 'mc' support.
[ ] [xselect2.mc~] and [xgate2.mc~] could also group channels, like [xselect.mc~] and [xgate.mc~]
[ ] [pan~]?
[ ] code cleanup, we dont need copy ALL samples from inputs...
[ ] code cleanup, make xgate2~ like pan~
[ ] code cleanup xfade~ is different xfade.mc~ needs cleanup
[ ] code cleanup, rotate~, spread~, get rid of free(sigvec) moreover match~ and chance~ as well