real time adjustable amplitude windowing
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.
"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).
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.
----------begin_max5_patcher---------- 912.3ocyXF0jZBCD.9Y8WACSezdMIDDr+P5Kc5zAg3coERbf34cdy4u8FR.O 7pbFQYm6AQIDyt62tYY27xzI9KkOwp789t2O8lL4koSlXFpdfIM2OwuH4oz7 jJyz7KXUUI2y7mYelh8jxL9WvdXDpcX4FUNSoddMyt199d+p4Q7Ly7kK+yWC BZm+JoPIRJLy1+GrxrDQR6yVWxpXBUhhKE+tjkprKIIBcGZlGAEW+Ep4xAwH 1TvEZcvn0jNhohuyHFLV+WZjPhJ8At39NqNlXVQrc0oKL2De75aMRi.v0C95 zo0Wl4HIWkK0KRuDS+3Dk+LO+kIh6OM9nWO9vwzShOM73EZsSOWzANcDSwCk oVIF1385EojAfzaZvIwE5dkgYVVPhlOZQY8gjJlxaKWLy6wcRYg1IGp+ob0p 5ww2cgnBA.pBhHFVQL6HwVjcig01jGYqjkE66hqTYtrzpCGDU+6V+fejyqLe eRFRhakYiWvXCG.xxMqVwJOfVsm6jXMrcMpcp1MugmGoyMQgTrEo3ndY57aX .XtTqbQgWVjFIBfHs41LiKHi1lRAaq1Z9Ojj9bZNaeuDoheuHI+zbID.tfCL DI.Y3CM5LIvugfYs7ur8dcB56Z5zK1zCtbSO1XyMaXlu3LlN51Y5eauWHFOn Xh.HhIlaSGGzYyxMNlfsKIK8r6Jl8wrf3+Q0vbBCiRocMrv1q2vpU5KKfbiP s2Co86Dug44w.34IH5aUysXLRFzaoKZ8iKpRJVWUynK7MHPTqB0VoK0t2.Qf 6UH15DNJW4.5r.GewPBOTHYSoFENBsCb0cXgc50piQuRMMFDRFsdk5I.JmKX tjrselMGr9lZpDIXAb3Ysb6fJPCGcU8paM2HzXbTGKLk8GDX6Ak.WUcWcnVL DE3zbPPM09t3yXZpH.xVShsuLyVH7njQ5p4PHDbn47GnTnyLOzTOAv0ZXS2. PlDQUlrlsSxy1WeVG0eFT5YH5gzxHR6wrDdAPxLESBy2cX8F4TO9wjqRtoLs 0taqjw6MIkwpTbg48LclT8Qd1YROvyxXlmiNToS1ZIWnpZONrS5GcUmpO9+y pSwvpRTWvT.r5DwAcptpK.0o2ItdzoHP0oXWbcfpQj.GUILbASHGTIBra5HQ tDLAqJE5Z7MbtNrKdtPPUIhS5DEVLE4pNg9jwIfSN4Rl.LrYBbMQ.ALMJzQM BvL3ibxR8MuN8efz.UdP -----------end_max5_patcher-----------
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.
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?
Forums > MaxMSP