This code will ultimately be called by what is created in:
56
However, that code will mostly be contributing device and channel for use in these calls; as such, design work can continue in parallel with that work.
This new high-level API will need to:
create an Erlang MIDI term (midimsg:*)
encode that term to MIDI binary (midibin:*) -- notterm_to_binary
send that MIDI binary to a MIDI device with um.nif:send
As a high-level API, we'll want to provide more than just a direct, 1:1 mapping to the low-level midimsg:* and midibin:* functions. And we won't want to pass data structures -- we'll want to pass args, as appropriate per function. These two requirements complicate the implementation somewhat.
Tasks:
[x] Create a core send/3 function that:
[x] takes device, channel, and a MIDI message in term format
[x] encodes the MIDI message
[x] uses um.nif:send to send the binary MIDI message to the given device
[x] Create a core batch/3 function that:
[x] takes device, channel, and a batch MIDI message in term format (list of MIDI messages wrapped in a batch tuple)
[x] encodes the MIDI message
[x] uses um.nif:send to send the binary MIDI message to the given device
[ ] Decide upon the optimal manner for all high-level functions of this API to utilise these core functions
This code will ultimately be called by what is created in:
56
However, that code will mostly be contributing device and channel for use in these calls; as such, design work can continue in parallel with that work.
This new high-level API will need to:
midimsg:*
)midibin:*
) -- notterm_to_binary
um.nif:send
As a high-level API, we'll want to provide more than just a direct, 1:1 mapping to the low-level
midimsg:*
andmidibin:*
functions. And we won't want to pass data structures -- we'll want to pass args, as appropriate per function. These two requirements complicate the implementation somewhat.Tasks:
send/3
function that:encode
s the MIDI messageum.nif:send
to send the binary MIDI message to the given devicebatch/3
function that:batch
tuple)encode
s the MIDI messageum.nif:send
to send the binary MIDI message to the given device