Hi, I'm building a really simple sampler to flex my pd muscle. I want to have a variable that controls the speed in milliseconds at which the sample repeats using the metro object, and I also want it to control the speed that the sample array is read by tabread. Right now I'm using a line object to control tabread, which takes a message. Right now the message is " 0, 44100 2000 " Since the message only has one inlet, I'm not sure how I can make the last number in the message variable, unless I somehow refer to a global variable that also controls the metro in the message. How could I do this?
-
Would I create a global variable in this case?
-
Hi,
generally, it's simple to have variable in message, just put $1 in it. If you need more than one variable in message, use [pack] object. For example:| |
[pack f f ]
|
[0, $1 $2(But, reading your post I can only imagine what are you trying to build. It will be much easier to help you if you post a patch, or at least a problematic part of it. Anyway, take a look at the attached patch, maybe it's an answer you were looking for
sinewave
-
Oh okay, the $1 did the trick. For some reason I get an error when I try to upload the patch, but the solution was really simple. I just wasn't sure how to send the bang and the variable to the message at the same time, but I just sent a bang through number via the metro. Thanks so much.