Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
multimedia:proaudio
helm-synth
03-fix-aftertouch-presure-for-arpeggiator.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 03-fix-aftertouch-presure-for-arpeggiator.patch of Package helm-synth
From a0a6939170cff4edfc536589036f5d2fa0e3bb02 Mon Sep 17 00:00:00 2001 From: jfrey <nomhad@gmail.com> Date: Fri, 1 Dec 2017 06:57:26 +0200 Subject: [PATCH] fix aftertouch / presure for arpeggiator --- mopo/src/arpeggiator.cpp | 22 ++++++++++++++++++++++ mopo/src/arpeggiator.h | 5 +++++ mopo/src/voice_handler.cpp | 2 +- src/synthesis/helm_engine.cpp | 4 ++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/mopo/src/arpeggiator.cpp b/mopo/src/arpeggiator.cpp index ae36db6aa..19179bed0 100644 --- a/mopo/src/arpeggiator.cpp +++ b/mopo/src/arpeggiator.cpp @@ -117,6 +117,7 @@ namespace mopo { mopo_float base_note = pattern->at(note_index_); mopo_float note = base_note + mopo::NOTES_PER_OCTAVE * current_octave_; mopo_float velocity = active_notes_[base_note]; + std::cout << "nextnote. note_index " << note_index_ << ", base note: " << base_note << "\n"; mopo_float aftertouch = aftertouch_[base_note]; return std::tuple<mopo_float, mopo_float, mopo_float>(note, velocity, aftertouch); } @@ -195,4 +196,25 @@ namespace mopo { pressed_notes_.remove(note); return kVoiceOff; } + + void Arpeggiator::setAftertouch(mopo_float note, mopo_float aftertouch, int sample) { + for (const auto &n : pressed_notes_) { + std::cout << "note: " << n << "\n"; + if (n == note) { + aftertouch_[n] = aftertouch; + } + } + } + + void Arpeggiator::setPressure(mopo_float pressure, int channel, int sample) { + MOPO_ASSERT(channel >= 1 && channel <= mopo::NUM_MIDI_CHANNELS); + + std::cout << "arp setpress, nb pressed: " << getNumNotes() << "\n"; + + // FIXME: check for channel + for (const auto &n : pressed_notes_) { + std::cout << "note: " << n << "\n"; + aftertouch_[n] = pressure; + } + } } // namespace mopo diff --git a/mopo/src/arpeggiator.h b/mopo/src/arpeggiator.h index 1f48b7a27..4b106e47c 100644 --- a/mopo/src/arpeggiator.h +++ b/mopo/src/arpeggiator.h @@ -71,6 +71,10 @@ namespace mopo { VoiceEvent noteOff(mopo_float note, int sample = 0) override; void sustainOn(); void sustainOff(); + + void setAftertouch(mopo_float note, mopo_float aftertouch, int sample = 0); + void setPressure(mopo_float pressure, int channel = 0, int sample = 0); + private: Arpeggiator() : Processor(0, 0) { } @@ -93,6 +97,7 @@ namespace mopo { CircularQueue<mopo_float> pressed_notes_; CircularQueue<mopo_float> sustained_notes_; + }; } // namespace mopo diff --git a/mopo/src/voice_handler.cpp b/mopo/src/voice_handler.cpp index 1208ec1d4..4d6fdf1fd 100644 --- a/mopo/src/voice_handler.cpp +++ b/mopo/src/voice_handler.cpp @@ -327,7 +327,7 @@ namespace mopo { pressed_notes_.pop_back(); pressed_notes_.push_front(old_note); new_voice->activate(old_note, voice->state().velocity, last_played_note_, - pressed_notes_.size() + 1, sample); + pressed_notes_.size() + 1, sample); last_played_note_ = old_note; voice_event = kVoiceReset; diff --git a/src/synthesis/helm_engine.cpp b/src/synthesis/helm_engine.cpp index 75f7a52c2..b8368c885 100644 --- a/src/synthesis/helm_engine.cpp +++ b/src/synthesis/helm_engine.cpp @@ -400,10 +400,14 @@ namespace mopo { } void HelmEngine::setPressure(mopo_float value, int channel, int sample) { + if (arp_on_->value()) + arpeggiator_->setPressure(value, channel, sample); voice_handler_->setPressure(value, channel, sample); } void HelmEngine::setAftertouch(mopo_float note, mopo_float value, int sample) { + if (arp_on_->value()) + arpeggiator_->setAftertouch(note, value, sample); voice_handler_->setAftertouch(note, value, sample); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor