Skip to content

Instantly share code, notes, and snippets.

// -------------------------------------

/* a) 117 full sphere matrix design - mains

*/

// full sphere azimuth and elevation ~mainAz = [ 58, 302, 180, // floor

@joslloand
joslloand / BY STYLE ATK code style options.scd
Last active August 30, 2019 21:15
More ATK code style options
@joslloand
joslloand / Working reference for ATK coding style - Receiver-verbose v2.scd
Last active August 30, 2019 22:57
Working reference for ATK coding style: Receiver-verbose v2

/* Working reference for ATK coding style: Receiver-verbose v2

General Hierarchy:

  1. Receiver-verbose
  2. unless it is clearer in Functional-verbose

*/

// ~~~~~~~~~~~~~~~~~~~~

@joslloand
joslloand / Working reference for ATK coding style - Receiver-sparse v2.scd
Last active August 30, 2019 22:57
Working reference for ATK coding style: Receiver-sparse v2

/* Working reference for ATK coding style: Receiver-sparse v2

General Hierarchy:

  1. Receiver-sparse
  2. unless it is clearer in Functional-sparse
  3. lastly, Functional-verbose as needed

*/

@joslloand
joslloand / HoaZoom.sc
Last active September 11, 2019 23:48
// HoaFocus {
// *ar {arg in, angle, theta = 0, phi = 0, radius = AtkHoa.refRadius, beamShape = 'energy', order = AtkHoa.defaultOrder;
// var beam, radiusEncode, out, nullAmp;
// nullAmp = angle.linlin(0, 0.5pi, 1, 0).squared;
// radiusEncode = HoaNFCtrl.ar(in, radius, AtkHoa.refRadius);
// beam = HoaBeam.ar(radiusEncode, theta, phi, radius, beamShape, order);
// out = beam + ((in - beam) * nullAmp);
// ^out
// }
// }

/* This code is adapted from the examples found in the help file: Introducing the Ambisonic Toolkit

Workshop materials for: Compositional techniques for Ambisonics

​10:00 am - 12:30 pm (Primera Parte) 2:30 - 5:00 pm (Segunda Parte) Escuela Superior de Música, Centro Nacional de las Artes Viernes 25 de octubre de 2019

~size = 512; ~joRfftsize = (~size/2 + 1).asInteger; // SignalBox quark

~real = Signal.newClear(~size); // some harmonics ~real.sineFill2([[8], [13, 0.5], [21, 0.25], [55, 0.125, 0.5pi]]);

~imag = Signal.newClear(~size); ~cosTable = Signal.fftCosTable(~size); ~rcosTable = Signal.rfftCosTable(~joRfftsize);

/* Compare sclang inbuilt fft with SignalBox rfft - refactor of tests by @spluta

What we're seeing is that sclang's complex fft is by far the fastest.

Relatedly, if a real fft (+freqs only) is desired, the quickest approach is to discard -freqs, and then use rfftToFft to create a mirrored spectrum for resynthesis via ifft.

It would be worth investigating refactoring the algorithms found in SignalBox, keeping in mind preserving the current interface(s).

/* Zoom H3-VR source recordings - convert to FOA & rotate

Requires use of HoaVST: https://gitlab.com/dxarts/projects/hoavst.quark

These recordings were made with the device facing away from the performer.

NOTE: we're going to FOA as the reference radius for FOA is inf */

// NRT example
(
~score = CtkScore.new;
/*
http://www.matthiaskronlachner.com/?p=1910
*/
// must set automateParams to true for NRT
~vst = HoaVST.new('mcfx_gain_delay4', numVSTs: 1, vstChannels: 4, automateParams: true);
// ~vst = HoaVST.new('mcfx_gain_delay8', numVSTs: 1, vstChannels: 8, automateParams: true);