Resonator bad start bug.

So far, matching position_'s value seems to work. I can rebuild with zero initial to see if that does something pathological, but I’m expecting not. Basically it’s one end of a LERP. Sadly, Andrew’s eurorack git provides no issues menu for me to report this.

P.S. Zero as an initial value seems to work fine as well.

diff --git a/rings/dsp/resonator.cc b/rings/dsp/resonator.cc
index 63a90a4..c01f375 100644
--- a/rings/dsp/resonator.cc
+++ b/rings/dsp/resonator.cc
@@ -49,6 +49,7 @@ void Resonator::Init() {
   set_brightness(0.5f);
   set_damping(0.3f);
   set_position(0.999f);
+  previous_position_ = 0.0f;
   set_resolution(kMaxModes);
 }
1 Like

Is there a similar bug in Elements?

1 Like

Yep. I just haven’t created any patches with it, so I’ve not been bitten by it. Thanks for pointing that at me. Outside of Southpole and Audible Instruments, are there any other modules that depend on the eurorack repo of which I should be aware?

I sent a pull request to the upstream pichenettes/eurorack. We’ll see what the commentary is. At worst, I’ll learn something. Whether or not Vortico considers it worthy is another thing altogether. There, at worst, I have to maintain it out of tree on my installations.

P.S. Upstream took the P.R.

4 Likes

It might be worth it to start checking the other Mutable/Audible codes too for these kinds of issues. It could be that the Mutable Instruments developer has not noticed these because of the compilers/architectures involved. (Maybe for example the embedded chips or their firmware in the Mutable hardwares zero out all their memory when the device is turned on…?)

1 Like

I think there is a similar one in Plaits, and I’d be curious to see if anyone else is getting this behavior. Steps to reproduce:

  1. drop a fresh Plaits in the patch.
  2. connect the OUT and AUX outputs to VCV Scope. We should see that AUX has no signal
  3. wiggle the harmonics knob and then double click to initialize it back to its center position, we then see that the AUX output is working, yet the module’s controls are in the exact same state as in step 1
1 Like

I wonder if that’s actually expected behavior because of the oscillator sync when the oscillators start at the exact same pitch…? (I guess it could be fixed by changing the initial oscillator phase.) Maybe in hardware it’s not possible to get the Harmonics parameter at exactly zero?

1 Like

I think you’re right on that, by slightly detunig the harmonics, and then initializing the knob again at eactly the right time, I was able to get the AUX output to be practically 0 again, so that seems quite logical! Nice :slight_smile:

The behavior is somewhat annoying, I’ve bumped into it a few times myself. So some kind of fix would be nice to have…Perhaps randomizing the oscillator phase when the module is inited would work OK. (So this is kind of opposite what this thread was originally about, I guess… :smiley: )

1 Like

I was expecting to find a similar bug in the Plaits modal resonator mode code, but so far haven’t found anything relevant. There doesn’t appear to be a “previous position” variable in any of the classes involved, but maybe I just didn’t spot it yet…

Interesting thing with Plaits: if you send a trigger pulse to the harmonics jack, it also clears the issue. This wart seems only present in the first of the “green” presets. Here, AUX is supposed to be hard synced pulses, and just maybe, there is a phase related pathology here. It’s as though the wave gets synced before it even gets to start. No ideas yet. I’ve not read any of that code. Hmmm… I’m reading the Init in “variable_shape_oscillator.h” and there’s a master and slave phase parameter. Maybe giving one of those a nudge during init, might ungum the initial AUX. Again, I’m grasping at straws, and I may be completely wrong here.

1 Like

I checked that the issue in Plaits can be fixed by initializing the phase of the aux oscillator to something different than 0.0.

--- a/eurorack/plaits/dsp/engine/virtual_analog_engine.cc
+++ b/eurorack/plaits/dsp/engine/virtual_analog_engine.cc
@@ -39,7 +39,7 @@ using namespace stmlib;

 void VirtualAnalogEngine::Init(BufferAllocator* allocator) {
   primary_.Init();
-  auxiliary_.Init();
+  auxiliary_.Init(0.1f); // prevent initial silence when Plaits harmonics parameter at exactly zero
   sync_.Init();
   variable_saw_.Init();

diff --git a/eurorack/plaits/dsp/oscillator/variable_shape_oscillator.h b/eurorack/plaits/dsp/oscillat$
index 47d250a..272bc3a 100644
--- a/eurorack/plaits/dsp/oscillator/variable_shape_oscillator.h
+++ b/eurorack/plaits/dsp/oscillator/variable_shape_oscillator.h
@@ -44,8 +44,8 @@ class VariableShapeOscillator {
   VariableShapeOscillator() { }
   ~VariableShapeOscillator() { }

-  void Init() {
-    master_phase_ = 0.0f;
+  void Init(float initphase=0.0f) {
+    master_phase_ = initphase;
     slave_phase_ = 0.0f;
3 Likes

I expected as much. I’m going to give a try to shoving down into the Init, and nudging the slave phase instead. I suspect the result will be the same. I suspect the actual needed delta to be very small.

Nope, I was stupid. You do need to handle it at the call site. initval of 0.25 outputs a square at the 2nd harmonic. Do you want to report this upstream?

1 Like

I think the interesting thing about the Plaits bug is that it is highly unlikely to arise in the world of hardware modules for the simple reason that in software, you have an exact and perfectly stable emulated harmonics setting. In the real world, that potentiometer will show thermal noise, and the setting is unlikely to be exactly centered. 侘寂 The imperfection is the perfection. :wink:

2 Likes

Is this bug fixed ? Because I still got some silent patches …

If you mean the Rings bug, it’s fixed in Audible Instruments, but I’m unsure about Southpole Annuli which depends on the same git submodule. I’ve not sent a report about the Plaits/Aux sync bug as that’s more a matter of intent. Maybe they really want it to work the way it does. I have a private fix, but it boils down to their taste, and I’m not sure how to proceed. Last I checked, Xenakios had not filed a bug report either.

1 Like

Do you know when it (the rings bugfix) will make it in to a vcv release?

think not the next years… Xenakios was my hope…

I get occasional issues with rings, just cloned the repo, went to build and got:

src/Frames.cpp:2:10: fatal error: frames/keyframer.h: No such file or directory
#include "frames/keyframer.h"

The v1 branch of AudibleInstruments git pulls the eurorack submodule that has this fix. To the best of my knowledge, southpole has not updated the commit of the eurorack submodule referenced, so I have to patch that by hand. You may have found a different bug though.