mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-15 15:00:46 +00:00
fixes bug reading zero values.
(input with index 0, velocity 0 etc)
This commit is contained in:
parent
73fc0dc243
commit
45370cb234
@ -199,11 +199,11 @@ module Voicemeeter
|
|||||||
exp: ->(x) { x >= 0 }
|
exp: ->(x) { x >= 0 }
|
||||||
)
|
)
|
||||||
if (got_midi = res > 0)
|
if (got_midi = res > 0)
|
||||||
vals = cmsg.read_string.bytes
|
data = cmsg.read_bytes(res).bytes
|
||||||
vals.each_slice(3) do |ch, key, velocity|
|
data.each_slice(3) do |ch, key, velocity|
|
||||||
midi.channel = ch.to_i
|
midi.channel = ch
|
||||||
midi.current = key.to_i
|
midi.current = key
|
||||||
midi.cache[key.to_i] = velocity.to_i
|
midi.cache[key] = velocity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
got_midi
|
got_midi
|
||||||
|
Loading…
Reference in New Issue
Block a user