Skip to content

Commit 57d5b09

Browse files
committed
If you're using Kontrol S MK2, A or M and OSARA, you can now quickly turn a knob first to report its parameter and value. Subsequent turns will adjust the value.
1 parent 185666c commit 57d5b09

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ However, ReaKontrol provides support for this.
5151
To access them, press the Mixer button on S MK2, or Track button on A/M series keyboards, then press the 4-d encoder.
5252
You then use the knobs to adjust parameters.
5353
If you're using a screen reader, you will need to enable OSARA's "Report changes made via control surfaces" setting to have parameter changes reported.
54-
Note also that touching the knobs will not provide any feedback and you will instead need to turn the knob slightly to have the parameter and value reported.
54+
Note also that touching a knob will not provide any feedback.
55+
Instead, you can quickly turn a knob first to report its parameter and value.
56+
Subsequent turns will adjust the value.
5557
On S MK2, you can use the page buttons to move through banks of parameters.
5658
On A and M series keyboards, pulling the 4-d encoder right and left moves through banks instead.
5759
Use 4-d encoder down and up to switch plugins.

src/niMidi.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,8 @@ class NiMidiSurface: public BaseSurface {
579579
int _lastChangedFxParam = -1;
580580
double _lastChangedFxParamValue = 0;
581581
FxMap _fxMap;
582+
int _suppressFxParam = -1;
583+
DWORD _suppressFxParamStartTime = 0;
582584

583585
void _onTrackBankChange() {
584586
if (this->_isUsingMixerForFx()) {
@@ -926,6 +928,38 @@ class NiMidiSurface: public BaseSurface {
926928
if (param == -1) {
927929
return;
928930
}
931+
if (osara_outputMessage) {
932+
DWORD now = GetTickCount();
933+
if (param == this->_suppressFxParam) {
934+
constexpr DWORD SUPPRESS_DELAY = 200;
935+
if (now - this->_suppressFxParamStartTime < SUPPRESS_DELAY) {
936+
// We avoid changing the parameter for a short period so that an OSARA user
937+
// can use a quick twist of the knob to report the parameter without
938+
// changing it.
939+
return;
940+
}
941+
// Allow the value to be changed now.
942+
} else {
943+
this->_suppressFxParam = param;
944+
this->_suppressFxParamStartTime = now;
945+
// When an OSARA user first turns the knob, report the parameter without
946+
// changing it.
947+
ostringstream s;
948+
s << this->_fxMap.getParamName(mp) << " ";
949+
double val = TrackFX_GetParamNormalized(this->_lastSelectedTrack,
950+
this->_selectedFx, param);
951+
char valText[100] = "";
952+
TrackFX_FormatParamValueNormalized(this->_lastSelectedTrack,
953+
this->_selectedFx, param, val, valText, sizeof(valText));
954+
if (valText[0]) {
955+
s << valText;
956+
} else {
957+
s << val;
958+
}
959+
osara_outputMessage(s.str().c_str());
960+
return;
961+
}
962+
}
929963
double val ;
930964
if (param == this->_lastChangedFxParam) {
931965
// Some parameters snap to defined values when you set them. This means that

0 commit comments

Comments
 (0)