{"id":2557,"date":"2018-08-24T23:00:52","date_gmt":"2018-08-24T14:00:52","guid":{"rendered":"https:\/\/www.utsbox.com\/?p=2557"},"modified":"2018-10-24T17:03:19","modified_gmt":"2018-10-24T08:03:19","slug":"%e3%82%a8%e3%83%95%e3%82%a7%e3%82%af%e3%82%bf%e3%83%bc%e3%81%ae%e7%b0%a1%e5%8d%98%e3%81%aa%e5%ae%9f%e8%a3%85%e4%be%8b-%e3%83%94%e3%83%83%e3%83%81%e3%82%b7%e3%83%95%e3%82%bf%e3%83%bc","status":"publish","type":"post","link":"https:\/\/www.utsbox.com\/?p=2557","title":{"rendered":"\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u306e\u7c21\u5358\u306a\u5b9f\u88c5\u4f8b \u2013 \u30d4\u30c3\u30c1\u30b7\u30d5\u30bf\u30fc"},"content":{"rendered":"<h1>\u30d4\u30c3\u30c1\u30b7\u30d5\u30bf\u30fc\u306e\u5b9f\u88c5\u4f8b<\/h1>\n<p>\u30d4\u30c3\u30c1\u30b7\u30d5\u30bf\u30fc\u306f\u5165\u529b\u4fe1\u53f7\u306b\u97f3\u7a0b\u3092\u9ad8\u304f\u3057\u305f\u308a\u3001\u4f4e\u304f\u3057\u305f\u308a\u3059\u308b\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u3067\u3059\u3002<\/p>\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3068\u3057\u3066\u4e0b\u8a18\u304c\u3088\u304f\u5229\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<table>\n<tr>\n<th>\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc<\/th>\n<th>\u610f\u5473<\/th>\n<th>\u3060\u3044\u305f\u3044\u306e\u7bc4\u56f2<\/th>\n<\/tr>\n<tr>\n<td>\u30df\u30c3\u30af\u30b9\u30ec\u30d9\u30eb<\/td>\n<td>\u30d4\u30c3\u30c1\u30b7\u30d5\u30bf\u30fc\u306e\u304b\u304b\u308a\u5177\u5408<\/td>\n<td>0\uff5e1\u306e\u9593<\/td>\n<\/tr>\n<tr>\n<td>\u30d4\u30c3\u30c1<\/td>\n<td>\u3069\u308c\u3060\u3051\u97f3\u3092\u9ad8\u304f(\u4f4e\u304f)\u3059\u308b\u304b<\/td>\n<td>-12\uff5e12\u534a\u97f3(-1\uff5e1\u30aa\u30af\u30bf\u30fc\u30d6)\u7a0b\u5ea6<\/td>\n<\/tr>\n<\/table>\n<p>\u5b9f\u88c5\u306f\u8aad\u307f\u8fbc\u307f\u901f\u5ea6\u3092\u901f\u3081\u305f\u30c7\u30a3\u30ec\u30a4\u4fe1\u53f7\u3092\u5165\u529b\u4fe1\u53f7\u306b\u52a0\u3048\u3066\u51fa\u529b\u3057\u307e\u3059\u3002<br \/>\n\u30c7\u30a3\u30ec\u30a4\u4fe1\u53f7\u306e\u8aad\u307f\u8fbc\u307f\u901f\u5ea6\u3092\u901f\u3081\u308b\u3053\u3068\u3067\u97f3\u7a0b\u304c\u5909\u308f\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30a3\u30ec\u30a4\u4fe1\u53f7\u306f\u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u3092\u4f7f\u7528\u3057\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002\u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u306f\u300c<a href=\"https:\/\/www.utsbox.com\/?p=1505#\u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u5b9f\u88c5\u4f8b\">\u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u3064\u3044\u3066<\/a>\u300d\u3067\u4f5c\u6210\u3057\u305f\u3082\u306e\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u8aad\u307f\u8fbc\u307f\u901f\u5ea6\u3092\u5909\u66f4\u3057\u305f\u969b\u3001\u6574\u6570\u5024\u306b\u306a\u3089\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u305f\u3081\u30b5\u30f3\u30d7\u30eb\u3068\u30b5\u30f3\u30d7\u30eb\u306e\u9593\u306e\u4f4d\u7f6e\u306e\u5024\u3092\u7dda\u5f62\u88dc\u9593\u306a\u3069\u3092\u7528\u3044\u3066\u5272\u308a\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u7dda\u5f62\u88dc\u9593\u306e\u8a73\u7d30\u306f\u7701\u7565\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<p>\u3042\u304f\u307e\u3067\u5b9f\u88c5\u4f8b\u3067\u3059\u306e\u3067\u3044\u3044\u97f3\u8cea\u306e\u3082\u306e\u304c\u307b\u3057\u3044\u5834\u5408\u306f\u3001\u3054\u81ea\u8eab\u3067\u8a66\u884c\u932f\u8aa4\u3044\u305f\u3060\u304f\u3088\u3046\u304a\u9858\u3044\u3057\u307e\u3059\u3002<\/p>\n<p>\u3010\u5b9f\u88c5\u30a4\u30e1\u30fc\u30b8\u3011<br \/>\n\u25a0\u7dda\u5f62\u88dc\u9593\u306e\u5b9f\u88c5<br \/>\n[crayon]<br \/>\n\/\/ \u7dda\u5f62\u88dc\u9593\u95a2\u6570<br \/>\n\/\/ v1\u3068v2\u3092\u5272\u5408t\u3067\u7dda\u5f62\u88dc\u9593\u3059\u308b\u3002t\u306f0.0\uff5e1.0\u306e\u7bc4\u56f2\u3068\u3059\u308b<br \/>\n\/\/ t\u304c0.0\u306e\u6642v1\u306e\u5024\u3068\u306a\u308a\u3001t\u304c1.0\u306e\u6642v2\u306e\u5024\u3068\u306a\u308b<br \/>\nfloat lerp(float v1, float v2, float t)<br \/>\n{<br \/>\n\treturn (1.0f &#8211; t) * v1 + t * v2;<br \/>\n}<br \/>\n[\/crayon]<br \/>\n\u25a0\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u306e\u5b9f\u88c5<br \/>\n[crayon]<br \/>\nvoid pitchshifter(float inL[], float inR[], float outL[], float outR[], int wavelength)<br \/>\n{<\/p>\n<p>\t\/\/ \u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc<br \/>\n\tstatic float mix   = 1.0f;  \/\/ \u30d4\u30c3\u30c1\u30b7\u30d5\u30bf\u30fc\u306e\u52b9\u304d\u5177\u5408\u30020.0\uff5e1.0\u306e\u9593<br \/>\n\tstatic float pitch = 12.0f; \/\/ \u3069\u308c\u3060\u3051\u97f3\u3092\u9ad8\u304f(\u4f4e\u304f)\u3059\u308b\u304b\u3002-12\uff5e12\u7a0b\u5ea6<\/p>\n<p>\t\/\/ \u5185\u90e8\u5909\u6570<br \/>\n\tstatic CRingBuffur ringbufL, ringbufR; \/\/ \u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1(https:\/\/www.utsbox.com\/?p=1505 \u3088\u308a)<\/p>\n<p>\t\/\/ \u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u306einteraval\u3092\u8a2d\u5b9a\u3059\u308b<br \/>\n\t\/\/ \u3068\u308a\u3042\u3048\u305a1000\u30b5\u30f3\u30d7\u30eb\u7a0b\u5ea6\u3068\u3059\u308b<br \/>\n\t\/\/ (interval\u306f\u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1(https:\/\/www.utsbox.com\/?p=1505 \u3088\u308a)<br \/>\n\tint delaysample = 1000;<br \/>\n\tringbufL.SetInterval(delaysample);<br \/>\n\tringbufR.SetInterval(delaysample);<\/p>\n<p>\t\/\/ \u8aad\u307f\u8fbc\u307f\u901f\u5ea6\u3092\u901f\u3081\u305f\u5f8c\u306e\u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e<br \/>\n\tstatic float pos = 0.0f;<\/p>\n<p>\t\/\/ \u30d4\u30c3\u30c1\u304b\u3089\u8aad\u307f\u8fbc\u307f\u901f\u5ea6\u3092\u8a08\u7b97<br \/>\n\t\/\/ -12\u534a\u97f3(1\u30aa\u30af\u30bf\u30fc\u30d6\u4e0b)\u3067-0.5\u300112\u534a\u97f3(1\u30aa\u30af\u30bf\u30fc\u30d6\u4e0a)\u30671\u3068\u306a\u308b\u3088\u3046\u306b\u3059\u308b<br \/>\n\tstatic float speed = pow(2.0f, pitch \/ 12.0f) &#8211; 1.0f ;<\/p>\n<p>\t\/\/ \u5165\u529b\u4fe1\u53f7\u3092\u30d4\u30c3\u30c1\u30b7\u30d5\u30c8\u3059\u308b<br \/>\n\tfor (int i = 0; i < wavelength; i++)\n\t{\n\t\t\/\/ \u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e\u3092\u79fb\u52d5\u3057\u305f\u969b\u306e\u524d\u5f8c\u306e\u6574\u6570\u5024\u3092\u53d6\u5f97(\u3042\u3068\u3067\u7dda\u5f62\u88dc\u9593\u3059\u308b\u305f\u3081)\n\t\tint p1 = (int)pos;\n\t\tint p2 = pos + 1;\n\n\t\t\/\/ \u524d\u5f8c\u306e\u6574\u6570\u5024\u304b\u3089\u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e\u306e\u5024\u3092\u7dda\u5f62\u88dc\u9593\u3067\u5272\u308a\u51fa\u3059\n\t\t\/\/ \u7dda\u5f62\u88dc\u9593\u3067\u5272\u308a\u51fa\u3057\u305f\u7d50\u679c\u306f\u30d4\u30c3\u30c1\u30b7\u30d5\u30c8\u5f8c\u306e\u4fe1\u53f7\u3068\u306a\u308b\n\t\tfloat lerpL1 = lerp(ringbufL.Read(p1), ringbufL.Read(p2), pos - (float)p1);\n\t\tfloat lerpR1 = lerp(ringbufR.Read(p1), ringbufR.Read(p2), pos - (float)p1);\n\n\t\t\/\/ \u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e\u3092\u66f4\u65b0\u3059\u308b\n\t\t\/\/ pos\u304c\u5927\u304d\u304f(\u5c0f\u3055\u304f)\u306a\u308a\u3059\u304e\u306a\u3044\u3088\u3046\u306b\u5b9a\u671f\u7684\u306b 0 \u306b\u623b\u3059\n\t\t\/\/ \u5927\u304d\u304f\u306a\u3063\u305f\u6642\u306b\u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u306einterval\u3092\u8d85\u3048\u3066\u306f\u3044\u3051\u306a\u3044\u306e\u3067\u3001\n\t\t\/\/ \u3068\u308a\u3042\u3048\u305adelaysample* 0.9\u3068\u3059\u308b\u3002\n\t\tpos += speed;\n\t\tif (abs(pos) >= (float)delaysample * 0.9f) { pos = 0.0f; }<\/p>\n<p>\t\t\/\/ \u30c7\u30a3\u30ec\u30a4\u4fe1\u53f7\u3068\u3057\u3066\u5165\u529b\u4fe1\u53f7\u3092\u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u307f<br \/>\n\t\tringbufL.Write(inL[i]);<br \/>\n\t\tringbufR.Write(inR[i]);<\/p>\n<p>\t\t\/\/ \u30ea\u30f3\u30b0\u30d0\u30c3\u30d5\u30a1\u306e\u72b6\u614b\u3092\u66f4\u65b0\u3059\u308b<br \/>\n\t\tringbufL.Update();<br \/>\n\t\tringbufR.Update();<\/p>\n<p>\t\t\/\/ \u5165\u529b\u4fe1\u53f7\u306b\u30d4\u30c3\u30c1\u30b7\u30d5\u30c8\u4fe1\u53f7\u3092\u6df7\u305c\u3066\u51fa\u529b\u3059\u308b<br \/>\n\t\toutL[i] = (1.0f &#8211; mix)*inL[i] + mix * lerpL1;<br \/>\n\t\toutR[i] = (1.0f &#8211; mix)*inR[i] + mix * lerpR1;<br \/>\n\t}<\/p>\n<p>[\/crayon]<\/p>\n<p>\u4e0a\u8a18\u306f\u3042\u304f\u307e\u3067\u5b9f\u88c5\u4f8b\u3067\u3059\u3002<br \/>\n\u8aad\u307f\u8fbc\u307f\u4f4d\u7f6e(\u4e0a\u8a18\u306e\u5909\u6570pos)\u304c0\u306b\u306a\u308b\u6642(42\u884c\u76ee)\u306b\u97f3\u58f0\u4fe1\u53f7\u304c\u4e0d\u9023\u7d9a\u3068\u306a\u308a\u30ce\u30a4\u30ba\u304c\u5165\u308a\u307e\u3059\u3002<br \/>\n\u30af\u30ed\u30b9\u30d5\u30a7\u30fc\u30c9\u7b49\u3092\u5229\u7528\u3057\u3066\u97f3\u58f0\u4fe1\u53f7\u3092\u6ed1\u3089\u304b\u306b\u3064\u306a\u3050\u3053\u3068\u3067\u30ce\u30a4\u30ba\u306f\u6539\u5584\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u8cea\u554f\u306f\u30b3\u30e1\u30f3\u30c8\u6b04\u3084<a href=\"https:\/\/jbbs.shitaraba.net\/computer\/42917\/\" title=\"\u63b2\u793a\u677f\" target=\"_blank\">\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<br \/>\n\u4ed6\u306e\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u5b9f\u88c5\u4f8b\u306f<a href=\"https:\/\/www.utsbox.com\/?page_id=1197\">\u3053\u3061\u3089<\/a>\u306b\u3082\u3042\u308a\u307e\u3059\u3002\u3000\u2192\u3000<a href=\"https:\/\/www.utsbox.com\/?page_id=1197\">\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u306e\u7c21\u5358\u306a\u5b9f\u88c5\u4f8b<\/a><\/p>\n<p>\u25a0<a href=\"https:\/\/jbbs.shitaraba.net\/computer\/42917\/\" title=\"\u63b2\u793a\u677f\" target=\"_blank\">\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>\u30d4\u30c3\u30c1\u30b7\u30d5\u30bf\u30fc\u306e\u5b9f\u88c5\u4f8b \u30d4\u30c3\u30c1\u30b7\u30d5\u30bf\u30fc\u306f\u5165\u529b\u4fe1\u53f7\u306b\u97f3\u7a0b\u3092\u9ad8\u304f\u3057\u305f\u308a\u3001\u4f4e\u304f\u3057\u305f\u308a\u3059\u308b\u30a8\u30d5\u30a7\u30af\u30bf\u30fc\u3067\u3059\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3068\u3057\u3066\u4e0b\u8a18\u304c\u3088\u304f\u5229\u7528\u3055\u308c\u307e\u3059\u3002 \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc \u610f\u5473 \u3060\u3044\u305f\u3044\u306e\u7bc4\u56f2 \u30df\u30c3\u30af\u30b9\u30ec\u30d9\u30eb \u30d4\u30c3\u30c1\u30b7\u30d5\u30bf\u30fc\u306e\u304b\u304b\u308a [&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":[19],"tags":[],"class_list":["post-2557","post","type-post","status-publish","format-standard","hentry","category-19"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5fXUX-Ff","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/2557","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=2557"}],"version-history":[{"count":3,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/2557\/revisions"}],"predecessor-version":[{"id":2561,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/2557\/revisions\/2561"}],"wp:attachment":[{"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.utsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}