Skip to content

Commit 9f11aea

Browse files
committed
Add global volume and reverb control.
1 parent d5a81e5 commit 9f11aea

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ The convolution reverb uses IRs from the [Open AIR](https://www.openair.hosted.y
2323

2424
## MIDI Control
2525
Sequencer steps are controlled via the program change messages sent on the control MIDI channel (program 0 corresponds to the first step of the sequencer, 1 - to the second and so on).
26+
27+
- `CC 7` on control channel controls the global volume;
28+
- `CC 91` on control channel controls the reverb output level;

Source/aeolus/engine.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,20 @@ void Engine::processControlMIDIMessage(const MidiMessage& message)
616616

617617
if (step >= 0 && step < _sequencer->getStepsCount())
618618
_sequencer->setStep(step);
619+
} else if (message.isController()) {
620+
int cc = message.getControllerNumber();
621+
const float value = float(message.getControllerValue()) / 127.0f;
622+
623+
switch (cc) {
624+
case CC_VOLUME:
625+
setVolume(value);
626+
break;
627+
case CC_REVERB:
628+
setReverbWet(value);
629+
break;
630+
default:
631+
break;
632+
}
619633
}
620634
}
621635

Source/aeolus/engine.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ class Engine
123123
NUM_PARAMS
124124
};
125125

126+
enum {
127+
CC_VOLUME = 7,
128+
CC_REVERB = 91
129+
};
130+
126131
//--------------------------------------------------------------------------
127132

128133
Engine();
@@ -161,6 +166,9 @@ class Engine
161166
*/
162167
int getReverbIR() const noexcept { return _selectedIR; }
163168

169+
/**
170+
* Returns the reverb tail in seconds.
171+
*/
164172
float getReverbLengthInSeconds() const;
165173

166174
/**

0 commit comments

Comments
 (0)