max lacks a curve drawing tool with an intuitive GUI?!?

maxplanck735@hotmail.com's icon

OK, can you guys please enlighten me here:

From all that I can find, it seems like there are no Max/MSP objects or externals for drawing curves which have an intuitive GUI. An example of what I would consider to be a good GUI for curve drawing is the one in Adobe Photoshop.

[techno~] only has exponential curve drawing... this is too limited.

Jasch's [bspline] object seems to be the closest thing to what I want. However, understanding how to use [bspline] confuses the heck out of me. I could spend a lot of time trying to figure it out, but I just feel like end users shouldn't have to deal with this.

I just want to draw some curves to control the amplitudes of some [cycle~] objects. I have no interest in dealing with the internal language used by any curve drawing objects or patchers. I think that there should be an object or patcher available that allows me to simply click and drag to create and position some control points in order to create a curve, like there is in Photoshop. (+ some additional configurability, such as user definable range and domain size, etc.)

Am I wrong? Is there an object, external, or patcher out there that does what I want? Is there a way to do what I want using [bspline]? If so, can someone post a patcher?

Thanks, any help would be much appreciated

seejayjames's icon

It would be nice to have a mode of bpfunction which does this. Maybe a good feature request, but it doesn't seem trivial to implement.

As a simple workaround you can use multislider or the waveform~ editor to draw curves, but they don't provide the "bezier-style" creation of the lines like Photoshop, Audition, etc.

Or you can roll your own functions using sin, cos, etc., using an uzi to generate a large set of values. bpfunction can then be used to scale the result too.

--CJ

Axiom-Crux's icon

why cant they just add that to the envelope draw widget already!!! max 5!?

jasch's icon

have a look at the updated help file of my [bspline] object.
there you'll find a few tricks for GUI applications.

www.jasch.ch/dl/

/*j

Wetterberg's icon

jasch skrev:
> have a look at the updated help file of my [bspline] object.
> there you'll find a few tricks for GUI applications.
let me guess; v. 0.4, which is osx-only?

Andreas.

johannes-eckart@gmx.at's icon

Hi there!
I am a little bit stopped here:
I am using the bspline-object from jasch's homepage. I can't get it rendered into a jit.window! When I take the "bspline.help"-file, the curve is rendered into a lcd-object. How can I render it into a jit.window or jit.pwindow?
I found another patch using the bspline-object (see afterwards) with a rendering, but when I try to mix the two patches up, I don't get a result...
Here the patch:

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

Can somebody have a look on the patch? Maybe I am just thinking too complicated?!?
Also I don't afford to put some more control-points into the curve. With a function-object it would work, but just adding points by given x/y-coordinates poses a big barrier for me!
Thanx,
Johannes

johannes-eckart@gmx.at's icon

Hello there!

Well, I spent quite a time on my problem and finally I come forward but "step-bystep" (in fact, very small steps ;) ).
I could reach to mix the two patches together now! Well, nearly...
The bspline is rendered now in a "jit.window", and I can also put more control-points into the curve, by changing the "jit.matrix". I cannot just jet give the control-points the x/y-coordinates, but I will work on it (I think the solution is in creating a control-matrix, or so...).
But here the problem for the moment: I can't visualize the control-points in the "jit.window"! The control-lines between the points are visible, but not the points. I have already a smoking head because of this problem...
Here my patch:

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

Can somebody help me here, please? Maybe for better understanding: in the "bspline.help"-file the points are visible, but just in an LCD-object!
Thx a lot,
Johannes

oli larkin's icon

havn't read the thread fully but have a look at this JSUI...

(curve-prelim)

oli

johannes-eckart@gmx.at's icon

Thanks Oli for your proposition!
Unfortunately it's not exactly what I need: The new curve-function by Martin is a modulation of the already existing function-object in Max/MSP. I will go on drawing my curves with the bspline-object, but what I need is a solution to put control- or breaking-points by x/y-coordinates into the curve.
Maybe for better understanding, an example:
In a video I have a red spot and I grab the coordinates of this spot. When the spot is moving in the video, also the coordinates change and they should create the new control-points.
I don't know, if it's better for understanding now, but maybe somebody has an idea, how to put "endless" many points into the bspline-object...

andré sier's icon

On Sep 8, 2007, at 10:03 AM, Johannes wrote:

> I don't know, if it's better for understanding now, but maybe
> somebody has an idea, how to put "endless" many points into the
> bspline-object...

hello, i did put endless points in a spline object...
splining is just a fancy interpolation that instead of using 2 normal
points as end, begin, it usually uses 4, drawing only in the space
between the middle two control points.

so basically, you need to keep track where you are interpolating, and
the moment you reach the end of _this 4 points interp_ you should
instantly change the control points, in fifo fashion. this behaviour
will make your spline continuous.

some pseudo code that exhibits continuous point calling spline and
regular spline reading n breakpoints..

// inside the object define:

//4 points for the continuous spline interp+next point
pt pt1,pt2,pt3,pt4,next;

// N breakpoints for regular spline path making
pt points[];
int numbreakpoints;

// store a head val that will keep track of where you are in the spline
float head=0.;
float stride=0.01;

// an example continuous function will only be triggered when
// you reach past 1. in the head

void spline_continuous_setpoint(pt next) {
    //fifo control points
    pt1 = pt2;
    pt2 = pt3;
    pt3 = pt4;
    pt4 = next;
}

pt read_spline_continuous() {

    //advance control val
    head+=stride;
    if(head>1.) {
        head-=1.; //make sure control wraps
        notify_user_point_is_past_head_so_he_can_update_next_pt();

        pt nextpt = read_next_pt_into_x->next();
        spline_continuous_setpoint(nextpt);
    }

    pt =    somespline(p1,p2,p3,p4,head);

    return pt;
}

pt read_spline_control_points() {

    //advance control val and find control points
    head+=stride;
    if(head>x->numbreakpoints-2)
        head-=x->numbreakpoints-2; //make sure control acesses all stored
points

    int c = (int) head; //cheap floor
    float sinterp = head-c; //set the spline interp range 0.-1. in
between breakpoints

    // so the points for the spline interp are..

    p1 = x->points[c-1];
    p2 = x->points[c+0];
    p3 = x->points[c+1];
    p4 = x->points[c+2];

    // perform the spline function with 4 points above and current head
value

    pt = somespline(p1,p2,p3,p4,sinterp);

    return pt;
}

if you want to see some code working, check out a-hspline3d from my
a-objects, available in my site at www.s373.net/code

the 'stack' message i implemented in the object uses these coding
concepts
to make a continuous ever-ending spline. however, its not an object
suitable
for curve drawing in max, i guess..

hope this helps,

a

Stefan Tiedje's icon

Did you ever consider to take the original (working) patch with lcd, and
just replace lcd with jit.lcd???

I didn't try, but that would be the first I'd try...

Stefan    

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

johannes-eckart@gmx.at's icon
ryan7585's icon

For people coming here that aren't familiar with it, Max now has a [function] object that does this well. Took me a while to find it