Put a 'brake' on a signal.

trummerschlunk's icon

Hi, beginner question probably...

I want to smooth a signal gradually from 'no smoothing' to 'full brake'. (see patcher). It should be doable with a lowpass filter, but I don't know which one... onepole~ does not go far enough to make it stop completely.

I've used something similar in faust a while ago and the solution was (not by me):

lp1p(cf) = si.smooth(ba.tau2pole(1/(2*ma.PI*cf))); 

(which I don't know how to implement in max.)

Thanks a lot :)

Brake Demo.maxpat
Max Patch

double_UG's icon

slide~ ramp~ sah~

xxxxxxxxxxxxxxxxxxxxxxxxxx

trummerschlunk's icon

Thanks.

I looked into these, and slide~ works nicely :)

I guess ramp~ is needed to 'slide' back when the brake is 'released'.

Just not sure how I would trigger the sah~ when brake == 0.

Could you enlighten me how to implement it?

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

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

trummerschlunk's icon

Ah, of course I need a selector.

Nice, thanks a lot!

I edited some details, so the brake can gradually go from 1. (no brake) to 0. (full brake).
When the brake is loosened, selector~ will ramp to the new value.

Cheers <3

Brake Test2.maxpat
Max Patch