fm in gen~ | self modulation

johannes's icon

hi,

i want to do a selfmodultion of an carrier oscillator in gen~. for now i feed the output of a cycle object into an history object, multiply it by a mod intensity value and from there i go back into the cycle inlet. but this doesn´t seem to work.

maybe someone can explain how feedback can used for selfmodultion in gen. i append a small patch showing the standard max version of a selfmod fm and a gen version which doesn´t work yet.

thanks, johannes

Max Patch
Copy patch and select New From Clipboard in Max.

Wesley Smith's icon

I think it actually is working. You can verify by sending out the frequency input out a second outlet and watching the value with number~. If you set selfmodint to 0, there's definitely a difference compared to a value of 100 for example.

It won't sound like the send~/receive~ version because history is a single sample delay and s~/r~ are vector sized delays.

if you use [delay] instead, you can vary how the feedback happens. Setting a delay equal to vectorsize will give you the same as the s~/r~ network.

johannes's icon

thanks wesley, thats it!

to understand: in my original patch the delay, used by the history object, was "to small" (1 sample) in order to create the feedback, no? so it is because of the rate difference at which sound gets processed  in gen (1 sample) and the msp ( signal vector size)?

Wesley Smith's icon

The defining feature of gen~ is that you can do single sample feedback. In your original gen patcher, feedback was working, but you weren't hearing much of a difference because the change due to feedback was minute.

johannes's icon

why minute? could you please elaborate …

stringtapper's icon

A single sample delay [history] is not going to audibly alter a signal in an extremely noticeable way beyond sounding like a basic low pass filter.

Wetterberg's icon

yeah, switch out the [history self] with a [delay 100] and it'll be mental.

volker böhm's icon

A single sample delay [history] is not going to audibly alter a signal in an extremely noticeable way beyond sounding like a basic low pass filter.

no, this really depends on the context. and in the context of a feedback oscillator having a one sample delay is just fine. although being able to introduce longer delays will give you the possibility for some nice chaotic sounds of course.

Max Patch
Copy patch and select New From Clipboard in Max.

to make the whole thing a little sharper i would switch to phase modulation, which is basically the same as fm, but has the advantage of a stable base frequency until the mod index is too high and the oscillator freaks out.
and inserting a lowpass filter inside the feedback chain will prevent heavy oscillation around nyquist with higher feedback amounts.

johannes's icon

thanks for the feedback, guys.

volker, very good that you mentioned phase modulation. i already had in mind but could understand how to effect the phase in gen. your patch is great to see how it can be done.

regarding fm/pm: is there an efficient way for dynamic routing of different operators in gen… like matrix~ object? (maybe another thread)

Peter McCulloch's icon

Not as such, but there are ways of faking it via buffer/data.

johannes's icon

hi peter, how would that work in detail?

Peter McCulloch's icon

You could use a buffer/data as a place to store values. It's more powerful than a variable because you can choose which index to read from/write to.

Short on time today, but will try to come up with an example.

johannes's icon

peter,  if you find some time than …  just that i get an idea how to create matrix~like stuff in gen~. thanks!

Alexis Baskind's icon

Hi all,

I also need a way to implement a matrix~ like function in gen~, for the reason mentioned above (single sample delay in the feedback loop). I roughly understand that a buffer~ is a good way to send all the commands to the gen matrix (so that one do not need for example 100 params for a 10x10 matrix). The question is about the matrix itself: is a bunch of multiply and lowpass (for rampsmooth) objects the only way to do that? Then again, for a 10x10 matrix, one would need 100 multiplications, 100 lowpass filters, plus all the mixes and the patch cable. Kind of discouraging...

My idea would be to do that in a genexpr codebox, using nested loops that read into a buffer to get the required coefficients, and write into another buffer the current values of the coeffs (because of ramps, the current value of the coeffs may differ from the orders). As far as I understand from gen and from the doc I read, I'm not 100% sure it's feasible. Can someone confirm me that it's the case? So that I don't spend 30 hours trying to square a circle. :)

Thanks,

Alexis

Noah's icon

Has anyone ever found any solutions to Alexis' problem? I've been interested in the same thing for a while now, but I'm equally stumped. All I have is the vague idea of making a sort of "feedback detector" that routes the operators' modulation input to the lowpass anytime it becomes equivalent to noise, but I'm not quite sure how to go about that, and if there's any better way to do it, I'd be greatful for any information.

Graham Wakefield's icon

It's a late reply, but here's something for 2017:

Max Patch
Copy patch and select New From Clipboard in Max.

Noah's icon

WOW it's only January but it already feels like christmas again!! Thanks so much, Graham!