Forums > MaxMSP

Algo to morph sound to sine or saw wave?

September 8, 2010 | 5:27 am

I’m thinking on how to implement morphing of the arbitrary sound wave to particular simple waveform (sine/saw/square). Preferably in realtime, some latency will take place of course
Here is a good demonstration of the effect, at 8:00

http://www.youtube.com/watch?v=Gxbx-fvvsGI#t=8m00s

Do you have any suggestions on the algorithm?
I guess I need some fundamental detection, and fiddle~ or pitch~ are good points to start with. But Max5 crashes when I try to open their help files (which are in old max format) so I don’t even know if they can be useful in my case


September 11, 2010 | 11:48 pm

that sounds promising :)

I had a quick look at the manual and there it says that these effects are precalculated and work on the zero-crossings of the signal.
In theory this is quite simple:
You take the segments between two zero-crossings and add or subtract a waveform of the corresponding length…

..but i don’t have any idea how this could be implemented as a max patch :(


September 12, 2010 | 2:55 am

You might try looking up Larry Polansky’s ‘morphological mutation functions’ and ‘spectral mutation functions’ online. Might give some interesting ideas on how to proceed.


September 12, 2010 | 1:02 pm

You might get something similar with waveshaping I guess.


September 12, 2010 | 4:09 pm

you can put your audio sample into a multislider with peek~, store the multislider with [pattr], then interpolate between your original waveform and a pre-stored one (sine, saw, square, whatever). Pick an overall sample length (like 512 or 1024) and use that for everything, including your pre-stored sine/saw/square waves. You *must* have the same number of points in your sample as the ones you want to interpolate to.


September 13, 2010 | 4:43 pm

Thank you all

mudang, that makes it clear, I had no hope they would write it in manual

seejayjames, yes, indeed, but first of all I need to detect frequency and phase for my waves

Steven Miller, interesting, I’m having a look

Do you guys have fiddle~ or pitch~? Can you post a screenshot of its help file? I would be very grateful for that, I still have problems with their help files


September 13, 2010 | 6:57 pm

I’ve got pretty exhaustive fiddle~ description here
http://crca.ucsd.edu/%7Etapel/icmc98.pdf
So I’m interested in pitch~ help only


September 13, 2010 | 7:38 pm

here's the pitch~ help patch…i don't know if it's up to date though

– Pasted Max Patch, click to expand. –

[attachment=141502,1127]

Attachments:
  1. pitch~.help.png

September 14, 2010 | 1:43 pm

Very helpful, thanks a lot!


Viewing 9 posts - 1 through 9 (of 9 total)