diff options
author | André Nusser <andre.nusser@googlemail.com> | 2019-07-22 02:35:34 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2019-07-22 02:35:34 +0200 |
commit | 85f0c0b1adc57c33a7c4d3ef50ac22e7001739a1 (patch) | |
tree | 578b80600b8f0d91c50dbf67aae3e29a68983466 /src/audioinputenginemidi.cc | |
parent | bf2ef1bb3a7f25338944ec3ce233f8b57611adba (diff) |
Center velocities as well as disable stddev when disabling humanizer.
Diffstat (limited to 'src/audioinputenginemidi.cc')
-rw-r--r-- | src/audioinputenginemidi.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/audioinputenginemidi.cc b/src/audioinputenginemidi.cc index abe00ff..0714546 100644 --- a/src/audioinputenginemidi.cc +++ b/src/audioinputenginemidi.cc @@ -127,8 +127,10 @@ void AudioInputEngineMidi::processNote(const std::uint8_t* midi_buffer, case NoteOn: if(instrument_idx != -1) { + // maps velocities to [.5/127, 126.5/127] + auto centered_velocity = (velocity-.5f)/127.0f; events.push_back({EventType::OnSet, (std::size_t)instrument_idx, - offset, velocity / 127.0f}); + offset, centered_velocity}); } break; |