Old 02-07-2017, 09:35 AM   #1
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,082
Default LUA: Basic gestures

Bored... gestures... why not

https://stash.reaper.fm/29736/BasicGestures.lua

Very basic recognition of movement,but also every movement is stored in the table ,so some advance stuff (if anyone knows, I don't) like patern recognition maybe possible (maybe) .But its useless for 99% of scripts... but cool
Sexan is offline   Reply With Quote
Old 02-07-2017, 10:36 AM   #2
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,341
Default

this + assign to actions + non opaque reascript gui + no frame for reascript gui is

a goto thing, if you want to show some magic for drunk friends came to your studio
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate

Last edited by mpl; 02-07-2017 at 11:46 AM.
mpl is offline   Reply With Quote
Old 02-07-2017, 11:08 AM   #3
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,660
Default

While we're waiting for transparent/frameless windows, you could use gfx.init("", 0, 0, 0, 0, 0); it just makes a tiny window in the upper-left corner, but gfx.mouse_x and gfx.mouse_y still work everywhere on the screen.
Lokasenna is online now   Reply With Quote
Old 02-07-2017, 01:02 PM   #4
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: brighton, uk
Posts: 12,589
Default

interesting!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 02-07-2017, 01:25 PM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,505
Default

Nice experiment !!
X-Raym is offline   Reply With Quote
Old 02-07-2017, 01:59 PM   #6
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,082
Default

I really dont know what is worse, that this actually looks like its working like im some kind of scientist (it actually works pretty darn well with any kind of mouse movement updated the gif) or that I am investigating really really advanced algorithms.

Anyway from coding side nothing complicated. Its really REALLY simple for this demo
Sexan is offline   Reply With Quote
Old 02-07-2017, 05:49 PM   #7
kawa_
Human being with feelings
 
kawa_'s Avatar
 
Join Date: Mar 2016
Posts: 117
Default

Great!
__________________
web | kawaScripts | donate | twitter |

Last edited by kawa_; 02-07-2017 at 06:00 PM.
kawa_ is offline   Reply With Quote
Old 02-07-2017, 07:48 PM   #8
EpicSounds
Human being with feelings
 
EpicSounds's Avatar
 
Join Date: Jul 2009
Posts: 5,317
Default

I'd love to be able to leave freehand notes, draw arrows and circle things in a project.

If this works for drawing over videos I could really use it right now.
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
EpicSounds is offline   Reply With Quote
Old 02-08-2017, 04:44 AM   #9
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,082
Default

Quote:
Originally Posted by EpicSounds View Post
I'd love to be able to leave freehand notes, draw arrows and circle things in a project.

If this works for drawing over videos I could really use it right now.
hm... never opened or did anything with video processor,will check it and do something if possible

EDIT: I see its EEL,Im not very friendly with that language...

EDIT2 : I think its not possible

Last edited by Sexan; 02-08-2017 at 05:11 AM.
Sexan is offline   Reply With Quote
Old 02-08-2017, 08:12 AM   #10
EpicSounds
Human being with feelings
 
EpicSounds's Avatar
 
Join Date: Jul 2009
Posts: 5,317
Default

Quote:
Originally Posted by Sexan View Post
hm... never opened or did anything with video processor,will check it and do something if possible

EDIT: I see its EEL,Im not very friendly with that language...

EDIT2 : I think its not possible
appreciate the try
__________________
REAPER Video Tutorials, Tips & Tricks and more at The REAPER Blog
EpicSounds is offline   Reply With Quote
Old 02-08-2017, 03:17 PM   #11
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,082
Default

Dear coding wizards I need help:
I have a problem with only one direction that can't be very well defined (I'm not able to do it)



Since my code is looking for the nearest value to limit the angle the problem is with the start-end value which is 0 or 360 degrees, on even smallest value it will trigger wrong direction because if I'm on 357 it will look for nearest value to 315 and if I'm on 23 it will look nearest to 0. How to solve this my brain stuck?
For example on opposite side which is 180 it can easily find nearest value to 180 because number after or before are 180+ or 180- , but here are 0+ or 360-.

Code:
https://stash.reaper.fm/29765/GesturesAlpha2.lua
(its beautifully commented)

Line 99 and Line 23 are the ones which are related to this

Thank you very much!

Last edited by Sexan; 02-08-2017 at 03:22 PM.
Sexan is offline   Reply With Quote
Old 02-08-2017, 08:31 PM   #12
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,660
Default

1. Not sure if this is on purpose, but on lines 91 and 92 you're subtracting the coordinates backwards - "where we started" minus "where we are now"; the Lua functions consider 0 degrees to be pointing right.

2. Your direction table only goes up to 315, so 359 correctly rounds down. Here: https://dl.dropboxusercontent.com/u/...0Lokasenna.lua
Lokasenna is online now   Reply With Quote
Old 02-09-2017, 12:36 AM   #13
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,082
Default

Quote:
Originally Posted by Lokasenna View Post
1. Not sure if this is on purpose, but on lines 91 and 92 you're subtracting the coordinates backwards - "where we started" minus "where we are now"; the Lua functions consider 0 degrees to be pointing right.

2. Your direction table only goes up to 315, so 359 correctly rounds down. Here: https://dl.dropboxusercontent.com/u/...0Lokasenna.lua
1. yeah my mistake there
2. thank you for fixing the problem and simplifying
Sexan is offline   Reply With Quote
Old 02-09-2017, 08:46 AM   #14
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,082
Default

Mistake
Sexan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.