local mw = require "midiwire"
require "iuplua"

print "ports:"
for i=0,mw.device_count()-1 do
    print(i, mw.name(i))
end

port, err = mw.open_in(0)
if not port then
	print("ERR " .. err)
	return
end

--[[
dlg = iup.dialog{size="100x100"}

dlg:showxy( iup.CENTER, iup.CENTER )

if (iup.MainLoopLevel()==0) then
  iup.MainLoop()
end
]]


while true do
	-- io.stdout:write "."
	mw.sleep(100)
	-- chyta inputy
end

