Skip to content

Instantly share code, notes, and snippets.

@joslloand
joslloand / foaSphericalWindow.scd
Created May 12, 2025 23:14
Example of windowing of an FOA soundfield.
@joslloand
joslloand / soundfieldWindowingFuncs.scd
Last active September 27, 2024 18:43
soundfieldWindowingFuncs.scd

/* Ultraspherical/Gegenbauer polynomials to unify 2D/3D Ambisonic directivity designs Franz Zotter

https://arxiv.org/abs/2401.00813 */

/* sc3 (style) implementations of functions found in: Zotter_G_MATLAB_Code_examples.scd

/*
Ultraspherical/Gegenbauer polynomials to unify 2D/3D Ambisonic directivity designs
Franz Zotter
https://arxiv.org/abs/2401.00813
*/
// ---------------------------------------------
// SOURCES - p 46
@joslloand
joslloand / wavetableSizeTest.scd
Created January 25, 2023 20:50
reproducer for: CtkBuffer: *collection appears to drop the last item

/* TEST:

wavetable size / precision

CtkBuffer:*collection appears to drop the last item, as a result of setting numFrames to size - 1 rather than size

With the Ctk test below, the returned \b_setn message is:

[ 'b_setn', 0, 0, 15.0, -0.70710676908493, 0.70710676908493, 0.41421353816986, 0.29289323091507, 1.2928931713104, -0.29289323091507, 1.4142135381699, -0.70710676908493, 0.70710676908493, -0.70710676908493, -0.41421353816986, -0.29289323091507, -1.2928931713104, 0.29289323091507, -1.4142135381699, 0.70710676908493 ]

@joslloand
joslloand / preisMeasures.scd
Created September 21, 2022 21:18
Preis measures

/* Phase Distortion and Phase Equalization in Audio Signal Processing-A Tutorial Review Author: Preis, Douglas Affiliation: Tuffs University, Department of Electrical Engineering, Medford, MA JAES Volume 30 Issue 11 pp. 774-794; November 1982 Publication Date: November 1, 1982 https://secure.aes.org/forum/pubs/journal/?elib=3810

Linear Distortion Author: Preis, Douglas

@joslloand
joslloand / lineArrayHoa.scd
Created June 24, 2022 00:59
HOA line array example
/*
custom five channel "line array" decoder
*/
~pantoNumChannels = 8;
~pantoOrientation = \point; // need a center speaker
/*
for discussion on decoder k, see this:
https://depts.washington.edu/dxscdoc/Help/Classes/FoaDecoderMatrix.html#Decoder%20k
*/
@joslloand
joslloand / lineArrayFoa1.scd
Created June 24, 2022 00:40
three FOA line array examples
// --------------------------------------
/*
1) match energy across front stage ( 0 & pi/2)
custom five channel "line array" decoder
*/
~pantoNumChannels = 8;
~pantoOrientation = \point; // need a center speaker
/*
for discussion on decoder k, see this:
/*
example of weighting window across the sphere
*/
/*
note: after truncation rV < 1 for HOA1
*/
// same order for decoding / re-encoding