Gen Based Granular Processor/Spectral FFT etc.

Matheu Watson's icon

Hi there everyone, hope you are safe and well out there? I recently got a device called a Mod Duo X, it can host patches created in Gen and I am looking for something that works on real time audio. I wondered if anyone knew of any Gen patches that work in this way that might be available? A bit of an open question so any thoughts on this would be great, many thanks and stay safe!

Graham Wakefield's icon

I have added a lot of gen~ examples that are included in Max -- search under Help/Examples/Gen -- some of which are fairly simple as learning tools, others are a lot more complex, including a few reverbs. Also there are many amazing examples that have been posted to the forums over the years, it's well-worth searching through the archives.

One thing to note (given your topic title) is that spectral/FFT isn't something that can be done inside a gen~ patcher, and thus won't be part of the code export that can be used with a Mod Duo etc. either.

Graham

manysounds's icon

BUT is there a codebox version to do what ~pfft does?

Max Gardener's icon

As several persons (including Graham) have suggested elsewhere, you could develop in pfft-hosted-gen~ and export the code, and wrap the exported code in a pfft~ equivalent based on Kissfft, Ipp or fftw. But a codebox version of what pfft~ does? No.

Graham Wakefield's icon

... if the desire is to understand how an FFT works, there *is* a thread somewhere on this forum where I implemented the majority of the work of an FFT in a codebox, but for anything in production or where you care about performance, absolutely as Max says, wrap the exported code in a C/C++ FFT library. A codebox-based FFT isn't going to be able to take advantage of the kinds of specific optimizations those libraries can provide.

manysounds's icon

Thanks thanks
yeah I don’t really fully “get” FFT entirely
unfortunately this forum is a giant swamp 🤪 and sometimes I feel like I could read for 24 hours straight and not find what even the simplest [gen~] functions are.
I was searching for a way to port the max gen resynthesis example to my Daisy platform but it looks like it won’t be as simple as using the wonderful [Oopsy~] package.
y’all rock

Graham Wakefield's icon

The aforementioned thread found: https://cycling74.com/forums/fft-inside-gen

Haven't tried this on Oopsy yet -- would love to hear what the performance is like. You'd need to convert the buffer~ references into data too -- the most important being generating the window function.

But I'd not get hopes up -- I really don't think this is going to be very efficient at all.