Skip to content

Commit 7b8e589

Browse files
committed
plugin: Implement pitch bend (WIP)
1 parent 74932c8 commit 7b8e589

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/MinatonProcess.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,11 @@ void MinatonPlugin::_processMidi(const uint8_t* data, const uint32_t size)
185185
}
186186
}
187187
// pitch bend
188+
// FIXME: Bend value +8192 (raw data: 0xe0 0x7f 0x7f) acts as same as -8192.
189+
// Input MIDI event in Plugin::run() has wrong values, even though REAPER passes the right data to Minaton.
188190
else if (status == 0xe0) {
189-
const float pitchbend = float(key + (value << 7) - 0x2000) / 8192.0f;
190-
d_stderr2("[Unimplemented] Pitch bend: bend to %f", pitchbend);
191+
const float pitchbend = float((data[1] & 0x7f) + (value << 7) - 0x2000) / 8192.0f;
192+
fSynthesizer->set_tuning(m_key - 38 + pitchbend);
191193
}
192194
}
193195
}

0 commit comments

Comments
 (0)