Go Back   Winamp Forums > Visualizations > MilkDrop > MilkDrop Presets

Reply
Thread Tools Search this Thread Display Modes
Old 23rd November 2008, 05:09   #1
Drasla
Member
 
Drasla's Avatar
 
Join Date: Sep 2001
Location: Chicago
Posts: 81
Scrolling Spectrogram

Hey all. This is my first attempt at making a MilkDrop preset. Wanted to implement a basic scrolling spectrogram, since XBMC doesn't seem to have one.

I'd hugely appreciate any feedback as to how to get around some minor issues I was having:
1. Making a continuous wave over the scrolling: I get small gaps in the spectrogram between each frame due to the scrolling. Any idea how to eliminate these?
2. Eliminating scrolling trails: A side-effect of the scrolling was that colors seemed to bleed as they approach the left-side of the screen. Any idea how to prevent all blurring, just a perfect non-destructive scrolling, like a ticker?
3. Clear the screen at preset load: Currently, any color on screen prior to the preset loading will stay there. I'd like to start with a black screen.

Many thanks!
Attached Files
File Type: milk simplespectrogram.milk (5.1 KB, 221 views)
Drasla is offline   Reply With Quote
Old 23rd November 2008, 09:25   #2
Cope
Senior Member
 
Cope's Avatar
 
Join Date: Jul 2008
Location: Germany
Posts: 149
Welcome to the boards

1. I think there's no simple way to get rid of this, other than slowing down the scroll rate. It's a fundamental problem with scrolling, since the wave is drawn only once per frame then the frame is scrolled. That'll always leave a gap between successive drawings of the wave.

2. This can be done very simply with pixel shaders. Check out the warp shader in the attached preset, basically all it's doing is the same as the dx equation in the per frame code (which is commented out now because it's not needed anymore).

The important part is the sampler type. The four types are fw, fc, pw and pc, milkdrop uses the fw type as default. The w's are the same as setting texture wrap to 'on' in the post-processing menu, the c's are the same as setting it to 'off'. The f's sample each point as an average of the points around it, and this is where the bleeding comes from. The p's on the other hand sample the nearest point directly, so you get no bleeding. Which you use depends entirely on the preset, some look really ugly with point sampling and others look ugly with averaged sampling.

Setting zoom=1 in the per frame code also helps, since (like warp) zoom isn't completely 'off' until it's set to 1 in the per frame code. You can see this by commenting out zoom=1 in the attached preset.

3. There's a few ways to do this. Since the colors are 'stuck' on the border of the preset (a side-effect of using no texture wrap) you can simply add a small outer border set to black. I've set this up in the preset.

That's the long and short of it Always nice to see some new people working on presets, I'm pretty new here myself.
Attached Files
File Type: milk drasla - simplespectrogram 2.milk (5.6 KB, 215 views)

Murphey's fighting Occam, and I'm in the stands.
Cope is offline   Reply With Quote
Old 23rd November 2008, 17:18   #3
Drasla
Member
 
Drasla's Avatar
 
Join Date: Sep 2001
Location: Chicago
Posts: 81
Beautiful. Thanks muchly! I made a couple more minor tweaks, mainly to get better color response from quiet sounds and to minimize the gaps. Update is attached.

One more question:

When I tried loading the preset to XBMC, it didn't seem to know how to react to the shader code. Same with my laptop. I suspect these are probably hardware limitations that are fundamentally unresolvable, but is anyone aware of any workarounds I could try?

In particular, is it possible to disable averaged sampling without using pixel shaders?
Attached Files
File Type: milk drasla - simplespectrogram 3.milk (5.8 KB, 229 views)
Drasla is offline   Reply With Quote
Old 23rd November 2008, 22:01   #4
Cope
Senior Member
 
Cope's Avatar
 
Join Date: Jul 2008
Location: Germany
Posts: 149
Well the laptop's graphics chip probably doesn't support pixel shaders, no way around that. I'm not sure about XBMC, never used it. I'd assume it supports pixel shaders in some way, but maybe they have to be formatted differently than in milkdrop.

I don't think there's a way to disable averaged sampling without the shaders, unless somebody here knows of a hack.

Looks good though

Murphey's fighting Occam, and I'm in the stands.
Cope is offline   Reply With Quote
Old 25th November 2008, 12:34   #5
Saint Goody
Senior Member
 
Join Date: Apr 2008
Location: Somewhere in Southern Indiana
Posts: 184
If I remember correctly, XMBC only runs Pixel Shader 1.4.

What graphics chip is in your laptop?

I am the purple heathen.
Saint Goody is offline   Reply With Quote
Old 26th November 2008, 03:49   #6
Drasla
Member
 
Drasla's Avatar
 
Join Date: Sep 2001
Location: Chicago
Posts: 81
It's an NVIDIA GeForce4 440 Go. So, yeah, it only supports Pixel Shader 1.3.

I assume there's no way to write a MilkDrop preset using v1.3/1.4 pixel shaders?
Drasla is offline   Reply With Quote
Old 26th November 2008, 10:14   #7
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.085108,12.127497
Posts: 1,967
Send a message via ICQ to Flexi
uh ... what ... wait ... ProjectM2.0 ... Pixelshader2.0 ... opensource ... I'm shitting bricks

http://projectm.sourceforge.net/

Quote:
8/28/08 - projectM 2.0 - Pixel Shaders & Milkdrop 2.0 Support

projectM 2.0 is a huge step forward. Pixel Shaders have been integrated via NVidia's Cg toolkit, for cross-platform shader acceleration. This, of course, allows Milkdrop 2.0 preset compatibility! It's awesome.

projectM (has been/is being) completely restructured. This will set the framework for new ways of writing presets. Milkdrop presets will become just one way of using the projectM framework. How do you want to write presets? PHP, Python, or Ruby? Let us know!

About the Mac port... Our macbook broke. So now any hopes for a polished up mac binary rest upon a) getting another macbook or b) Alligator returning and saving the day.

projectM 2.0 is in subversion and we have reports of it working on many different distributions and with multiple video cards, so the handy among you should feel free to try it out. Just remember to use Milkdrop 2.0 presets if you want to see the new stuff! We'll make a formal release once our hackathon stops.


btw: here's one more pixel-accurate scrolling code
http://www.youtube.com/watch?v=p1dqQtBw-fo
http://www.youtube.com/watch?v=6OZJGpKluVM
Attached Files
File Type: milk drasla - simplespectrogram 4.milk (5.9 KB, 242 views)
Flexi is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Visualizations > MilkDrop > MilkDrop Presets

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