xbmc / visualization.milkdrop2

Milkdrop2 visualizer for Kodi
Other
28 stars 19 forks source link

Question about beat detection #17

Open WindowsNT opened 4 years ago

WindowsNT commented 4 years ago

It's very cool, I 've included it in my sequencer. However it doesn't seem to feed properly the wave.

I 've used float* botter to feed:

int PluginRender(unsigned char *pWaveL, unsigned char *pWaveR); And I 've modified the code in DoCustomSoundAnalysis:

memcpy(mysound.fWave[0], m_sound.fWaveform[0], sizeof(float)*576);
memcpy(mysound.fWave[1], m_sound.fWaveform[1], sizeof(float)*576);

but still, no reaction in the visualization. Any clues?

AlwinEsch commented 3 years ago

A very late answer here, sorry.

Think thats comes like on other addons by limit of stream data to the fixed size of 576, see here https://github.com/xbmc/visualization.milkdrop2/blob/Matrix/src/Milkdrop2XBMC.cpp#L69-L82, if now more data, does it interrupt between and audio always only partly given to milkdrop library.

AlwinEsch commented 3 years ago

Normally should also the Start() function called from Kodi's API (see https://alwinesch.github.io/group__cpp__kodi__addon__visualization.html#gaa4ba9bea676e0bccf5bcc7ac33b80f49), but them on this addon not used.

To have it works correct should it check by "Start" the channels, sample rate and bitsPerSample and do on "AudioData" call a wanted resample to match Milkdrops wanted sound.

Problem for me is that I'm not a good WIndows guy to know how exact this addon here works with his DirectX and not looked to fix itself for things like this.

If we could find someone who would look into it and fix these bugs would be great.

AlwinEsch commented 3 years ago

As example here I used a way on another addon with OpenGL to make a very small resample, with no audio corrections (as only for GUI and not for the ears :smirk:).

https://github.com/xbmc/visualization.waveform/blob/Nexus/src/Main_gl.cpp#L252-L279