Frank told me to make this tutorial to figure out
http://lists.puredata.info/pipermail/pd-list/attachments/20070528/967bc319/attachment-0001.bin
Thanks for his help.
If anybody has the same problem. Here is the message he wrote me:
> I have some newbie questions about Pd. I wanted to write a Patch
> which is based on this one (maybe):
> http://puredata.hurleur.com/sujet-643-sample-player
> The mentioned Sample Player has 2 Sliders which control the Start-/
> End-Loop position which is the exact thing what i was looking for.
Attached is a slightly different sampler, actually not a sampler
itself, but a tutorial on how to build your own sampler.
> What i want to do:
> I want to make a patch, a sample player. When i press a button i want
> to loop the actual sample position according to the key i have pressed.
>
> I give you an example. I load a loop which is 120 BPM fast. I set
> somewhere my tempo. When i press "a" it starts looping 1/4th at the
> actual play position.
>
> For this sort of thing. The Sample Player seems to be perfect. But
> now there are the difficulties.
>
> - How can i set the tempo right? I figured out how to calculate the
> tempo for any note length.
If you work through attached tutorial, maybe some of the neccessary
calculations (as: duration(smps) => duration(msec) etc.) become clearer.
> - How can i get my keyboard entries into the software?
Use the [keyname] or [key] objects.
> - And lust but not least. How can i get the Patch to act how i would
> like.
Just build it! If you get stuck, try to make a patch that illustrates
where you got stuck and send it here.
You may want to start with empty subpatches, that divide your
problem/approach into smaller problems/steps. Like first do a
completely empty patch and put some empty subpatches in there:
[pd load_file]
[pd get_duration_in_msec]
[pd convert_duration_to_BPM]
[pd get_keypresses]
[pd play_sample]
or similar. Then give your subpatches inlets and outlets and connect
them in order. And last fill in these subpatches with the real patches
one by one, always checking if every subpatch does what it should do.
> I know...dumb question you know too.
It's not a dumb question at all. While playing samples isn't exactly
magic, it's also not trivial to do, especially for the first time.