You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.2 KiB
Plaintext
63 lines
2.2 KiB
Plaintext
TITLE:: FluidAudioTransport
|
|
summary:: Interpolate between sounds
|
|
categories:: FluidManipulation
|
|
related:: Classes/FluidBufAudioTransport
|
|
|
|
DESCRIPTION::
|
|
Interpolates between the spectra of two sounds using the Optimal Transport algorithm
|
|
|
|
See
|
|
Henderson and Solomonm (2019) AUDIO TRANSPORT: A GENERALIZED PORTAMENTO VIA OPTIMAL TRANSPORT, DaFx
|
|
|
|
|
|
CLASSMETHODS::
|
|
|
|
METHOD:: ar
|
|
Process incoming audio signals
|
|
|
|
ARGUMENT:: in
|
|
Source A
|
|
|
|
ARGUMENT:: in2
|
|
Source B
|
|
|
|
ARGUMENT:: interpolation
|
|
The amount to interpolate between A and B (0-1, 0 = A, 1 = B)
|
|
|
|
ARGUMENT:: bandwidth
|
|
Someone tell me
|
|
|
|
ARGUMENT:: windowSize
|
|
The window size in samples. As HPSS relies on spectral frames, we need to decide what precision we give it spectrally and temporally, in line with Gabor Uncertainty principles. http://www.subsurfwiki.org/wiki/Gabor_uncertainty
|
|
|
|
ARGUMENT:: hopSize
|
|
The window hop size in samples. As HPSS relies on spectral frames, we need to move the window forward. It can be any size but low overlap may create audible artefacts. The -1 default value will default to half of windowSize (overlap of 2).
|
|
|
|
ARGUMENT:: fftSize
|
|
The inner FFT/IFFT size. It should be at least 4 samples long; at least the size of the window; and a power of 2. Making it larger than the window size provides interpolation in frequency. The -1 default value will use the next power of 2 equal or above the windowSize.
|
|
|
|
ARGUMENT:: maxFFTSize
|
|
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
|
|
|
|
RETURNS::
|
|
An audio stream with the interpolated spectrum of the inputs.
|
|
EXAMPLES::
|
|
|
|
code::
|
|
//didactic - the mouse X axis interpolates between the two sinewaves
|
|
{FluidAudioTransport.ar(SinOsc.ar(220,mul: 0.1),SinOsc.ar(440,mul: 0.02),MouseX.kr())}.play;
|
|
|
|
//richer with complex spectra
|
|
//load 2 files
|
|
(
|
|
b = Buffer.read(s,File.realpath(FluidAudioTransport.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Tremblay-CEL-GlitchyMusicBoxMelo.wav");
|
|
c = Buffer.read(s,File.realpath(FluidAudioTransport.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Tremblay-CF-ChurchBells.wav");
|
|
)
|
|
//listen to them
|
|
b.play
|
|
c.play
|
|
//stereo cross!
|
|
{FluidAudioTransport.ar(PlayBuf.ar(2,b,loop: 1),PlayBuf.ar(2,c,loop: 1),MouseX.kr())}.play;
|
|
|
|
::
|