<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi,</div>

<div> </div>

<div>when you have a [delwrite~] in a subpatch with overlap, you have to make sure that the delay time for [delread~] is rounded down to the hopsize in ms, otherwise you will read parts of two non-consecutive blocks of audio and get glitchy results. Here's what happens:</div>

<div> </div>

<div>[block~ 8 4] // for the sake of simplicity</div>

<div> </div>

<div>blocksize: 8, overlap: 4, hopsize: 2</div>

<div> </div>

<div>input signal: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15</div>

<div> </div>

<div>[delwrite~] fills the delay line for every window:</div>

<div> </div>

<div>window1: 0, 1, 2, 3, 4, 5, 6, 7</div>

<div>window2: 2, 3, 4, 5, 6, 7, 8, 9</div>

<div>window3: 4, 5, 6, 7, 8, 9, 10, 11</div>

<div>window4: 6, 7, 8, 9, 10, 11, 12, 13</div>

<div> </div>

<div>after 8 samples of input, the delay line will actually contain 8 * 4 = 32 samples:</div>

<div> </div>

<div>0, 1, 2, 3, 4, 5, 6, 7 | 2, 3, 4, 5, 6, 7, 8, 9 | 4, 5, 6, 7, 8, 9, 10, 11 | 6, 7, 8, 9, 10, 11, 12, 13</div>

<div> </div>

<div>as you can see, the delay time *in samples* for [delread~] must be a multiple of 8 (= blocksize) to avoid discontinuities. when [delread~] converts from ms to samples, it takes the overlap into account, so you can use a multiple of the *hopsize in ms*.</div>

<div> </div>

<div>As you might have noticed, with 4x overlap the delay line needs 4x more space than usual. Luckily, [delwrite~] also accounts for the overlap when resizing the delay line, so for 4x overlap [delwrite~ 1000] will actually allocate 1000 * 44.1 * 4 = 176,400 samples (+ a few extra samples).</div>

<div> </div>

<div>Attached you'll find a modified version of your test patch with the glitches removed and an example for a spectral delay. Enjoy!</div>

<div> </div>

<div>Christof</div>

<div> 
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Freitag, 02. August 2019 um 07:46 Uhr<br/>
<b>Von:</b> "Alexandre Torres Porres" <porres@gmail.com><br/>
<b>An:</b> Pd-List <pd-list@lists.iem.at><br/>
<b>Betreff:</b> [PD] delay with fft / block size with overlap</div>

<div>
<div>Hi, I'm trying to make sense of how delread/delwrite work in a fft subpatch.
<div> </div>

<div>So, I have attached a test patch, why does it sound so bad? All I'm trying to do here is delay the sound input before it gets analyzed/ressynthesized. This is not my ultimate goal so I don't really need to do what I'm doing here, but I am exploring delays in spectral patches so I need to figure a few things out. </div>

<div> </div>

<div>thanks</div>
</div>
_______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" target="_blank">https://lists.puredata.info/listinfo/pd-list</a></div>
</div>
</div>
</div></div></body></html>