Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cool waveform renderer (HSV) #6684

Closed
mixxxbot opened this issue Aug 22, 2022 · 27 comments
Closed

New cool waveform renderer (HSV) #6684

mixxxbot opened this issue Aug 22, 2022 · 27 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: xorik
Date: 2012-11-02T13:00:28Z
Status: Fix Released
Importance: Wishlist
Launchpad Issue: lp1074346
Tags: hsv, patch, waveform
Attachments: hsv.patch


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
@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-02T13:00:28Z

@mixxxbot
Copy link
Collaborator Author

Commented by: esbrandt
Date: 2012-11-02T13:09:31Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2012-11-02T13:32:50Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-02T14:25:25Z


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?

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2012-11-02T14:38:02Z


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)

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-02T15:03:10Z


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",
    

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-02T15:07:34Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-02T15:13:23Z

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2012-11-02T21:05:04Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2012-11-02T21:53:07Z


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!

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-03T07:00:51Z


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...

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-03T07:14:59Z

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-16T12:26:57Z


Synced with upstream, fix bug #⁠1065318

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2012-11-16T13:16:32Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-11-16T13:58:55Z


done, my name is Andrey Smelov

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-12-10T07:24:45Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-12-10T07:26:01Z


Latest version of hsv.patch

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2012-12-10T15:44:35Z


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 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

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-12-11T05:22:35Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-12-12T10:38:23Z
Attachments: hsv.patch


Yet another version of patch.

  • AlignBottom/AlignTop support
  • fixed wrong visual waveform on some cases

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-12-12T10:39:49Z


Oops, I mean visual gain, not waveform

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2012-12-13T22:52:50Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: xorik
Date: 2012-12-14T05:17:08Z


I'm glad to help :)

@mixxxbot
Copy link
Collaborator Author

Commented by: rob2192
Date: 2013-01-12T22:53:26Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2013-01-12T23:41:51Z


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?

@mixxxbot
Copy link
Collaborator Author

Commented by: rob2192
Date: 2013-01-15T11:29:19Z


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.

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 1.11.0 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant