[SCM] calf/master: + Monosynth: use gate as amplitude source when EG->Amp is 0%; free-run EG
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:39:17 UTC 2013
The following commit has been merged in the master branch:
commit f4a4646a94574f4a6270deeaa99c198c0bf36588
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Mon Feb 2 00:33:38 2009 +0000
+ Monosynth: use gate as amplitude source when EG->Amp is 0%; free-run EG
diff --git a/src/calf/modules_synths.h b/src/calf/modules_synths.h
index 2aaa07a..d55696b 100644
--- a/src/calf/modules_synths.h
+++ b/src/calf/modules_synths.h
@@ -131,16 +131,21 @@ public:
void calculate_step();
/// Main processing function
uint32_t process(uint32_t offset, uint32_t nsamples, uint32_t inputs_mask, uint32_t outputs_mask) {
- if (!running && queue_note_on == -1)
+ if (!running && queue_note_on == -1) {
+ for (uint32_t i = 0; i < nsamples / step_size; i++)
+ envelope.advance();
return 0;
+ }
uint32_t op = offset;
uint32_t op_end = offset + nsamples;
while(op < op_end) {
if (output_pos == 0) {
if (running || queue_note_on != -1)
calculate_step();
- else
+ else {
+ envelope.advance();
dsp::zero(buffer, step_size);
+ }
}
if(op < op_end) {
uint32_t ip = output_pos;
diff --git a/src/monosynth.cpp b/src/monosynth.cpp
index 6e919ea..a0feaf2 100644
--- a/src/monosynth.cpp
+++ b/src/monosynth.cpp
@@ -332,6 +332,7 @@ void monosynth_audio_module::calculate_step()
dsp::zero(buffer, step_size);
if (is_stereo_filter())
dsp::zero(buffer2, step_size);
+ envelope.advance();
return;
}
float porta_total_time = *params[par_portamento] * 0.001f;
@@ -411,17 +412,8 @@ void monosynth_audio_module::calculate_step()
break;
}
float aenv = env;
- /* isn't as good as expected
- if (e2a > 1.0) { // extra-steep release on amplitude envelope only
- if (envelope.state == adsr::RELEASE && env < envelope.sustain) {
- aenv -= (envelope.sustain - env) * (e2a - 1.0);
- if (aenv < 0.f) aenv = 0.f;
- printf("aenv = %f\n", aenv);
- }
- e2a = 1.0;
- }
- */
- newfgain *= 1.0 - (1.0 - aenv) * e2a;
+ if (*params[par_envtoamp] > 0.f)
+ newfgain *= 1.0 - (1.0 - aenv) * e2a;
fgain_delta = (newfgain - fgain) * (1.0 / step_size);
switch(filter_type)
{
@@ -440,7 +432,7 @@ void monosynth_audio_module::calculate_step()
calculate_buffer_stereo();
break;
}
- if (envelope.state == adsr::STOP || force_fadeout)
+ if ((envelope.state == adsr::STOP && !gate) || force_fadeout || (envelope.state == adsr::RELEASE && *params[par_envtoamp] <= 0.f))
{
enum { ramp = step_size * 4 };
for (int i = 0; i < step_size; i++)
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list