Skip to content

Commit 88d11b8

Browse files
fix getVarlenBytes implementation
1 parent 66b0443 commit 88d11b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ZMidi/Read.fs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ module ReadFile =
5353
return (uint32 result) }
5454

5555
let getVarlenText = gencount getVarlen readChar (fun _ b -> System.String b)
56-
let getVarlenBytes = gencount getVarlen readByte (fun _ b -> b)
56+
let getVarlenBytes =
57+
parseMidi {
58+
let! l = getVarlen
59+
return! ParserMonad (
60+
fun data state ->
61+
Ok (data.[state.Position .. state.Position + (int l) - 1], { state with Position = state.Position + int l})
62+
)
63+
}
64+
5765
let deltaTime =
5866
parseMidi {
5967
let! v = getVarlen

0 commit comments

Comments
 (0)