\ Swift Forth experiments \ 11/14/03 \ Revisited 11/20/03 dll: winmm.dll create moc 52 allot variable hmo variable dev 0 winproc: midiOutGetNumDevs 3 winproc: midiOutGetDevCaps 5 winproc: midiOutOpen 2 winproc: midiOutShortMsg 1 winproc: midiOutClose : pack-bytes 65536 * swap 256 * + + ; ( n n n -- n ) : pk pack-bytes ; ( n n n -- n) : setDev 9 dev ! ; ( -- ) : getCaps dev @ moc 52 midiOutGetDevCaps drop ; ( -- ) : opn hmo dev @ NULL NULL NULL midiOutOpen drop ; ( -- ) : bang hmo @ swap midiOutShortMsg drop ; ( n n n -- n ) : alloff 127 0 do 128 i 0 pack-bytes hmo @ swap midiOutShortMsg drop loop ; ( -- ) : cls hmo @ midiOutClose drop ; ( -- ) : init dev ! getCaps opn ; ( n -- ) : dumpAll moc 52 dump hmo 4 dump ; ( -- ) CR CR .( Type device number and 'init' to open device.) CR CR CR CR .( Type dumpall to see results.) CR CR CR CR .( Use pack-notes and bang to hear notes.) CR CR