Skip to content

Commit

Permalink
[midi2] Fix midi 1 -> midi 2 conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jul 2, 2024
1 parent 8e9455d commit 9cda570
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/libremidi/midi_in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ convert_midi2_to_midi1_input_configuration(const ump_input_configuration& base_c
converter.convert(
msg.bytes.data(), msg.bytes.size(), msg.timestamp,
[cb](const uint32_t* ump, std::size_t n, int64_t ts) {
cb(libremidi::ump{{}, 0});
if(n >= 4)
{
libremidi::ump u{ump[0],ump[1],ump[2],ump[3]};
u.timestamp = ts;
cb(std::move(u));
}
return stdx::error{};
});
};
Expand Down

0 comments on commit 9cda570

Please sign in to comment.