Old 27th January 2011, 03:12   #1
Danya Lukin
Junior Member
 
Join Date: Jan 2011
Posts: 9
merging a DSP and Vis plugin

Hello to all!

For the reasons of the musical analysis visualization I am working on, i need to have waveform data that is avalable for use for vis plugins of greater resolution: for visualizations, winamp provides a 576 array of 'char' values, which is not enough for me.

AN answer could be a DSP plugin, as winamp provides for it unchanged data in full its entirety: a unmodified block of waveform.

The dilemma is: The data can be retrieved through a DSP plugin, but the next step is to make it avalilable to the visualization plugin. Is some sort of combination of the two plugins possible? how could you transfer data from one to the other?
Or maybe how else could you manually retrieve the complete waveform data from winamp?

Thanks,

Danya
Danya Lukin is offline   Reply With Quote
Old 27th January 2011, 08:35   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
why not do it as a DSP and manually replicate or feed your vis plug-in with the data - isn't anything saying that cannot be done though it means everything is done from the one plug-in and at it's most basic, it's no more different than a DSP showing vu meters of the input level.

-daz
DrO is offline   Reply With Quote
Old 27th January 2011, 15:05   #3
Danya Lukin
Junior Member
 
Join Date: Jan 2011
Posts: 9
If I understood correctly, you suggest confine the visualization in the DSP, right?
The problem with that, and that is exactly what makes it different from a VU meter, is that a DSP, as i checked, must run at at least 60 or something frames per second, otherwise it slows down the playabck, and in end i dont expect to have an FPS that big.
So what i would need is maybe some sort of data transfer from one plugin to the other?
Or could there possibly be a way to just merge two plugins together, make a DSP module and a vis module in the same plugin ang have winamp call both? is that possible?

thanks,

Danya
Danya Lukin is offline   Reply With Quote
Old 27th January 2011, 15:32   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
Quote:
Originally Posted by Danya Lukin View Post
Or could there possibly be a way to just merge two plugins together, make a DSP module and a vis module in the same plugin ang have winamp call both? is that possible?
that's not possible for Winamp to use one plugin for both aspects.

what i'm suggesting is that you can do it as a DSP but pass that to your own vis engine and then with that say running on a different thread could update / use data being fed as needed so that shouldn't affect the DSP handling much and still allows you to do what you're trying to achieve.

i had thought i'd seen other true vis plug-ins do some sort of musical analysis. either way, you're going to be looking at some compromises since you want the higher data resolution but be a vis plug-in is really just designed for prettiness rather than data processing (a guess a legacy issue from when it was added over a decade ago).

only other option might be to have a look at the Milkdrop v1 source code as that does some funky things with audio data so that might have something of use in there or not - just thinking of what might help.

-daz
DrO is offline   Reply With Quote
Old 27th January 2011, 15:39   #5
Danya Lukin
Junior Member
 
Join Date: Jan 2011
Posts: 9
Thanks alot!

The thing with my plugin is taht it will have very intense analysis, and then a visualization with it, and the data will include the detection of genre, mood, onsets, and such, although yes, for realtime I will definitely have to make some compromises.

The problem of transferring data from a DPS to a vis plugin i cant get to work right now..
I tried writing it data to a file and pich it up from the visualization, but the DSP plugin is slowing down, maybe because there is a conflict when both plugins try to access the file...
Do you know of a better solution for transferring data from one plugin to another?

thanks,

Danya
Danya Lukin is offline   Reply With Quote
Old 27th January 2011, 15:47   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
file access will always be a poor thing to go for especially if you're doing time and data intensive operations. you'd probably be best off looking at some sort of shared memory between the two with relevant locks on the handling of it though you're probably over complicating things with having two plug-ins when it should work in just one with the relevant thread usage (but as you've got to code it, my view is probably wrong on what's best with what you're doing).

-daz
DrO is offline   Reply With Quote
Old 28th January 2011, 06:43   #7
Danya Lukin
Junior Member
 
Join Date: Jan 2011
Posts: 9
Thanks a million for that multi-threading suggestion!
I really did not know how it was done before, wasnt familiar at all, but read a bit on it and now i have the DSP function updated as often as it must and a separate process, a window, which is multithreaded in the same program, which is updated at any rate i want!
Thanks again, it worked out perfectly!

Danya
Danya Lukin is offline   Reply With Quote
Old 1st February 2011, 09:58   #8
1337fapx0r
Junior Member
 
Join Date: Feb 2011
Posts: 1
Are you doing anything to handle the fact that you do not know when the samples that are supplied to the DSP module will actually be output?

Try setting your output module buffer to several seconds or more and see how well it all matches up, especially after a bit of track changing/seeking.

You might be able to hack around these issues but I am doubtful.

I tried to do this many many years ago but couldn't see a way to get everything in sync . I actually came back here to see if there had been any maturation of the Winamp plugin situation but it all looks pretty much the same unfortunately.
1337fapx0r is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp 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 On
HTML code is Off

Forum Jump