New cool waveform renderer (HSV)

Bug #1074346 reported by xorik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Wishlist
xorik

Bug Description

Hi!
I make patches, to add to mixxx new waveform renderer, based on software filtered renderer.
I never before write on Qt, so my code may be terrible. But anyway new renderer is cool, you can see it on screenshot: http://ompldr.org/vZ216bA
to apply patch, just go to mixxx directory and run "patch -p1 < hsv.patch".

That is not good:
- 90% of code is copy+pasted from filtered waveform, so there is many dublicated functions;
- CPU usage is pretty big (depends on waveform refresh framerate). In fact this problem is present in another waveform renderers;
- in filtered signal there was code, something like: Qt::AlignBottom and Qt::AlignTop. I killed this code

xorik (xor29a)
description: updated
Revision history for this message
jus (jus) wrote :

Nice, and very useful imo.
It`s like http://flic.kr/p/absqfa from lp:823354, which did not made it into trunk for whatever reasons.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Wow, nice, Xorik!
Can you make it change the hue rather than the lightness? To me it's easier to see colors than luminance at a glance.

Changed in mixxx:
importance: Undecided → Wishlist
Revision history for this message
xorik (xor29a) wrote :

I can try to do this, but I think it was hard to determine sound's frequency, depending on color, if you see rainbow waveform :)
Or maybe you mean draw both waveforms in same colors? like: high->yellow, mid->green, low->blue?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Thank you xorik.
This schould be a good alternative vor low performance hadware because we have only one drawLine() per visual sample it should be significant faster..
I would vote vor having it in 1.11.
Maybe we can also prepare a pure GL version.
(I am making good progress in dejerking GL waveforms , but not with Software rendered)

Revision history for this message
xorik (xor29a) wrote :

OK, When I change hue of color, depending of low and high freq. value I got this: http://ompldr.org/vZzQ5cw
Just make this:
- lo = maxLow[0]/300.0;
+ lo = maxLow[0]/200.0;

- color.setHsvF(h, 1.0-hi, 1.0-lo);
+ color.setHsvF(h+(lo-hi)/3.0, s, v);

I think this if worse, than my first screenshot.

About perfomance: my code is use 60% of my CPU when mixxx, but "filtered - software" uses just 40% cpu. Maybe someon can make some optimizations, but I can't...

P.S. I forgot to add one file to my patch, there is:
--- a/mixxx/build/depends.py
+++ b/mixxx/build/depends.py
@@ -633,6 +633,7 @@ class MixxxCore(Feature):
                    "waveform/renderers/waveformrendererpreroll.cpp",

                    "waveform/renderers/waveformrendererfilteredsignal.cpp",
+ "waveform/renderers/waveformrendererhsv.cpp",
                    "waveform/renderers/qtwaveformrendererfilteredsignal.cpp",
                    "waveform/renderers/qtwaveformrenderersimplesignal.cpp",
                    "waveform/renderers/glwaveformrendererfilteredsignal.cpp",
@@ -649,6 +650,7 @@ class MixxxCore(Feature):
                    "waveform/widgets/waveformwidgetabstract.cpp",
                    "waveform/widgets/emptywaveformwidget.cpp",
                    "waveform/widgets/softwarewaveformwidget.cpp",
+ "waveform/widgets/hsvwaveformwidget.cpp",
                    "waveform/widgets/qtwaveformwidget.cpp",
                    "waveform/widgets/qtsimplewaveformwidget.cpp",
                    "waveform/widgets/glwaveformwidget.cpp",

Revision history for this message
xorik (xor29a) wrote :

use 60% of my CPU when mixxx idle, I mean

Revision history for this message
Daniel Schürmann (daschuer) wrote :

a little hint: please create the patch by
bzr diff > patchname.patch

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Hrm, I see what you meant by rainbow waveforms. I wonder if we can use the skin colors but tint them like a little red for bass and blue for treble. I'll play around with your patch and see what I can cook up. Thanks so much for submitting it!

Revision history for this message
xorik (xor29a) wrote :

You can do anything with my patch :)
Also If you plan include it into mixxx, maybe you want to rename this waveform render. Also maybe someone can improve CPU usage...

Revision history for this message
xorik (xor29a) wrote :

Synced with upstream, fix bug #1065318

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Oh, would you please sign the contributor agreement here? https://docs.google.com/a/mixxx.org/spreadsheet/viewform?formkey=dEpYN2NkVEFnWWQzbkFfM0ZYYUZ5X2c6MQ
And let us know your real name to put in the credits.

Revision history for this message
xorik (xor29a) wrote :

done, my name is Andrey Smelov

Revision history for this message
xorik (xor29a) wrote :

Hi all!
I check my code, and was notified: all my math is not correct. So I rewrite math code, and now waveform is more correct and nice: http://ompldr.org/vZ216bA

Revision history for this message
xorik (xor29a) wrote :

Latest version of hsv.patch

xorik (xor29a)
description: updated
Revision history for this message
RJ Skerry-Ryan (rryan) wrote : Re: [Bug 1074346] Re: New cool waveform renderer (HSV)

Hi Xorik,

Can you work on adding AlignBottom/AlignTop support? It is a feature of the
waveform that the signal can be drawn aligned top or bottom and we will
likely use this in a future skin so it's important all the waveform
renderers support it.

Thanks!
RJ

On Mon, Dec 10, 2012 at 2:41 AM, xorik <email address hidden> wrote:

> ** Description changed:
>
> Hi!
> I make patches, to add to mixxx new waveform renderer, based on software
> filtered renderer.
> - I never before write on Qt, so my code may be terrible. But anyway new
> renderer is cool, you can see it on screenshot: http://ompldr.org/vZzQ4Yg
> + I never before write on Qt, so my code may be terrible. But anyway new
> renderer is cool, you can see it on screenshot: http://ompldr.org/vZ216bA
> to apply patch, just go to mixxx directory and run "patch -p1 <
> hsv.patch".
> +
> + That is not good:
> + - 90% of code is copy+pasted from filtered waveform, so there is many
> dublicated functions;
> + - CPU usage is pretty big (depends on waveform refresh framerate). In
> fact this problem is present in another waveform renderers;
> + - in filtered signal there was code, something like: Qt::AlignBottom and
> Qt::AlignTop. I killed this code
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/1074346
>
> Title:
> New cool waveform renderer (HSV)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1074346/+subscriptions
>

Revision history for this message
xorik (xor29a) wrote :

Ok, I'll try it, but I'm not sure, how to debug it :)

Revision history for this message
xorik (xor29a) wrote :

Yet another version of patch.
- AlignBottom/AlignTop support
- fixed wrong visual waveform on some cases

Revision history for this message
xorik (xor29a) wrote :

Oops, I mean visual gain, not waveform

Changed in mixxx:
assignee: nobody → xorik (xor29a)
status: New → In Progress
milestone: none → 1.11.0
Revision history for this message
Daniel Schürmann (daschuer) wrote :

Hi xorik,

Thank you very much!
I have committed your patch to lp:mixxx/1.11 #3624 and will add you to the contributor list.

Kind regards
Daniel

Changed in mixxx:
status: In Progress → Fix Committed
Revision history for this message
xorik (xor29a) wrote :

I'm glad to help :)

Revision history for this message
Robert Broadley (rob2192) wrote :

Would it be possible to change colour of the waveform dependant on key. I'm pretty sure there is a vamp plugin that can detect the key changes in music. I think it's the key detector on here - http://www.vamp-plugins.org/plugin-doc/qm-vamp-plugins.html#qm-tonalchange.

This could be really useful for detecting melodic changes and also finding where in the tracks to mix - i.e. sam colour should mixxx harmonically.

Thanks for the great work
Rob

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Thank you for your post.

Can you please file a new bug, because this is already committed.
So we can better keep track of it.
It sounds similar to Bug #1074392 what do you think?

Revision history for this message
Robert Broadley (rob2192) wrote :

Added new bug report here https://bugs.launchpad.net/mixxx/+bug/1099782
I think this could be potentially much more useful than the moodbar depending how you mix as it would be simpler to interpret.

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/6684

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.