sorted the latency formula of HPSS

nix
Pierre Alexandre Tremblay 7 years ago
parent 032aefc621
commit e7efba1f59

@ -64,7 +64,7 @@ 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 allows an oversampling of the spectral precision.
RETURNS::
An array of three audio streams: [0] is the harmonic part extracted, [1] is the percussive part extracted, [2] is the rest. The latency between the input and the output is TBC samples.
An array of three audio streams: [0] is the harmonic part extracted, [1] is the percussive part extracted, [2] is the rest. The latency between the input and the output is ((harmFiltSize + (winSize / hopSize) - 1) * hopSize) samples.
EXAMPLES::

@ -10,26 +10,24 @@ b.play
{FluidHPSS.ar(PlayBuf.ar(1,b.bufnum,loop:1),17,31,1,0.05,40,0.1,-40)}.play
// params in mode 2
{FluidHPSS.ar(PlayBuf.ar(1,b.bufnum,loop:1),17,31,2,0.05,40,0.1,-40, 0.1, -10, 0.2, 10)}.play
{FluidHPSS.ar(PlayBuf.ar(1,b.bufnum,loop:1),17,31,2,0.05,40,0.1,-40, 0.1, -10, 0.2, 10)[2].dup}.play
// null test (the process add a latency of ((harmFiltSize + (winSize / hopSize) - 1) * hopSize) samples
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,31, winSize:1024,hopSize:512,fftSize:2048).sum - DelayN.ar(sig, 1, ((31 + 1) * 512 / s.sampleRate))]}.play
// null test (the process add a latency of ((harmonicFilterSize +1) * windowSize / 2) samples NOT WORKING ARGGGG
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,21,0,0,1024,512,2048).sum , DelayN.ar(sig, 1, ((31 + 1) * 1024 / 2 / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,21, winSize:1024,hopSize:512,fftSize:2048).sum - DelayN.ar(sig, 1, ((21 + 1) * 512 / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,31,0,0,1024,512,2048).sum - DelayN.ar(sig, 1, ((31 + 5) * 512 / 2 / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,29, winSize:1024,hopSize:512,fftSize:2048).sum - DelayN.ar(sig, 1, ((29 + 1) * 512 / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,29,0,0,1024,512,2048).sum - DelayN.ar(sig, 1, ((29 + 7) * 512 / 2 / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,29, winSize:1024,hopSize:256,fftSize:2048).sum - DelayN.ar(sig, 1, ((29 + 3) * 256 / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,29,0,0,1024,256,2048).sum - DelayN.ar(sig, 1, (40 * 256 / 2 / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,11,29, winSize:2048,hopSize:512,fftSize:4096).sum - DelayN.ar(sig, 1, ((29 + 3) * 512 / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,21, winSize:2048,hopSize:256,fftSize:4096).sum - DelayN.ar(sig, 1, ((21 + 7) * 256 / s.sampleRate))]}.play
//((harmonicFilterSize + (overlap - 1)) * hopsize)
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,31,0,0,1024,512,2048).sum - DelayN.ar(sig, 1, (((31 + (4 - 1)) * 512) / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,21,1,1,winSize:1024,hopSize:512,fftSize:2048).sum - DelayN.ar(sig, 1, ((21 + 1) * 512 / s.sampleRate))]}.play
// half harmoSize+1 * hop + window
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,31,0,0,1024,512,2048).sum - DelayN.ar(sig, 1, ((((31+1) / 2 * 512) + 1024) / s.sampleRate))]}.play
{var sig = PlayBuf.ar(1,b.bufnum,loop:1); [FluidHPSS.ar(sig,17,21,1,2,winSize:1024,hopSize:512,fftSize:2048).sum - DelayN.ar(sig, 1, ((21 + 1) * 512 / s.sampleRate))]}.play

Loading…
Cancel
Save