Forums > MaxMSP

add points and curves on ej.function.js

July 3, 2008 | 2:51 am

Hello,

Is there any way other than using the mouse and alt key to create points and set the curve between them?

Thanks,

Don


July 3, 2008 | 7:11 am

In the ej.function.js help the standard, non-curve way of adding/changing points is via lists (which I’m sure you know):

[x] [y] : add new point
[point] [x] [y] : move existing point

To change a point just add the curve value onto the end of the list:

[point] [x] [y] [curve]: move existing point

I suppose if would make sense if you could do:

[x] [y] [curve]: add new point

but of course that has the same number of numerical args as moving an existing point without a curve value.

Any ideas ej?


July 3, 2008 | 11:49 am

Thanks – that works fine…


July 3, 2008 | 12:34 pm


July 3, 2008 | 3:48 pm

ej wrote:
>yeah, IMHO, it would have been confusing that the a list of 3 items
>would do something different depending on the mode� Although, I
>realize that it’s exactly what the addpoints message does ;-) So if
>you send addpoints [x] [y] [curve], it should also work.

I thought I’d tried that with something like:

50 0.5 -0.5

…and I got an error saying point 50 didn’t exist (since it’s assuming [point] [x] [y] )


July 3, 2008 | 4:29 pm


July 3, 2008 | 7:35 pm

Quote: Emmanuel Jourdan wrote on Thu, 03 July 2008 17:29
> or make it create a new point if you’re in curve mode. Any opinion?

Would checking whether the first arg is an int or float be too subtle? i.e., if it’s an int it’s an index of a point, if it’s a float it’s a y value for a new point?


July 3, 2008 | 11:02 pm

On 3 juil. 08, at 21:35, Martin Robinson wrote:

> Quote: Emmanuel Jourdan wrote on Thu, 03 July 2008 17:29
>> or make it create a new point if you’re in curve mode. Any opinion?
>
> Would checking whether the first arg is an int or float be too
> subtle? i.e., if it’s an int it’s an index of a point, if it’s a
> float it’s a y value for a new point?

It’s not an easy task in js, because everything have the type
number ;-) I could modulo it, but then if you send 0 0.5 -0.5, it will
cause weird result.

ej


Viewing 8 posts - 1 through 8 (of 8 total)