curve~ doesnt work with exact same messages as line~

mcQ's icon

I made a little portamento patch and used line~, it worked fine. I substituted in curve~ and all of a sudden it doesn't work. It literally takes the exact same messages. There seems to be a delay in curve~ taking the messages and actually using them out of order or something. Why?

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

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

Thanks a lot, but this doesn't work properly with presets still. I used to settle for little tricks/settle for less when an object wouldn't work properly, but whenever I would elaborate on a patch later on it would always come back to haunt me.
Nowadays I simply won't settle for less than the patch working in an efficient way that isn't duct-taped up around some nonsense bug.
I know I sound stubborn, which I am, but this patch is going to be hooked up to an actual sequencer which very well could be sending it a lot of notes in a small amount of time, so optimization is a must. I think I'll just use line~ and if I really need to curve it ill just use gen or expr or something.

Thanks again.

Christopher Dobrian's icon

Your patch has a bug. Do not send the message containing the comma from sprintf directly to curve~. The curve~ object has no idea what to do with a comma. The comma is only meaningful in the way you intend within the message box. So, if you want to do things the way you're doing them here, you need to trigger the message box after you put the message in it, like this (your patch with one small change).

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

Also, FWIW, when line~ and curve~ get correctly formatted messages, they both work fine for me. (Max 7.3.1, Mac OS 10.12.2).

BTW, here is some text from a post I made on this comma topic on the MaxMSP Facebook group a while back:

Although lots of help files and tutorial patches and examples use the message box to send a message such as "0., 0.95 5000" to line or line~, there's no inherent reason that the messages have to come from a message box object. So I occasionally see people agonizing over how to format a message with commas and the like, when in fact that's not necessary. The comma in the message box just separates the message "0." or "0" from the message "0.95 5000" and sends them out in rapid succession (in the same tick of the scheduler). You can easily do that without the message box, just by triggering a "0." then triggering a "0.95 5000". Here's an example that doesn't use a message box at all.

... I also see some people being confused as to whether/when the initial "0" message is needed. If you want to set the starting point of a line or a line~, a single number (or a 'set' message) will do that. But if you just want the line to start from wherever it currently is, then you should omit that initial step of resetting to a particular value. Which to do depends on what exactly you're trying to achieve.

mcQ's icon

Oh man, thanks a lot. I really should've noticed that. I formatted it for the message object, but then exempted the message object to make the patch more concise, so I confused the curve~ object. Thank you very much.

However, how come the line~ object knew what to do with the comma yet curve didn't?