Old 3rd October 2006, 22:20   #1
SteveW
Junior Member
 
Join Date: Sep 2006
Posts: 7
Spectrogram in Milkdrop

Hi,

I know I'm risking being flamed for cross-posting, but my posting isn't without having spent quite some time searching throught the MilkDrop forum for answers to my question.

I orignially asked this question in the AVS forum, but since have decided that MilkDrop has more to offer my development efforts (use of 3D graphics acceleration), so I'm posting my question here.

I'm trying to create a real-time Spectrogram that responds to the live input of music, ultimately to accompany live instrumental performance. A static visual that gives you the basic idea has been attached to this posting.

Of course, I'm interested in going way beyond a plain real-time spectrogram, but want to enhance this with 3D effects to essentially create what I call a 'Spectrogram on Steroids'

I've read many impressive comments about the amazing capabilities of MilkDrop, but after having looked at MANY available presets, haven't seen anything like this.

And in looking through the tutorials, I haven't found a clear way of coupling the pitch (frequency, as determined by FFT I assume) with an associated graphical function.

Please excuse my inexperience here. If there is anyone who can direct me as to the appropriateness of MilkDrop for this project, and how to get started with this particular type of visualization, I'd most appreciate it.

Thanks,

SteveW
SteveW is offline   Reply With Quote
Old 4th October 2006, 02:56   #2
SteveW
Junior Member
 
Join Date: Sep 2006
Posts: 7
Just for added clairification:

A horizontal line in the display would scroll from left to right, changing in relative height, based on the relative pitch within the scale of the instrument.

This differs fundamentally from all the Milkdrop visualizations I've seen, all of which seem to be radially designed - emanating from the center out, or randomly, not in a steady scroll from left to right. Is this type of movement possible with MilkDrop?

SteveW

(Sorry, was unable to attach the jpg in the last post. Looks similar to a heart rate monitor display though)

Last edited by SteveW; 4th October 2006 at 03:22.
SteveW is offline   Reply With Quote
Old 5th October 2006, 00:25   #3
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
i'm not totaly sure what your looking for, but there is a preset somewhere that looks like a heart monitor-> i think its in the preset pack on my website - milkdrop.us/presets.aspx

as far as the left-right scrolling, just use the 'dx' variable, it centers on 0 so +-.001 will prolly work(depending in the speed you want it to scroll at) you can use the custom wave to draw the point(that gets dragged out into a line) that does what you want it too.. as far as getting good frequency data... i guess put the wave in spectrum mode and do some testing for the higest value(strongest frequency) but i'm still not sure what you want it to look like, you may be best off figureing out how to make the wave look the way you want while its static, then using the audio data to modulate its speeds or something....

ither way i would need a better discripton of what you want it to look like and how you want it to respond to the music.

Blah!
redi jedi is offline   Reply With Quote
Old 5th October 2006, 17:37   #4
SteveW
Junior Member
 
Join Date: Sep 2006
Posts: 7
Thanks for your reply, Jedi.

Here's a link to a spectrogram that I created of a flute playing 'Amazing Grace' using a spectrogram program I found on the internet (called 'Spectrogram'):


Of course what I want to create will be an enhanced version of what you see here, without the scientific trappings, expandable to full screen, possibly with two insrtuments input - one into each of the stereo channels -shown in different colors, with 3D effects, etc., etc...
SteveW is offline   Reply With Quote
Old 8th October 2006, 00:57   #5
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
well it depends on what exactly is being graphed here, is that time/frequency? if so is it just the strongest frequency? cause thats not too hard.

basicly in side the wave you have value1 + value2 one for the right channel one for the left(if your gonna try pusing diffrent signals through the channels you'll want the stero sepration variable as high as posiable) normaly there just the amplitude of the channel, but you can put it in Spectrum mode and it will return the amplude of frequency. the Sample variable is how far through the current sample we are, so in non-Spectrum its just that, but in Spectrum mode it corresponds to the frequency, so if you do:
x=sample;
y=vaule1;

in the per-point of the custom wave, in non-Spectrum mode you get your normal time/amp graph, but in spectrum mode it gives you the time/frequency(spectrascope) for this sample(frame).....


from the looks of it you want this to be streched out over time(the 'time' quoted above is only a few hundreths of a second) and want to basicly draw a line that is/was the loudest frequency we can see,the bottom of the screen being the lowest frequency and the top of the screen being the highest, right?

assuming thats the case your gonna wanna just draw the dot for this frame with the custom wave, then use the 'dx' var to drag it across the screen.
in the wave you'll just need to basicly just put it in Spectrum mode, and make a test to see if the last value1(custom variables hold there value from one sample to the next, but not from one frame to the next.) is higher than this one, if it is higher, you want to save the value of sample(rember that holds how far we are through the frequencys) then on the last sample(when the variable sample is equal to 1) you want to draw your dot all the way to one side on x, and for y you would use your saved value of sample(witch should now hold the value of sample when vaule1 was at its higest)..... so something like:

per-point code:

bigger=above(value1,maxvalue);
bigsamp=bigsamp*(1-bigger)+bigger*sample; //basicly an if statment, if bigger use current sample, else keep value
maxvalue=max(value1,maxvalue);
x=.99; // just inside the edge of the screen
y=bigsamp;
a=equal(sample,1); // only draw the last one

you might need to play with the last line, not sure if sample ever actualy gets to one or not. also "usedots" needs to be on.

but it should just be that and the dx=-.001; in the per-vertex code of the preset to move it over.

Blah!
redi jedi is offline   Reply With Quote
Old 9th October 2006, 14:23   #6
SteveW
Junior Member
 
Join Date: Sep 2006
Posts: 7
Great information - Thanks Jedi. Yes, this is what I'm trying to do, produce a realtime (live) visualization of the fundamental frequency line only, not the harmonics. This gives the audience a sense of the live music creation process, and can see a visual representation of what the musician is creating with their instrument. This may be somewhat interesting with a piano or guitar, but it really gets interesting with, say, a jazz saxaphonist that puts many improvisational slurs, glissandos and appregios into their performance.

Then add the accompaniment instrument (maybe MIDI piano), with a different color and 3D treatment into the same screen (isolated input to the other stereo channel, or maybe you handle realtime MIDI differently), and you have sort of 'musical canvase' and an entertaining visual accompaniment to the piece.

Last edited by SteveW; 9th October 2006 at 14:39.
SteveW is offline   Reply With Quote
Old 9th December 2006, 15:34   #7
Babylon-warp
Senior Member
 
Join Date: Oct 2005
Posts: 116
SEE pictures for my home-made spectrogram

this is an unusual post because I have actually programmed a very powerful sample accurate spectrogram that can do 50 to 2000 scan lines corresponding to each frequency and one dot for each sample, by using a sweeping filter with a special resonance -one such filter takes about 1% of my processor power so I can basically do a hundred lines at a time at audio rates.,
one of the most useful things I've found is that by multiplying one sinewave that comes out of the filter with a high resonance with a copy of itself at 90° you can do some maths on it that averages the peaks of all the frequencies rather than having phase accurate information which would give you peaks and troughs.

unfortunately the program I use only saves table files, so I would have it to find a way to get screenshots of all the segments of a sound and stick them together to publish a very impressive results, the most amazing thing was a Nightingale song that I got from free sound the website

In any case I'm good at audio and I could give some advice to anyone making spectrograms and trying to improve spectrogram some visualisation, as far as I know a sample accurate SpectroScope-oscilloscope takes about 1% processor power on a modern computer, that said, anyway, I will attach some pictures of the program I did
Attached Images
File Type: jpg nightingale one.jpg (91.9 KB, 2649 views)
Babylon-warp is offline   Reply With Quote
Old 9th December 2006, 15:38   #8
Babylon-warp
Senior Member
 
Join Date: Oct 2005
Posts: 116
Winamp forums are messing up
Babylon-warp is offline   Reply With Quote
Old 9th December 2006, 15:49   #9
Babylon-warp
Senior Member
 
Join Date: Oct 2005
Posts: 116
phaseaccurate peaks and troughs across the frequencies
Attached Images
File Type: gif 2006-10-12_135202.gif (79.7 KB, 1336 views)
Babylon-warp is offline   Reply With Quote
Old 9th December 2006, 15:50   #10
Babylon-warp
Senior Member
 
Join Date: Oct 2005
Posts: 116
same stuff
Attached Images
File Type: gif 2006-10-15_000124.gif (38.0 KB, 969 views)
Babylon-warp is offline   Reply With Quote
Old 9th December 2006, 15:53   #11
Babylon-warp
Senior Member
 
Join Date: Oct 2005
Posts: 116
a home-made fast Fourier spectrogram
Attached Images
File Type: jpg p73258533004728.jpg (84.9 KB, 1271 views)
Babylon-warp is offline   Reply With Quote
Old 4th April 2008, 18:45   #12
svshepherd
Junior Member
 
Join Date: Apr 2008
Posts: 1
spectrograpm

Hi all,

I was looking into this myself - has anyone gotten a spectrogram working? I wasn't able to figure out, on a quick pass, how to activate a spectrogram as a custom waveform in milkdrop 1.04. I've wanted a nice log-f spectrogram for a long time. I'd also like to play around with using color to represent phase / stereo information or to highlight musical note value.

Does anyone have a script I could work from, or have a good pointer as to how to access the freq spectrum as a custom wave?

stephen
svshepherd is offline   Reply With Quote
Old 13th April 2008, 10:26   #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
crawled my milkdrop archives and found a folder including presets from this:
http://forums.winamp.com/showthread....hreadid=263823
thread.
There are some sort of cool analyzer presets - have a look.
Flexi is offline   Reply With Quote
Old 15th April 2008, 02:08   #14
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
http://forums.winamp.com/showthread....threadid=85171

Tada.

Edit: Actually, I don't think that's the preset I thought it was.

Oh well.
ryan is offline   Reply With Quote
Old 30th April 2008, 12:53   #15
yhscchpcbr
Senior Member
 
Join Date: Apr 2006
Posts: 449
spectro experiments

messed around with spectro
i list goals at the end of presets for those interested
jpg is for a couple of the preset's textures
Attached Images
File Type: jpg vitriol.jpg (118.2 KB, 1143 views)

ayahuasca chupacabra
yhscchpcbr is offline   Reply With Quote
Old 30th April 2008, 12:56   #16
yhscchpcbr
Senior Member
 
Join Date: Apr 2006
Posts: 449
1of2 attached
Attached Files
File Type: zip mixesexperiments1of2.zip (131.0 KB, 763 views)

ayahuasca chupacabra
yhscchpcbr is offline   Reply With Quote
Old 30th April 2008, 12:57   #17
yhscchpcbr
Senior Member
 
Join Date: Apr 2006
Posts: 449
2of2 attached
Attached Files
File Type: zip mixesexperiments2of2.zip (140.6 KB, 675 views)

ayahuasca chupacabra
yhscchpcbr is offline   Reply With Quote
Old 8th May 2008, 06:18   #18
yhscchpcbr
Senior Member
 
Join Date: Apr 2006
Posts: 449
more spectro

here is an attempt at improving the evenness of the amplitude response from frequency to frequency. i kept playing with equations cuz i'm too dumb to predict rigorously what's going to happen. plus a mash with it (not a sentence)
Attached Files
File Type: zip demonizer.zip (4.6 KB, 724 views)

ayahuasca chupacabra
yhscchpcbr is offline   Reply With Quote
Old 14th May 2008, 19:15   #19
hexcollie
Senior Member
 
hexcollie's Avatar
 
Join Date: Feb 2008
Location: Rochester, Michigan
Posts: 177
Send a message via AIM to hexcollie
I mean WOW!!!!!

so i was wandering aimlessly thru the internet and came across someone using that Spectrogram program to analyze an Aphex Twin song...this is what it produced


Impressive huh? not really too related to the subject, but it amazed me. check out the whole page at http://www.bastwood.com/aphex.php

^_^ Don't Panic!! ^_^
hexcollie is offline   Reply With Quote
Old 14th May 2008, 22:25   #20
Saint Goody
Senior Member
 
Join Date: Apr 2008
Location: Somewhere in Southern Indiana
Posts: 184
huh...

I'm gonna start putting that kinda thing into some synths...

Anyway, which of these presets seems to provide the most accurate spectrogram? I'm wanting to try out some Pixel shader effects with one.

I am the purple heathen.
Saint Goody is offline   Reply With Quote
Old 14th May 2008, 22:53   #21
Saint Goody
Senior Member
 
Join Date: Apr 2008
Location: Somewhere in Southern Indiana
Posts: 184
Okay, here's one that I edited to make the bass, mid, and treb values and their position on the spectrograph correspond with the red, green, and blue values of the wave.

It's not perfect, but it's a start.

I am the purple heathen.
Saint Goody is offline   Reply With Quote
Old 15th May 2008, 02:05   #22
yhscchpcbr
Senior Member
 
Join Date: Apr 2006
Posts: 449
the thing i really wanted to do i found i couldn't because of the way milkdrop is built. that is, i wanted to be able to use the value1 / value2 vars outside the custom wave perpoint code using q or t vars, but course, they don't flow that direction. it would be nice if you could use, in perpixel or in shader code, those values to be able to do something based on specific frequencies or ranges.

the ultimate goal in my mind is to do some kind of voice separation or filtering to get events on the screen for each specific voice, ie, kick drum, vocalist 1, vocalist 2, symbol 3, guitar, random instrument #4, etc. of course, timbre is very complex and filtering probably has to be statistical if you want to do things real time (still with a big buffer) since all the voices are mixed and there is great information loss at an individual freq at a specific time, and that can only be regained by multiple plays of the same voice in different contexts (something we do with our ears and brain deceptively easily), and probably still with much interpolation since timbre varies depending on pitch being played on the instrument, the velocity at which it's played, etc.

milkdrop, of course, doesn't have enough for this as far as i can tell. you can't get at value1/2 outside perpoint code, and even there you can't draw anything more than a thick dot for each sample (and that's just too little on the screen to easily associate a visual event with an audio event), and you wouldn't have enough vars to do voice filtering anyway. maybe i'm wrong, and if so, that'd be nice.

i did at least like that i could see some individual voices in the presets i did mess with, and to boot, in stereo, which is really fun with stuff like venetian snares.

i'm checking out your preset, saint g. it looks good. i wish more people would try more stuff with this and maybe we can get a breakthrough.

like i said above with only being able to draw a dot per frequency, one is always left with too much information at too homogeneous of a level to really pick out anything but the most significant contrasts in the music visually. i wonder if pseudo-randomizing the position based on frequency and/or loudness combinations could create a more intuitive voice to visual association.

i was just thinking, maybe quantizing value1/2 vs sample, maybe by running them through some modulo arithmatic, and then using a warp shader like the disco ball , might more correlate a position / color / brightness / set of squares with a voice. you don't need to connect the value1/2 with the warp shader code because it's all just pixels on the canvas which can be sampled. the key would be to be strategic about where certain frequency combinations are placed. does it make sense? any thoughts anyone?

ayahuasca chupacabra
yhscchpcbr is offline   Reply With Quote
Old 15th May 2008, 08:20   #23
hexcollie
Senior Member
 
hexcollie's Avatar
 
Join Date: Feb 2008
Location: Rochester, Michigan
Posts: 177
Send a message via AIM to hexcollie
... >,< dextroamp. nasal spray...must resist compulsion to post nonsense presets...substituting nonsense nonsense

^_^ Don't Panic!! ^_^
hexcollie is offline   Reply With Quote
Old 15th May 2008, 10:24   #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
@yhscchpcbr:

check out redi-jedis latest beta version, there are two very interesting concepts: first the sound(lofreq,hifreq) function which gives the summed volume in an interval. (a little bit tricky to find out: parameters are integers 0-1024)
the other thing is the w1-w8 variables which carry values from custom waves to the q1-q8 vars in the per-frame section.

Doll Doll Doll!
Flexi is offline   Reply With Quote
Old 15th May 2008, 20:35   #25
yhscchpcbr
Senior Member
 
Join Date: Apr 2006
Posts: 449
beta106

i remember when reading thread from when md2.0 was first released and redi asking something about re-integrating his forked changes into md2.0, but it seems like geiss didn't care, or maybe it's just impractical for some reason. i'd attempt it myself if i had the md2.0 source. is it available? i had searched around that same time, but i couldn't find it. i hadn't really started learning the structure of milkdrop until 2.0, but those features sound very useful for what this thread might be trying to accomplish. but i don't know if i can live without shaders.

ayahuasca chupacabra
yhscchpcbr is offline   Reply With Quote
Old 15th May 2008, 20:59   #26
Saint Goody
Senior Member
 
Join Date: Apr 2008
Location: Somewhere in Southern Indiana
Posts: 184
Can winamp handle that yhscchpcbr?

I would have thought that by now someone would have recompiled milk1.04 for something other than winamp (something with lots of input possibilities?).

hmmm... standalone milkdrop1 with it's own media player... maybe with the possibility of playing acid loops... SHIT there's an idea...

I don't think that Geiss made the MD2.0 source public. It kind of looks like he just lost interest.

Take a lookat his webpage...

Not quite off topic, but getting there: Arkaos Grand VJ is supposedly being released soon. I'll wait for that for live shows.

goddamn... I'm babbling... need moar shroomery...

I am the purple heathen.
Saint Goody is offline   Reply With Quote
Old 17th May 2008, 11:44   #27
yhscchpcbr
Senior Member
 
Join Date: Apr 2006
Posts: 449
a

alter goody
Attached Files
File Type: zip spectro only 20080517 0540.zip (2.8 KB, 793 views)

ayahuasca chupacabra
yhscchpcbr is offline   Reply With Quote
Old 18th May 2008, 13:46   #28
fed0r
Senior Member
 
fed0r's Avatar
 
Join Date: Mar 2008
Location: Russia, Saint-Petersburg
Posts: 121
Send a message via ICQ to fed0r
Maybe this...

I think that would be quite useful...
(Don't blame me for demolishing your eyes, tis looks ugly without pixelizing.)

Last edited by fed0r; 18th May 2008 at 14:03.
fed0r is offline   Reply With Quote
Old 19th May 2008, 22:18   #29
Saint Goody
Senior Member
 
Join Date: Apr 2008
Location: Somewhere in Southern Indiana
Posts: 184
EYES???? My eyes became pixelated on... and off... and gibberish...

Anyway, I fixed the blurring along y, now I just need to figure out x.

It looks like y stretching needs to be at 1.0005 to stop the shrinking, but that leaves horizontal blur...

Alter yhscchpcbr

I am the purple heathen.
Saint Goody is offline   Reply With Quote
Old 20th May 2008, 11:48   #30
fed0r
Senior Member
 
fed0r's Avatar
 
Join Date: Mar 2008
Location: Russia, Saint-Petersburg
Posts: 121
Send a message via ICQ to fed0r
WHERE IS MY FILE???????/
Attached Files
File Type: milk fed's spectro.milk (8.2 KB, 652 views)
fed0r is offline   Reply With Quote
Old 20th May 2008, 19:10   #31
fed0r
Senior Member
 
fed0r's Avatar
 
Join Date: Mar 2008
Location: Russia, Saint-Petersburg
Posts: 121
Send a message via ICQ to fed0r
BETTER

enhanced prev. file:
Attached Files
File Type: milk fed's spectro 2.milk (5.5 KB, 747 views)
fed0r is offline   Reply With Quote
Old 22nd May 2008, 01:58   #32
yhscchpcbr
Senior Member
 
Join Date: Apr 2006
Posts: 449
skin load

well, i tried with my might to figure out what's wrong with the x stretch, but couldn't, but i did find that the real problem with the y stretch wasn't at sy, but somewhere else, so now sy can remain at 1.000. I tried many values for sx, but it always stretches after half the screen. anyway, if anyone who knows milkdrop better could look, it would be nice to stop it blurring as it goes left.

jin tian kuai le sha ren jia!
Attached Files
File Type: zip spectro preset 20080521 1955.zip (1.1 KB, 632 views)

ayahuasca chupacabra
yhscchpcbr is offline   Reply With Quote
Old 23rd November 2008, 17:34   #33
Drasla
Member
 
Drasla's Avatar
 
Join Date: Sep 2001
Location: Chicago
Posts: 81
To add to the list of spectrogram presets...

this picks up quiet notes a little better than the others posted here, and doesn't having the blurring issues, but is otherwise pretty similar.
Attached Files
File Type: milk drasla - simplespectrogram 3.milk (5.8 KB, 872 views)
Drasla is offline   Reply With Quote
Old 25th October 2015, 15:04   #34
Talwick
Junior Member
 
Join Date: Sep 2015
Posts: 8
I think not...

After using various spectrogram programs and plugins, I have to say that none of these come close, no offence intended to you creators out there.

My reasoning for acquiring a spectrogram visualizer is to look for hidden images in music (such as by Aphex Twin, who has done this sort of thing before).

I went to the trouble of learning how to translate images into audio (using FL Studio's BeepMap), and have them seemingly print out an image using sound waves.

I tested each one of these milk visualizers on a recording that spells out "Hello" in big letters, and saw nothing from these presets but noise or a blank image. Even after many adjustments, I got some visual feedback, but nothing close to what a true Spectrogram would show.


Here's the highest input vs output quality I was able to achieve in my experiments. And it would have been clearer if I remembered to turn off Stereo Widening (the reason for those little lines through the image)
Talwick is offline   Reply With Quote
Old 25th October 2015, 17:12   #35
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 854
Waste of time. Milkdrop was never meant as a signal analyser, and what you try to do does not work for a few simple reasons:

1. Milkdrop does not analyse 100% of the audio information. It only provides an FFT chunk over a few milliseconds each frame. Roughly 70% of the audio is lost.
2. The phase information is not available. Another 50% information loss.
3. Probably due to the short FFT window used, the basses are missing.
4. At 30 fps, the time resolution is hardly sufficient in the first place.
5. This stuff certainly requires careful adjustment of the FFT parameters, the window type, length, overlap etc. None of this can be adjusted in milkdrop except by modifying the source code... which you can do, as it is open source. In this case, you should consider using the wavelet transform which would probably be the better choice than FFT for this sort of thing anyway.
Nitorami is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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