diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-06-14 21:13:28 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-06-14 21:13:28 +0200 |
commit | 9453078f2d66fad806ee104e7c6993bba1043c6a (patch) | |
tree | 3b1ffe1e7b67c7d626336d835b44203f2c2c6ac5 /src/instrument.cc | |
parent | 1bc07f860fa7f01763586f45b7fb2e53cd1c2557 (diff) |
New input processor filter system. Moved processing from Instrument calss to new input processing filter system and prepared for new latency filter.
Diffstat (limited to 'src/instrument.cc')
-rw-r--r-- | src/instrument.cc | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/instrument.cc b/src/instrument.cc index 8c78f40..5c96c6d 100644 --- a/src/instrument.cc +++ b/src/instrument.cc @@ -56,46 +56,8 @@ bool Instrument::isValid() const Sample* Instrument::sample(level_t level, size_t pos) { - // Read out all values from settings. - auto enable_velocity_randomiser = settings.enable_velocity_randomiser.load(); - auto velocity_randomiser_weight = settings.velocity_randomiser_weight.load(); - auto samplerate = settings.samplerate.load(); - auto velocity_modifier_falloff = settings.velocity_modifier_falloff.load(); - auto enable_velocity_modifier = settings.enable_velocity_modifier.load(); - auto velocity_modifier_weight = settings.velocity_modifier_weight.load(); - Sample *sample = nullptr; - if(enable_velocity_modifier == false) - { - mod = 1.0; - lastpos = 0; - } - - if(enable_velocity_randomiser) - { - float r = rand.floatInRange(-1.0 * velocity_randomiser_weight, - velocity_randomiser_weight); - level += r; - if(level > 1.0) - { - level = 1.0; - } - if(level < 0.0) - { - level = 0.0; - } - } - - if(enable_velocity_modifier) - { - mod += (pos - lastpos) / (samplerate * velocity_modifier_falloff); - if(mod > 1.0) - { - mod = 1.0; - } - } - if(version >= VersionStr("2.0")) { // Version 2.0 @@ -113,12 +75,6 @@ Sample* Instrument::sample(level_t level, size_t pos) sample = rand.choose(s); } - if(enable_velocity_modifier) - { - lastpos = pos; - mod *= velocity_modifier_weight; - } - return sample; } |