## windowing for simple looper

Jun 14 2018 | 2:44 am
I'm trying to make a very simple looper/stutter effect in gen and want to perform some windowing to remove clicks. Basically I am recording one second of audio that is played back by a [phasor] [fold] [sample] combination for the stutter. Only problem is I get terrible clicks and I'd like to window the playback.

• Jun 14 2018 | 1:58 pm
There's a few different ways you could do this. You could create an external buffer that defines a window, and apply that to the amplitude of the loop/stutter. You could set up some math that automatically fades in/out the amplitude when the playback gets close the beginning/end of the loop/stutter. The way you've implemented the playhead for the stutter is a bit wonky (to me, this might be what you are trying to do) - the phasor jumps back to 0 after each second, so you may want to rethink that part, using a counter and folding/wrapping would eliminate that.
• Jun 14 2018 | 4:30 pm
Thanks Evan ill try that out!
• Jun 14 2018 | 4:41 pm
I think the counter part of your suggestion is crucial for this
• Jun 14 2018 | 4:54 pm
I use counters all the time for reading through samples/loops. Using counter and then wrapping that to the size of the loop, then dividing by the length will give you a nice 0 - 1 ramp, which you can use to read through a window buffer using a sample operator.
• Jun 14 2018 | 5:54 pm
The only thing im wondering is how i would trigger the windowing at the right moment. For example if i am using peek to play back and loop say index 157 to 2341 how to i trigger the windowing to occur at the right moment? Maybe using ==157 and/or==2341 to open a gate?
• Jun 14 2018 | 6:09 pm
I wouldn't worry about triggering anything, just read through the window buffer at all times. Massage the playback index to a range of 0 - 1. In this case you would subtract the offset, and then divide by the length to get an index value of 0 - 1. send that value to a sample operator to read through the buffer containing the window. You would have fades at the beginning and end of the window of a certain amount of samples, effectively fading in and out at the edges of the loop.
• Jun 14 2018 | 6:41 pm
Hmm sounds easy enough i will try tonight. Thanks man
• Jun 14 2018 | 6:44 pm
Good luck! Let me know if you get stuck, I'd be happy to help with examples, etc.
• Jun 14 2018 | 10:58 pm
Cool man. Yeah if u wanna post an example that would be cool cuz i will prob be stuck
• Jun 17 2018 | 10:47 pm
How would I create a windowing buffer inside of gen~? Thing is I got it to work but I wanna load this on my OWL pedal so I have to do everything inside gen~ (ie I cannot reference a buffer object inside of MSP).
Another viable alternative would be to do all the windowing using maths instead of using a windowing buffer which would probably also be better because it would be more computationally efficient which is important for the whole OWL thing
• Jun 18 2018 | 3:27 pm
I'm not sure what type of efficiency gains you'll get from doing the math as opposed from reading from a small buffer, but here's an example of each approach:
I did an internal data object in gen, and also just used a fold, clip, and divide to get a window from the sample index of a loop.
• Jun 18 2018 | 3:35 pm
Hi Dario, I've attached a patch where the windowing is done using math within a codebox. There's 3 functions (some of them come from the gen pulsar examples). There is also a phase offset so that if you want you can do some time stretching and chain 2 or 4 windows with a relative phase offset. The bandwidth parameter is really nice for granular synthesis but for a stutter you might want to keep it low (==1).
There's a really good collection of windows in Graham Wakefield's site : https://grrrwaaa.github.io/gct633/audio.html
• Jun 18 2018 | 3:41 pm
.quasars stuff is better than mine!
• Jun 19 2018 | 8:42 am
I use counters all the time for reading through samples/loops. Using counter and then wrapping that to the size of the loop, then dividing by the length will give you a nice 0 - 1 ramp, which you can use to read through a window buffer using a sample operator.
• Jun 23 2018 | 6:13 pm
cool Im gonna try these solutions right now.
Also came up with this solution making an almost rectangular window using maths:
• Jun 23 2018 | 10:13 pm
if you dont mind having a tail at the end of your audio, you can setup only one window and create the others using delays.
(thinking external buffer here, but might also be cool for live generated math functions)