If you're just getting started with Pd, it might be a good idea to use the [susloop~] external because it also allows for dynamic pitch shift, the math for which can be tricky (though apparently someone just got it down on their own recently if I recall from a previous post).  Are you using Pd-extended?  It has this object included by default in the bsaylor library.  Look into the documentation, it's a really handy one, I have attached my GUI for it which you can use by putting the attached file into your "extra" directory and then typing "susloopgui~" to create the object.
<br><br>As for intervals like 1/4, etc... use [key] or [keyname].&nbsp; [key] will give you the numeric keycode for a keyboard press; using [sel] you can then do the appropriate math based on which key is pressed.&nbsp; Again I don&#39;t know how new you are to pd, but proficiency with sends and receives, hot and cold inlets using trigger, etc will be really helpful in getting all to work properly as far as the math goes.
<br><br>For setting tempo, you will need to calculate the total length of the sample and divide it accordingly.&nbsp; With susloop~ you give it a beginning and end point in samples (as in the actual pieces of data, not soundfiles), so you could say that a quarternote at 120 BPM with a samplerate of 44100 samples per second would be 22050 samples long, right?&nbsp; Thus an eighth note is 11025, and so on with division.
<br><br>The attached gui has the sliders implemented.&nbsp; I hope that this helps a little bit!<br><br>Good luck,<br>Kevin<br><br><div><span class="gmail_quote">On 5/28/07, <b class="gmail_sendername">Zeitler Andreas</b> &lt;
<a href="mailto:azeitler@zettt.de">azeitler@zettt.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi<br><br>I have some newbie questions about Pd. I wanted to write a Patch
<br>which is based on this one (maybe):<br><a href="http://puredata.hurleur.com/sujet-643-sample-player">http://puredata.hurleur.com/sujet-643-sample-player</a><br>The mentioned Sample Player has 2 Sliders which control the Start-/
<br>End-Loop position which is the exact thing what i was looking for.<br><br>What i want to do:<br>I want to make a patch, a sample player. When i press a button i want<br>to loop the actual sample position according to the key i have pressed.
<br><br>I give you an example. I load a loop which is 120 BPM fast. I set<br>somewhere my tempo. When i press &quot;a&quot; it starts looping 1/4th at the<br>actual play position.<br><br>For this sort of thing. The Sample Player seems to be perfect. But
<br>now there are the difficulties.<br><br>- How can i set the tempo right? I figured out how to calculate the<br>tempo for any note length.<br>- How can i get my keyboard entries into the software?<br>- And lust but not least. How can i get the Patch to act how i would
<br>like.<br><br>I know...dumb question you know too. But maybe there is someone who<br>knows an answer.<br><br>Many, many thanks.<br><br>–––––––––––––––––––<br><br>Zeitler Andreas<br><br><br>_______________________________________________
<br><a href="mailto:PD-list@iem.at">PD-list@iem.at</a> mailing list<br>UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a><br></blockquote>
</div><br><br clear="all"><br>-- <br><br><br>++++<br><a href="http://pocketkm.blogspot.com">http://pocketkm.blogspot.com</a>