zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 18308d8d5366c708406380b72c91478e2e9e0bdf
parent a7a674bfdf6c783600ec1ab2aef51e4b03a81fed
Author: michiboo <chanmickyyun@gmail.com>
Date:   Wed, 26 Jun 2019 16:12:08 +0300

add a simple trigger threshold check in watchpoint

Diffstat:
Msrc/Synth/WatchPoint.cpp | 19++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/Synth/WatchPoint.cpp b/src/Synth/WatchPoint.cpp @@ -169,7 +169,6 @@ void WatchManager::satisfy(const char *id, float *f, int n) return; int space = 128 - sample_list[selected]; - int start = sample_list[selected]; if(space >= n) space = n; @@ -177,11 +176,20 @@ void WatchManager::satisfy(const char *id, float *f, int n) //FIXME buffer overflow if(space){ for(int i=0; i<space; ++i){ - data_list[selected][start] = f[i]; - start++; + + if(strstr(active_list[i], "noteout") == NULL) + { + data_list[selected][sample_list[selected]] = f[i]; + sample_list[selected]++; + } + else{ + if(f[i] > -4){ + data_list[selected][sample_list[selected]] = f[i]; + sample_list[selected]++; + } + } } - sample_list[selected] += space; } } -} +} +\ No newline at end of file