How to change the speed/pitch using play~ object in a fluid responsive way?

Noisey Parker's icon

Hello,

I am building a one shot sampler/ granular type device. For simplicities sake I have chosen play~ as groove is a bit of a faff out of loop mode. I am looking for a fluid resposive way to alter the pitch of the sample being played. You can see from my patch below that I have come up with a clunky annoying way to do it. What I would like is to be able to change the speed/pitch with a dial that smoothly alters the length of the duration of the sample and thus the pitch. I'm sure it's really obvious, but I have a bit of a block about it!

Thanks for any help

Max Patch
Copy patch and select New From Clipboard in Max.

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hi
by far the simplest/quickest method would be to use [sfplay~] and its associated "speed $1" message:

Unless you intend to use huge audio files, or want to do granular playback/stretching, sfplay~ is now built for the kind of job you describe. You may also override the "speed" message by sending a signal into the object's right inlet.

Brendan

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

. . . getting play~ to operate like this is, of course, also possible, but slightly more of a "faff":

Brendan

Noisey Parker's icon

Hi Brendan,

The second example is great! It's actually perfect for another similar sampler I have been working on. I didn't phrase my question very well...I want to be able to change the loop duration part of the message that reads: Start 0. 1000. 1000. Basically I need a max maths type thing that can both multiple and divide the signal in order to transpose it. I don't think i'm being very clear, do you understand what I mean?

Thanks so much for your help

Will

brendan mccloskey's icon

Hi
I understand your question - dynamically vary the duration of a ramp - and using line~ in this way is problematic; phasor~ is much more flexible in this regard.

Noisey Parker's icon

OK, what if it wasn't dynamically changed, just able to change the pitch for each sample triggered? The patch I am making is designed for very small one shot samples, so actually saying dynamically is misleading. I just want to be able to change the the third part of a message to play globally to the shots can have some pitch variation. start 0 350 350 start 0 400 280 etc. That way I can introduce more complexity into the patch.

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This isn't dynamic:

Brendan

brendan mccloskey's icon

(I usually read OP very quickly, so the misunderstanding is nearly always mine! Although "fluid and responsive" did mislead me a little)

Noisey Parker's icon

Thanks Brenden!! This isn't the first time you've helped me, I really appreciate the time you take to respond to forums queries - I'm terrible at the operations and math side of Max.

brendan mccloskey's icon

Learning by doing; it's what we do.

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

And this is an old patch of mine that makes [phasor~] work a little like [line~] for one-shot ramps, with variable ramp time:

Brendan