<p dir="ltr">You'll get zipper noise with the samphold per block approach.</p>
<p dir="ltr">Cost to dereference a struct member is probably a little more than just using or getting a value. It's possible it'll be cached, though.</p>
<div class="gmail_quote">On Oct 2, 2015 5:26 PM, "Jonathan Wilkes via Pd-list" <<a href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div>There are probably a lot more ways to implement ramps.  For example, you</div><div dir="ltr">could increment only at block boundaries and just repeat that value for the</div><div dir="ltr">rest of the block.  That would looks a lot like Supercollider's "kr" ugens.  (I</div><div dir="ltr">actually thought that's how [line~] worked until I looked at the code.)</div><div dir="ltr"><br></div><div dir="ltr">Btw-- does it cost anything significant to dereference x->x_inc inside the</div><div dir="ltr">while loop of line_tilde_perform?  Or is the compiler able to somehow</div><div dir="ltr">optimize that?</div><div dir="ltr"><br></div><div dir="ltr">-Jonathan<br></div><div><span></span></div>  <br><div><br><br></div><div style="display:block"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"> <div dir="ltr"> <font face="Arial" size="2"> On Friday, October 2, 2015 11:36 AM, i go bananas <<a href="mailto:hard.off@gmail.com" target="_blank">hard.off@gmail.com</a>> wrote:<br> </font> </div>  <br><br> <div><div><div>Hi, me again.  <div><br clear="none"></div><div>Thanks for the discussion.  It has really opened my eyes.  </div><div><br clear="none"></div><div>So, i got my naive c++ implementation of line~ basically working.  </div><div><br clear="none"></div><div>And of course, just running a for loop incrementing by ticks, i run into the exact precision error that this block quantizing seems to avoid.  My line from 0 to 100 over 44100 samples only gets to 99.93   </div><div><br clear="none"></div><div>So, i also need to add something like pd's block quantization to make sure my line goes all the way to the specified value.  </div><div><br clear="none"></div><div>My questions then are 2:  </div><div><br clear="none"></div><div>Is pd's method the way i should do it?  Or is there a better alternative?  </div><div><br clear="none"></div><div>And, if i do it the pd way, how does that work?  Does the increment get updated every block?   Or is it just the last block that is stretched?  </div></div></div><br><br></div>  </div> </div>  </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>