fm in gen~ | self modulation

    May 16 2013 | 7:18 am
    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

    • May 16 2013 | 6:39 pm
      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.
    • May 16 2013 | 10:18 pm
      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)?
    • May 17 2013 | 5:30 pm
      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.
    • May 17 2013 | 7:13 pm
      why minute? could you please elaborate …
    • May 18 2013 | 5:42 pm
      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.
    • May 19 2013 | 12:38 pm
      yeah, switch out the [history self] with a [delay 100] and it'll be mental.
    • May 19 2013 | 4:58 pm
      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.
      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.
    • May 19 2013 | 8:13 pm
      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)
    • May 20 2013 | 7:15 am
      Not as such, but there are ways of faking it via buffer/data.
    • May 21 2013 | 8:34 pm
      hi peter, how would that work in detail?
    • May 21 2013 | 8:54 pm
      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.
    • Jun 03 2013 | 5:54 pm
      peter,  if you find some time than …  just that i get an idea how to create matrix~like stuff in gen~. thanks!
    • Aug 05 2013 | 2:44 pm
      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. :)
    • Dec 24 2016 | 9:35 pm
      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.
    • Jan 04 2017 | 4:58 am
      It's a late reply, but here's something for 2017:
    • Jan 05 2017 | 1:59 am
      WOW it's only January but it already feels like christmas again!! Thanks so much, Graham!