Closed AnClark closed 3 years ago
yeah, having i=4294967295 sounds like it having a negative value, which shouldn't ever happen :(...
does it occur all the time or just with some special DCO settings?
Occurs all the time. Here are my two instances' settings:
A temporary workaround:
diff --git a/src/synthv1_wave.h b/src/synthv1_wave.h
index 9657f86..c93d030 100644
--- a/src/synthv1_wave.h
+++ b/src/synthv1_wave.h
@@ -120,6 +120,9 @@ public:
const uint32_t i = uint32_t(index);
const float alpha = index - float(i);
+ if(i >= __UINT32_MAX__)
+ return 0;
+
phase.phase += freq / m_srate;
if (phase.phase >= 1.0f) {
phase.phase -= 1.0f;
can you set a conditional breakpoint on that very condition (i >= __UINT32_MAX__
) and then print the state of some variable eg. index, alpha, phase.phase, freq, m_nsize and m_srate ?
there's something very wrong and weird going on there, probably induced by the windows compiler, stdlib or the processor architecture, that at least never happens on GNU/Linux x86 (g++)...
My GDB will freeze when setting conditional breakpoints. So I use MessageBoxA()
instead.
how come m_srate
(sample-rate) is zero??
there you have the culprit ! could it be that reaper/windows is instantiating (via synthv1_lv2_instantiate()
) with a foul sample rate value, which seems to be zero?
please try to set a BP on synthv1_lv2_instantiate()
and verify for yourself what sample_rate
value is being passed to the synthv1_lv2
constructor, somewhere here https://github.com/rncbc/synthv1/blob/10fdb2b6d12db8a62e5208e6ce9b004b1b574da6/src/synthv1_lv2.cpp#L807
Sample rate seems OK. It's my fault that I'd forgotten to use %f
for printing m_srate
.
Here's the real output:
ok. thanks, then please we must investigate why oh why is 'freq' negative...
can you trace the values of pv->dco1_freq1
, m_ctl1.pitchbend
, modwheel1
, lfo1
and possibly pv->dco1_glide1.tick()
, just before this line in synthv1_impl::process()
is executed:
https://github.com/rncbc/synthv1/blob/10fdb2b6d12db8a62e5208e6ce9b004b1b574da6/src/synthv1.cpp#L2464-L2466
what happens when you set DCO Glide to Off ?
what happens when you set DCO Glide to Off ?
It seems that there's no explicit problem when playing sounds (aka. Glide effect can be switched off well). I've two instances (with 4 synthesizers). Only one synthesizer has Glide turned off.
what happens when you set DCO Glide to Off ?
It seems that there's no explicit problem when playing sounds (aka. Glide effect can be switched off well). I've two instances (with 4 synthesizers). Only one synthesizer has Glide turned off.
i mean WITHOUT you workaround (https://github.com/AnClark/synthv1/commit/176dbd548b0a7779c76c7b210cf8fc4ff706d02e)!...
on another update, can you please merge/update from develop branch (https://github.com/rncbc/synthv1/commit/0ae7c0d), and check whether it behaves then?
note that the issue seems to occur only on very first note is playing after instantiation and Glide is on (> 0).
i mean WITHOUT you workaround (AnClark@176dbd5)!...
Don't worry. All of the bugs above occurs without that workaround. I'll merge your upstream, bypass my workaround, and retry.
UPDATE: Seems that your improvement below has solved this issue. Great! (I've also bypassed my workaround.)
index 6eec17e..b9a4126 100644
--- a/src/synthv1.cpp
+++ b/src/synthv1.cpp
@@ -596,7 +596,7 @@ struct synthv1_glide
{
m_frames = frames;
- if (m_frames > 0) {
+ if (m_frames > 0 && m_last > 0.0f) {
m_freq = m_last - freq;
m_step = m_freq / float(m_frames);
} else {
Here I have a new bug when working with REAPER on Windows. Seems that
synthv1_wave::sample()
generated an overflown value, then passed tosynthv1_wave::interp()
.Backtrace from GDB: