fm matrix - questions
- KVRist
- Topic Starter
- 180 posts since 18 Nov, 2017
hi coders,
i'd like to recreate something like Sytrus FM matrix in a work I'm doing.
im trying to figure out the best way to do this.
the idea is:
for each op, take the signal from the prev sample (i.e. x-1) and sum it with current phase, if modulated.
so for this scenario:
starting with outOP1 = outOP2 = outOP3 = outOP4 = outOP5 = outOP6 = 0
at phase0:
outOP1 = osc1(phase0 + outOP1)
outOP2 = osc2(phase0 + outOP2)
outOP3 = osc3(phase0)
...
at phase1:
outOP1 = osc1(phase1 + outOP2 + outOP3)
outOP2 = osc2(phase1 + outOP1 + outOP2)
outOP3 = osc3(phase1)
and so on.
questions are:
1. is this approch correct? it would be light on cpu and guarantee also fm feedback
2. what about the first sample processed (i.e. phase0)? it won't be fm modulated at all; fm will effectively starts at phase1. can be considered ok? should i skip it? smooth since can introduce clicks?
it looks good for me, but that first sample "ignored" make me worry about...
thanks
i'd like to recreate something like Sytrus FM matrix in a work I'm doing.
im trying to figure out the best way to do this.
the idea is:
for each op, take the signal from the prev sample (i.e. x-1) and sum it with current phase, if modulated.
so for this scenario:
starting with outOP1 = outOP2 = outOP3 = outOP4 = outOP5 = outOP6 = 0
at phase0:
outOP1 = osc1(phase0 + outOP1)
outOP2 = osc2(phase0 + outOP2)
outOP3 = osc3(phase0)
...
at phase1:
outOP1 = osc1(phase1 + outOP2 + outOP3)
outOP2 = osc2(phase1 + outOP1 + outOP2)
outOP3 = osc3(phase1)
and so on.
questions are:
1. is this approch correct? it would be light on cpu and guarantee also fm feedback
2. what about the first sample processed (i.e. phase0)? it won't be fm modulated at all; fm will effectively starts at phase1. can be considered ok? should i skip it? smooth since can introduce clicks?
it looks good for me, but that first sample "ignored" make me worry about...
thanks
- KVRAF
- 4590 posts since 7 Jun, 2012 from Warsaw
Either you'll have to take previous sample, or for the current sample solve 6 x 6 system of equations which is probably suboptimal.
Regardless of what you choose, FM will produce heavy aliasing by its nature. So "quality" might not be something to die for in this scenario.
Regardless of what you choose, FM will produce heavy aliasing by its nature. So "quality" might not be something to die for in this scenario.
Blog ------------- YouTube channel
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)
- KVRAF
- 7911 posts since 12 Feb, 2006 from Helsinki, Finland
It this "correct"? Not necessarily, but it's how it's usually done. If you're computing the oscillators in order (eg. top to bottom) then it's also possible to use the current sample in one direction (ie. "feed forward" connections) and the previous sample for "feedback" connections, but it doesn't necessarily matter much in most cases.
Just treat the initial state as zero. You should normally have a non-zero envelope attack time to avoid clicks anyway, so it's not really a practical concern.2. what about the first sample processed (i.e. phase0)? it won't be fm modulated at all; fm will effectively starts at phase1. can be considered ok? should i skip it? smooth since can introduce clicks?
- KVRAF
- 7911 posts since 12 Feb, 2006 from Helsinki, Finland
I highly doubt there's a single synth that actually solves the delay-free loops in this case, because for a non-linear system like this you'd have to use something like Newton-Raphson and just getting it to converge would be a huge pain.DJ Warmonger wrote: ↑Fri Feb 26, 2021 1:07 pm Either you'll have to take previous sample, or for the current sample solve 6 x 6 system of equations which is probably suboptimal.
- KVRist
- Topic Starter
- 180 posts since 18 Nov, 2017
thanks all for the replies
maybe I can't elaborate it mentally, but it seems that if i use the "actual" sample of the op (instead of the previous) it will generate (at time phase0) a total different output from operators, not just the same "shifted" by 1 sample.
i mean: wouldn't (using the "crazy" 6 x 6 system of equations solved on place) sounds totally different than use the prev samples as fm amount? I don't think that will result just shifted...
not that I care about if they will be differents (probably a matter of tastes), but just curious scientifically in regards of results
won't this create a total/different output?mystran wrote: ↑Fri Feb 26, 2021 1:23 pm If you're computing the oscillators in order (eg. top to bottom) then it's also possible to use the current sample in one direction (ie. "feed forward" connections) and the previous sample for "feedback" connections, but it doesn't necessarily matter much in most cases.
maybe I can't elaborate it mentally, but it seems that if i use the "actual" sample of the op (instead of the previous) it will generate (at time phase0) a total different output from operators, not just the same "shifted" by 1 sample.
i mean: wouldn't (using the "crazy" 6 x 6 system of equations solved on place) sounds totally different than use the prev samples as fm amount? I don't think that will result just shifted...
not that I care about if they will be differents (probably a matter of tastes), but just curious scientifically in regards of results
- KVRAF
- 7911 posts since 12 Feb, 2006 from Helsinki, Finland
At sample step i, you can either use the outputs of all operators at sample step (i-1) for modulation, or you can first compute op1, then use sample i of op1 to modulate the others (rather than i-1), then compute op2, then use sample i (rather than i-1) of op1 and op2 to modulate ops3+ and so on. This is literally just a 1 sample shift and in fact takes less state variables to implement (ie. you just keep the "last" output for each oscillator, but whether this "last" output is previous sample or current sample varies based on which operators have already been computed for current sample).Derozer wrote: ↑Mon Mar 01, 2021 10:32 am thanks all for the replies
won't this create a total/different output?mystran wrote: ↑Fri Feb 26, 2021 1:23 pm If you're computing the oscillators in order (eg. top to bottom) then it's also possible to use the current sample in one direction (ie. "feed forward" connections) and the previous sample for "feedback" connections, but it doesn't necessarily matter much in most cases.
maybe I can't elaborate it mentally, but it seems that if i use the "actual" sample of the op (instead of the previous) it will generate (at time phase0) a total different output from operators, not just the same "shifted" by 1 sample.
For emphasis, neither of these strategies involves anything fancy. It's just a matter of do you update the "last" sample for the oscillators one at a time as they are processed or do you update them all in bulk. The former is likely preferable in your average 80-90s micro while the latter has better SIMD potential.
Now.. does this 1 sample shift drastically change the sound of FM? No, not really. The effect of changing the phase of a modulator is usually fairly minor (which is why you can add some animation to FM sounds by detuning the modulator slightly with regards to the carrier, so their relative phases drift slowly over time).
For feedback configurations, possibly (at least for larger feedback amounts). For feedforward configurations, not really.i mean: wouldn't (using the "crazy" 6 x 6 system of equations solved on place) sounds totally different than use the prev samples as fm amount? I don't think that will result just shifted...
-
- KVRAF
- 7417 posts since 17 Feb, 2005
I think the 1 sample delay does cause issues. FMing two signals with correlated (in-phase) large deltas tends to results in massive bandwidth expansion. I don't know how to say that better, but oversampling has always helped in this regard.
- KVRist
- Topic Starter
- 180 posts since 18 Nov, 2017
But we can fight aliasing with oversampling, right?DJ Warmonger wrote: ↑Fri Feb 26, 2021 1:07 pm Regardless of what you choose, FM will produce heavy aliasing by its nature. So "quality" might not be something to die for in this scenario.
Or in FM aliasing is appreciated?
- KVRAF
- 4590 posts since 7 Jun, 2012 from Warsaw
Yes, oversampling is important. But with heavy FM you can go into MHz range, where no oversampling can help ¯\_(ツ)_/¯Derozer wrote: ↑Sat Mar 27, 2021 12:49 pmBut we can fight aliasing with oversampling, right?DJ Warmonger wrote: ↑Fri Feb 26, 2021 1:07 pm Regardless of what you choose, FM will produce heavy aliasing by its nature. So "quality" might not be something to die for in this scenario.
Or in FM aliasing is appreciated?
I demonstrated this here: https://youtu.be/jfgRDh29Nl8?t=325
Blog ------------- YouTube channel
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)
- u-he
- 28075 posts since 8 Aug, 2002 from Berlin
DX synthesisers average the past two samples for feedback, to avoid fast build up of chaotic spectra. I guess a synth with a feedback matrix would compute each oscillator one by one and average each input that results from previous steps. I.e. in a 6x6 matrix I'd probably average Osc 1-6 as input for Osc 1, then for Osc 2 use the Osc 1 sample directly but average 2-6 and so on.