<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> 
<div>
<div>let me correct:</div>

<div> </div>

<div> 
<div><span style="color:#000080;">>>For counting / finding zero-X it's simply this:  <br/>
>> if {sample[now]*sample[before]==negative</span><br/>
<br/>
if {sample[now]*sample[before]<=0</div>
 

<div> </div>
</div>

<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Mittwoch, 25. September 2019 um 15:10 Uhr<br/>
<b>Von:</b> lacuna_@gmx.net<br/>
<b>An:</b> "Johannes Lorenz" <j.spam@lorenz-ho.me><br/>
<b>Cc:</b> linux-audio-dev@lists.linuxaudio.org<br/>
<b>Betreff:</b> Re: [LAD] Click-free fade-in algorithm for synths?</div>

<div name="quoted-content">
<div style="font-family: Verdana;font-size: 12.0px;">
<div>
<div><span style="color: rgb(0,0,128);">>> For example, in zynaddsubfx, we count the ascending zero crossings and<br/>
>> calculate the fade-in length upon it [1]. Then, an S-curve of that<br/>
>> length is multiplied with the signal. Counting zero crossings prevents<br/>
>> clicking on lower notes, and it makes higher notes more punchy.</span></div>

<div> </div>

<div>You are experiencing different phenomena:</div>

<div><br/>
- Groove: by dividing / multiplying frequencies to rhythm, envelope-times ect. - it just grooves.<br/>
In fact this is a very basic part of Electronic Dance Music.</div>

<div>- On lower notes the envelope might be slow here = no clicking<br/>
- Did you try syncing the oscillator with the note-on trigger? this gives a consistent "punch" and you can start it at 0, -1, +1, whatever - your choice.<br/>
Free running oscillators are more "groovy" and "alive".<br/>
- "Punch" is archived with the hold-stage in an AHDSR-envelope. Minimoog has that, - it overdrives the envelope, which rersults in a plateu.</div>

<div><br/>
For counting / finding zero-X it's simply this:  <br/>
 if {sample[now]*sample[before]==negative<br/>
<br/>
Of course the result depends very much on the resolution (samplewise and bitwise).<br/>
Small buffersizes shouldn't be any problem anyway!? But yes for counting you have to wait, find and count.<br/>
<br/>
Actually you do know the count of zerocrossings, as you know the frequency the oscillator swings!? So you don't have to mesure it!<br/>
<br/>
<br/>
Interesting topic... what are you working on? What is your goal?</div>

<div> </div>

<div> 
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Dienstag, 24. September 2019 um 20:38 Uhr<br/>
<b>Von:</b> "Johannes Lorenz" <j.spam@lorenz-ho.me><br/>
<b>An:</b> linux-audio-dev@lists.linuxaudio.org<br/>
<b>Betreff:</b> [LAD] Click-free fade-in algorithm for synths?</div>

<div>A note-on event can lead to clicks in synths, which is often fixed by a<br/>
fade-in algorithm.<br/>
<br/>
If the attack rate for a synth's signal is 0, the synth shall not click,<br/>
and still fade in as fast as possible. What is the best algorithm for<br/>
fading in a signal, that scales also with small buffersizes, like 32<br/>
samples per buffer (at 44100 samples/s)?<br/>
<br/>
For example, in zynaddsubfx, we count the ascending zero crossings and<br/>
calculate the fade-in length upon it [1]. Then, an S-curve of that<br/>
length is multiplied with the signal. Counting zero crossings prevents<br/>
clicking on lower notes, and it makes higher notes more punchy. That<br/>
algorithm works very well for a buffersize of 256 samples (at 44100<br/>
samples/s), but it fails at 32 samples (since the zero crossings of 32<br/>
samples are often not representive).<br/>
<br/>
Any papers, or experience with other synths? We currently need a good<br/>
solution for (at least) zynaddsubfx and the triple oscillator in LMMS.<br/>
<br/>
<br/>
Links:<br/>
[1]<br/>
<a href="https://github.com/zynaddsubfx/zynaddsubfx/blob/4e36e765f677dbc689461889e502d015c22966a5/src/Synth/ADnote.cpp#L1202-L1222" target="_blank">https://github.com/zynaddsubfx/zynaddsubfx/blob/4e36e765f677dbc689461889e502d015c22966a5/src/Synth/ADnote.cpp#L1202-L1222</a><br/>
_______________________________________________<br/>
Linux-audio-dev mailing list<br/>
Linux-audio-dev@lists.linuxaudio.org<br/>
<a href="https://lists.linuxaudio.org/listinfo/linux-audio-dev" target="_blank">https://lists.linuxaudio.org/listinfo/linux-audio-dev</a></div>
</div>
</div>
</div>

<div> </div>

<div class="signature"> </div>
</div>
_______________________________________________ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org <a href="https://lists.linuxaudio.org/listinfo/linux-audio-dev" target="_blank">https://lists.linuxaudio.org/listinfo/linux-audio-dev</a></div>
</div>
</div>
</div></div></body></html>