{"id":2811,"date":"2019-11-04T22:22:23","date_gmt":"2019-11-04T13:22:23","guid":{"rendered":"https:\/\/www.utsbox.com\/?p=2811"},"modified":"2020-02-09T17:07:49","modified_gmt":"2020-02-09T08:07:49","slug":"midi%e3%83%8e%e3%83%bc%e3%83%88%e3%82%aa%e3%83%b3%e3%83%bb%e3%82%aa%e3%83%95%e3%81%ae%e5%87%ba%e5%8a%9b","status":"publish","type":"post","link":"https:\/\/www.utsbox.com\/?p=2811","title":{"rendered":"MIDI\u30ce\u30fc\u30c8\u30aa\u30f3\u30fb\u30aa\u30d5\u306e\u51fa\u529b"},"content":{"rendered":"<h1>MIDI\u30ce\u30fc\u30c8\u30aa\u30f3\u30fb\u30aa\u30d5\u306e\u51fa\u529b<\/h1>\n<p>VST\u3067\u306fMIDI\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306b\u3088\u308a\u3001MIDI\u30a8\u30d5\u30a7\u30af\u30c8\u306e\u3088\u3046\u306a\u3082\u306e\u3084\u97f3\u58f0\u4fe1\u53f7\u304b\u3089MIDI\u3078\u306e\u5909\u63db\u306a\u3069\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\u97f3\u58f0\u51e6\u7406\u30af\u30e9\u30b9\u304b\u3089MIDI\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001MIDI\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u5165\u529b\u306a\u3069\u306b\u3064\u3044\u3066\u306f\u4e0b\u8a18\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<table>\n<tr>\n<td><a href=\"https:\/\/www.utsbox.com\/?p=1083\">MIDI\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u53d7\u53d61<\/a><\/td>\n<td>MIDI\u306eNote On\u3001Note Off\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u3051\u53d6\u308b\u65b9\u6cd5\u306e\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u3002\u7c21\u5358\u306a\u30e2\u30ce\u30d5\u30a9\u30cb\u30c3\u30af\u30b7\u30f3\u30bb\u30b5\u30a4\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.utsbox.com\/?p=1109\">MIDI\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u53d7\u53d62<\/a><\/td>\n<td>MIDI\u306eControl Change\u3001Pitch Bend\u306a\u3069\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u3051\u53d6\u308b\u65b9\u6cd5\u306e\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/table>\n<p>\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001\u5165\u529b\u3055\u308c\u305fMIDI\u30ce\u30fc\u30c8\u30aa\u30f3\u30fb\u30aa\u30d5\u30e1\u30c3\u30bb\u30fc\u30b8\u305d\u306e\u307e\u307e\u51fa\u529b\u3059\u308b\u3060\u3051\u306e\u3082\u306e\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305a\u306f\u97f3\u58f0\u51e6\u7406\u30af\u30e9\u30b9\u306einitialize\u95a2\u6570\u306b\u51fa\u529b\u7528\u306eEventBus\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002(\u300c<a href=\"https:\/\/www.utsbox.com\/?p=1083#\u5165\u529b\u30a4\u30d9\u30f3\u30c8\u30d0\u30b9\u306e\u8ffd\u52a0\">\u5165\u529b\u30a4\u30d9\u30f3\u30c8\u30d0\u30b9\u306e\u8ffd\u52a0<\/a>\u300d\u3068\u307b\u307c\u540c\u3058\u3067\u3059\u3002)<br \/>\n<!--more--><\/p>\n<p>\u3010processor.cpp\u3011<br \/>\n[crayon mark=&#8221;9&#8243;]<br \/>\ntresult PLUGIN_API MyVSTProcessor::initialize(FUnknown* context)<br \/>\n{<br \/>\n\t\/\/ \u307e\u305a\u7d99\u627f\u5143\u30af\u30e9\u30b9\u306e\u521d\u671f\u5316\u3092\u5b9f\u65bd<br \/>\n\ttresult result = AudioEffect::initialize(context);<br \/>\n\tif (result == kResultTrue)<br \/>\n\t{<br \/>\n\t\t\/\/ \u5165\u529b\u3068\u51fa\u529b\u3092\u8a2d\u5b9a<br \/>\n\t\taddEventInput(L&#8221;MIDI In&#8221;,1 );<br \/>\n\t\taddEventOutput(L&#8221;MIDI Out&#8221;,1);<br \/>\n\t}<\/p>\n<p>\t\/\/ \u521d\u671f\u5316\u304c\u6210\u529f\u3059\u308c\u3070kResultTrue\u3092\u8fd4\u3059\u3002<br \/>\n\treturn result;<br \/>\n}<br \/>\n[\/crayon]<\/p>\n<p>\u6b21\u306b\u97f3\u58f0\u51e6\u7406\u30af\u30e9\u30b9\u306eprocess\u95a2\u6570\u306bMIDI\u30ce\u30fc\u30c8\u30aa\u30f3\u30fb\u30aa\u30d5\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\nMIDI\u30ce\u30fc\u30c8\u30aa\u30f3\u30fb\u30aa\u30d5\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3059\u308b\u306b\u306f\u3001data\u5909\u6570\u304b\u3089outputEvents\u3092\u53d6\u5f97\u3057\u3001\u3053\u306eoutputEvents\u306b\u30a4\u30d9\u30f3\u30c8(MIDI\u30ce\u30fc\u30c8\u30aa\u30f3\u30fb\u30aa\u30d5\u30e1\u30c3\u30bb\u30fc\u30b8)\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u3010processor.cpp \u8ffd\u52a0\u5206\u3011<br \/>\n[crayon mark=&#8221;8-11,21-22&#8243;]<br \/>\ntresult PLUGIN_API MyVSTProcessor::process(ProcessData&#038; data)<br \/>\n{<br \/>\n\t\/\/ \u4e0e\u3048\u3089\u308c\u305f\u30a4\u30d9\u30f3\u30c8\u304c\u3042\u308b\u3068\u304ddata\u306einputEvents\u306b<br \/>\n\t\/\/ IEventList\u30af\u30e9\u30b9\u3078\u306e\u30dd\u30a4\u30f3\u30bf\u306e\u30a2\u30c9\u30ec\u30b9\u304c\u5165\u308b<br \/>\n\tIEventList* eventList = data.inputEvents;<br \/>\n\tif (eventList != NULL)<br \/>\n\t{<br \/>\n\t\t\/\/ MIDI\u30ce\u30fc\u30c8On\/Off\u3092\u51fa\u529b\u3059\u308b\u306b\u306f\u3001data.outputEvents\u306b\u30a4\u30d9\u30f3\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3002<br \/>\n\t\t\/\/ nullptr\u306e\u5834\u5408(\u51fa\u529b\u7528\u306e\u30a4\u30d9\u30f3\u30c8\u30d0\u30b9\u304c\u7121\u3044\u5834\u5408)\u3001\u7d42\u4e86\u3059\u308b\u3002<br \/>\n\t\tIEventList* outEventList = data.outputEvents;<br \/>\n\t\tif (outEventList == nullptr) { return kResultTrue; }<\/p>\n<p>\t\t\/\/ \u30a4\u30d9\u30f3\u30c8\u306e\u6570\u3092\u53d6\u5f97\u3059\u308b\u3002<br \/>\n\t\tint32 numEvent = eventList->getEventCount();<br \/>\n\t\tfor (int32 i = 0; i < numEvent; i++)\n\t\t{\n\t\t\t\/\/ i\u756a\u76ee\u306e\u30a4\u30d9\u30f3\u30c8\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\n\t\t\tEvent event;\n\t\t\tif (eventList->getEvent(i, event) == kResultOk)<br \/>\n\t\t\t{<br \/>\n\t\t\t\t\/\/ \u51fa\u529b\u7528\u306e\u30a4\u30d9\u30f3\u30c8\u30d0\u30b9\u306b\u30a4\u30d9\u30f3\u30c8\u3092\u8ffd\u52a0\u3059\u308b<br \/>\n\t\t\t\toutEventList->addEvent(event);<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t}<\/p>\n<p>\t\/\/ \u554f\u984c\u306a\u3051\u308c\u3070kResultTrue\u3092\u8fd4\u3059(\u304a\u305d\u3089\u304f\u5fc5\u305akResultTrue\u3092\u8fd4\u3059)<br \/>\n\treturn kResultTrue;<br \/>\n}<br \/>\n[\/crayon]<\/p>\n<p>\u4ee5\u4e0a\u3067\u97f3\u58f0\u51e6\u7406\u30af\u30e9\u30b9\u304b\u3089MIDI\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u4ee5\u5916\u306b\u3082VST3.6\u306b\u3064\u3044\u3066\u306e\u60c5\u5831\u304c\u3042\u308a\u307e\u3059\u3002\u4e0b\u8a18\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/www.utsbox.com\/?page_id=1316\">\u306f\u3058\u3081\u3066\u306eVST3\u30d7\u30e9\u30b0\u30a4\u30f3\u4f5c\u308a<\/a><\/li>\n<\/ul>\n<p>\u307e\u305f\u3001\u8cea\u554f\u3084\u3054\u6307\u6458\u306f\u30b3\u30e1\u30f3\u30c8\u6b04\u3084<a href=\"https:\/\/jbbs.shitaraba.net\/computer\/42917\/\" title=\"\u63b2\u793a\u677f\" target=\"_blank\" rel=\"noopener noreferrer\">\u63b2\u793a\u677f<\/a>\u3001<a href=\"https:\/\/twitter.com\/vstcpp\">Twitter<\/a>\u3067\u3044\u305f\u3060\u3051\u3070\u3068\u304a\u3082\u3044\u307e\u3059\u3002<\/p>\n<p>\u25a0<a href=\"https:\/\/jbbs.shitaraba.net\/computer\/42917\/\" title=\"\u63b2\u793a\u677f\" target=\"_blank\" rel=\"noopener noreferrer\">\u63b2\u793a\u677f<\/a><br \/>\n\u25a0Twitter\u30a2\u30ab\u30a6\u30f3\u30c8\uff1a@vstcpp\u3000\u3000\u3000URL\uff1a<a href=\"https:\/\/twitter.com\/vstcpp\">https:\/\/twitter.com\/vstcpp<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MIDI\u30ce\u30fc\u30c8\u30aa\u30f3\u30fb\u30aa\u30d5\u306e\u51fa\u529b VST\u3067\u306fMIDI\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u308c\u306b\u3088\u308a\u3001MIDI\u30a8\u30d5\u30a7\u30af\u30c8\u306e\u3088\u3046\u306a\u3082\u306e\u3084\u97f3\u58f0\u4fe1\u53f7\u304b\u3089MIDI\u3078\u306e\u5909\u63db\u306a\u3069\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u3053\u3067\u306f\u3001\u97f3\u58f0\u51e6\u7406\u30af\u30e9\u30b9\u304b\u3089MI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-2811","post","type-post","status-publish","format-standard","hentry","category-vst3"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5fXUX-Jl","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/2811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2811"}],"version-history":[{"count":3,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/2811\/revisions"}],"predecessor-version":[{"id":2867,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/2811\/revisions\/2867"}],"wp:attachment":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}