{"id":389442,"date":"2024-06-29T08:35:54","date_gmt":"2024-06-29T08:35:54","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=389442"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=389442","title":{"rendered":"<span>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 CoreMIDI<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a81\/34c\/357\/a8134c357d5419a11b5a068240ae95e4.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a81\/34c\/357\/a8134c357d5419a11b5a068240ae95e4.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0432 macOS \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u0433\u0430\u0442\u044b\u0435 (\u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 Windows, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440), \u043e\u0434\u043d\u0430\u043a\u043e, \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c. \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u043e\u0449\u043d\u044b\u0439, \u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e\u0434 macOS \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CoreMIDI \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/post\/564476\/\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/u><\/a> \u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f NuGet-\u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f .NET-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c API. \u041f\u043e\u0441\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0442 \u0441\u043b\u043e\u0432 \u043a \u0434\u0435\u043b\u0443. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 API \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0432 macOS.<\/p>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 MIDI \u0432 macOS \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\" rel=\"noopener noreferrer nofollow\"><u>CoreMIDI<\/u><\/a>. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443 \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043a\u0443\u0434\u043d\u0430\u044f, \u043c\u043d\u043e\u0433\u0438\u0435 \u0432\u0435\u0449\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u044f\u0441\u043d\u044f\u0442\u044c \u043b\u0438\u0431\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c, \u043b\u0438\u0431\u043e \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 (\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0442\u0430\u043c \u0432\u0435\u0440\u043d\u044b). \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431\u043e \u0432\u0441\u0451\u043c, \u0447\u0442\u043e \u0443\u0437\u043d\u0430\u043b \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e CoreMIDI \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midi_services\/deprecated_symbols\" rel=\"noopener noreferrer nofollow\"><u>\u0432 CoreMIDI \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 API<\/u><\/a>. \u041d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0432 macOS 11.0 Big Sur \u0438 \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 MIDI 2.0. \u041d\u043e \u044f \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u0440\u044b\u0439 API, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d:<\/p>\n<ol>\n<li>\n<p>\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u0432\u043d\u043e, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u043c\u0430\u0441\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0441 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c (\u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/gs.statcounter.com\/macos-version-market-share\/desktop\/worldwide\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 statcounter<\/a>, \u0434\u043e\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Big Sur \u043d\u0438\u0447\u0442\u043e\u0436\u043d\u043e \u043c\u0430\u043b\u0430 (CSV-\u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0441 \u0441\u044b\u0440\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430 \u0438\u044e\u043d\u044c 2020 \u2013 \u0438\u044e\u043d\u044c 2021 <a href=\"https:\/\/www.dropbox.com\/s\/9acv84twsqe6a21\/macos_version-ww-monthly-202006-202106.csv?dl=0\" rel=\"noopener noreferrer nofollow\"><u>\u0442\u0443\u0442<\/u><\/a>));<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u043f\u0440\u0435\u043a\u0438 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u043c Apple \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495225-midiinputportcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIInputPortCreate<\/u><\/a>, \u043a\u043e\u043b\u043e\u043d\u043a\u0430 <em>Availability<\/em> \u0441\u043f\u0440\u0430\u0432\u0430), \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 macOS;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u043e\u0432\u043e\u0433\u043e, \u0432\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 API \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0442\u0438\u043f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 (MIDI 1.0\/2.0) \u0438\/\u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Blocks_(C_language_extension)\" rel=\"noopener noreferrer nofollow\"><u>\u0431\u043b\u043e\u043a\u0430<\/u><\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u042f \u0431\u0443\u0434\u0443 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u043e\u0436\u0435, \u0445\u043e\u0442\u044f \u0438\u0445 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 API, \u0445\u043e\u0442\u044f \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u043c. MIDI 2.0 \u0435\u0449\u0451 \u0434\u0430\u043b\u0451\u043a \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0439\u0442\u0438 \u043d\u0430 \u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u0440\u044b\u043d\u043e\u043a MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0430 \u043d\u043e\u0432\u044b\u0439 API CoreMIDI \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u043b\u043e\u0434\u043e\u0439, \u043c\u043e\u0436\u0435\u0442, \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u0436\u0435 \u043d\u0430\u0439\u0434\u0443\u0442\u0441\u044f \u0431\u0430\u0433\u0438.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0443 \u043c\u0435\u043d\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 360 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438. \u041e\u0442\u043b\u0430\u0434\u043a\u0443 \u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 macOS 10.14 Mojave, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u043b \u0432\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u0432 11.3 Big Sur \u0438 \u0432 12.0 Monterey (Beta 3).<\/p>\n<h2>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/h2>\n<p>\u041e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0442\u043a\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 CoreMIDI \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midi_services\" rel=\"noopener noreferrer nofollow\"><u>MIDI Services<\/u><\/a> \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d54\/75f\/a21\/d5475fa21aaaa658cc1b35c10959122d.png\" alt=\"\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e &quot;\u0433\u043b\u0430\u0437\u0430\u043c\u0438&quot; CoreMIDI\" title=\"\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e &quot;\u0433\u043b\u0430\u0437\u0430\u043c\u0438&quot; CoreMIDI\" width=\"780\" height=\"343\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d54\/75f\/a21\/d5475fa21aaaa658cc1b35c10959122d.png\"\/><figcaption>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e &#171;\u0433\u043b\u0430\u0437\u0430\u043c\u0438&#187; CoreMIDI<\/figcaption><\/figure>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (entities), \u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0447\u0435\u043a \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430 (endpoints), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438 (source) \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430\u043c\u0438 (destination). \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 CoreMIDI, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0430 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u2013 \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495164-midigetnumberofdevices\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetNumberOfDevices<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">ItemCount devicesCount = MIDIGetNumberOfDevices();<\/code><\/pre>\n<p>\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 (\u043e\u0442 <code>0<\/code> \u0434\u043e <code>devicesCount - 1<\/code>) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495368-midigetdevice\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetDevice<\/u><\/a>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e:<\/p>\n<pre><code class=\"cpp\">MIDIDeviceRef deviceRef = MIDIGetDevice(0);<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495354-mididevicegetnumberofentities\" rel=\"noopener noreferrer nofollow\"><u>MIDIDeviceGetNumberOfEntities<\/u><\/a> \u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495261-mididevicegetentity\" rel=\"noopener noreferrer nofollow\"><u>MIDIDeviceGetEntity<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">ItemCount entitiesCount = MIDIDeviceGetNumberOfEntities(deviceRef); MIDIEntityRef firstEntityRef = MIDIDeviceGetEntity(deviceRef, 0);<\/code><\/pre>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u0430\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495284-midientitygetnumberofsources\" rel=\"noopener noreferrer nofollow\"><u>MIDIEntityGetNumberOfSources<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495236-midientitygetsource\" rel=\"noopener noreferrer nofollow\"><u>MIDIEntityGetSource<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495188-midientitygetnumberofdestination\" rel=\"noopener noreferrer nofollow\"><u>MIDIEntityGetNumberOfDestinations<\/u><\/a> \u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495223-midientitygetdestination\" rel=\"noopener noreferrer nofollow\"><u>MIDIEntityGetDestination<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">ItemCount entitySourcesCount = MIDIEntityGetNumberOfSources(firstEntityRef); MIDIEndpointRef firstEntitySourceRef = MIDIEntityGetSource(firstEntityRef, 0);  ItemCount entityDestinationsCount = MIDIEntityGetNumberOfDestinations(firstEntityRef); MIDIEndpointRef firstEntityDetinationRef = MIDIEntityGetDestination(firstEntityRef, 0);<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438 \u0431\u0435\u0437\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495116-midigetnumberofsources\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetNumberOfSources<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495168-midigetsource\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetSource<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495309-midigetnumberofdestinations\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetNumberOfDestinations<\/u><\/a> \u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495108-midigetdestination\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetDestination<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">ItemCount sourcesCount = MIDIGetNumberOfSources(); MIDIEndpointRef firstSourceRef = MIDIGetSource(0);  ItemCount destinationsCount = MIDIGetNumberOfDestinations(); MIDIEndpointRef firstDetinationRef = MIDIGetDestination(0);<\/code><\/pre>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 DryWetMIDI, \u0438\u0431\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 API \u0434\u043b\u044f Windows \u0438 macOS. \u0412 Windows \u043d\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 CoreMIDI. \u0422\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u044b <em>\u0432\u0445\u043e\u0434\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/em> \u0438 <em>\u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/em>. \u0422\u0430\u043a\u0438\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u044f \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0441\u044c \u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0432 CoreMIDI \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0430 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438 \u2013 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c\u0438.<\/p>\n<p>\u041c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u0442\u043e\u0447\u043a\u0438 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430. \u041d\u043e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043b\u043e \u0442\u043e\u043b\u043a\u0430, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0443\u043c\u0435\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441 \u0438\u0445 \u0438\u043c\u0435\u043d\u0430\u043c\u0438. CoreMIDI \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 MIDI-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445). \u041f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midi_services\/midi_object_properties\" rel=\"noopener noreferrer nofollow\"><u>MIDI Object Properties<\/u><\/a> \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <em>Property Accessors<\/em>. \u0412\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <em>MIDI A<\/em>, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">ItemCount sourcesCount = MIDIGetNumberOfSources(); MIDIEndpointRef sourceRef;  for (int i = 0; i &lt; sourcesCount; i++) {     sourceRef = MIDIGetSource(i);      CFStringRef nameRef;     MIDIObjectGetStringProperty(sourceRef, kMIDIPropertyDisplayName, &amp;nameRef);      if (CFStringCompare(nameRef, CFSTR(\"MIDI A\"), 0) == kCFCompareEqualTo)     {         break;     } }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043d\u0435 \u0441\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495282-midiobjectgetstringproperty\" rel=\"noopener noreferrer nofollow\"><u>MIDIObjectGetStringProperty<\/u><\/a>, \u0430 \u043f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>OSStatus<\/code>, \u0447\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e 32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c. \u0412 CoreMIDI \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <code>OSStatus<\/code>, \u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0438 \u043a \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0437\u043d\u0430\u0442\u044c, \u044d\u0442\u043e <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495156-midi_services_errors\" rel=\"noopener noreferrer nofollow\"><u>\u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a<\/u><\/a> \u0432 CoreMIDI, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0445\u0440\u0443\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0448\u0430\u0440\u0430 \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u043a \u043a\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442. \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0447\u0442\u043e \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>OSStatus<\/code>, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432\u044b \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0437\u0430\u0442\u0435\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u043e\u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u0443\u0440\u0443. \u0410 \u043f\u043e\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c MIDI-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 Windows \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/www.tobias-erichsen.de\/software\/virtualmidi.html\" rel=\"noopener noreferrer nofollow\"><u>virtualMIDI<\/u><\/a>. \u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0440\u0435\u0436\u0438\u043c\u0430 \u044f\u0434\u0440\u0430. \u0417\u0432\u0443\u0447\u0438\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u043b\u0430\u0442\u043d\u044b\u043c\u0438, \u043b\u0438\u0431\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u0431\u0435\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c \u0438\u0445, \u043b\u0438\u0431\u043e \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 macOS \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495212-midisourcecreate\" rel=\"noopener noreferrer nofollow\"><u>MIDISourceCreate<\/u><\/a> (\u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 CoreMIDI \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 (<a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495360-midiclientcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIClientCreate<\/u><\/a>) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438):<\/p>\n<pre><code class=\"cpp\">MIDIClientRef clientRef; MIDIClientCreate(CFSTR(\"CLIENT\"), NULL, NULL, &amp;clientRef);  MIDIEndpointRef sourceRef; MIDISourceCreate(clientRef, CFSTR(\"SRC\"), &amp;sourceRef);<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439, \u043d\u043e\u0432\u0430\u044f \u0436\u0435 \u2013 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/3566495-midisourcecreatewithprotocol\" rel=\"noopener noreferrer nofollow\"><u>MIDISourceCreateWithProtocol<\/u><\/a> \u2013 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">MIDISourceCreateWithProtocol(clientRef, CFSTR(\"SRC\"), kMIDIProtocol_1_0, &amp;sourceRef);<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495347-mididestinationcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIDestinationCreate<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">void ReadProc(const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon) {     \/\/ executed on new packet received }  \/\/ ...  MIDIEndpointRef destinationRef; MIDIDestinationCreate(clientRef, nameRef, ReadProc, NULL, &amp;destinationRef);<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>ReadProc<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0435\u0441\u0442\u044c \u0438 \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430 \u2013 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/3566476-mididestinationcreatewithprotoco\" rel=\"noopener noreferrer nofollow\"><u>MIDIDestinationCreateWithProtocol<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">MIDIDestinationCreateWithProtocol(clientRef, nameRef, kMIDIProtocol_1_0, &amp;destinationRef, ^(const MIDIEventList *evtlist, void *srcConnRefCon) {     \/\/ executed on new event packet received });<\/code><\/pre>\n<p>\u0412\u0438\u0434\u044f, \u0447\u0442\u043e \u0432 C \u043d\u044b\u043d\u0447\u0435 \u0435\u0441\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043e\u043d\u0438 \u0436\u0435 \u0431\u043b\u043e\u043a\u0438), \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u0442\u0430\u043b \u043e\u0442 \u0436\u0438\u0437\u043d\u0438.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438 \u0432 \u0432\u0430\u043a\u0443\u0443\u043c\u0435, \u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043f\u0430\u0440\u044b, \u043e\u0431\u0440\u0430\u0437\u0443\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Loopback\" rel=\"noopener noreferrer nofollow\"><u>loopback-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/u><\/a>. \u0422\u0430\u043a\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0445 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0431\u0435\u0437\u043e \u0432\u0441\u044f\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0430 \u0434\u043e\u0441\u0442\u0438\u0433 \u043b\u0438 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0434\u0430, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e. \u0412\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0435\u0439 loopback-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u043c\u0435\u043d\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;CoreFoundation\/CoreFoundation.h> #include &lt;CoreMIDI\/CoreMIDI.h> #include &lt;stdio.h>  typedef int LPBCREATE_RESULT;  #define LPBCREATE_OK 0 #define LPBCREATE_FAILEDCREATECLIENT 1 #define LPBCREATE_FAILEDCREATESOURCE 2 #define LPBCREATE_FAILEDCREATEDESTINATION 3  typedef struct {     MIDIEndpointRef destRef;     MIDIEndpointRef srcRef;     char *portName; } PortInfo;  void ReadProc(const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon) {     PortInfo* portInfo = (PortInfo*)readProcRefCon;     printf(\"Data arrived on '%s'; notifying ports...\", portInfo->portName);     OSStatus status = MIDIReceived(portInfo->srcRef, pktlist);     printf(\"%d\\n\", status); }  int main(int argc, char *argv[]) {     printf(\"Creating client...\\n\");          MIDIClientRef clientRef;     OSStatus result = MIDIClientCreate(CFSTR(\"LoopbackClient\"), NULL, NULL, &amp;clientRef);     if (result != noErr)         return LPBCREATE_FAILEDCREATECLIENT;          for (int i = 1; i &lt; argc; i++)     {         printf(\"Creating port '%s'...\", argv[i]);                  PortInfo *portInfo = malloc(sizeof(PortInfo));         portInfo->portName = argv[i];                  CFStringRef nameRef = CFStringCreateWithCString(NULL, argv[i], kCFStringEncodingUTF8);                  result = MIDISourceCreate(clientRef, nameRef, &amp;portInfo->srcRef);         if (result != noErr)             return LPBCREATE_FAILEDCREATESOURCE;                  result = MIDIDestinationCreate(clientRef, nameRef, ReadProc, portInfo, &amp;portInfo->destRef);         if (result != noErr)             return LPBCREATE_FAILEDCREATEDESTINATION;                  printf(\"OK\\n\");     }          printf(\"Waiting for data...\\n\");     getchar();          return LPBCREATE_OK; }<\/code><\/pre>\n<p>\u0412\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u0430\u043a \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e loopback-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>ReadProc<\/code>, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495276-midireceived\" rel=\"noopener noreferrer nofollow\"><u>MIDIReceived<\/u><\/a> \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442 \u0432\u0441\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0443 \u043f\u043e\u0440\u0442\u044b \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0436\u0435 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438. \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0440\u0442\u0430\u043c\u0438 (\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c) \u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438\/\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/98e\/692\/95a\/98e69295a01051bef777c05055cd1349.png\" alt=\"\u041e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 CoreMIDI\" title=\"\u041e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 CoreMIDI\" width=\"780\" height=\"430\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/98e\/692\/95a\/98e69295a01051bef777c05055cd1349.png\"\/><figcaption>\u041e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 CoreMIDI<\/figcaption><\/figure>\n<p>\u0412\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0442 \u043f\u0440\u0438\u0437\u0432\u0430\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495225-midiinputportcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIInputPortCreate<\/u><\/a> (\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e API \u2013 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/3566488-midiinputportcreatewithprotocol\" rel=\"noopener noreferrer nofollow\"><u>MIDIInputPortCreateWithProtocol<\/u><\/a>):<\/p>\n<pre><code class=\"cpp\">MIDIPortRef inPortRef; MIDIInputPortCreate(clientRef, CFSTR(\"PORT_NAME\"), ReadProc, NULL, &amp;inPortRef);<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e <code>NULL<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>readProcRefCon<\/code> \u0432 <code>ReadProc<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>ReadProc<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0432 \u043a\u043e\u0434\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e loopback-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0441 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c (\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438). \u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0432\u044b\u0448\u0435 \u0442\u0430\u043a\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0436\u0438\u0440\u043d\u043e\u0439 \u0441\u043f\u043b\u043e\u0448\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0435\u0439, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0448\u0442\u0440\u0438\u0445\u043e\u0432\u044b\u043c \u043c\u0435\u0436\u0434\u0443 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430\u043c\u0438, \u0433\u0434\u0435 \u0441\u0432\u044f\u0437\u044c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435. \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0442 \u0441 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495278-midiportconnectsource\" rel=\"noopener noreferrer nofollow\"><u>MIDIPortConnectSource<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">MIDIPortConnectSource(inPortRef, sourceRef, NULL);<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e <code>NULL<\/code> \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u0432 <code>ReadProc<\/code> \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>srcConnRefCon<\/code>. \u0421\u0432\u044f\u0437\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043b\u044e\u0431\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u0441 \u043b\u044e\u0431\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u043d\u0435 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440 Windows API, \u0433\u0434\u0435 \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u044d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u043e\u0435 (\u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/mmeapi\/nf-mmeapi-midiinopen\" rel=\"noopener noreferrer nofollow\"><u>midiInOpen<\/u><\/a> \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/mmeapi\/nf-mmeapi-midiinclose\" rel=\"noopener noreferrer nofollow\"><u>midiInClose<\/u><\/a> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u0430\u043a \u043e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0434\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>ReadProc<\/code>. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>MIDIReceived<\/code> \u0431\u0435\u0437 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 <code>MIDIReceived<\/code>.<\/p>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0441\u0432\u044f\u0437\u044c \u043c\u043e\u0436\u043d\u043e \u0438 \u0440\u0430\u0437\u043e\u0440\u0432\u0430\u0442\u044c, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0441\u043b\u0443\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495342-midiportdisconnectsource\" rel=\"noopener noreferrer nofollow\"><u>MIDIPortDisconnectSource<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">MIDIPortConnectSource(inPortRef, sourceRef);<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495166-midioutputportcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIOutputPortCreate<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">MIDIPortRef outPortRef; MIDIOutputPortCreate(clientRef, CFSTR(\"PORT_NAME\"), &amp;outPortRef);<\/code><\/pre>\n<p>\u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495289-midisend\" rel=\"noopener noreferrer nofollow\"><u>MIDISend<\/u><\/a> (\u0438\u043b\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/3566494-midisendeventlist\" rel=\"noopener noreferrer nofollow\"><u>MIDISendEventList<\/u><\/a>), \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"cpp\">MIDISend(outPortRef, destinationRef, packetList);<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 <code>packetList<\/code> \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0440\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <code>outPortRef<\/code> \u043d\u0430 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a <code>destinationRef<\/code>. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043d\u0435\u044f\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2013 \u0430 \u043a\u0430\u043a \u0436\u0435 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438? \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0432\u044b\u0448\u0435, \u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0441\u0442\u0430\u0440\u044b\u0439 API. \u0418 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 <code>MIDISend<\/code> \u2013 \u044d\u0442\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. \u042f \u043e\u043f\u0438\u0448\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0435\u0433\u043e, \u0438 \u0441\u043a\u0430\u0436\u0443 \u043f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043f\u0440\u043e \u043d\u043e\u0432\u044b\u0439.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u0437\u0443\u0447\u0438\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midipacketlist\" rel=\"noopener noreferrer nofollow\"><u>MIDIPacketList<\/u><\/a> (\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u043d\u0435\u044f\u0441\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439), \u0442\u043e \u0440\u0435\u0437\u044e\u043c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<ol>\n<li>\n<p>\u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midipacketlist\/1495393-numpackets\" rel=\"noopener noreferrer nofollow\"><u>numPackets<\/u><\/a>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midipacketlist\/1495228-packet\" rel=\"noopener noreferrer nofollow\"><u>packet<\/u><\/a> \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u0438\u043d\u044b <code>1<\/code>, \u0430 \u043f\u0430\u043a\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midipacket\" rel=\"noopener noreferrer nofollow\"><u>MIDIPacket<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u0435\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midipacket\/1495113-timestamp\" rel=\"noopener noreferrer nofollow\"><u>timeStamp<\/u><\/a> \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midipacket\/1495352-length\" rel=\"noopener noreferrer nofollow\"><u>length<\/u><\/a> \u0441 \u0434\u043b\u0438\u043d\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0438, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u043e\u043b\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midipacket\/1495258-data\" rel=\"noopener noreferrer nofollow\"><u>data<\/u><\/a>, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043a\u0430\u043a \u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u0438\u043d\u044b <code>256<\/code>.  <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u0435 <code>timeStamp<\/code> \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0438 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435. \u0418\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<blockquote>\n<p>If receiving MIDI data, this property represents the time at which the events occurred. If sending MIDI data, it represents the time at which to play the events. A value of 0 means \u201cnow.\u201d<\/p>\n<\/blockquote>\n<p>\u0422.\u0435. \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0443\u043a\u0430\u0437\u0430\u0432 \u0432\u0440\u0435\u043c\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u0410 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>0<\/code>, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0441\u0440\u0430\u0437\u0443. \u041d\u043e, \u0443\u043a\u0430\u0437\u0430\u0432 <code>0<\/code>, \u043c\u044b \u044d\u0442\u043e\u0442 <code>0<\/code> \u0438 \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0435\u0433\u043e \u043e\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430. \u0418 \u0432\u044b\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e \u043c\u0435\u0442\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c <em>the time at which the events occurred<\/em>. \u041f\u043e \u043c\u043d\u0435, \u0437\u0434\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u043c\u0443\u0434\u0440\u0438\u043b\u0438, \u0438 \u0432 Windows \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u2013 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u0438 \u043d\u0435\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0414\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e-\u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443:<\/p>\n<pre><code class=\"cpp\">MIDIPacket packet; packet.timeStamp = 0; packet.length = 3; packet.data[0] = 0x90; \/\/ note on, channel 0 packet.data[1] = 0xA6; \/\/ note number packet.data[2] = 0xB7; \/\/ velocity  MIDIPacketList packetList; packetList.numPackets = 1; packetList.packet[0] = packet;<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b:<\/p>\n<ol>\n<li>\n<p>\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>256<\/code> \u0431\u0430\u0439\u0442 (\u0442\u0430\u043a \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u043b\u0435 <code>data<\/code>) \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0442\u0440\u0451\u0445;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0434\u043d\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u043e\u0442\u044b \u0438\u043b\u0438 \u0436\u0435 system exclusive \u0434\u0430\u043d\u043d\u044b\u0435).<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b (\u0434\u0430, \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a \u043f\u043e\u043b\u044e <code>data<\/code> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e <em>variable-length stream<\/em>, \u043d\u043e \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0437\u043d\u0430\u0447\u0438\u0442, \u043d\u0435 \u044f\u0441\u043d\u043e). \u041e\u0442\u043a\u0443\u0434\u0430 \u044f \u044d\u0442\u043e \u0443\u0437\u043d\u0430\u043b? \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>3333<\/code> \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f <em>note on<\/em>, \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u043b\u0438\u043d\u043e\u0439 <code>3<\/code>:<\/p>\n<pre><code class=\"cpp\">ByteCount dataSize = 9999; Byte buffer[dataSize + sizeof(MIDIPacketList)]; MIDIPacketList* packetList = (MIDIPacketList*)buffer; MIDIPacket* packet = MIDIPacketListInit(packetList);  for (int i = 0; i &lt; dataSize; i += 3) {     data[i] = 0x90;     data[i+1] = 0xA6;     data[i+2] = 0xB7;      packet = MIDIPacketListAdd(packetList, sizeof(buffer), packet, 0, 3, &amp;data[i]); }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0433\u0438\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0430\u0439\u0442\u043e\u0432 (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 <code>unsigned char<\/code>) \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 <code>MIDIPacketList<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495218-midipacketlistinit\" rel=\"noopener noreferrer nofollow\"><u>MIDIPacketListInit<\/u><\/a> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435. \u042d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0442\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495128-midipacketlistadd\" rel=\"noopener noreferrer nofollow\"><u>MIDIPacketListAdd<\/u><\/a>, \u0434\u0430\u0431\u044b CoreMIDI \u0441\u0430\u043c \u0440\u0430\u0437\u0431\u0438\u043b \u0432\u0441\u0451 \u043f\u043e \u043f\u0430\u043a\u0435\u0442\u0430\u043c, \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u043c. \u0421\u0442\u043e\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u043a\u0435\u0442, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0435\u0451 \u0441\u0442\u043e\u0438\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u201c\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432\u201d.<\/p>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 <code>65536<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e, \u043e\u0442\u043e\u0441\u043b\u0430\u0432 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u0434\u043e\u043c \u0432\u044b\u0448\u0435 (<code>9999<\/code> \u0431\u0430\u0439\u0442), \u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0432 \u0432 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>ReadProc<\/code> (\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430), \u0437\u0430\u043c\u0435\u0442\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ol>\n<li>\n<p><code>ReadProc<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 <code>3<\/code> \u0440\u0430\u0437\u0430;<\/p>\n<\/li>\n<li>\n<p><code>numPackets<\/code> \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u043c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 <code>1<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u0438\u043d\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0431\u0443\u0434\u0435\u0442 <code>4082<\/code>, \u0430 \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u043c <code>1835<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u0434\u0430\u043d\u043d\u044b\u0435, \u0434\u043b\u0438\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439, \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u0431\u0438\u0442\u044b \u043d\u0430 \u0442\u0440\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0430\u043a\u0435\u0442\u0443 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c. \u0420\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 <code>4082<\/code> (\u0432 \u0441\u0443\u043c\u043c\u0435 \u0434\u043b\u0438\u043d\u044b \u0442\u0440\u0451\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u0430\u0434\u0443\u0442 \u0438\u0441\u043a\u043e\u043c\u044b\u0435 <code>9999<\/code>). \u042f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u043f\u0440\u0438\u0437\u044b\u0432\u0430\u044e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0434\u0443\u043c\u0430\u044e, \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u041a \u0441\u043b\u043e\u0432\u0443, \u0435\u0441\u043b\u0438 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u0430 \u0440\u0430\u0434\u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u0438\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 <code>65536<\/code>, \u043f\u043e\u043b\u0443\u0447\u0438\u043c EXC_BAD_ACCESS, \u043e\u043d \u0436\u0435 \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 segmentation fault.<\/p>\n<p>\u0418, \u0440\u0430\u0437 \u0443\u0436 \u043c\u044b \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"cpp\">void ReadProc(const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon) {     MIDIPacket* packet = &amp;pktlist->packet[0];      for (int i = 0; i &lt; pktlist->numPackets; i++)     {         \/\/ do something with packet's data              packet = MIDIPacketNext(packet);     } }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495178-midipacketnext\" rel=\"noopener noreferrer nofollow\"><u>MIDIPacketNext<\/u><\/a> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435. \u041f\u043e \u043c\u043e\u0438\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0435\u0440\u0443\u043d\u0434\u0443, \u043d\u0435 <code>NULL<\/code>. \u0421\u0442\u043e\u0438\u0442 \u0438\u043c\u0435\u0442\u044c \u044d\u0442\u043e \u0432 \u0432\u0438\u0434\u0443 \u0438 \u043d\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u043e\u0432\u043e\u043c API. \u041f\u043e \u0441\u0443\u0442\u0438 \u0432\u0441\u0451 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"cpp\">MIDIEventPacket packet; packet.timeStamp = 0; packet.wordCount = 1; packet.words[0] = (2 &lt;&lt; 28) | (0x90 &lt;&lt; 16) | (0x40 &lt;&lt; 8) | 0x65;  MIDIEventList eventList; eventList.protocol = kMIDIProtocol_1_0; eventList.numPackets = 1; eventList.packet[0] = packet;  MIDISendEventList(outPortRef, destinationRef, &amp;eventList);<\/code><\/pre>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0442\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 Universal MIDI Packet (UMP, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/www.midi.org\/specifications\/midi-2-0-specifications\/midi2-core\/universal-midi-packet-and-midi-2-0-protocol-specification\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<\/u><\/a>). \u0412\u043c\u0435\u0441\u0442\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c 32-\u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 (\u0441\u043b\u043e\u0432\u0430\u043c\u0438), \u0432\u043c\u0435\u0441\u0442\u043e <code>MIDIPacket<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midieventpacket\" rel=\"noopener noreferrer nofollow\"><u>MIDIEventPacket<\/u><\/a>, \u0432\u043c\u0435\u0441\u0442\u043e <code>MIDIPacketList<\/code> \u2013 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midieventlist\" rel=\"noopener noreferrer nofollow\"><u>MIDIEventList<\/u><\/a>, \u0432\u043c\u0435\u0441\u0442\u043e <code>MIDISend<\/code> \u2013 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/3566494-midisendeventlist\" rel=\"noopener noreferrer nofollow\"><u>MIDISendEventList<\/u><\/a>. \u041b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u2013 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u043e <em>event<\/em>.<\/p>\n<p>\u042f \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0432\u043d\u0438\u043a\u0430\u043b \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u043e\u0432\u044b\u043c API, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c <code>MIDIEventList<\/code> \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0435\u043c \u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0447\u0442\u043e \u0438 <code>MIDIPacketList<\/code>, \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0430\u0439\u0442\u043e\u0432 (\u0438\u043b\u0438 \u0436\u0435 \u0441\u043b\u043e\u0432) \u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u044f \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0435\u043d \u043d\u0430 \u0441\u0442\u0430\u0440\u043e\u043c API. \u041d\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u043c, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0432 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 macOS. \u042f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u043d\u0430 11.3 Big Sur \u0438 12 Monterey (Beta 3). \u041d\u0430 Big Sur \u0432 \u0446\u0435\u043b\u043e\u043c \u0432\u0441\u0451 \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0445\u043e\u0442\u044f \u0442\u043e\u0442 \u043d\u0430\u0448 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 <code>3333<\/code> \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0412\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u043e\u0442\u0447\u0451\u0442\u0430 \u043e \u043f\u0430\u0434\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"bash\">... Exception Type:        EXC_CRASH (SIGABRT) Exception Codes:       0x0000000000000000, 0x0000000000000000 Exception Note:        EXC_CORPSE_NOTIFY ... 5   libc++abi.dylib               0x00007fff205fe307 std::__terminate(void (*)()) + 8 6   libc++abi.dylib               0x00007fff205fe2b8 std::terminate() + 56 7   com.apple.audio.midi.CoreMIDI 0x00007fff350177de void MIDI::EventList::traverse&lt;MIDIIORingBufferWriter::copyPacketList(PacketHeader&amp;, MIDIEventList const&amp;)::'lambda'(auto const&amp;)>(MIDIEventList const&amp;, auto&amp;&amp;) + 212 8   com.apple.audio.midi.CoreMIDI 0x00007fff35021ac9 caulk::inplace_function_detail::vtable&lt;void, MIDI::EventList const&amp;>::vtable&lt;MIDIIORingBufferWriter::copyPacketList(PacketHeader&amp;, MIDIPacketList const&amp;)::'lambda'(MIDI::EventList const&amp;)>(caulk::inplace_function_detail::wrapper&lt;MIDIIORingBufferWriter::copyPacketList(PacketHeader&amp;, MIDIPacketList const&amp;)::'lambda'(MIDI::EventList const&amp;)>)::'lambda'(void*, MIDI::EventList const&amp;)::__invoke(void*, MIDI::EventList const&amp;) + 29 9   com.apple.audio.midi.CoreMIDI 0x00007fff34ff9b72 MIDI::PacketizerBase&lt;MIDI::EventList>::begin_new_packet(unsigned long long, gsl::span&lt;unsigned int const, -1l>) + 52 10  com.apple.audio.midi.CoreMIDI 0x00007fff34ffc7d8 MIDI::Packetizer::add(unsigned long long, MIDI::UniversalPacket const&amp;) + 296 11  com.apple.audio.midi.CoreMIDI 0x00007fff34ffd03f void MIDI::LegacyPacketList::traverse&lt;MIDI::MIDIPacketList_to_MIDIEventList(MIDIPacketList const&amp;, caulk::inplace_function&lt;void (MIDI::EventList const&amp;), 48ul, 16ul>)::'lambda'(MIDIPacket const&amp;)>(MIDIPacketList const&amp;, MIDI::MIDIPacketList_to_MIDIEventList(MIDIPacketList const&amp;, caulk::inplace_function&lt;void (MIDI::EventList const&amp;), 48ul, 16ul>)::'lambda'(MIDIPacket const&amp;)&amp;&amp;) + 131 12  com.apple.audio.midi.CoreMIDI 0x00007fff35021960 void MIDIProcess::WriteOutput&lt;MIDI::LegacyPacketList>(MIDIIOHeader&amp;, MIDIProtocolID, MIDI::LegacyPacketList const&amp;) + 166 13  com.apple.audio.midi.CoreMIDI 0x00007fff35021864 MIDISend + 313<\/code><\/pre>\n<p>\u0418\u0437 \u0441\u0442\u0435\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u0444\u0430\u043a\u0442 \u2013 \u0432\u044b\u0437\u043e\u0432 \u0441\u0442\u0430\u0440\u043e\u0433\u043e API \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u043e\u0432\u043e\u0433\u043e (<code>MIDIPacketList_to_MIDIEventList<\/code>). \u0422.\u0435. \u0432 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 macOS CoreMIDI \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438.<\/p>\n<p>\u0421\u0430\u043c\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043d\u0435 \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430, \u0438\u0431\u043e \u044f \u0432 \u0441\u0432\u043e\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0441\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u201c\u043e\u0434\u043d\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u2013 \u043e\u0434\u0438\u043d \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445\u201d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442.<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f macOS Monterey, \u0442\u043e \u0442\u0443\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0441\u044f \u0431\u0430\u0433. \u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u043e\u0442\u044b (<em>note on<\/em>) \u0441 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0436\u0430\u0442\u0438\u044f (<em>velocity<\/em>), \u0442\u043e CoreMIDI \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 <em>note off<\/em> \u0441 <em>velocity = 64<\/em>. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 API, \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043a \u0447\u0435\u0440\u0435\u0437 <code>MIDISend<\/code>, \u0442\u0430\u043a \u0438 \u0447\u0435\u0440\u0435\u0437 <code>MIDISendEventList<\/code>. \u042f \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 Apple, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0441\u0442\u0430\u0442\u0443\u0441 <em>Potential fix identified &#8212; In macOS 12<\/em>.<\/p>\n<h2>\u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 MIDI-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>CoreMIDI \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 MIDI-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495360-midiclientcreate\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 MIDI \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/u><\/a> \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"cpp\">MIDIClientCreate(CFSTR(\"CLIENT\"), NotifyProc, NULL, &amp;clientRef);<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>NotifyProc<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midinotifyproc\" rel=\"noopener noreferrer nofollow\"><u>MIDINotifyProc<\/u><\/a>.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f MIDI-\u043e\u0431\u044a\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h> #include &lt;CoreFoundation\/CoreFoundation.h> #include &lt;CoreMIDI\/CoreMIDI.h>  void NotifyProc(const MIDINotification* message, void* refCon) {     switch (message->messageID)     {         case kMIDIMsgObjectAdded:         case kMIDIMsgObjectRemoved:         {             printf(\"MIDI object added or removed.\");             break;         }     } }  int main(int argc, const char * argv[]) {     MIDIClientRef clientRef;     MIDIClientCreate(CFSTR(\"CLIENT\"), NotifyProc, NULL, &amp;clientRef);          CFRunLoopRun(); }<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>message<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>NotifyProc<\/code>. <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midinotification\" rel=\"noopener noreferrer nofollow\"><u>MIDINotification<\/u><\/a> \u043c\u043e\u0436\u0435\u0442 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439. \u0412\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midinotificationmessageid\" rel=\"noopener noreferrer nofollow\"><u>MIDINotificationMessageID<\/u><\/a>: <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midinotificationmessageid\/kmidimsgsetupchanged\" rel=\"noopener noreferrer nofollow\"><u>kMIDIMsgSetupChanged<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midinotificationmessageid\/kmidimsgobjectadded\" rel=\"noopener noreferrer nofollow\"><u>kMIDIMsgObjectAdded<\/u><\/a> \u0438 \u0442.\u0434. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u043d \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 message. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midinotificationmessageid\/kmidimsgobjectremoved\" rel=\"noopener noreferrer nofollow\"><u>kMIDIMsgObjectRemoved<\/u><\/a> \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midiobjectaddremovenotification\" rel=\"noopener noreferrer nofollow\"><u>MIDIObjectAddRemoveNotification<\/u><\/a>. \u041a \u0441\u043b\u043e\u0432\u0443, \u044d\u0442\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (<a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midiobjectaddremovenotification\/1495248-childtype\" rel=\"noopener noreferrer nofollow\"><u>childType<\/u><\/a>) \u0438 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e (<a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midiobjectaddremovenotification\/1495380-child\" rel=\"noopener noreferrer nofollow\"><u>child<\/u><\/a>). \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u0432\u043e\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<p>\u0421 \u0443\u0447\u0451\u0442\u043e\u043c \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cpp\">void NotifyProc(const MIDINotification* message, void* refCon) {     switch (message->messageID)     {         case kMIDIMsgObjectAdded:         case kMIDIMsgObjectRemoved:         {             MIDIObjectAddRemoveNotification* n = (MIDIObjectAddRemoveNotification*)message;                          switch (n->childType)             {                 case kMIDIObjectType_Source:                 {                     printf(\"Source added or removed.\");                                       break;                 }                 case kMIDIObjectType_Destination:                 {                     printf(\"Destination added or removed.\");                                 break;                 }             }         }     } }<\/code><\/pre>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/corefoundation\/1542011-cfrunlooprun\" rel=\"noopener noreferrer nofollow\"><u>CFRunLoopRun<\/u><\/a> \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>main<\/code>. \u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495360-midiclientcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIClientCreate<\/u><\/a> \u0441\u043a\u0430\u0437\u0430\u043d\u043e:<\/p>\n<blockquote>\n<p>The system invokes the callback function on the same run loop that you created the client on.<\/p>\n<\/blockquote>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u044d\u0442\u043e \u043d\u0438 \u043e \u0447\u0451\u043c \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043b\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0438 (\u0434\u0430 \u0438 \u043f\u0440\u0438 \u0432\u0442\u043e\u0440\u043e\u043c). \u041d\u043e \u0435\u0441\u043b\u0438 \u0436\u0435 \u043d\u0430\u0448\u0430 <code>main<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">int main(int argc, const char * argv[]) {     MIDIClientRef clientRef;     MIDIClientCreate(CFSTR(\"CLIENT\"), NotifyProc, NULL, &amp;clientRef);      printf(\"Press any key to exit program...\\n\");     getchar(); }<\/code><\/pre>\n<p>\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0438\u0431\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0446\u0438\u043a\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (<a href=\"https:\/\/developer.apple.com\/documentation\/corefoundation\/cfrunloop\" rel=\"noopener noreferrer nofollow\"><u>run loop<\/u><\/a>) \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430. \u0422\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0446\u0438\u043a\u043b \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u0418 \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0442\u0440\u044b\u0432\u043e\u043a \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0431\u0430\u0433 \u043f\u043e \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0446\u0438\u043a\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443:<\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h> #include &lt;CoreFoundation\/CoreFoundation.h> #include &lt;CoreMIDI\/CoreMIDI.h> #include &lt;pthread.h>  typedef struct {     char clientCreated; } ThreadData;  void NotifyProc(const MIDINotification* message, void* refCon) {     printf(\"Notification arrived\\n\"); }  void* ThreadProc(void* data) {     printf(\"Thread started\\n\");          ThreadData* threadData = (ThreadData*)data;          MIDIClientRef clientRef;     MIDIClientCreate(CFSTR(\"CLIENT\"), NotifyProc, NULL, &amp;clientRef);          threadData->clientCreated = 1;          printf(\"MIDI client created. Running run loop...\\n\");     CFRunLoopRun();          printf(\"Run loop exited!\\n\");     return NULL; }  void GetCountOfMIDIObjects() {     ItemCount count = MIDIGetNumberOfDevices();     \/\/ or MIDIGetNumberOfSources     \/\/ or MIDIGetNumberOfDestinations }  int main(int argc, const char * argv[]) {     printf(\"Program start\\n\");          \/\/ GetCountOfMIDIObjects();          ThreadData threadData;     threadData.clientCreated = 0;          pthread_t thread;     pthread_create(&amp;thread, NULL, ThreadProc, &amp;threadData);          while (threadData.clientCreated == 0) {}          GetCountOfMIDIObjects();          printf(\"Press any key to exit program...\\n\");     getchar();          return 0; }<\/code><\/pre>\n<p>\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0451:<\/p>\n<pre><code>Program start Thread started MIDI client created. Running run loop... Press any key to exit program...<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043f\u043e\u0442\u043e\u043a \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 \u0441\u0447\u0451\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442.\u0435. \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u0434\u043e\u0448\u043b\u0430 \u0434\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f <em>Run loop exited!<\/em>. \u0412\u0441\u0451 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 (\u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0435\u0451?)<\/p>\n<pre><code class=\"cpp\">\/\/ GetCountOfMIDIObjects();<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0436, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0438, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0443\u0432\u0438\u0434\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043c\u0430\u0433\u0438\u0438:<\/p>\n<pre><code>Program start Thread started MIDI client created. Running run loop... Run loop exited! Press any key to exit program...<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u043e\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u201c\u0410 \u043a\u0430\u043a\u043e\u0433\u043e \u0447\u0451\u0440\u0442\u0430?\u201d \u0412\u043e\u043f\u0440\u043e\u0441 \u0432\u043e\u0437\u043d\u0438\u043a \u0438 \u0432 \u043c\u043e\u0435\u0439 \u0433\u043e\u043b\u043e\u0432\u0435, \u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 (\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u201c\u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u044b\u0445\u201d \u0444\u0443\u043d\u043a\u0446\u0438\u0439) \u043e\u0442\u0440\u044b\u0432\u0430\u0435\u0442 \u0446\u0438\u043a\u043b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0435\u0449\u0451 \u043d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d, \u044f \u043d\u0435 \u0441\u043c\u043e\u0433. \u0417\u0430\u043a\u0438\u043d\u0443\u043b \u0431\u0430\u0433 \u0432 Apple, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432\u0441\u0451 \u0435\u0449\u0451 Open, \u0442.\u0435. \u0438\u043c \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f (\u0430 \u0437\u0430\u0432\u0435\u0434\u0451\u043d \u043e\u043d 22 \u0430\u0432\u0433\u0443\u0441\u0442\u0430 2021 \u0433\u043e\u0434\u0430).<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CoreMIDI. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0448\u0438\u0440\u0435, \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u201c\u0437\u0430 \u043a\u0430\u0434\u0440\u043e\u043c\u201d. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u0430\u0451\u0442 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438.<\/p>\n<p>\u0412 \u043c\u043e\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u0445 \u043c\u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043c\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/thestk\/rtmidi\" rel=\"noopener noreferrer nofollow\"><u>RtMidi<\/u><\/a>, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 API (Windows\/macOS) \u0434\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 DryWetMIDI \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 <a href=\"https:\/\/github.com\/melanchall\/drywetmidi\/tree\/develop\/Resources\/Native\" rel=\"noopener noreferrer nofollow\">Resources\/Native<\/a> \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 GitHub.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/570670\/\"> https:\/\/habr.com\/ru\/articles\/570670\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0432 macOS \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u0433\u0430\u0442\u044b\u0435 (\u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 Windows, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440), \u043e\u0434\u043d\u0430\u043a\u043e, \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c. \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u043e\u0449\u043d\u044b\u0439, \u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e\u0434 macOS \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CoreMIDI \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/post\/564476\/\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/u><\/a> \u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f NuGet-\u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f .NET-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c API. \u041f\u043e\u0441\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0442 \u0441\u043b\u043e\u0432 \u043a \u0434\u0435\u043b\u0443. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 API \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0432 macOS.<\/p>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 MIDI \u0432 macOS \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\" rel=\"noopener noreferrer nofollow\"><u>CoreMIDI<\/u><\/a>. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443 \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043a\u0443\u0434\u043d\u0430\u044f, \u043c\u043d\u043e\u0433\u0438\u0435 \u0432\u0435\u0449\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u044f\u0441\u043d\u044f\u0442\u044c \u043b\u0438\u0431\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c, \u043b\u0438\u0431\u043e \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 (\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0442\u0430\u043c \u0432\u0435\u0440\u043d\u044b). \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431\u043e \u0432\u0441\u0451\u043c, \u0447\u0442\u043e \u0443\u0437\u043d\u0430\u043b \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e CoreMIDI \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midi_services\/deprecated_symbols\" rel=\"noopener noreferrer nofollow\"><u>\u0432 CoreMIDI \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 API<\/u><\/a>. \u041d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0432 macOS 11.0 Big Sur \u0438 \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 MIDI 2.0. \u041d\u043e \u044f \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u0440\u044b\u0439 API, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d:<\/p>\n<ol>\n<li>\n<p>\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u0432\u043d\u043e, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u043c\u0430\u0441\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0441 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c (\u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/gs.statcounter.com\/macos-version-market-share\/desktop\/worldwide\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 statcounter<\/a>, \u0434\u043e\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Big Sur \u043d\u0438\u0447\u0442\u043e\u0436\u043d\u043e \u043c\u0430\u043b\u0430 (CSV-\u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0441 \u0441\u044b\u0440\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430 \u0438\u044e\u043d\u044c 2020 \u2013 \u0438\u044e\u043d\u044c 2021 <a href=\"https:\/\/www.dropbox.com\/s\/9acv84twsqe6a21\/macos_version-ww-monthly-202006-202106.csv?dl=0\" rel=\"noopener noreferrer nofollow\"><u>\u0442\u0443\u0442<\/u><\/a>));<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u043f\u0440\u0435\u043a\u0438 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u043c Apple \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495225-midiinputportcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIInputPortCreate<\/u><\/a>, \u043a\u043e\u043b\u043e\u043d\u043a\u0430 <em>Availability<\/em> \u0441\u043f\u0440\u0430\u0432\u0430), \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 macOS;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u043e\u0432\u043e\u0433\u043e, \u0432\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 API \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0442\u0438\u043f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 (MIDI 1.0\/2.0) \u0438\/\u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Blocks_(C_language_extension)\" rel=\"noopener noreferrer nofollow\"><u>\u0431\u043b\u043e\u043a\u0430<\/u><\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u042f \u0431\u0443\u0434\u0443 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u043e\u0436\u0435, \u0445\u043e\u0442\u044f \u0438\u0445 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 API, \u0445\u043e\u0442\u044f \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u043c. MIDI 2.0 \u0435\u0449\u0451 \u0434\u0430\u043b\u0451\u043a \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0439\u0442\u0438 \u043d\u0430 \u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u0440\u044b\u043d\u043e\u043a MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0430 \u043d\u043e\u0432\u044b\u0439 API CoreMIDI \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u043b\u043e\u0434\u043e\u0439, \u043c\u043e\u0436\u0435\u0442, \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u0436\u0435 \u043d\u0430\u0439\u0434\u0443\u0442\u0441\u044f \u0431\u0430\u0433\u0438.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0443 \u043c\u0435\u043d\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 360 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438. \u041e\u0442\u043b\u0430\u0434\u043a\u0443 \u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 macOS 10.14 Mojave, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u043b \u0432\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u0432 11.3 Big Sur \u0438 \u0432 12.0 Monterey (Beta 3).<\/p>\n<h2>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/h2>\n<p>\u041e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0442\u043a\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 CoreMIDI \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midi_services\" rel=\"noopener noreferrer nofollow\"><u>MIDI Services<\/u><\/a> \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e &#171;\u0433\u043b\u0430\u0437\u0430\u043c\u0438&#187; CoreMIDI<\/figcaption><\/figure>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (entities), \u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0447\u0435\u043a \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430 (endpoints), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438 (source) \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430\u043c\u0438 (destination). \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 CoreMIDI, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0430 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u2013 \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495164-midigetnumberofdevices\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetNumberOfDevices<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">ItemCount devicesCount = MIDIGetNumberOfDevices();<\/code><\/pre>\n<p>\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 (\u043e\u0442 <code>0<\/code> \u0434\u043e <code>devicesCount - 1<\/code>) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495368-midigetdevice\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetDevice<\/u><\/a>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e:<\/p>\n<pre><code class=\"cpp\">MIDIDeviceRef deviceRef = MIDIGetDevice(0);<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495354-mididevicegetnumberofentities\" rel=\"noopener noreferrer nofollow\"><u>MIDIDeviceGetNumberOfEntities<\/u><\/a> \u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495261-mididevicegetentity\" rel=\"noopener noreferrer nofollow\"><u>MIDIDeviceGetEntity<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">ItemCount entitiesCount = MIDIDeviceGetNumberOfEntities(deviceRef); MIDIEntityRef firstEntityRef = MIDIDeviceGetEntity(deviceRef, 0);<\/code><\/pre>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u0430\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495284-midientitygetnumberofsources\" rel=\"noopener noreferrer nofollow\"><u>MIDIEntityGetNumberOfSources<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495236-midientitygetsource\" rel=\"noopener noreferrer nofollow\"><u>MIDIEntityGetSource<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495188-midientitygetnumberofdestination\" rel=\"noopener noreferrer nofollow\"><u>MIDIEntityGetNumberOfDestinations<\/u><\/a> \u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495223-midientitygetdestination\" rel=\"noopener noreferrer nofollow\"><u>MIDIEntityGetDestination<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">ItemCount entitySourcesCount = MIDIEntityGetNumberOfSources(firstEntityRef); MIDIEndpointRef firstEntitySourceRef = MIDIEntityGetSource(firstEntityRef, 0);  ItemCount entityDestinationsCount = MIDIEntityGetNumberOfDestinations(firstEntityRef); MIDIEndpointRef firstEntityDetinationRef = MIDIEntityGetDestination(firstEntityRef, 0);<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438 \u0431\u0435\u0437\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495116-midigetnumberofsources\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetNumberOfSources<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495168-midigetsource\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetSource<\/u><\/a>, <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495309-midigetnumberofdestinations\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetNumberOfDestinations<\/u><\/a> \u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495108-midigetdestination\" rel=\"noopener noreferrer nofollow\"><u>MIDIGetDestination<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">ItemCount sourcesCount = MIDIGetNumberOfSources(); MIDIEndpointRef firstSourceRef = MIDIGetSource(0);  ItemCount destinationsCount = MIDIGetNumberOfDestinations(); MIDIEndpointRef firstDetinationRef = MIDIGetDestination(0);<\/code><\/pre>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 DryWetMIDI, \u0438\u0431\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 API \u0434\u043b\u044f Windows \u0438 macOS. \u0412 Windows \u043d\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 CoreMIDI. \u0422\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u044b <em>\u0432\u0445\u043e\u0434\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/em> \u0438 <em>\u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/em>. \u0422\u0430\u043a\u0438\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u044f \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0441\u044c \u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0432 CoreMIDI \u044f \u0441\u0447\u0438\u0442\u0430\u044e \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0430 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438 \u2013 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c\u0438.<\/p>\n<p>\u041c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u0442\u043e\u0447\u043a\u0438 \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430. \u041d\u043e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043b\u043e \u0442\u043e\u043b\u043a\u0430, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0443\u043c\u0435\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441 \u0438\u0445 \u0438\u043c\u0435\u043d\u0430\u043c\u0438. CoreMIDI \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 MIDI-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445). \u041f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/midi_services\/midi_object_properties\" rel=\"noopener noreferrer nofollow\"><u>MIDI Object Properties<\/u><\/a> \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <em>Property Accessors<\/em>. \u0412\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <em>MIDI A<\/em>, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">ItemCount sourcesCount = MIDIGetNumberOfSources(); MIDIEndpointRef sourceRef;  for (int i = 0; i &lt; sourcesCount; i++) {     sourceRef = MIDIGetSource(i);      CFStringRef nameRef;     MIDIObjectGetStringProperty(sourceRef, kMIDIPropertyDisplayName, &amp;nameRef);      if (CFStringCompare(nameRef, CFSTR(\"MIDI A\"), 0) == kCFCompareEqualTo)     {         break;     } }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043d\u0435 \u0441\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495282-midiobjectgetstringproperty\" rel=\"noopener noreferrer nofollow\"><u>MIDIObjectGetStringProperty<\/u><\/a>, \u0430 \u043f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>OSStatus<\/code>, \u0447\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e 32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c. \u0412 CoreMIDI \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <code>OSStatus<\/code>, \u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0438 \u043a \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0437\u043d\u0430\u0442\u044c, \u044d\u0442\u043e <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495156-midi_services_errors\" rel=\"noopener noreferrer nofollow\"><u>\u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a<\/u><\/a> \u0432 CoreMIDI, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0445\u0440\u0443\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0448\u0430\u0440\u0430 \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u043a \u043a\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442. \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0447\u0442\u043e \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>OSStatus<\/code>, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 MIDI-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432\u044b \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0437\u0430\u0442\u0435\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u043e\u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u0443\u0440\u0443. \u0410 \u043f\u043e\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c MIDI-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 Windows \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/www.tobias-erichsen.de\/software\/virtualmidi.html\" rel=\"noopener noreferrer nofollow\"><u>virtualMIDI<\/u><\/a>. \u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0440\u0435\u0436\u0438\u043c\u0430 \u044f\u0434\u0440\u0430. \u0417\u0432\u0443\u0447\u0438\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u043b\u0430\u0442\u043d\u044b\u043c\u0438, \u043b\u0438\u0431\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u0431\u0435\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c \u0438\u0445, \u043b\u0438\u0431\u043e \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 macOS \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495212-midisourcecreate\" rel=\"noopener noreferrer nofollow\"><u>MIDISourceCreate<\/u><\/a> (\u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 CoreMIDI \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 (<a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495360-midiclientcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIClientCreate<\/u><\/a>) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438):<\/p>\n<pre><code class=\"cpp\">MIDIClientRef clientRef; MIDIClientCreate(CFSTR(\"CLIENT\"), NULL, NULL, &amp;clientRef);  MIDIEndpointRef sourceRef; MIDISourceCreate(clientRef, CFSTR(\"SRC\"), &amp;sourceRef);<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439, \u043d\u043e\u0432\u0430\u044f \u0436\u0435 \u2013 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/3566495-midisourcecreatewithprotocol\" rel=\"noopener noreferrer nofollow\"><u>MIDISourceCreateWithProtocol<\/u><\/a> \u2013 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">MIDISourceCreateWithProtocol(clientRef, CFSTR(\"SRC\"), kMIDIProtocol_1_0, &amp;sourceRef);<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/1495347-mididestinationcreate\" rel=\"noopener noreferrer nofollow\"><u>MIDIDestinationCreate<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">void ReadProc(const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon) {     \/\/ executed on new packet received }  \/\/ ...  MIDIEndpointRef destinationRef; MIDIDestinationCreate(clientRef, nameRef, ReadProc, NULL, &amp;destinationRef);<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>ReadProc<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0435\u0441\u0442\u044c \u0438 \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430 \u2013 <a href=\"https:\/\/developer.apple.com\/documentation\/coremidi\/3566476-mididestinationcreatewithprotoco\" rel=\"noopener noreferrer nofollow\"><u>MIDIDestinationCreateWithProtocol<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">MIDIDestinationCreateWithProtocol(clientRef, nameRef, kMIDIProtocol_1_0, &amp;destinationRef, ^(const MIDIEventList *evtlist, void *srcConnRefCon) {     \/\/ executed on new event packet received });<\/code><\/pre>\n<p>\u0412\u0438\u0434\u044f, \u0447\u0442\u043e \u0432 C \u043d\u044b\u043d\u0447\u0435 \u0435\u0441\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043e\u043d\u0438 \u0436\u0435 \u0431\u043b\u043e\u043a\u0438), \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u0442\u0430\u043b \u043e\u0442 \u0436\u0438\u0437\u043d\u0438.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0438 \u0432 \u0432\u0430\u043a\u0443\u0443\u043c\u0435, \u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043f\u0430\u0440\u044b, \u043e\u0431\u0440\u0430\u0437\u0443\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Loopback\" rel=\"noopener noreferrer nofollow\"><u>loopback-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/u><\/a>. \u0422\u0430\u043a\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0445 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0431\u0435\u0437\u043e \u0432\u0441\u044f\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0430 \u0434\u043e\u0441\u0442\u0438\u0433 \u043b\u0438 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0434\u0430, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e. \u0412\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0435\u0439 loopback-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u043c\u0435\u043d\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;CoreFoundation\/CoreFoundation.h> #include &lt;CoreMIDI\/CoreMIDI.h> #include &lt;stdio.h>  typedef int LPBCREATE_RESULT;  #define LPBCREATE_OK 0 #define LPBCREATE_FAILEDCREATECLIENT 1 #define LPBCREATE_FAILEDCREATESOURCE 2 #define LPBCREATE_FAILEDCREATEDESTINATION 3  typedef struct {     MIDIEndpointRef destRef;     MIDIEndpointRef srcRef;     char *portName; } PortInfo;  void ReadProc(const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon) {     PortInfo* portInfo = (PortInfo*)readProcRefCon;     printf(\"Data arrived on '%s'; notifying ports...\", portInfo->portName);     OSStatus status = MIDIReceived(portInfo->srcRef, pktlist);     printf(\"%d\\n\", status);<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-389442","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/389442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=389442"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/389442\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=389442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=389442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=389442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}