x-y controller jsui example?

Apr 3, 2009 at 6:09pm

x-y controller jsui example?

Hi everybody!

There’s a long post to follow, but the bottom line is that i want to build a x-y controller (with lcd or jsui) that has more than one ‘dot’ in it. It’d have multiple draggable points and report the position of each. The next step would be intead of having points, having circles whose radius can be changed as well as being moved around. These would live on a square in both cases.

I’ve never used lcd or jsui and I have no idea where to begin with this stuff. I am a fair hand at computer programming in general, tho I only have a little experience at javascript and that was more than 5 years ago. Examples are what I need to build from.

I am still running max 4.6, btw (on windows xp).

a somewhat verbose description of the patch idea follows:

i have this idea for a sort of crossfader thing sort of inspired by vector synthesis. Basically, the idea is to have N sound sources (not just four) where the loudness is controlled by a 2-d oscillator. Imagine a square with points inside it representing the different sound sources. now imagine a dot running around in the square, and the nearer the dot is to a given point, the louder the corresponding sound source is. Now, instead of the sound sources being represented by points, represent them with a circle. the smaller the circle, the closer the dot has to be to make the sound loud, so a really wide circle will basically mean the sound is always on.

So, the interface I want to have is a square with a fixed number of circles in it where I can drag the circles around inside the square, and also drag to make them wider or thinner (i’m guessing the circles have a dot in the center for dragging and the circle around for width control). The scanning dot should be able to be controlled by external commands or dragged around with the mouse.

A much simpler but also useful interface would just have several points that i could move around, where the scanning dot and width would not be displayed or controlled within the interface, but separately with vanilla max interface elements.

Adding/removing sound sources (circles/points) would not be necessary, as this would involve on the fly connection of signals inside max. It might could be done with poly~ or something but i’d be content with just a fixed number of points.

I had the idea just listening to vents and other common noises, where it seems that there are two or more tones where the loudness of one depends on the loudness of the others. Sometimes when one tone appears another goes away, and sometimes the loudness is positively linked.

Getting this to work wihtout the nice interface shouldn’t be too hard, but playability is key. It’s not unlike the mulch metasurface i guess, but automating (as with a randomized lfo) the scanner would be impossible inside mulch so far as I know.

Thanks!

#43181
Apr 3, 2009 at 7:52pm

Quite recently Andrew Benson unveiled an external called [nodes] that does pretty much what you are looking for, however it is for mac and max5 only at the moment. Here’s the link just in case you can get on a mac and test it out.

http://www.cycling74.com/twiki/bin/view/Share/AndrewBenson

I haven’t used [jsui] in a while but I had a sort of [pictslider] type control working at one point. I’ll see if I can find it and post it here if I think it might be useful to you. Sorry I can’t be of more help.

lh

#154813
Apr 4, 2009 at 5:15pm

somebody linked me to this website, http://www.pixelmechanics.com/ , which had this set of nifty patches: http://www.pixelmechanics.com/jr_xy_maxpatches.zip

which includes a multi-point x-y controller built on lcd. there’s some javascript in there but not in a jsui object. i like their approach, the js is used to handle programming tasks that’d be cumbersome to do in max… how nice to have functions and variables…

#154814
Apr 5, 2009 at 5:09pm

Hi,

Around the same idea, i did a jsui object just a few days ago (see attachment). As it is my first javascript thing, the code may probably be improved. Please let me know if you do so.
I got another version, with an additional square, that I can post after I clean the code if you are interested.
The help file is max 5, but it works the same under 4.6.

Ch.

#154815
Apr 8, 2009 at 1:15pm

Hi

I’m the author of the nifty patches you mention…

I used LCD over JSUI due to speed issues with JSUI, plus I couldn’t get my head around screen-to-world etc, at the time.

I’ve now got the gravity example ported to Jitter, and should really do the same with the others.

You might be interested in a standalone app I just released that also uses the LCD and JS combination.

As you’re on a PC you’ll need the Max 5 runtime installed.

http://www.pixelmechanics.com/jr_Bupp_mac.zip

http://www.pixelmechanics.com/jr_Bupp_pc.zip

#154816
Jun 11, 2009 at 8:02am

Hi,

I’m having some issues with js lcd combination. I’m making an additive synth that is controlled by a touchscreen. I used to use [function] for he individual adsr shapes for every harmonics, but due to the touchscreen i use i needed to step of of this idea, and recreated a [function]-like js that draws on an lcd. But it seems to be very hard on my macbook pro. I guess it is because the lcd is large (1500×900).

I also use the js within a poly to use just one lcd and turn the drawing function off when ever the harmonic isn’t in focus.

I was wondering if it would be better to address opengl (not within jsui) directly, but don’t know how. Could someone please have a look at the attached patches? the bigscreen patch is just the lcd with some send/receives. the jr_adsr_xy.maxpat is a simple one, but better test the untitled4 that uses the poly.

If I check in the cpu dsp meter it doesn’t move at all though.

best pieter

ps the script is an adaption of the jr_lcd script (thx for that)

#154817
Dec 8, 2009 at 3:39am
#154818
Dec 8, 2009 at 3:40am
#154819
Mar 17, 2012 at 11:18pm

@pixelmechanic – those js things are great

#154820

You must be logged in to reply to this topic.