## [lcd] object doesn't do what i want!

Dec 24 2006 | 3:32 pm
Hi all.
I've been working on some stuff with gesture recognition with the [lcd] object. One problem I've encountered is that lcd doesn't output every value drawn unless the line is drawn very slowly.
I can get the length of a line drawn along a single axis (subtract the start value from the end value...) but I can't measure the length of a line drawn in actual pixels covered.
In particular, I'm working on a 'z' gesture. I've sorted out horiz. line recognition, but the diagonal is proving more tricky. I was planning on having max test the length of the drawn diagonal line against the shortest possible length of the line given by pythagoras' theorum, and giving a maximum deviation after which the line can be deemed not diagonal.
There are two things I'd love to know - 1) Is there a way to work out the length of a line on a graph by comparing the two sets of coordinates? 2) Is there a similar object to [lcd], perhaps a 3rd party, that outputs every value? Can't find anything on maxobjects.com though.
Thanks, and merry christmas!
robin

• Dec 25 2006 | 1:27 am
> There are two things I'd love to know - > 1) Is there a way to work out the length of a line on a graph by comparing the two sets of coordinates?
For a line from coordinates (x1,y1) to (x2, y2), you want:
the square root of ((x1-x2)squared + (y1-y2)squared)
> 2) Is there a similar object to [lcd], perhaps a 3rd party, that outputs every value? Can't find anything on maxobjects.com though. > >
Does jsui do what you want?
mz
• Dec 25 2006 | 2:15 pm
Hi,
There is an example in FTM library that does gesture recognition using hmm. If you have ftm installed, you can find the example in extras menu, mnm-examples->hmm->mnm.hmmL2R-ez.help
In that example, you can use lcd to draw patterns for training and recognition.
best, nesa
• Dec 25 2006 | 2:40 pm
Firstly, i can't believe i'm actually posting on Christmas day. Secondly, thanks - hadn't thought of jsui. The jsui example that responds most similar to lcd doesn't put out all values though... If I draw a line with a range from 100 to 0, i get the following:
print: 97 print: 95 print: 94 print: 93 print: 87 print: 77 print: 62 print: 40 print: 20 print: 0 print: 0 print: 0 print: 0 print: 0
There may well be some way to edit the javascript, but I know nothing about java. Maybe when I'm not too busy drinking as much as I can I'll have a look
merry christmas
• Dec 26 2006 | 3:41 am
>One problem I've encountered is that lcd doesn't output every >value drawn unless the line is drawn very slowly.
yoyu mean mousing output? its some 20 or 50 milliseconds and not more.
> I was planning on having max test the length of the > drawn diagonal line against the shortest possible length > of the line given by pythagoras' theorum, and giving a > maximum deviation after which the line can be deemed not > diagonal.
[110.pythagoras] at maxobjects.com
> 2) Is there a similar object to [lcd], perhaps a 3rd > party, that outputs every value?
this already fits into the category "dont exspect MAX to replace photoshop" when i am not wrong.
there is [jit.lcd] ... those two are the only ones of that type.
-110
• Dec 26 2006 | 11:25 am
Thanks, but I'm a little confused now. I said I intended to measure the length of the actual line drawn and compare it to the length of the straightest possible line between the start and end points, using pythagoras.
You (Roman) said it can't be done, but also pointed me to an external - which doesn't exist anyway.
did i miss something?!
thanks anyway, the lcd info is useful to know.
robin
• Dec 26 2006 | 10:59 pm
Quote: robin wrote on Tue, 26 December 2006 04:25 ---------------------------------------------------- > Thanks, but I'm a little confused now. I said I intended to measure the length of the actual line drawn and compare it to the length of the straightest possible line between the start and end points, using pythagoras. > > You (Roman) said it can't be done, but also pointed me to an external - which doesn't exist anyway. > > did i miss something?! > > thanks anyway, the lcd info is useful to know. > > robin > ----------------------------------------------------
to know the lenght of a drawn line the beginning and the end point should be enough no? though i am not sure how we could get the exact end point via mousing.
but feel free to post your problem patch, maybe i can learn something myself fixing it.
not to self: dont point people to files which are not online.
• Dec 27 2006 | 1:12 am
the patch i'm working on/planning involves the user drawing lines with the mouse in [lcd], and as such, a 'straight' line may not actually be so. I was hoping to count the numbers of pixels covered by the line - say i moved from coordinates 0,0 to 0,100, but via 10,100, the line's length would be greater than 100. i need to be able to work out the value in terms of pixels, so i was hoping to just be able to count each output value. as you pointed out, [lcd] outputs on a time-based interval, so it ain't really much use.
forgive me for not posting it, its a little embarrassing at this stage
thanks for the patch - nice festive colour scheme
robin
• Dec 29 2006 | 8:00 pm
What about using mousestate to read the coordinate values where you are drawing, then collect and store them into a coll or something? Looks like mousestate can output every bang, so 1 ms. is lot better than 20 ms (if you want finer resolution).
Using LCD you can read when it's clicked, this starts the metro/mousestate and begins collecting the coordinate data, then releasing will stop the metro. You'd have a list of your coordinates, though they would be time-based. Guess you could use a *change* object in the stream to filter out times that you don't move within the polling period.
Hm, this would be a nice way to record gestural motions on the screen to use for lots of stuff like musical parameters too. Of course, an mtr and a 2D slider would do it too. You might consider mtr as a possible tool for recording your information too, the textfile has all the info you need (though maybe a bit awkward to parse through).
--CJ
• Dec 29 2006 | 8:53 pm
hey. thanks for the idea. i think though, that unless i can measure the exact amount of pixels drawn in a line, then i can't use pythag to compare it to a straight line between those two points. with both [mousestate] and [lcd], i still end up with diagonal lines that appear to be shorter than the hypotenuse, which is obviously impossible. i may have to rethink the approach for this
thanks
• Dec 29 2006 | 9:21 pm
...oh, and you talked about how it would be a nice way to record gestures. i made this thing a while ago. it records gesture and plays it back, preserving the timing
• Dec 29 2006 | 9:42 pm
Robin,
Each time I discover something new for lcd, I think this is one of the most full-featured object of Max. A user lib (a la Reaktor) should exist for storing a such great patcher!!!
Well-done ;-) Philippe
• Dec 29 2006 | 10:30 pm
Hey, that recordable patch is great. Nicely done, there's definitely some potential for using that in other patches. Good use of counter, coll, and the LCD.
I'm thinking that the playback of it could be nicely coordinated with something underneath, like a frequency/timbre 2D plot, or a "level-of-effect" area that would send the coordinates to sound generators or wavefile playback signals. This way there would be a visual indication of where the levels are at during playback.
How might you make this real-time-eraseable, that is, have a trail of some length behind the current point, but the rest disappears after a moment or two? ;-)
This way the LCD would stay "clean"....
--CJ
• Dec 29 2006 | 10:51 pm
So, i'm just gonna give you this patch. It might help you about the curve in LCD. It's true that if you don't draw your curve very slowly, it seems like you can't get all the values for each pixel.
Well, with this patch, you can do it...
Have a look at it and let me know if it helps :-) Seb.
***patch***
• Dec 29 2006 | 11:13 pm
Seb, maybe i'm being dense, but i can't seem to get anything in the coll. if it works, i might fly to france and kiss you.
thanks to seejayjames and Philippe for their kind words about the lcd record patch.
• Dec 30 2006 | 12:41 am
> i can't seem to get anything in the coll. > if it works, i might fly to france and kiss you.
- "No kiss, non non!" - "But why?" - "The patcher posted by seb doesn't work."
Bogus ;-) Philippe
• Dec 30 2006 | 9:04 am
Roman Thilenius wrote: > not to self: dont point people to files which are not > online.
They are not ready... (the + 0.5 creates a result 0.5 too big... ;-)
Stefan
-- Stefan Tiedje------------x------- --_____-----------|-------------- --(_|_ ----|-----|-----()------- -- _|_)----|-----()-------------- ----------()--------www.ccmix.com
• Dec 30 2006 | 11:15 pm
what's wrong with my patch ? It works perfectly fine here ! please let me know
• Dec 30 2006 | 11:18 pm
Try to re-enter 110 in the number box before you press the bang !! I tried and it works just fine !!
• Dec 30 2006 | 11:33 pm
Nothing gets fed into the coll.
Andreas.
tworowski.sebastien skrev: > what's wrong with my patch ? > It works perfectly fine here ! please let me know > -- > serious : http://www.synart.org > > a lot less serious : > - http://www.bloghotel.org/oulchenowski > - http://www.bloghotel.org/tworowski > > . > >
• Dec 30 2006 | 11:37 pm
Nope. Still doesn't work.
A.
tworowski.sebastien skrev: > Try to re-enter 110 in the number box before you press the bang !! > I tried and it works just fine !! > > -- > serious : http://www.synart.org > > a lot less serious : > - http://www.bloghotel.org/oulchenowski > - http://www.bloghotel.org/tworowski > > . > >
• Dec 30 2006 | 11:41 pm
Ditto.
MaxMSP 4.6.2 over OSX.4.8
• Dec 30 2006 | 11:53 pm
ditto
ditto specs
• Dec 31 2006 | 12:20 am
Make sure you press [loadbang] after pasting this patcher from text. The number doesn't bang unless the patch is loaded.
Works fine after that.
b
robin foster wrote: > ditto > > ditto specs >
-- barry threw :: sound | (if you would see the stars clearly, http://www.barrythrew.com | look hard at the surrounding darkness) bthrew(at)gmail(dot)com | -Ooka Makoto 857-544-3967 |
• Dec 31 2006 | 10:10 am
Make sure your first pixel is part of the curve as we're starting the search from the first pixel. If there's nothing, it won't work.
Honestly, i copied the code i sent and made it work just perfectly !
1- open the patch 2- draw your curve (starting with the fisrt pixel) 3- enter 110 in the number box 4- press bang (you should have all the coords in coll) 5- clear lcd 6- press dump
htw
• Dec 31 2006 | 12:01 pm
weird, banging the uzi crashes max...
tworowski.sebastien skrev: > Make sure your first pixel is part of the curve as we're starting the search from the first pixel. > If there's nothing, it won't work. > > Honestly, i copied the code i sent and made it work just perfectly ! > > 1- open the patch > 2- draw your curve (starting with the fisrt pixel) > 3- enter 110 in the number box > 4- press bang (you should have all the coords in coll) > 5- clear lcd > 6- press dump > > htw > -- > serious : http://www.synart.org > > a lot less serious : > - http://www.bloghotel.org/oulchenowski > - http://www.bloghotel.org/tworowski > > . > >
• Dec 31 2006 | 12:14 pm
Quote: Wetterberg wrote on Sun, 31 December 2006 13:01 ---------------------------------------------------- > weird, banging the uzi crashes max...
Me too. Put a print on the left outlet of [route 0]... Then put it on the right outlet...
• Dec 31 2006 | 12:19 pm
Well, it worked for me after I drew the line from the very beginning of the lcd. Only the x coordinates are stored though??