Old 31st May 2005, 11:14   #1
Boktor
Junior Member
 
Join Date: May 2005
Location: Amsterdam
Posts: 38
AVS joystick control

A short while ago I came across winstick. A program to control your winamp with a joystick.
I saw it mimicks keyboard keys, which gave me the idea it could be used to control AVS.
I have worked out a little scheme, a list how to set it up and a test.avs. Klique here.

I hope at least some of you have a gamepad.
Well, check it out and tell me what you think.
Boktor is offline   Reply With Quote
Old 31st May 2005, 22:29   #2
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
with open source avs we might be able to add a good joystick/gamepad support which would eliminate the need to share the keyboard with winamp

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 1st June 2005, 09:59   #3
Boktor
Junior Member
 
Join Date: May 2005
Location: Amsterdam
Posts: 38
I tend to believe that priority on open source AVS is and should not be joystick input. For real multi-tasking however it seem inevitable. One should be able to type and control AVS with a joystick at the same time

Until it happens the keyboard still has plenty of keys left. Maybe not enough to use whole a second controller, but one could give up some winamp hotkeys.

For now it works.
I wonder however if any AVS-user has either a logitech dual action or sidewinder.
Boktor is offline   Reply With Quote
Old 1st June 2005, 10:50   #4
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
I only recommended it because it has the look of a 10 minute job (not literally... read 'only needs small code changes') and would be very useful for making avs games. (the main thing always putting me off is the bad keyb support)

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 1st June 2005, 11:55   #5
Boktor
Junior Member
 
Join Date: May 2005
Location: Amsterdam
Posts: 38
The highly responsive keyboard is annoying.

You made me think and here is an improvement.

q1=band(q2,(getkbmouse(79)));
q2=bnot(getkbmouse(79));
if(equal(q1, 1), assign(q3, q3+1), 0);
reg01=(q3|0)&1;

Now reg01 goes on and off by pressing o.

I've worked it out in the new example file, which can be found here.

Thanks for making me think.

Last edited by Boktor; 1st June 2005 at 12:32.
Boktor is offline   Reply With Quote
Old 1st June 2005, 18:00   #6
Warrior of the Light
Forum King
 
Warrior of the Light's Avatar
 
Join Date: Aug 2002
Location: The Netherlands
Posts: 4,116
my method:
code:

frame
mc=getkbmouse(3); //mc=mouseclick
mcpulse=if(equal(mcold,mcnew),0,if(equal(mcold,0),1,0));
// enabled only 1 frame on mouseclick

mcold=var;
var=if(equal(mc,0),mcpulse,1); //var is only used as temp
mcnew=var;

mcswitch=if(mcpulse,bnot(mcswitch),mcswitch);
reg02=mcswitch;



I used this in Oil Grease Is Not Black in Preset Pack 2.
I wanted to attach it, but you can't attach presets in edit mode anymore. I hate doubleposting so I'll post a link to PP2 instead..
http://www.deviantart.com/download/12533150/

Jesus loves you [yes, you] so much, he even died for you so that you will not need to die, but live forever
Warrior of the Light is offline   Reply With Quote
Old 1st June 2005, 22:18   #7
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
i normally stick with something simpler like this:

code:

oldg=g;
g=getkbmouse(akeynum);
pressedonce=below(oldg,g);



pressedonce is 1 the frame that the user first pushes the key down and is otherwise 0.

also for doing time independant moves (i.e. a quake style camera walk) use:
code:

dt=gettime(lasttime);
lasttime=gettime(0);
pos=pos+dt*(getkeybmouse(keyplus)-getkeybmouse(keyminus));



again, short and sweet

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 2nd June 2005, 07:12   #8
Warrior of the Light
Forum King
 
Warrior of the Light's Avatar
 
Join Date: Aug 2002
Location: The Netherlands
Posts: 4,116
Quote:
Originally posted by jheriko
i normally stick with something simpler like this:

code:

oldg=g;
g=getkbmouse(akeynum);
pressedonce=below(oldg,g);

why didn't I think of that!

Jesus loves you [yes, you] so much, he even died for you so that you will not need to die, but live forever
Warrior of the Light is offline   Reply With Quote
Old 2nd June 2005, 10:31   #9
^..^
Major Dude
 
^..^'s Avatar
 
Join Date: Sep 2004
Location: There
Posts: 1,002
Send a message via ICQ to ^..^
wouldn't this even be a bit faster:
code:
pressedonce=band(getkbmouse(3),stopit);
stopit=bnot(getkbmouse(3));

? 'pressedonce' is 1 during the frame you press the key, from the following frame on it's 0 again.

Well, atleast that's what i always use...

^..^ is offline   Reply With Quote
Old 2nd June 2005, 11:32   #10
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Its debateable which would be faster (I'd guess at mine by a few clock cycles), but the difference would be slim anyway.

2 assignments + 2 getkbmouse + band + bnot
against
3 assignments + 1 getkbmouse + below

speed isnt that much of an issue... i just wanted to point out a tidier solution rather than a faster one. none of this code is particularly slow or time critical.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 2nd June 2005, 11:35   #11
Boktor
Junior Member
 
Join Date: May 2005
Location: Amsterdam
Posts: 38
counter

So a on/off switch could be this counter with an &1 added to it.
code:
oldg=g;
g=getkbmouse(number);
counter=if(below(oldg,g), counter+1, counter);
reg03=counter&1;

or
code:
counter=if(band(getkbmouse(number),g), counter+1, counter);
g=bnot(getkbmouse(number));
reg04=counter&1;

Nice. Or are there even better ways to do this?
Boktor is offline   Reply With Quote
Old 2nd June 2005, 11:51   #12
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Avoid using those ifs when you dont need to.

counter = if(below(oldg,g),counter+1,counter);

could be

counter = counter + below(oldg,g);

which is better as it avoids the if which is slower than the + anyway, so dodging the + with if isnt a speed boost.

Whats the & 1 for? you want it to toggle from 0 to 1?

I'm not sure if its faster but I think it is tidier to use:

code:

oldg=g;g=getkbmouse(number);
counter = (counter + below(oldg,g))%2;



I'm not sure but I think & and | are pretty slow 'cos of rounding to int, likewise %, floor etc. The %2 can be replaced by &1 if it is faster...

The other thing is that this can be expanded to 'toggle' between 0,1,2 or 0,1,2,3 and so on, by changing the final %2 for %3 or %4 etc... very useful for complicated menus.

The most comprehensive menu I have released on a preset is on this one:

http://www.deviantart.com/deviation/13908660/

Although its prolly full of bad coding practice, as all presets are, it shows some of this in use, like the color switchers and click buttons etc.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 2nd June 2005, 12:16   #13
Boktor
Junior Member
 
Join Date: May 2005
Location: Amsterdam
Posts: 38
Thanks for the +-instead-of-if tip. Never looked at it from this angle.
Quote:
Whats the & 1 for? you want it to toggle from 0 to 1?
Yes, that was the idea.
I'm not sure either, but the difference between | & and % seems negliable (and the numbers used are integers already, I'd guess that it shouldn't take long to recognise). The extended 'toggle' is an advantage, though.

I was thinking about making something like a menu for the joystick control, so you'd see what you're doin, your example will be a great help.

Last edited by Boktor; 2nd June 2005 at 12:34.
Boktor is offline   Reply With Quote
Old 18th August 2005, 16:02   #14
Boktor
Junior Member
 
Join Date: May 2005
Location: Amsterdam
Posts: 38
A menu is rather irritating actually, so I dismissed it.


Made a little avi in which i use my gamepad.
Except for reencoding it to 3ivX, it's all AVS.


Reactions appreciated.
Boktor is offline   Reply With Quote
Old 14th September 2005, 16:38   #15
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
firstly. the video is huge.

secondly. why not post the avs preset and ape or whatever?

I'll give you another reply in 3 minutes when i have finished downloading your huge video.

--------

It uses Winstick? Thats so useful... a prerequisite for an avs preset that can be nicely wrapped into an installer .exe and requires no effort from the user. Joystick presets are the way to go!!! ¬

Seriously though, its pretty cool, but for reasons outlined above, not practical for an avs pack. I guess its awesome for VJ'ing though.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 14th September 2005, 19:04   #16
Boktor
Junior Member
 
Join Date: May 2005
Location: Amsterdam
Posts: 38
Thanks for your comment.
Quote:
Originally posted by jheriko
firstly. the video is huge.
Depends on your definition of small/huge, for a video file it's not that big.
Quote:
secondly. why not post the avs preset and ape or whatever?
It's an AVS -file and it's already on my site.
Quote:
It uses Winstick? Thats so useful... a prerequisite for an avs preset that can be nicely wrapped into an installer .exe and requires no effort from the user. Joystick presets are the way to go!!! ¬
You should work on your irony skills.
But indeed an installer would be nice.
I don't think it's impossible.
Quote:
Seriously though, its pretty cool, but for reasons outlined above, not practical for an avs pack.
I agree for now.

Though, the xbox360 will get a gamepad controlled visualizer, called lightsynth, which might change things.
I guess you don't want to download there videos.
Quote:
I guess its awesome for VJ'ing though.
It is. It's very pleasant.
Boktor is offline   Reply With Quote
Old 25th September 2005, 02:03   #17
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
yeah. glad you appreciated the humour and didnt take offense

any file > 500k is huge on dialup

i'm on 1meg and that took a long time to dl. and for that short a video... that is pretty huge, and not even at a justifyable quality.

i have videos of episodes of tv series that big or smaller and not just cartoons.

anyway, this does look cool. its just a shame there isnt inbuilt joystick control... if avs was really open we could add it

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 25th September 2005, 06:26   #18
MaTTFURY
Major Dude
 
MaTTFURY's Avatar
 
Join Date: Jun 2004
Location: Australia,
Posts: 1,356
another improvement for avs! mpeg's/other types of non-M$ video file formats!!!

i am not normal, no really.
MaTTFURY is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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