Handbook
Glossary
write-chunk ( chunk -- )
Vocabulary
midi
.
private
Inputs
chunk
an
object
Outputs
None
Definition
IN:
midi.private
GENERIC:
write-chunk
( chunk -- )
Methods
USING:
accessors
endian
io
kernel
midi
midi.private
sequences
;
M:
midi-chunk
write-chunk
[
type>>
write
]
[
bytes>>
[
length
4
>be
write
]
[
write
]
bi
]
bi
;
USING:
accessors
endian
io
kernel
midi
midi.private
;
M:
midi-header
write-chunk
B{
77 84 104 100
}
write
B{
0 0 0 6
}
write
[
format>>
]
[
#chunks>>
]
[
division>>
]
tri
[
2
>be
write
]
tri@
;
USING:
accessors
endian
io
io.encodings.binary
io.streams.byte-array
kernel
midi
midi.private
sequences
;
M:
midi-track
write-chunk
B{
77 84 114 107
}
write
binary
[
events>>
f
swap
[
write-event
]
each
drop
]
with-byte-writer
[
length
4
>be
write
]
[
write
]
bi
;