summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-09-03 14:08:41 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-09-03 14:08:41 +0200
commit1c25d3a69ac27dc1f93bca3a71996e757b452c4b (patch)
treea67541f62bd35577003f812b35ab6a35098e36ae /src/drumgizmo.cc
parenta359d234ff53bcdab671faa169f45c4f14f5575d (diff)
Add bleed controls for the drumkit with priority over those set in the instrument files.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index dad174b..9874bbe 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -283,7 +283,8 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t* s, size_t sz)
size_t initial_chunksize = (pos + sz) - evt.offset;
evt.buffer = audio_cache.open(af, initial_chunksize,
af.filechannel, evt.cache_id);
- if(!af.main && enable_bleed_control)
+ if((af.mainState() == main_state_t::is_not_main) &&
+ enable_bleed_control)
{
evt.scale = master_bleed;
}
@@ -333,7 +334,7 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t* s, size_t sz)
for(; (n < optend) && (t < evt.buffer_size); n += N)
{
- *(vNsf*)&(s[n]) += *(vNsf*)&(evt.buffer[t]);
+ *(vNsf*)&(s[n]) += *(vNsf*)&(evt.buffer[t]) * evt.scale;
t += N;
}
#endif
@@ -354,7 +355,7 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t* s, size_t sz)
for(; (n < end) && (t < evt.buffer_size) && evt.rampdown; ++n)
{
float scale = (float)evt.rampdown/(float)evt.ramp_start;
- s[n] += evt.buffer[t] * evt.scale * scale;
+ s[n] += evt.buffer[t] * evt.scale * scale;
++t;
evt.rampdown--;
}