! Copyright (C) 2026 Serre ! See https://factorcode.org/license.txt for BSD license. USING: windows.types ; IN: midi.windows ! === Streamed MIDI output via Windows winmm.lib MIDI API 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 ; ! == C Bindings 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 )