Author Topic: Inconsistent sound with certain algorithms [Fixed in 2.09]  (Read 227 times)

cwyss

  • Team member
  • *
  • Posts: 7
    • View Profile
Inconsistent sound with certain algorithms [Fixed in 2.09]
« on: September 30, 2018, 01:53:41 PM »
Hi!

When I use  algorithms with stacked modulators, e.g. alg1, alg5 or alg11 which all contain the chain Op3->Op2->Op1, I experience a random change in the tone colour between consecutive strokes of the same key.

My patch is very simple:
  • Start e.g. with alg1, velo=0, voice=6
  • set op1 and 2 to sin, keyb, freq=1.00, ftun=0.00; op3=off
  • set a "gate profile" for op1 and op2 envelopes, i.e. lv=1.00 for Attk,Deca,Sust, Release lv=0.00, all times=0.00
  • all matrix routing off (I used srce=none)
  • Modulation IM1=2.00, v=0.00, all other modulation off
  • arp and filter both off
If I now play a note, I get a slightly different tone everytime I press a key. I see this in a spectrum analyser where most of the time the amplitude of the carrier frequency is smaller than that of the first sideband c+m (and even the second c+2m), but sometimes also the carrier is the strongest component. This changes in tone colour are also audible.

I get the same behaviour with different algos, as long as they contain op2->op1 and op2 is the destination of another operator, e.g. alg5 or alg11.

To be absolutely clear here: When I play and hold a single note, this one note is perfectly stable, no change in its spectrum at all.
But when I release the key and then hit it again, then I obtain a different spectrum than before. The change is sometimes smaller, sometimes larger, in an apparently random way.

At first I thought perhaps this is how FM works in this particular situation, but...:
  • Since my patch use only two ops, I went to alg3 where op2 is not the destination of another modulator and voilĂ : no more change in spectrum, everything is perfectly stable! The same for other algos with op2->op1 and op2 not destination of some other op
  • When I stay with alg1 and now turn on op3=sin, keyb, freq=2.00, ftun=0, op3 env="gate" as for op1 and op2, and IM2=1.00. Then I also get a changing spectrum as described above. (Only this time perhaps the differences are bigger) Again the situation is identical for alg5 or alg11.

So this is probably a bug?
« Last Edit: October 28, 2018, 08:28:09 AM by Xavier »

cwyss

  • Team member
  • *
  • Posts: 7
    • View Profile
Re: Inconsistent sound with certain algorithms
« Reply #1 on: October 02, 2018, 08:50:50 AM »
So yesterday I did some more knob tweaking and button pushing and finally arrived at a patch with the setup I intended and which is now perfectly stable.   :D

This one uses algo 9 with op1 and op6 off, op4 and op5 are sine with freq=1.00 and the IM from op5 to op4 is 2.00. The envelope settings for op4 and 5 are again gate-type, as in my first patch. Also velocity and voices settings are the same.

So with my first patch perhaps I found some strange "instable" combination of parameters?
Will do some more testing and then report.

cwyss

  • Team member
  • *
  • Posts: 7
    • View Profile
Re: Inconsistent sound with certain algorithms
« Reply #2 on: October 03, 2018, 07:21:48 PM »
Ok, I think I found it:
it's the envelope release time settings of the operators that cause the problem.

Instability occurs in two different cases:
  • All carrier envelope release times are 0.00. This gives a strong instability.
  • The release time of one carrier is smaller than the release time of its modulator. Here the instability is more subtle, but can be observed with a spectrum analyser. Also: the greater the difference of the release times, the greater the effect.
The amount of instability also depends on the carrier to modulator frequency ratio c:m; you get a strong effect for c:m=1:2, for example.

Here is a list of steps to reproduce these instability phenomena:
Start with the patch "Preen mk2" from the factory default combo. It uses alg9. Then make the following parameter changes:
  • op1,op6 off
  • op4: sine, freq=1.00
  • op5: sine, freq=2.00
  • for op4 and op5: env attk, deca, sust time=0.00, level=1.00
  • Matrix 2: mult=0.00 (this has the routing lfo1->pan2)
  • Matrix 12: mult=0.00 (this is Not1->IM*)
This produces a steady timbre with stable frequency spectrum between repeated key strokes.

Now set
  • op1, op4 and op5 rele time=0.00
You get an instability of the first type, which is easily audible (at least for me ;) ). Then:
  • op1 rele time=2.56
It's stable again. Then
  • op4 rele time=0.50
  • op5 rele time=1.50
This is the instability of the second type. Finally
  • op5 rele time=0.25
Again stable.

I tested this by repeatedly playing a C at 261Hz. In my spectrum analyser I then measured the level difference between the 1. and 3. harmonic, i.e. at 261Hz and 785Hz.
In the stable case I obtain a difference of around 11dB, where the 3. harmonic is stronger. For the first type of instability the changes are drastic, sometimes the 1. harmonic even becomes strongest. For the second type, the measurements vary between 11dB and around 8dB, if I remeber correctly.
For the second type, the time you wait befor the next key stroke also seems to matter. If I release the key, then wait for the sound to die completely, and only then trigger the note again, then the instability is much smaller. If after key release I retrigger the note immediately, the instability is stronger.
It seems like you have to give the envelopes enough time to complete their release phase...

Finally I also checked some other algorithms and got the same results:
for alg11 (with both cascades 123 and 456), alg14 (cascade 123), alg16 (345), alg1 (123)

My conclusion (so far):
  • Avoid setting all release times of your carriers to 0.00. It is sufficient to have one >0.00, and this one can even be turned off(!). However a very small time like 0.01 might not be enough.
  • The second type of instability is hardly audible (I was not able to hear it), so I guess one can live with it... Unless we aim to verify FM theory and Bessel function values by measuring the output of the preenfm ;)
  • These instabilities remind me of the tuning instabilities of the pre-DCO analog synths of the 70s, and the efforts in virtual analogs to recreate those free-running and drifting oscillators. In order to accurately capture the warmth and character attributed to the vintage synths. So in the end we also might want to preserve this analogish "character" of our little machine... ;)

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 1329
    • View Profile
Re: Inconsistent sound with certain algorithms
« Reply #3 on: October 12, 2018, 10:55:11 PM »
Thanks a lot for the post and the update.

I have to try to exactly understand what instability you talked about, but it seems OK in your last post :)

You can definitely get some weird behaviour with release time, specially when some release levels are not 0.0.

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 1329
    • View Profile
Re: Inconsistent sound with certain algorithms
« Reply #4 on: October 13, 2018, 12:52:04 PM »
Thanks again for the detailed post.

I think i have a fix for these problems.
Some variables that must be 0 at the beginig of a note,  were not correctly reset at the end of previous note. Specially audible when carrier releast time is 0.

Please, can you confirm the attached firmware fix that ?
(It also fixes the other bug you reported with op1 release time of default combo always 2.56).

To flash, upload and flash the firmware through the bootloader is the quickest solution :
http://ixox.fr/preenfm2/manual/upgrade-firmware/

Thanks

Xavier

cwyss

  • Team member
  • *
  • Posts: 7
    • View Profile
Re: Inconsistent sound with certain algorithms [Fix pending]
« Reply #5 on: October 14, 2018, 12:36:00 PM »
The new firmware fixes the issue for the cascade 456 of alg9 and the cascade 123 in algos 1,5,11,14,19  :)
Unfortunately, the problem persists for the cascade 456 of alg11 and 345 in alg16.  :(

I also noticed that when I do my test for alg1, i.e., op1=sin, freq=1.0, op2=sin, freq=2.0, op3=off, IM1=1.8, and then switch to alg3 (and have op4=off too!), then the sound changes.
Theoretically the sounds should be the same for alg1 and alg3 when op3 and op4 are off, since both give just op2->op1, right?

Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 1329
    • View Profile
Re: Inconsistent sound with certain algorithms [Fix pending]
« Reply #6 on: October 14, 2018, 09:12:53 PM »

Wow impressive test  ;)
OK i also fixed alg11 and alg16 in the attached firmware.
If you're into code here is the change :
https://github.com/Ixox/preenfm2/commit/1eefac254cdd65e0d54e67375ed608216a6c25d9

Thanks again for your test and report :)

In real FM you have to  add a high pass for operator in the middle of a cascade.
Without that, the final carrier is pitched shifted.
So in Algo1, op2 is high passed which caused this difference.
Keeping your same values, you won't here any difference if you use Op1 & Op3.


cwyss

  • Team member
  • *
  • Posts: 7
    • View Profile
Re: Inconsistent sound with certain algorithms [Fix pending]
« Reply #7 on: October 15, 2018, 09:08:31 PM »
Tested all algos with the new firmware: everything fine now :)

And thanks for the info about the additional high pass: that makes it clear.