[Sound] Waveform display

I begin in OF, i would like to display sound waveform of samples, and zoom with the mouse (if it’s possible).
I don’t see any answers about this. I was wondering if FMOD, Qt, Juce or OpenAl could do this, but I can’t see it.
Any suggestions ?
Thanks

Sound waveform display is already achieved in the OF audioOutputExample.

Zooming could be achieved by extending this example but is slightly more complicated. Everything is there, but how hard it would be to build depends more on your knowledge of sample buffers and digital audio than OF.

You could do the same thing using FMOD, juce, or Openal instead of rtAudio but it wouldn’t be any easier.

hope that’s useful…

So are you looking to do a static display of a Sample, similar to an editing environment or waveform display in Max/MSP? Off the top of my head, you could extend the example to draw an entire buffer on load, right now I believe it draws instantaneous output. As for zoom and mouse, that would be harder… I would look at maybe extended MSAInteractiveObject for your sample window to get the mouse interactions, then scale/redraw loaded buffer on mouse press/drag/release inside window. Hope that helps a little more. Grimus is correct that you may be able to do it with FMOD or juice, but I think it would complicate things a little… Start with the built in ofSoundPlayer, and if that works, you can expand on that (ofSoundPlayer is a wrapper for FMOD anyhow, so expanding into FMOD if it works would be simple enough)

Thanks for nice informations.

The example is a good way to start. However, i have some errors like :

  
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized|  
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized|  
... etc ...  

Did you see it before ?

For my purpose, you see right, I want a static display not an oscilloscope.

Start with the built in ofSoundPlayer

I expected more methods… and not to do it myself.
I think i will do it worst than audio experimented developpers.

how hard it would be to build depends more on your knowledge of sample buffers and digital audio than OF

I work on an simple audio editor, open source + cross platform, with audio researchers, maybe we could implement a simple way to do this.

I expected at leaset find a beautiful tiny method in others libraries. Why not in **Juce **(Max/MSP, LIVE), in GTK++ (ARDOUR), in wxWidgets(Audacity) ?

Does it mean all this projects developp their own methods for displaying and zooming waveform ?

My last question is about what GUI Library choose ? I begin with Qt4 for the application, but now i don’t know if it’s the correct choice.

very quickly - these particular warnings can be disregarded – they are about a version of quicktime compiled with visual studio and they don’t really effect the application you compile.

hope that helps !!

take care,
zach

Jerome,
Audio functionality in OF is still pretty minimal, but that’s more or less how it will be I think. The idea is to keep the core minimal, simple and bug free.

Extra functionality comes in the form of addons (there’s a list on the website), so the sort of thing you are talking about could be reused by others if you made it into an addon.

A lot of audio apps (and graphical ones as well) redo everything from scratch. Hopefully OF will improve this situation once lots of people extend the core and share their code. If you have anything to contribute, it will be warmly received :slight_smile:

Regarding GUI there’s a GTK example here if that helps:
http://forum.openframeworks.cc/t/of-gtk±port/560/0

In fact, I don’t need real-time but **asynchronous **audio.

I will start practicing Juce now, because I find this :
http://www.rawmaterialsoftware.com/juce/api/classAudioThumbnail.html#f639060d5db08b94233c55d990743343

An interesting visualization system here :
http://soundlab.cs.princeton.edu/software/sndpeek/

There are a lot of including files, i don’t know which can manage waveform display and zoom. I think the main system is using C/C++ with sndfile.h and rtAudio.h.
If I’m right, may be it’s possible to incorporate it into OF …
What do you think ?

the Juce method looks promising… and if the library is c++ you should be able to get it into OF with little issue. I haven’t really messed with Juce, but I will stab at it and let ya know.

I think a good technical solution would be to use **Fmod **for extracting Data from sounds and Qwt to display it and to offer zooming?

Interesting methods in Fmod:
GetWaveData
FMOD_Sound_ReadData | Sound::readData

**Qwt **:
http://qwt.sourceforge.net/curvescreenshots.html

In OF, this could help :
http://forum.openframeworks.cc/t/oscilloscope-extension/554/0