Sound wave generator

itsthejayj's picture

Hi guys, i think i might not be using the right terminology here, but anyway i trying to recreate a sound wave image like how Ableton Live and Serarto display there audio clips. (see images on attached)

The idea is to decode an audiofile into a queued structure, save to a plist and relaunch to display a waveform. However my quick attempts have not gone as planned. See how my attempt (the blight blue soundwave) is different to Ableton's (the dark blue) and i was wondering what i'm doing wrong and if any one can think of a more efficient way to recreate this in QC? for example using chart tools?

Thanks

cybero's picture
Re: Sound wave generator

Firstly isn't the Ableton sound image formed of two channels and your construct is actually reading only one channel? Interesting idea using Chart Tools. However, my first port of call would be to collect data from both the Waveform channels.

itsthejayj's picture
Re: Sound wave generator

Ok that can be done (is done) see attachment for composition with both channels and an audiotrack to use + a still image of ableton's decoded soundwave.

PreviewAttachmentSize
Wavegenerate like ableton.zip830.81 KB

itsthejayj's picture
Re: Sound wave generator

Think i might have almost done this, however it does still look abit different. + i'm not really understanding why ableton shape the soundwave like this but...

PreviewAttachmentSize
WaveGenerate_final_really?.zip831.29 KB

gtoledo3's picture
Re: Sound wave generator

The main problem with your setup is that you aren't offsetting the y values/calculating your lengths correctly, so that they are centered (this is just from looking at the pictures).

I happen to have had this mocked up for something I was experimenting with recently (http://www.vimeo.com/13421825).

There is a mode for volume peaks, as well as LR spectrum, and a CI shadow/highlight setup. If you end up wanting to use this or need it modified for J.A.M let me know...

PreviewAttachmentSize
LR_GT.qtz34.55 KB

itsthejayj's picture
Re: Sound wave generator

Thanks George for the composition + like the vimeo video and track u made!

However your composition is pretty much what i tried before, although from the overall view it looks correct its not what Ableton has done... i've made a video to show the difference when zooming in on a soundwave within Abe. See how the soundwave values are smoothed rather than being symmetrical at the top and bottom.

PreviewAttachmentSize
ScreenFlow.mov15.38 MB

gtoledo3's picture
Re: Sound wave generator

Oh, that's reconstructing the curve... it looks like it's dropping points as needed depending on the zoom level. That would be time consuming to set up.

edit: damnit, I hate it that we can't edit our attachments here when a post has been tagged on.

I messed up the labelling on the source index above. Re-attaching for posterity.

PreviewAttachmentSize
LR_GT.qtz34.35 KB

gtoledo3's picture
Re: Sound wave generator

As I look at it more, the problem becomes clear:

What needs to happen to mimic this is to write two x points per every y point, and then be able to dynamically adjust the distance between those two x points. That's how they are able to get this kind of waveform representation. If there weren't two X points (to get the bit/stairstep/quantize effect), then you would just be able to use X scale on a 3D transform to do your zooms... but it "feels" like I would set this up so that I had a variable that added a given value between each two x points depending on the desired rendering size. I would also try to limit the structure so that only what is onscreen is rendering, as this could get pricey.

Sorry if I'm telling you stuff you already know.

usefuldesign.au's picture
Re: Sound wave generator

The lack of symmetry in your waveform when it is squished is maybe a clue too. Something must be effecting the data to cause that displacement.

dust's picture
Re: Sound wave generator

@itsthejay

looks like you have it right on.... i mean i have no idea how live draws its waveform view context but if you simply duplicate and flip your waveform every thing lines up nicely when you overlay qc with the live image.

(see attached img)

itsthejay, what is the deal with your live jam project. it is very interesting to me and i would love to try it. is there a download for it anywhere ? i would be willing to contribute for a plugin like this ;)

PreviewAttachmentSize
Screen shot 2010-08-04 at 3.49.56 PM.png
Screen shot 2010-08-04 at 3.49.56 PM.png45.25 KB
WaveGenerate copy.qtz38.86 KB

itsthejayj's picture
Re: Sound wave generator

yeah i'm just too confused on this 'reconstructing curve' soundwave, as you pointed out dust it looks good enough visually just by flipping the image.

As for JAM, sure Dust i would love to get you involved. I will post a topic soon about the JAM touch project and get you all get involved!