It sounds as if the ‘line’ object or one of its variants (bline, line~) is what you need. The ramp-up/ramp-down time can be stored as part of your pattr preset. Check below. One trick to getting this to work correctly is that the ramptime needs to be sent before the the value. You can do this by setting the priority of the ramp to a lower number than the value in the pattrstorage "Client Objects" window.
— Pasted Max Patch, click to expand. —
Copy all of the following text. Then, in Max, select New From Clipboard.