Forums > MaxMSP

real time adjustable amplitude windowing

Mar 05 2009 | 7:42 pm

Hi. I would like to create an amplitude window with it’s type and size being adjustable in real time. kind of like an audio gate effect or the sequencer gate length. I would like to use it as an effect but also to remove pops between randomly and rapidly read audio files. I was looking into the wave~ / buffer~ method, but i am not sure how to implement the real time control aspect. Are these objects the best way to approach this or is there a better way? I’m just looking for a nudge in the right direction so any help is greatly appreciated!

Thanks for your time and attention.


Mar 06 2009 | 12:34 am

"real-time adjustable" implies you want to be able to switch the window in the middle of another window(ex. you have a gaussian window and half-way through a grain with a gaussian window you want the grain to switch to having a square or other type of window?)… but i’m not sure why you’d want that since that would introduce clicks and pops at certain points where the switch between envelope-shapes causes waveform discontinuity… in any case, if you want something like that, you could look at this thread which talks about generating the window without writing it to a buffer~ and if you did that you might be able to work in some smoothing functions for the switches in shape:

otherwise, if you are looking to generate different windows for each grain/segment of audio(scaled according to length, and only choosing a different window-shape at the start of each grain/segment) then i’d recommend the old-fashioned way of writing an amp-window into a buffer~ and then reading that buffer~ back at different rates in order to scale the window according to playback-length(plus, just fill the buffer~ with a different waveform or have several buffers with different amp-window shapes and have different poly~ grains address the different buffer~s containing amp-windows to get as many window-function choices as you need).

here’s a patch(attached) that shows two windowing techniques in case it helps(one is similar to your mention of a wave~/buffer~ technique), you could easily modify it to include different amp-window-shapes. (also, check out the adsr~ object, when used in conjunction with poly~ it’s very effective; and if you like adsr~, check out Eric Lyon’s el.adsr~ object for impulse-triggering of envelopes).

Mar 06 2009 | 8:18 am

This method does a non linear scaling on the domain and range. Because of two pow~s it might be to heavy to use multiple instances. With poke~ it is possible to refresh the buffer in realtime.


— Pasted Max Patch, click to expand. —
Mar 06 2009 | 7:00 pm

Thank you so much for your replies. By real time adjustable I just meant that I want to adjust the window size in real time not necessarily the actual window.

I’m not home right now so I’ll have to check out your examples when I get there.

Thanks for taking the time to post them.

Mar 06 2009 | 7:10 pm

Johan, when you say that it may be too heavy for multiple instances
because of the pow~s do you mean that those objects are cpu intensive?

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

Forums > MaxMSP