Paste: Example MIDI thing, Factor C FFI ver.
| Author: | Serre |
| Mode: | factor |
| Date: | Mon, 13 Jul 2026 02:08:50 |
Plain Text |
USING: windows.types ;
IN: midi.windows
CONSTANT: note-on "1001"
CONSTANT: note-off "1000"
: on-channel ( on? ch. -- byte )
[ note-on note-off ? ]
[ 15 min >bin 4 CHAR: 0 pad-tail ] bi* append bin> ;
CONSTANT: default-vel 127
: dial-note-bytes ( note on? ch. -- byte-array )
on-channel swap 127 min default-vel
spin 3array >byte-array ;
LIBRARY: winmm
TYPEDEF: uint MMRESULT
FUNCTION: MMRESULT midiOutOpen (
PVOID* phmo,
UINT uDeviceID,
DWORD_PTR dwCallback,
DWORD_PTR dwInstance,
DWORD fdwOpen
)
FUNCTION: MMRESULT midiOutClose (
HANDLE hmo
)
FUNCTION: MMRESULT midiOutMessage (
HANDLE hmo,
UINT uMsg,
DWORD_PTR dw1,
DWORD_PTR dw2
)
| Author: | Serre |
| Mode: | factor |
| Date: | Mon, 13 Jul 2026 02:37:58 |
Plain Text |
FUNCTION: MMRESULT midiOutShortMsg (
HANDLE hmo,
DWORD dwMsg
)
New Annotation