Old 24th March 2008, 22:41   #1
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
Wiimote-reactive Milkdrop visuals

Hello developers, users, preset artists,

I just released the first version version of a Milkdrop mod that I think you'll like. I modified Milkdrop so that all the preset graphics is drawn only in response to you moving two Wiimotes in your hands. Move your right hand to the right, for example, and the fireball on the screen glows more blue. Move it faster forward, and it becomes hot white and zoomed in closer.

If you do it to the rhythm of the music (whether played by Winamp or from some other source -- an iPod in your room or a DJ in the nightclub), and if you hook up a projector to your PC, the feeling of the feedback when you flick the Wiimote and see the preset/Milkdrop instantly react is spectacular.

Here's the best part: it uses many existing Milkdrop presets unchanged. I disabled all sound analysis in Milkdrop, and replaced it with Wiimote readings. So the "bass" variable that a preset reads is really the acceleration on the X axis of the right Wiimote, "bass_att" is the X acceleration of the left Wiimote, "treb_att" is Z acceleration of left and right combined, and so on. In other words the stronger you move the Wiimote on the X axis, the stronger the "bass" the preset thinks is, and some shape on the screen gets bigger or greener or whatever in response.

I put on YouTube a demo of the software in action at

     http://youtube.com/watch?v=bCVF6EZFR3g

-- I'm still struggling to find the best way to describe this but I hope the video will make it clear. And fun, too.

You can download the software (predictably named Miilkdrop, packaged as a Winamp vis plugin) and setup instructions, from http://indaviz.com/download/. It's free, and I'll post the source code as well, once I clean it up.

I included in the installation hundreds of fantastic presets that react well to Wiimotes. I also modified one of them (Zylot's "Wisps") to directly read some new Wii-related preset variables I introduced.

There's other software out there that connects Wiimotes to visuals, for example via MIDI which a VJ-ing program reads. But everything I've seen looked too slow: for the feedback to feel good, both for you and the people watching, the image must be drawn no later than around 30-40ms (roughly the same time as one frame of video) after you move the Wiimote. Milkdrop is a speed demon that's up to the task.

Thanks for reading this, if you'd like to give it a shot I'd appreciate any feedback (and/or Wii-customized presets that I'd include in the next release).

Cheers,
Davor/indaVizz
indaVizz is offline   Reply With Quote
Old 25th March 2008, 03:03   #2
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
... just noticed the URLs didn't come through, so here they are in the raw form:

YouTube video: youtube.com/watch?v=bCVF6EZFR3g

Download page: indaviz.com/download
indaVizz is offline   Reply With Quote
Old 25th March 2008, 15:36   #3
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
I SOOOO have to check this out when I get home, Hope my bluetooth is compatable...

which version of milkdrop did you make this from?
1.04
1.04d
or on of the 1.05 betas?

I'm assuming its not 2 since I dont think the source is out there...

Blah!
redi jedi is offline   Reply With Quote
Old 25th March 2008, 17:32   #4
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
It's 1.04b I think, the only source I could find. (I SOOOO wish I had 2... :-) But even the 1.04 source is priceless.)

As for USB bluetooth, I can recommend the one I got from SparkFun Electronics for $17, link below. It worked for me on 3 different laptops, two of which had bluetooth built in but built-ins rarely work with Wiimotes. The SparkFun one was also recommended by a well-known Wiimote hacker (well known in the Wiimote hacking circles anyway), Johnny Chung.

You'll also definitely want two Wiimotes. Circuit City and the like usually have plenty in stock for $40 apiece even though you can't buy the Wii console itself. (I don't have one either.)

wiili.org/index.php/Compatible_Bluetooth_Devices
sparkfun.com/commerce/product_info.php?products_id=150
indaVizz is offline   Reply With Quote
Old 26th March 2008, 00:59   #5
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
hey thats pretty fun... what are the available variables from the wii?

here's a quick remix of your test preset...
the left wiimote controls the zoom and the rot, tilt it to the sides to rotate and tilt foward and back to zoom, right one does the same as it use to, but for both "dots"

Blah!
redi jedi is offline   Reply With Quote
Old 26th March 2008, 03:24   #6
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
This is great!! I love it how you can change the depth of the tunnel when you want to, and then send the fireballs down so they "fall" longer. The feedback is awesome, the best so far.

Here's the list of all the variables:
indaviz.com/download/miilkdrop.html#8

wii_l_x, for example, is the acceleration on the X axis of the left Wiimote. The X axis is not in space but relative to the Wiimote -- it's in the direction and orientation of the left cursor button on the Wiimote. It's range is -3.0 to +3.0, close to 0.0 if the Wiimote is not moving (on its X axis). The Z axis is in the direction of the face of the Wiimote, and the Y axis is the direction of the up cursor button.

The roll and pitch (wii_*_r and wii_*_p) are the only ones that don't drop to 0 when you hold the Wiimote still so they can be used to change something slowly, like this depth and rotation of the Wisps' tunnel.

Were you able to connect the hardware already?
indaVizz is offline   Reply With Quote
Old 26th March 2008, 05:46   #7
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
... here's a video of the remixed preset:

youtube.com/watch?v=AVqtB0tJkuo
indaVizz is offline   Reply With Quote
Old 26th March 2008, 10:51   #8
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
ya hardware hook up just fine, already had a bluetooth adapter and the wiimotes... prolly have some more remixes for ya soon...

Blah!
redi jedi is offline   Reply With Quote
Old 26th March 2008, 12:07   #9
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
holy crap! this is awesome!
and hey i've got all the necessary hardware (beamer, wiimotes, BT dongle)
and as you crawled my mind, about two weeks ago i've been to Berlin where i discussed this idea with some friends who want to organize a demo-party.
Someone has to call Ryan Geiss for the Milkdrop2 source . I want to dive into brilliant shader fractals with my wiimotes.
okay this is dreams of the future, but imagine a headtracking implementation..

...something very cool is going on...
Flexi is offline   Reply With Quote
Old 26th March 2008, 18:25   #10
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
I just saw 1.05 beta on redi jedi's site... don't know how I missed it. I'll take it and Wiify it, probably in a week or so.

As for a party, you can imagine 5-6 people holding a Wiimote each and each controlling a different part of the preset. Each would be in charge of visualizing a different instrument or vocals in the song, kind of like playing in a visual orchestra.

(Would be easy to make, Miilkdrop-wise, too, I'd just need to add vars wii_1_x, wii_2_x, wii_3_x etc, and you'd need a good preset to show it all well.)
indaVizz is offline   Reply With Quote
Old 26th March 2008, 21:00   #11
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
oh no, i can't find my bluetooth dongle - i fear this is the moment, where i have to tidy up my room
Flexi is offline   Reply With Quote
Old 27th March 2008, 01:11   #12
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
(A) buttons for effects

redi jedi,

here's a minor edit to show the use of the "A" buttons on wiimotes for effects ("B" buttons are for preset navigation):

replace
rot=-wii_l_r*wii_l_f
with
rot=-wii_l_r*wii_l_f*(1-wii_l_b)

so that if the left button (A) is pressed, it blocks the rotation. (i also added *.3 to reduce sensitivity.) wii_l_b is either 0.0 or 1.0.

and also replace
zoom=.9+sin(wii_l_p)*.1
with
zoom=.9+sin(wii_l_p*(1-wii_r_b))*.1
so that the right A button blocks the zoom.

i like it how it looks when i start with small visual changes and then expand as the music goes, using the most dramatic effects sparingly. in this case it's start with both zoom and rot blocked, just activating one dot, than another, and so on until at one point everything explodes at once.

thanks again btw, this remix is fantastic.

davor/indaVizz
indaVizz is offline   Reply With Quote
Old 27th March 2008, 09:40   #13
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
i borrowed my dongle to a friend and will get it back next weekend. say what's the physical maximum number of wiimotes you can connect to a pc resp. milkdrop?
My hypothesis: if you average all input of a serious number of 'pilots' and map it on the right selection of visualization, some very strange psychic effects will appear.
You know the Ideomotor effect? ( http://en.wikipedia.org/wiki/Ideomotor_effect )
I hope, steering the motion will end up in flowing and surfing the viz and finally in a perfect mindfuck. at least it's worth a try
Flexi is offline   Reply With Quote
Old 27th March 2008, 20:29   #14
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
a friend of mine suggested exact same thing...

i read somewhere that the maximum number of wiimotes per PC is 7 (some master-slave thing, part of the protocol). but there's nothing that says that you can't have another PC that reads 7 more, and so on, and they can all send updates the one running miilkdrop over the network. the averaging could be done by miilkdrop and given to presets as input vars (wii_avg_x etc.)

what would the preset look like?
indaVizz is offline   Reply With Quote
Old 27th March 2008, 22:47   #15
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
i would really love to see a trip through one of the chaotic "skin dot" presets, but... there's no go with Milkdrop 1.04/1.05.
I guess a really fast ride into a starfield should work fine too.
i will do my own experiments and give feedback!
Flexi is offline   Reply With Quote
Old 28th March 2008, 01:52   #16
ryan
not fucked, not quite.
(Forum King)
 
ryan's Avatar
 
Join Date: Feb 2002
Location: Tn
Posts: 8,798
Send a message via AIM to ryan
Wiitards.

ryan is offline   Reply With Quote
Old 29th March 2008, 14:29   #17
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
setup successfully completed!

Biiig Thanks for bringing me to this point, it's like a litte dream come true.
Now let's hack some stunning presets!

(@ryan: )
Flexi is offline   Reply With Quote
Old 30th March 2008, 10:48   #18
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
oh i really forgot about the poor image quality of Milkdrop 1.05
(i want pixelshader )

i think, i need the acceleration values inclusive gravity. i can do the smoothing and roll pitch calculation in milkdrop code as well.
and may it be possible, that the number of variables shrunk? i just tried to remix an old preset, which already used the maximum number. (but hey - i remember, this number was raised with the 1.05beta )

here are first results. this is fun

edit:
it's probably not the best preset for dancing action.i tried a really soft dampening - inclusive overshooting - so all peaks are filtered out, but if you're lucky you get into resonance with the loop controller. you might edit the first three vars...)
Attached Files
File Type: milk flexi - miilkdrop random dive.milk (6.9 KB, 413 views)

Last edited by Flexi; 30th March 2008 at 12:07.
Flexi is offline   Reply With Quote
Old 30th March 2008, 13:42   #19
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
man this is insane...
...press A

this preset obviously uses the maximum amount of variables. it's only 12 of em? thats far to few for most presets...
Attached Files
File Type: milk flexi - miilkdrop random dive [button action mix].milk (7.1 KB, 385 views)
Flexi is offline   Reply With Quote
Old 31st March 2008, 07:55   #20
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
this is like you're navigating a spaceship through a field of acid shapes. the colors are incredible.

here's a remix that includes beat reaction: the right wiimote paints shapes, the stronger the move the bigger the shapes, while the left wiimote navigates the "spaceship" as before, plus any force applied to it makes it move faster. (i.e. zoom depends on wii_l_f). left and right buttons are for two speeds (couldn't think of anything better).

youtube.com/watch?v=u78m9TfL9l4
Attached Files
File Type: milk flexi - miilkdrop random dive (beat remix) - wii.milk (6.6 KB, 430 views)
indaVizz is offline   Reply With Quote
Old 31st March 2008, 09:58   #21
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
still practicing.
this is the code i would rather see in the per-frame section.

enjoy!
Attached Files
File Type: milk flexi - wii spriing.milk (12.1 KB, 405 views)
Flexi is offline   Reply With Quote
Old 1st April 2008, 01:53   #22
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
the physics of it is awesome. it feels like you're moving a live worm with the wiimotes.

can you add more direct feedback to it but still keep the lifelikeness of it? e.g. you squish it with one wiimote acceleration and stretch with another, but it's standing still when you're not moving the wiimotes? (almost still, it would be good that it still wiggles a bit but very little.) the roll and pitch of one wiimote could control its angle or how close the two ends are.

what i'm thinking is, it would be cool to make the feedback so that you always know what action your arm movement is going to make (like you do with your real arms and hands).
indaVizz is offline   Reply With Quote
Old 1st April 2008, 02:32   #23
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
another wii-only mix

here's a wii remix of Rovastar's Eye on Reality mix. i just copied what redi jedi did with the wisps wii remix: left wiimote roll controls rotation, pitch controls zoom, right wiimote force (acceleration) controls the size and colors of the eye, and left wiimote force does something that i don't know what it is but looks really cool. buttons supress roll/pitch->rot/zoom.

it has great feedback (the only thing i talk about) but i think the colors and shapes are great too (that came with the package). hope you like it!

davor

p.s. i'll base the new release off of latest MD beta; let me know if you think some other vars should be supported. (i was planning to add wii_{1..7}_* values for up-to-7 wiimote support.) as for gravity-including x, y, and z acceleration, you can derive them from wii_{l,r}_{x,y,z} and roll/pitch:

wii_l_gx = wii_l_x + sin( wii_l_r );
wii_l_gy = wii_l_y - sin( wii_l_p );
wii_l_gz = wii_l_z + cos( wii_l_p );

and same thing for wii_r_*. the gx, gy, gz are the acceleration values as measured by the wiimote directly and they are most accurate. roll and pitch is calculated from there (and not quite accurate when you move the wiimotes too fast), and so are x, y, z gravity-less accelerations.
Attached Files
File Type: milk rovastar - eye on reality (mega 3 mix) -- wii v1.milk (7.8 KB, 408 views)
indaVizz is offline   Reply With Quote
Old 1st April 2008, 09:40   #24
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
no way, that roll and pitch values have most accuracy jet.
see how the the other value freaks out, when one axis is rotated by 90°. place your wiimote on a table and roll it from left to right.
(red is pitch and blue is roll)
can't you pass through the acceleration values right before gravity is subtracted, or am i totally off the mark?

and another thing:
what an effort would it be to give me input from the IR sensor? i read "Wiimote detects and transfers up to four IR hotspots" (just imagine, all i need for headtracking is two points)
Attached Files
File Type: milk flexi - roll pitch test.milk (5.2 KB, 396 views)
Flexi is offline   Reply With Quote
Old 1st April 2008, 17:12   #25
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
Gotta check these out when I get home... damn this is so cool.

hey is there any way to get the litebar supported so we can get exact positional data, and or mabye a point that the user is point the mote at? that could be fun..

hey indaVizz, are you any good with c#? I don't care much for the fact that I dont have the V2 source(maybe saying this will help with that) so I've decided to rebuild it in C#.. mainly cause my new job is c#/vb6 based so I need the practice.. but once i get the md features implemented I'm prolly gonna switch the preset format(xml based most likely) or at least extend it alot... can you do the same thing in c#?!?

btw.. using Lua as the scripting engin(current md format executes fine) so the extendability is gonna be wicked(built in strings/arrays/classes anyone?)

Blah!
redi jedi is offline   Reply With Quote
Old 1st April 2008, 18:30   #26
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
i have just been to our electronics store and buyed some IR-LEDs and a button cell.
Who's faster - me organizing a soldering gun or you implementing?

this will get into serious performance art!

@jedi redi: nice to hear. I have quite a lot experience with Java and need C# practice as well. Say if you need a helping hand.
Flexi is offline   Reply With Quote
Old 1st April 2008, 22:13   #27
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
helping hands are always good..

I'm thinking that at least up to being md2 feature comparable(I don't expect to match the speed) it will be open source, then I might break it off into another project(leaving the source still available for others of course) for further development but I may start totally over at that point to, I'm not sure(nor do i care right now) cause I have some other ideas I want to explore after gaining the experience of this.

But anyway I'm trying to make it fully OOP so I can reuse parts of it in other projects, right now I'm mostly doing the design parts, are you any good at class design?

@indaVizz: btw thanks for reintegrating it into my beta, thats cool.. Few requests for the next version:
if you have any more variables from the controller, expose them.

put the bass,mid,and treb back, or add a var we can set that say to turn them off, or a menu option, something..

up the min eval user variables(think its in one of the header files), are you adding to that when you add your variables? as its just a total, not the avail custom variables. its needs to be 30 over all the built in ones for md1.04 and 40-45+ for betas.

Blah!

Last edited by redi jedi; 1st April 2008 at 22:46.
redi jedi is offline   Reply With Quote
Old 1st April 2008, 23:23   #28
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
[ot]
I'm studying computer science major in software-technics UML is my milk (or should be ), but i must admit i have not worked too much with it yet. I'm also quite proficient in XML (but again more in an academic manner).
Re-engineering and model-based software engineering are exactly my topics.

this is curious: I'm still waiting for my processor for my new state-of-the-art PC and i also resolved to finally switch to Vista and going into demo-stuff like wiimotes and DX10.
I'm a little delayed with my studies, but this semester i don't have very much courses... (but therefore more examinations )
[/ot]
Flexi is offline   Reply With Quote
Old 2nd April 2008, 01:15   #29
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
Well heres the main design questions as I see them(remember this inst exactly suppose to be a direct copy of MD2, just have AT LEAST the features in it):

do you go with a fixed or semi-fixed render loop(like MD, this is what allows transitions to work the way they do)

or do you go with a preset driven render(presets make render calls directly) loop(possible with Lua) to give more control but resolve to bitmap based scripted transitions? then write a milkdrop translator to fill a template with the code from an md file...


I personally like transitions so I'm prone to go with a semi-fixed(kinda like the beta where you have some predetermined control over the loop, but its essentially static) loop, any thoughts on that?

Lua presents the ability to add some really cool shit as far as presets are concerned.. for instance Events, you could create an Event handler in C# that would call functions that have been registered from Lua, With a built in beat detection system you could register some code to run On Beat, maybe some other code to run OnMouseMove... that could be cool..
anyway do ya add things like events or maybe custom renders(humm.. fixed render line with scriptable renders on top? is that feaseable..)

also do you build a beat detection system into the main shell, since it will be faster there, and most real-time BD algos need some "warm up" time, plus a standard BD output will make remixing presets easier, and if they have standard out put you could switch between them aswell, mabye let the user pick the one they think works the best

Blah!
redi jedi is offline   Reply With Quote
Old 2nd April 2008, 02:52   #30
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
new features

hey guys, thanks for the feedback, first of all!

based on the last few messages here's the list of new features i plan to add:

1. based on redi jedi's latest beta.

2. IR support -- that's a great idea! i was obsessed with the wii-wristbands (with camera soldered out) and totally forgot about it. more about IR in the next message.

3. more wii vars -- though the only ones missing at the moment are wii_*_g{x,y,z}, which are raw accelerator values. (flexi: more on that in the next message), and also wii_*_y for "yaw", the angle at which the wiimote tils in (its) horizontal plane; that one works only when IR is supported.

4. a preset-writable var to determine whether bass/mid/treb come from sound or from wii.

5. bumping up user eval vars -- i didn't know such thing existed, thanks. anyone has a preset where this number is exceeded (or i can make it easy to exceed it) so i can test?

6. supporting up to 7 wiimotes at the time: wii_{1,2,3,4,5,6,7}_* (in addition to wii_l_* and wii_r_*) for collective performance. that should be pretty straightforward, although tedious, to add.

btw could adding 100+ new input vars make running presets slow? i would guess/hope not, but i don't know how MD really works.

7. add an option that if no wiimotes are found, behaves like a regular milkdrop. (also when you press certain key combos you can turn off wii-reactivity and put back regular sound-reactivity. then if you play your music through winamp you can switch from user-driven to music-driven visuals.)

8. make left wiimote's cursor buttons decide what the right wiimote's cursor buttons do, e.g. if the last left cursor button pressed was "up", then right cursor buttons control sensitivity; if the last left button was "down" then the right cursor buttons do something else, like send their values to the preset. (it's a terrible user interface but in a performance you may need to do as much as possible without going back to the PC).


let me know if something is missing or you think is unnecessary. if you want IR support right now, i could do that first and then switch to beta.

i'll also release the source soon, the cleanup is almost done. all the changes in the code are marked with [wii], and there's about 40 small blocks of code added to the MD source and just one block commented out, plus there's a couple of wii-only files. so i'm hoping that the transition to the beta should be fairly smooth.
indaVizz is offline   Reply With Quote
Old 2nd April 2008, 03:16   #31
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
IR

now let's talk about IR. once again, great idea.

each wiimote can detect up to 4 IR spots with its camera, and process the data and send it to the host at 10ms intervals.

the "sensor" bar next to the wii console has a group of two IR LEDs on each side, which i think the wii still sees as two bright spots b/c the LEDs on each side are close. which probably means you could use up to two sensor bars. (you can buy a wii sensor bar for $10 which looks pretty neat.)

the viewing angle of the wiimote is pretty narrow, only 40 degrees. but if you hold a sensor bar relatively close to it you could control it pretty smoothly. or, you could use two sensor bars (or some other source, like an IR floodlight far away).

if you want everything IR related, you'd have

- wii_{l,r}_ir{1,2,3,4}_{x,y,o,s}, where
1..4 are up to 4 spots, x y are its coordinates,
o is the order of the dot on the x axis, and s is its size.
(assume size 0 means it's out of the viewing angle.)
- wii_{l,r}_ir_{x,y,d,z} which is data derived from the
4 hotspots. x and y are the calculated virtual "cursor"
coordinate (0 - 1.0), d is distance between first two
dots (i.e. one on the sensor bar), and z is the
calculated distance between the wiimote and the sensor
bar; if the sensor bar is not far, z could also be put
to some pretty good use (e.g. zoom)

... which is a lot of vars (especially if supported for 1..7 wiis: wii_{l,r,1..7}_ir{{1,2,3,4}_{x,y,o,s},ir_{x,y,d,z}} is 180 new vars. but then again, maybe it doesn't matter.)

but i'm thinking maybe it would be ok for now just to pass on the calculated virtual cursor data to presets, i.e. wii_{l,r}_ir_{x,y,d,z}. what do you think?

also i'll try to see if i can detect whether IR is used by a preset (i.e. if it references a wii_*_ir* var, to turn IR reading off when not needed to save battery; if it's too much change in the sources, a preset that uses Wii IR can set fUsesWiiIR=1).

the great thing about the ir is it lets you make a slow, continuous change, unlike the accelerometers which can only detect the force of your strike at the moment. roll and pitch are also ok for slow change (as you guys used them in the presets you made), but are inaccurate when closer to right angles.
indaVizz is offline   Reply With Quote
Old 2nd April 2008, 03:37   #32
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
speed

"It's like Speed 2, only with a bus instead of a boat!" -- Milhouse

redi jedi, i don't know c#, never used .net. but i'm sure it shouldn't be hard to add wii support to MD[2] even if it were c#: i basically have one external .c file that fires up threads that set up and read wii stuff and write the readings into some global vars. then the rest of md is changed in a few places to read those global vars and do something extra. (the MD functions' code is changed in less than a dozen places, and those are almost all added blocks of code -- the rest is added #defines and help/text etc.). so the changes are few and isolated and i guess c# can be linked with C code in some form.

i only wonder if c# is fast enough to do what MD[2] does... i have a feeling that a java MD wouldn't be, and i've heard somewhere that c# is similar to java, don't know if its bytecode too.

what i've measured (unscientifically) is that if the delay between music -- beat for example -- and the visual effect that matches it is more than 50 or so ms, but under 150 or so ms, you can't directly see the delay but the visuals feel kind of flat. so super fantastic visuals that change 90ms after the beat may feel less good that more ordinary visuals that show 20ms after.

maybe i'm just paranoid about speed, there's all these games that draw full 3d scenery 30 times a second and, i doubt they are all written in super-optimized c/c++.

as for changing the preset to use some scripting, i think that would be terrific!

cheers
indaVizz is offline   Reply With Quote
Old 2nd April 2008, 08:57   #33
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
@indavizz:

@rj: a built-in BD sounds very nice! I guess you should open up a new thread on this topic.
Transitions are a must-have feature and in my opinion they have to be scriptable same as ordinary presets, but maybe only with one color channel as filter. btw: filter is good headword, i'd love to see full layer control.
Flexi is offline   Reply With Quote
Old 2nd April 2008, 16:45   #34
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
@indavis: adding 170 variables to evalLib(the expression evaluator) *might* slow things down.. lol it kinda depends. all I can tell you for sure it that it WILL increase runtime memory usage, although thats not rocket science.. I never saw any real slow downs from adding variables(never added that many though) just from what the variables implemented. If you do have any problems with speed, I have a possible solution for ya.. you can add functions to eval lib, so add like a get_wi_var(controller_number, var_name); this will add no variables at all(except your control var) so that should clear up the speed issues if any preset them selves..

for an example of how to go about that and be able to get data to-from the main MD(eval has no access to MD) look at the sound(low,high) function I added to the beta, the main rendering loop calls a function in eval lib to update its copy of the music frame data, which the callable function actually grabs.. so it might be best(since your dealing with more data here) to move the data reading/storage to be inside of eval lib...

@flexi -- ya I think a new thread is warranted.. maybe we can stir some more interested devlopers..

Oh and about c#'s speed..
It ALL depends on what your doing.
saw a trade study the other day where they did a prime number counter in c++,vb6,managed c++,c#,vb.net

one guy rote the test in c++ then the other dude coppied it into c# and the like, right out of the box managed c++ won, and even c# beat normal c++(vb.net lost horriably)

for the c++ to win the guy had to go through 6 revisions and write 5 or 6 low level classes to override c++'s built in(string for instance, but also his own memory allocator)

so.. c++ *can* be made faster than the .net languages, but I for one(giess might be an exception) cant compete with the programers that write compilers.. let a lone the CLR.. there are so many optimizations there its not funny, given the quicker dev cycle of c# it seems like a good trade off to me...

Blah!
redi jedi is offline   Reply With Quote
Old 12th April 2008, 08:43   #35
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
IR support!

hey guys,

i just finished adding IR support and making lots of buttons available as inputs to presets to control preset actions. the IR thing looks fantastic and opens up great opportunities for intelligent visualization. thanks for the suggestion!

here's a video demo:
youtube.com/watch?v=A0dS7ll9e48

i'll post the new release and the source tomorrow.

cheers
indaVizz is offline   Reply With Quote
Old 12th April 2008, 16:22   #36
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
oh i really see a lot of fun coming up.

thx so much!
Flexi is offline   Reply With Quote
Old 12th April 2008, 18:29   #37
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
... the video above is long, here's a short clip with the best effects:

youtube.com/watch?v=j8QE4Awn4mM
indaVizz is offline   Reply With Quote
Old 12th April 2008, 18:35   #38
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
Miilkdrop 0.2.0

miilkdrop update to v.0.2.0 is at

indaviz.com/download/milkdrop_0.2.0_update.zip

just copy the contents of "milkdrop 0.2.0 update" into winamp\Plugins. (it's 176K, just the dll and some new wii presets.)

i haven't updated the documentation (i'm leaving soon and i'll have no internet for a week) so i'll put the most important documentation update right here:

* IR is now supported!
* plenty more wii buttons now available for presets to read
* more wii vars
* changed how you navigate presets
* some more wii and wii-IR specific presets



let's start with the IR support first:
-----------------------------------------------
variables wii_l_irx and wii_l_iry show the position of the virtual cursor on the screen, calculated from the IR source(s) to which the left wiimote points. so this is not the direct location of the sources but it's derived from them. (i made those direct coordinates available as well but the virtual cursor seems more useful.) variable wii_l_irz is a distance from the IR source, in some arbitrary units, and around the 0..1 range. variable wii_l_yaw is the horizontal tilt angle of the wiimote. and same thing for wii_r_* vars.

this is great for remixing presets where x and y of something is determined by music.

in the Miilkdrop directory where presets are there are several (attempts at) remixes of presets to use the IR. only one is serious, "[] wisps [wii-IR].milk", but the pac-man is funny too.

these presets now need instruction manuals, or you can reverse engineer them, but here's the "[] wisps [wii-IR].milk" in short:
- left wiimote looks into IR, right wiimote is used for beat (as in the video)
- right wiimote's (B) button increases the glow of wisps, left (B) changes the bg color and uses distance from the sensor bar for zoom; left (A) turns the blood color of the wisps, right (A) turns off the IR and essentially changes the preset into redi jedi's original remix.
- but wait, there's more: right wiimote keys control the shape of the formation of the wisps -- one, two, three, four, square; (see note on cursors keys mode below)

(i find it the presets are most instrument-like when the left wiimote controls some slow-changing value -- rotation, zoom, or position, while the right wiimote controls the beat through force. the left wiimote force can be also applied sometimes, and then there's all the buttons.)

NOTE: now both Wiimotes have IR reading turned on, which drains batteries faster (twice as fast). i use the Nyko wiimote charger and it works great, never have to change batteries. in the 0.2.1 release i'll change it so that IR is turned off for the current preset if it doesn't use IR.





buttons and navigation
--------------------------------
so now plenty of wiimote buttons are available to presets to change their mode of operation: wii_l_b is the (B) button (it used to be (A), so the few Wii-enabled presets we had that used button (A) will now expect button (B), this is the only "compatibility break"), wii_l_a is the (A) button, and same for wii_r_*.

the preset can read four extra buttons: the cursor keys on the right wiimote: wii_r_cup, wii_r_cdo, wii_r_cle, wii_r_cri. for that the right wiimote must be in the "send cursor keys to preset mode" which is controlled by the left wiimote cursor keys:

* when the left wiimote cursor key DOWN is pressed, right wiimote gets in the mode where right wiimote cursor keys are sent to preset
* when the left wiimote cursor key LEFT is pressed, right wiimote gets in the mode where right wiimote cursor keys navigate presets: left changes to previous, and right changes to next. i have some interesting plans for up and down right cursors keys for preset navigation for live performance.
* when the left wiimote cursor key RIGHT is pressed, right wiimote gets in the mode where right wiimote cursor keys control wii sensitivity (the only thing right wiimote cursor keys used to do in 0.1.0)
* when the left wiimote cursor key UP is pressed, nothing happens. any suggestions for what that mode could be?

also now because presets are changed with cursor keys, there won't be that annoying accidental preset switch when you put the wiimote on the table and lose all your in-preset editing.

i also added a couple of "system" modes:
- holding left wiimote DOWN cursor key and then pressing the left (A) key will reload the preset; useful if you're editing the preset in a text editor
- holding left wiimote (A) key and then pressing (1) key will turn off wii-reactivity and basically switch to normal Milkdrop, where presets are controlled by music (unless they are wii presets, of course). good if you want to see how the preset originally works, or to take a break, or show how much better you are in driving the preset than the beat detection algorithm. :-)
- holding left wiimote (A) key and then pressing (1) key turns on Wii reactivity again.

F1 for help can remind you of all these.



new vars
------------

here's a complete list of wii-specific variables:

wii_{l,r}_* vars available to presets, where l=left wiimote, r=right wiimote, *=var:
------------------------------------------------------------------------------------

gx: [3.0..3.0] - acceleration on wiimote X axis as measured by wiimote, includes gravity
gy: [3.0..3.0] - acceleration on wiimote Y axis as measured by wiimote, includes gravity
gz: [3.0..3.0] - acceleration on wiimote Z axis as measured by wiimote, includes gravity
r: [-PI..+PI] - roll (e.g. twist) of the wiimote, r = 0.0 when wiimote is horizontal and face up
p: [-PI..+PI] - pitch (e.g. vertical angle ) of the wiimote, p = 0.0 when wiimote is horizontal and face up
x: [3.0..3.0] - acceleration on wiimote X axis, gravity excluded: x = gx - sin(r)
y: [3.0..3.0] - acceleration on wiimote Y axis, gravity excluded: y = gy + sin(p)
z: [3.0..3.0] - acceleration on wiimote Z axis, gravity excluded: z = gz - cos(p)
f: [0.0..5.9] - total force of the acceleration vector without gravity (f = sqrt(x^2 + y^2 + z^2)
g: [0.0..5.9] - total force of the acceleration vector with gravity (g = sqrt(gx^2 + gy^2 + gz^2)
a: [0.0 | 1.0] - indicates whether wiimote A button is being pressed
b: [0.0 | 1.0] - indicates whether wiimote B button is being pressed
m: [0.0 | 1.0] - motion detection (currently pathetic: m = (f < 0.9 || f > 1.1)
irx: [0.0..1.0] - X coordinate of the cursor calculated from the IR source (sensor bar)
iry: [0.0..1.0] - Y coordinate of the cursor calculated from the IR source (sensor bar)
irz: [0.2..11.0+] - distance from the IR source (sensor bar), 0.8 seems to be "normal" distance
yaw: [-PI/9..+PI/9] - yaw (horizontal tilt angle), -20..+20 degrees is wiimote's viewing angle

the following are right-wiimote only:
------------------------------------
wii_r_cup: [0.0 | 1.0] - indicates whether the UP cursor button on the right wiimote is pressed
wii_r_cdo: [0.0 | 1.0] - indicates whether the DOWN cursor button on the right wiimote is pressed
wii_r_cle: [0.0 | 1.0] - indicates whether the LEFT cursor button on the right wiimote is pressed
wii_r_cri: [0.0 | 1.0] - indicates whether the RIGHT cursor button on the right wiimote is pressed

miscellaneous:
-------------
wii_inc: [0..infinity] incrementer -- increases by 1.0 every 10ms (in lieu of "time" which is a function of wiimote force now)

these are subject to change:
---------------------------
wii_aux1: [0.0 | 1.0] visibility of the first IR dot as seen by the LEFT wiimote
wii_aux2: [0.0..1.0] X coordinate of the first IR dot as seen by the LEFT wiimote
wii_aux3: [0.0..1.0] Y coordinate of the first IR dot as seen by the LEFT wiimote
wii_aux4: [0.0..20.0] size of the first IR dot as seen by the LEFT wiimote
wii_aux{5..8}: same but for the second IR dot as seen by the LEFT wiimote



that's all i can think of for now. thanks a lot for giving this a shot, you guys are helping me make this way cooler than it was originally.

enjoy!
indaVizz is offline   Reply With Quote
Old 12th April 2008, 18:36   #39
indaVizz
Junior Member
 
Join Date: Mar 2008
Location: Santa Barbara
Posts: 27
Miilkdrop 0.2.0 source

here's the source!

indaviz.com/download/miilkdrop-src.v0.2.0.zip

this too has no documentation but if you want to rebuild it i'm sure you can figure it out: all you need in terms of initial info is to checkout the README in the wii\ directory for the software you need to install to build for Wiimotes (WINDDK), and you'll need to muck with the include/link paths a bit but that should be all.

if you just want to take a look at what was changed, look for the [wii] tag in the sources. the changes are rather small and contained i believe, but any feedback on this is welcome. also it needs a little bit more cleanup and comments.

release 0.2.1 would just be
- turning on IR only for presets that need them
- adding wii_1..7 and wii_avg vars for collective trips
- documentation update

once again i'll be away for a week with no internet but will continue work the first day i'm back.

some nice new wii and wii-IR presets would be much appreciated!

cheers
indaVizz
indaVizz is offline   Reply With Quote
Old 16th April 2008, 12:03   #40
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
OMFG i never believed it would be that cool.
i tuned and tuned and tuned and finally it was just ...wow

hope you like it.
(let http://www.youtube.com/watch?v=SQq_XmhBTgg run in background when trying this out.)
Attached Files
File Type: milk flexi - paintjob pro [wii-ir].milk (14.1 KB, 359 views)
Flexi is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > MilkDrop > MilkDrop Development

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 Off
HTML code is Off

Forum Jump