From 02c9fafb25f86bcd37acd6de15d3c2924c25b66e Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 26 Sep 2016 19:58:05 +0000 Subject: [PATCH] Added post processing volume (output) --- src/Dexed.ttl | 2 +- src/dexed.cpp | 7 +++++++ src/dexed.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Dexed.ttl b/src/Dexed.ttl index bfbfe91..6901e3c 100644 --- a/src/Dexed.ttl +++ b/src/Dexed.ttl @@ -73,7 +73,7 @@ lv2:name "Output" ; lv2:default 1.000000 ; lv2:minimum 0.0 ; - lv2:maximum 1.0 ; + lv2:maximum 2.0 ; ] , [ a lv2:InputPort, lv2:ControlPort ; diff --git a/src/dexed.cpp b/src/dexed.cpp index 7da0754..8485008 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -48,6 +48,13 @@ void DexedVoice::render(uint32_t from, uint32_t to) } } +void DexedVoice::post_process(uint32_t from, uint32_t to) +{ + for (uint32_t i = from; i < to; ++i) + { + p(p_lv2_audio_out_1)[i] *= *p(p_output); + } +} //============================================================================== diff --git a/src/dexed.h b/src/dexed.h index c3355a1..998e66e 100644 --- a/src/dexed.h +++ b/src/dexed.h @@ -54,6 +54,7 @@ class DexedVoice : public lvtk::Voice void off(unsigned char velocity); unsigned char get_key(void) const; void render(uint32_t from, uint32_t to); + void post_process(uint32_t from, uint32_t to); protected: unsigned char m_key;