<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">The docs are right in one sense (at least for block = 64), but probably misleading: min delay possible is zero, but to get zero delay [delwrite~] needs to compute before [delread~]. Max delay is given in [delwrite~], but to attain the max delay, [delread~] needs to compute before [delwrite~]. There's a symmetry to it.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">The piece of code I can't figure out is this. When the buffer is allocated, it actually does add 64 samples to the size:</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">/*--------------------------------------------------------------*/</div><div class="gmail_default" style="font-family:verdana,sans-serif"><div class="gmail_default">    int nsamps = x->x_deltime * sr * (t_float)(0.001f);</div><div class="gmail_default">    if (nsamps < 1) nsamps = 1;</div><div class="gmail_default">    nsamps += ((- nsamps) & (SAMPBLK - 1));</div><div class="gmail_default">    nsamps += DEFDELVS; /*DEFDLVS == 64/*</div><div class="gmail_default">/*--------------------------------------------------------------*/<br></div><div class="gmail_default"><br></div><div class="gmail_default">But when you set the delay in [delread~], it clips the size of the buffer to (size - 64 == buffer size specified in [delwrite~]):</div><div class="gmail_default"><br></div><div class="gmail_default"><br class="">/*--------------------------------------------------------------*/<br></div><div class="gmail_default"><div class="gmail_default">        x->x_delsamps = (int)(0.5 + x->x_sr * x->x_deltime)</div><div class="gmail_default">            + x->x_n - x->x_zerodel;</div><div class="gmail_default">        if (x->x_delsamps < x->x_n) x->x_delsamps = x->x_n;</div><div class="gmail_default">        else if (x->x_delsamps > delwriter->x_cspace.c_n - DEFDELVS)</div><div class="gmail_default">            x->x_delsamps = delwriter->x_cspace.c_n - DEFDELVS;</div></div><div class="gmail_default">/*--------------------------------------------------------------*/<br></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default">I don't have time to puzzle through this right now, but I'm not sure what DEFDELVS is actually designed to do.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 13, 2015 at 1:09 PM, Alexandre Torres Porres <span dir="ltr"><<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Well, it's just a matter of opinion, you think it's unnecessary and I couldn't disagree more, we could just get it over with :)<br><br>But tell me, deep inside, if it did just work without you bothering with anything, would that be a problem to you? Cause it'd be a huge relief for me...<div><br></div><div>It's not even for me, I guess I could live with that, but I teach Pd for almost a decade now, I know something about newcomers... I'm an advocate of Pd and I try to make it as accessible and easy as possible, and I'd really have a problem with telling them (well, you gotta worry about all this stuff because there is a mentality in the Pd world that it'd be "unnecessary" for this to be automatically worked out for the user).<br><br>My life in Pd world is mostly devoted to teaching and advocating Pd as an user friendly tool, it has this power... <br><br>just think outside your mind a little, think about other people that are not you... why would you insist in saying things are unnecessary just because you don't mind doing it - do you mind *not* doing it? What would you lose? Why making a case out of it?</div><div><br></div><div>well, again, in the end, it's a matter of opinion, but as a tie-breaking criteria, I think that making it easier for more people and more user friendly should count.</div><div><br></div><div>cheers</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-12-13 15:54 GMT-02:00 Christof Ressi <span dir="ltr"><<a href="mailto:christof.ressi@gmx.at" target="_blank">christof.ressi@gmx.at</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>>  add a bunch of samples to the delay ; work that internally<br>
<br>
</span>In a way, I agree on that, just add 64 samples so everything works for trivial use cases at block size 64. If you're using delay lines with other block sizes you're doing advanced stuff anyway.<br>
<br>
> why live so hard?<br>
<br>
Given that everything is documented cleanly, there's no higher math involved in getting the right buffer size, just a multiplication and a subtraction ;-).<br>
<span><br>
<br>
> That doesn't seem crazy, get them all, check their block size, stay with the greater block size, work it out interbally, voilà...<br>
> all the worries are over. Not too crazy and just elegant simple coding. You're treating this as a mission impossible where it's quite trivial to me.<br>
<br>
</span>I never said it's a mission impossible. I just said it's unnecessary. If [delwrite~] has fixed buffer size, why should it constantly change only because I change the block size in some subpatch? To me this sounds rather absurd. It's not like that we don't have to care about a lot things on our own (just think of fft subpatches!).<br>
<br>
<br>
<br>
<br>
 <br>
 <br>
<br>
Gesendet: Sonntag, 13. Dezember 2015 um 18:34 Uhr<br>
<span>Von: "Alexandre Torres Porres" <<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>><br>
An: "Christof Ressi" <<a href="mailto:christof.ressi@gmx.at" target="_blank">christof.ressi@gmx.at</a>><br>
Cc: "Miller Puckette" <<a href="mailto:mpuckett@imusic1.ucsd.edu" target="_blank">mpuckett@imusic1.ucsd.edu</a>>, "<a href="mailto:pd-list@lists.iem.at" target="_blank">pd-list@lists.iem.at</a>" <<a href="mailto:pd-list@lists.iem.at" target="_blank">pd-list@lists.iem.at</a>><br>
</span>Betreff: Re: Re: Re: [PD] 0 length delay in delwrite~<br>
<div><div><br>
> At least we all agree that there's a mismatch between<br>
> the docs and the actual behaviour.<br>
 <br>
that's a start<br>
 <br>
<br>
In my opinion, being able to use [delwrite~] and [delread~] at different blocksizes is a nice feature, so what about a nice little warning in the docs that you have to care about the buffer size if you're using different blocksizes?<br>
 <br>
Even failing to see how one thing prevents the other, my point is that you need to care about buffer size ALL OF THE TIME... it's never Good.<br>
 <br>
And in my point of view, it's just so simple: add a bunch of samples to the delay ; work that internally<br>
 <br>
Of course Miller could add some complicated mechanism for [delwrite~] to keep track of all the block sizes of its [delread~] objects.<br>
 <br>
That doesn't seem crazy, get them all, check their block size, stay with the greater block size, work it out interbally, voilà... all the worries are over. Not too crazy and just elegant simple coding. You're treating this as a mission impossible where it's quite trivial to me.<br>
 , but to me the simplest solution is updating the docs and stating: "max. delay time = buffer size - block size of [delread~]"<br>
 <br>
Might be "simpler", but the craziest, and also the laziest, turning the user and patching experience into a nightmare. You're asking us to check all the block sizes and do the math ourselves and then convert it to ms and then insert it into a delwrite~ object... why live so hard?<br>
 <br>
cheers<br>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br></div>