<HEAD></HEAD>
<BODY >
<P>You're on exactly the right track and thinking all the right things. </P>
<P>An important value to grab is the length of the sample (in samples)</P>
<P>which you can get from [soundfiler]. Multiply your [phasor~] by the</P>
<P>magnitude of the loop and add it to an offset in samples and that should</P>
<P>be the table index you need.</P>
<P>(please excuse awful html formatting , using webmailer )</P>
<P>andy</P>
<P><BR>&nbsp;</P>
<TABLE width="100%">
<TBODY>
<TR>
<TD width=5 bgColor=blue>&nbsp;</TD>
<TD>
<STYLE>

</STYLE>

<DIV>
<P><FONT face=Arial size=2><SPAN>Hi!</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN>Maybe I haven’t looked hard enough but I just haven’t been able to find any examples on building a sample playback engine<SPAN>&nbsp; </SPAN>that will allow for sample-start, loop-start and loop-end positions to be set. The question is what would be the easiest way to achieve this.</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN>I have been thinking about ways to achieve the sample clock driver but since I’m new to PD perhaps my thinking is too complex.</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN>My ideas have been:</SPAN></FONT></P>
<OL>
<LI><FONT face=Arial size=2><SPAN>Should I try generating the sample clock driver using two phasor~ objects where one phasor~ handles sample-start ‘til loop-end and let the other one (loop-start ‘til loop-end) kick in once the first one has completed it’s first and single run.</SPAN></FONT> 
<LI><FONT face=Arial size=2><SPAN>Perhaps using a vline~ for the first part instead of a phasor~</SPAN></FONT> 
<LI><FONT face=Arial size=2><SPAN>Simply using one phasor~ object and offsetting the start value of it’s second cycle to the loop-start position</SPAN></FONT> 
<LI><FONT face=Arial size=2><SPAN>Simply using a vline~ object and “loop it” with a different start position the second time onwards.</SPAN></FONT> </LI></OL>
<P style="MARGIN-LEFT: 18pt"><FONT face=Arial size=2><SPAN>&nbsp;</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN>I suppose I would have to use the samphold~ object to make the shift between phasor~ or vline~ or just to offset the start position of a phasors~ second cycle.</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN>Any ideas or examples on how to best achieve this would be more than welcome.</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN>&nbsp;</SPAN></FONT></P>
<P><FONT face=Arial size=2><SPAN>/Mikael</SPAN></FONT></P></DIV></TD></TR></TBODY></TABLE></BODY>