[{"data":1,"prerenderedAt":8434},["ShallowReactive",2],{"series-fm-synthesis":3},[4,1687,7540,8064],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"date":11,"tags":12,"rowTypeId":18,"seriesOrder":19,"sitemap":20,"body":21,"_type":1681,"_id":1682,"_source":1683,"_file":1684,"_stem":1685,"_extension":1686},"/articles/tech/blazor/fm-synthesis-2op-implementation","blazor",false,"","2オペレータFM音源をC#で実装する｜サイン波2本で音を作る最小構成","FM音源シリーズ第2回。前回の式 out = sin(2π·fc·t + I·sin(2π·fm·t)) を、そのままC#のコードに落とします。オペレータを「位相を進めてsinを引く1ユニット」として設計し、キャリアとモジュレータ2個だけを直列に繋いで、サンプル単位のループで1音を生成する最小構成を解説します。位相累算の仕組みと、周波数を比（レシオ）で持つ理由まで。","2026-06-21",[13,14,15,16,17],"C#","FM音源","音声合成","DSP","SoundMaker",1,2,{"loc":5,"lastmod":11,"priority":18},{"type":22,"children":23,"toc":1673},"root",[24,32,54,59,76,82,95,123,529,549,568,574,586,998,1010,1018,1063,1068,1111,1554,1572,1581,1587,1592,1597,1602,1607,1651,1667],{"type":25,"tag":26,"props":27,"children":29},"element","h2",{"id":28},"はじめに",[30],{"type":31,"value":28},"text",{"type":25,"tag":33,"props":34,"children":35},"p",{},[36,43,45,52],{"type":25,"tag":37,"props":38,"children":40},"a",{"href":39},"/articles/tech/blazor/fm-synthesis-basics",[41],{"type":31,"value":42},"前回",{"type":31,"value":44},"はFM音源の原理を、式 ",{"type":25,"tag":46,"props":47,"children":49},"code",{"className":48},[],[50],{"type":31,"value":51},"out = sin(2π·fc·t + I·sin(2π·fm·t))",{"type":31,"value":53}," 1本だけで説明しました。今回はその式を、そのままC#のコードに落とします。",{"type":25,"tag":33,"props":55,"children":56},{},[57],{"type":31,"value":58},"ゴールはひとつだけ。キャリアとモジュレータの2個のサイン波（2オペレータ）で、実際に鳴る1音のPCM波形を生成することです。アルゴリズム（接続の組み合わせ）やオペレータを増やす話はまだ出しません。それは次回以降の領分で、今回は「最小のFM音源」に集中します。",{"type":25,"tag":60,"props":61,"children":62},"summary-box",{},[63],{"type":25,"tag":33,"props":64,"children":65},{},[66,68,74],{"type":31,"value":67},"オペレータを「位相を持ち、毎サンプル位相を進めてsinを引く1ユニット」として設計します。モジュレータのsin出力をキャリアの位相に足し込めば、それが前回の式そのものです。サンプル単位のループで位相を ",{"type":25,"tag":46,"props":69,"children":71},{"className":70},[],[72],{"type":31,"value":73},"phase += freq / sampleRate",{"type":31,"value":75}," ずつ進めながら値を埋めていくと、1音分のPCMバッファが完成します。音量・エンベロープは固定にして、まずは「鳴る」ことを最優先にします。",{"type":25,"tag":26,"props":77,"children":79},{"id":78},"オペレータは位相を進めてsinを引くだけ",[80],{"type":31,"value":81},"オペレータは「位相を進めてsinを引く」だけ",{"type":25,"tag":33,"props":83,"children":84},{},[85,87,93],{"type":31,"value":86},"FM音源の部品はオペレータと呼ばれます。難しそうな名前ですが、やることは1つです。自分の位相（phase）を毎サンプル少しずつ進めて、その位相の ",{"type":25,"tag":46,"props":88,"children":90},{"className":89},[],[91],{"type":31,"value":92},"sin",{"type":31,"value":94}," を返す。それだけです。",{"type":25,"tag":33,"props":96,"children":97},{},[98,100,106,108,114,116,121],{"type":31,"value":99},"オペレータが持つ状態は、現在の位相と、自分の周波数です。ここで周波数は絶対値ではなく、基準となる音の高さ（ピッチ）に対する比 ",{"type":25,"tag":46,"props":101,"children":103},{"className":102},[],[104],{"type":31,"value":105},"Ratio",{"type":31,"value":107}," で持ちます。前回触れたとおり、こうしないと音の高さを変えたときに音色が崩れるからです。基準周波数 ",{"type":25,"tag":46,"props":109,"children":111},{"className":110},[],[112],{"type":31,"value":113},"hertz",{"type":31,"value":115}," に ",{"type":25,"tag":46,"props":117,"children":119},{"className":118},[],[120],{"type":31,"value":105},{"type":31,"value":122}," を掛けたものが、そのオペレータの実際の周波数になります。",{"type":25,"tag":124,"props":125,"children":129},"pre",{"code":126,"language":127,"meta":8,"className":128,"style":8},"// 1つのサイン波ユニット。状態は「位相」だけ。\npublic class FmOperator\n{\n    // 基準周波数に対する周波数比。1.0 ならピッチそのまま、2.0 なら1オクターブ上。\n    public double Ratio { get; set; } = 1.0;\n\n    private double _phase;\n\n    // 1サンプル分、位相を進める。phaseModulation がFM変調の入力。\n    public double Next(double baseHertz, int sampleRate, double phaseModulation)\n    {\n        var value = Math.Sin(2 * Math.PI * _phase + phaseModulation);\n        _phase += baseHertz * Ratio / sampleRate;\n        return value;\n    }\n}\n","csharp","language-csharp shiki shiki-themes vitesse-dark",[130],{"type":25,"tag":46,"props":131,"children":132},{"__ignoreMap":8},[133,144,164,174,183,249,259,281,289,298,363,372,455,494,511,520],{"type":25,"tag":134,"props":135,"children":137},"span",{"class":136,"line":18},"line",[138],{"type":25,"tag":134,"props":139,"children":141},{"style":140},"--shiki-default:#758575DD",[142],{"type":31,"value":143},"// 1つのサイン波ユニット。状態は「位相」だけ。\n",{"type":25,"tag":134,"props":145,"children":146},{"class":136,"line":19},[147,153,158],{"type":25,"tag":134,"props":148,"children":150},{"style":149},"--shiki-default:#CB7676",[151],{"type":31,"value":152},"public",{"type":25,"tag":134,"props":154,"children":155},{"style":149},[156],{"type":31,"value":157}," class",{"type":25,"tag":134,"props":159,"children":161},{"style":160},"--shiki-default:#5DA994",[162],{"type":31,"value":163}," FmOperator\n",{"type":25,"tag":134,"props":165,"children":167},{"class":136,"line":166},3,[168],{"type":25,"tag":134,"props":169,"children":171},{"style":170},"--shiki-default:#666666",[172],{"type":31,"value":173},"{\n",{"type":25,"tag":134,"props":175,"children":177},{"class":136,"line":176},4,[178],{"type":25,"tag":134,"props":179,"children":180},{"style":140},[181],{"type":31,"value":182},"    // 基準周波数に対する周波数比。1.0 ならピッチそのまま、2.0 なら1オクターブ上。\n",{"type":25,"tag":134,"props":184,"children":186},{"class":136,"line":185},5,[187,192,198,204,209,214,219,224,228,233,238,244],{"type":25,"tag":134,"props":188,"children":189},{"style":149},[190],{"type":31,"value":191},"    public",{"type":25,"tag":134,"props":193,"children":195},{"style":194},"--shiki-default:#4D9375",[196],{"type":31,"value":197}," double",{"type":25,"tag":134,"props":199,"children":201},{"style":200},"--shiki-default:#80A665",[202],{"type":31,"value":203}," Ratio",{"type":25,"tag":134,"props":205,"children":206},{"style":170},[207],{"type":31,"value":208}," {",{"type":25,"tag":134,"props":210,"children":211},{"style":149},[212],{"type":31,"value":213}," get",{"type":25,"tag":134,"props":215,"children":216},{"style":170},[217],{"type":31,"value":218},";",{"type":25,"tag":134,"props":220,"children":221},{"style":149},[222],{"type":31,"value":223}," set",{"type":25,"tag":134,"props":225,"children":226},{"style":170},[227],{"type":31,"value":218},{"type":25,"tag":134,"props":229,"children":230},{"style":170},[231],{"type":31,"value":232}," }",{"type":25,"tag":134,"props":234,"children":235},{"style":170},[236],{"type":31,"value":237}," =",{"type":25,"tag":134,"props":239,"children":241},{"style":240},"--shiki-default:#4C9A91",[242],{"type":31,"value":243}," 1.0",{"type":25,"tag":134,"props":245,"children":246},{"style":170},[247],{"type":31,"value":248},";\n",{"type":25,"tag":134,"props":250,"children":252},{"class":136,"line":251},6,[253],{"type":25,"tag":134,"props":254,"children":256},{"emptyLinePlaceholder":255},true,[257],{"type":31,"value":258},"\n",{"type":25,"tag":134,"props":260,"children":262},{"class":136,"line":261},7,[263,268,272,277],{"type":25,"tag":134,"props":264,"children":265},{"style":149},[266],{"type":31,"value":267},"    private",{"type":25,"tag":134,"props":269,"children":270},{"style":194},[271],{"type":31,"value":197},{"type":25,"tag":134,"props":273,"children":274},{"style":200},[275],{"type":31,"value":276}," _phase",{"type":25,"tag":134,"props":278,"children":279},{"style":170},[280],{"type":31,"value":248},{"type":25,"tag":134,"props":282,"children":284},{"class":136,"line":283},8,[285],{"type":25,"tag":134,"props":286,"children":287},{"emptyLinePlaceholder":255},[288],{"type":31,"value":258},{"type":25,"tag":134,"props":290,"children":292},{"class":136,"line":291},9,[293],{"type":25,"tag":134,"props":294,"children":295},{"style":140},[296],{"type":31,"value":297},"    // 1サンプル分、位相を進める。phaseModulation がFM変調の入力。\n",{"type":25,"tag":134,"props":299,"children":301},{"class":136,"line":300},10,[302,306,310,315,320,325,330,335,340,345,349,353,358],{"type":25,"tag":134,"props":303,"children":304},{"style":149},[305],{"type":31,"value":191},{"type":25,"tag":134,"props":307,"children":308},{"style":194},[309],{"type":31,"value":197},{"type":25,"tag":134,"props":311,"children":312},{"style":200},[313],{"type":31,"value":314}," Next",{"type":25,"tag":134,"props":316,"children":317},{"style":170},[318],{"type":31,"value":319},"(",{"type":25,"tag":134,"props":321,"children":322},{"style":194},[323],{"type":31,"value":324},"double",{"type":25,"tag":134,"props":326,"children":327},{"style":200},[328],{"type":31,"value":329}," baseHertz",{"type":25,"tag":134,"props":331,"children":332},{"style":170},[333],{"type":31,"value":334},",",{"type":25,"tag":134,"props":336,"children":337},{"style":194},[338],{"type":31,"value":339}," int",{"type":25,"tag":134,"props":341,"children":342},{"style":200},[343],{"type":31,"value":344}," sampleRate",{"type":25,"tag":134,"props":346,"children":347},{"style":170},[348],{"type":31,"value":334},{"type":25,"tag":134,"props":350,"children":351},{"style":194},[352],{"type":31,"value":197},{"type":25,"tag":134,"props":354,"children":355},{"style":200},[356],{"type":31,"value":357}," phaseModulation",{"type":25,"tag":134,"props":359,"children":360},{"style":170},[361],{"type":31,"value":362},")\n",{"type":25,"tag":134,"props":364,"children":366},{"class":136,"line":365},11,[367],{"type":25,"tag":134,"props":368,"children":369},{"style":170},[370],{"type":31,"value":371},"    {\n",{"type":25,"tag":134,"props":373,"children":375},{"class":136,"line":374},12,[376,381,386,390,396,401,406,410,415,420,424,428,433,437,441,446,450],{"type":25,"tag":134,"props":377,"children":378},{"style":149},[379],{"type":31,"value":380},"        var",{"type":25,"tag":134,"props":382,"children":383},{"style":200},[384],{"type":31,"value":385}," value",{"type":25,"tag":134,"props":387,"children":388},{"style":170},[389],{"type":31,"value":237},{"type":25,"tag":134,"props":391,"children":393},{"style":392},"--shiki-default:#BD976A",[394],{"type":31,"value":395}," Math",{"type":25,"tag":134,"props":397,"children":398},{"style":170},[399],{"type":31,"value":400},".",{"type":25,"tag":134,"props":402,"children":403},{"style":200},[404],{"type":31,"value":405},"Sin",{"type":25,"tag":134,"props":407,"children":408},{"style":170},[409],{"type":31,"value":319},{"type":25,"tag":134,"props":411,"children":412},{"style":240},[413],{"type":31,"value":414},"2",{"type":25,"tag":134,"props":416,"children":417},{"style":149},[418],{"type":31,"value":419}," *",{"type":25,"tag":134,"props":421,"children":422},{"style":392},[423],{"type":31,"value":395},{"type":25,"tag":134,"props":425,"children":426},{"style":170},[427],{"type":31,"value":400},{"type":25,"tag":134,"props":429,"children":430},{"style":392},[431],{"type":31,"value":432},"PI",{"type":25,"tag":134,"props":434,"children":435},{"style":149},[436],{"type":31,"value":419},{"type":25,"tag":134,"props":438,"children":439},{"style":392},[440],{"type":31,"value":276},{"type":25,"tag":134,"props":442,"children":443},{"style":149},[444],{"type":31,"value":445}," +",{"type":25,"tag":134,"props":447,"children":448},{"style":392},[449],{"type":31,"value":357},{"type":25,"tag":134,"props":451,"children":452},{"style":170},[453],{"type":31,"value":454},");\n",{"type":25,"tag":134,"props":456,"children":458},{"class":136,"line":457},13,[459,464,469,473,477,481,486,490],{"type":25,"tag":134,"props":460,"children":461},{"style":392},[462],{"type":31,"value":463},"        _phase",{"type":25,"tag":134,"props":465,"children":466},{"style":149},[467],{"type":31,"value":468}," +=",{"type":25,"tag":134,"props":470,"children":471},{"style":392},[472],{"type":31,"value":329},{"type":25,"tag":134,"props":474,"children":475},{"style":149},[476],{"type":31,"value":419},{"type":25,"tag":134,"props":478,"children":479},{"style":392},[480],{"type":31,"value":203},{"type":25,"tag":134,"props":482,"children":483},{"style":149},[484],{"type":31,"value":485}," /",{"type":25,"tag":134,"props":487,"children":488},{"style":392},[489],{"type":31,"value":344},{"type":25,"tag":134,"props":491,"children":492},{"style":170},[493],{"type":31,"value":248},{"type":25,"tag":134,"props":495,"children":497},{"class":136,"line":496},14,[498,503,507],{"type":25,"tag":134,"props":499,"children":500},{"style":194},[501],{"type":31,"value":502},"        return",{"type":25,"tag":134,"props":504,"children":505},{"style":392},[506],{"type":31,"value":385},{"type":25,"tag":134,"props":508,"children":509},{"style":170},[510],{"type":31,"value":248},{"type":25,"tag":134,"props":512,"children":514},{"class":136,"line":513},15,[515],{"type":25,"tag":134,"props":516,"children":517},{"style":170},[518],{"type":31,"value":519},"    }\n",{"type":25,"tag":134,"props":521,"children":523},{"class":136,"line":522},16,[524],{"type":25,"tag":134,"props":525,"children":526},{"style":170},[527],{"type":31,"value":528},"}\n",{"type":25,"tag":33,"props":530,"children":531},{},[532,534,539,541,547],{"type":31,"value":533},"位相を ",{"type":25,"tag":46,"props":535,"children":537},{"className":536},[],[538],{"type":31,"value":105},{"type":31,"value":540}," で決まる量だけ毎サンプル足していくこの操作を、位相累算（phase accumulation）と呼びます。",{"type":25,"tag":46,"props":542,"children":544},{"className":543},[],[545],{"type":31,"value":546},"baseHertz * Ratio / sampleRate",{"type":31,"value":548}," が「1サンプルあたりに進む位相の量」です。たとえばサンプリングレートが44100Hzで、周波数440Hzのサイン波なら、1秒（44100サンプル）かけて位相がちょうど440周します。",{"type":25,"tag":33,"props":550,"children":551},{},[552,558,560,566],{"type":25,"tag":46,"props":553,"children":555},{"className":554},[],[556],{"type":31,"value":557},"Next",{"type":31,"value":559}," の引数 ",{"type":25,"tag":46,"props":561,"children":563},{"className":562},[],[564],{"type":31,"value":565},"phaseModulation",{"type":31,"value":567}," が、FM音源の心臓です。ここに何か値を足し込むと、その瞬間だけ位相が前後にズレ、結果として周波数が揺さぶられます。何も足さなければ（0なら）、ただの素のサイン波です。",{"type":25,"tag":26,"props":569,"children":571},{"id":570},"_2個を直列に繋ぐ-前回の式",[572],{"type":31,"value":573},"2個を直列に繋ぐ ＝ 前回の式",{"type":25,"tag":33,"props":575,"children":576},{},[577,579,584],{"type":31,"value":578},"オペレータを2個用意します。1個をモジュレータ、もう1個をキャリアにして、モジュレータの出力をキャリアの ",{"type":25,"tag":46,"props":580,"children":582},{"className":581},[],[583],{"type":31,"value":565},{"type":31,"value":585}," に流し込む。これだけで2オペレータFMになります。",{"type":25,"tag":124,"props":587,"children":589},{"code":588,"language":127,"meta":8,"className":128,"style":8},"public class TwoOperatorFm\n{\n    private readonly FmOperator _modulator = new() { Ratio = 1.0 };\n    private readonly FmOperator _carrier = new() { Ratio = 1.0 };\n\n    // 変調指数 I。倍音の豊かさを決める。\n    public double ModulationIndex { get; set; } = 2.0;\n\n    public double Next(double baseHertz, int sampleRate)\n    {\n        // モジュレータは素のサイン波（変調入力なし）\n        var mod = _modulator.Next(baseHertz, sampleRate, 0) * ModulationIndex;\n        // キャリアの位相に mod を足し込む = 周波数変調\n        return _carrier.Next(baseHertz, sampleRate, mod);\n    }\n}\n",[590],{"type":25,"tag":46,"props":591,"children":592},{"__ignoreMap":8},[593,609,616,673,725,732,740,793,800,843,850,858,929,937,984,991],{"type":25,"tag":134,"props":594,"children":595},{"class":136,"line":18},[596,600,604],{"type":25,"tag":134,"props":597,"children":598},{"style":149},[599],{"type":31,"value":152},{"type":25,"tag":134,"props":601,"children":602},{"style":149},[603],{"type":31,"value":157},{"type":25,"tag":134,"props":605,"children":606},{"style":160},[607],{"type":31,"value":608}," TwoOperatorFm\n",{"type":25,"tag":134,"props":610,"children":611},{"class":136,"line":19},[612],{"type":25,"tag":134,"props":613,"children":614},{"style":170},[615],{"type":31,"value":173},{"type":25,"tag":134,"props":617,"children":618},{"class":136,"line":166},[619,623,628,633,638,642,647,652,656,660,664,668],{"type":25,"tag":134,"props":620,"children":621},{"style":149},[622],{"type":31,"value":267},{"type":25,"tag":134,"props":624,"children":625},{"style":149},[626],{"type":31,"value":627}," readonly",{"type":25,"tag":134,"props":629,"children":630},{"style":160},[631],{"type":31,"value":632}," FmOperator",{"type":25,"tag":134,"props":634,"children":635},{"style":200},[636],{"type":31,"value":637}," _modulator",{"type":25,"tag":134,"props":639,"children":640},{"style":170},[641],{"type":31,"value":237},{"type":25,"tag":134,"props":643,"children":644},{"style":149},[645],{"type":31,"value":646}," new",{"type":25,"tag":134,"props":648,"children":649},{"style":170},[650],{"type":31,"value":651},"()",{"type":25,"tag":134,"props":653,"children":654},{"style":170},[655],{"type":31,"value":208},{"type":25,"tag":134,"props":657,"children":658},{"style":392},[659],{"type":31,"value":203},{"type":25,"tag":134,"props":661,"children":662},{"style":170},[663],{"type":31,"value":237},{"type":25,"tag":134,"props":665,"children":666},{"style":240},[667],{"type":31,"value":243},{"type":25,"tag":134,"props":669,"children":670},{"style":170},[671],{"type":31,"value":672}," };\n",{"type":25,"tag":134,"props":674,"children":675},{"class":136,"line":176},[676,680,684,688,693,697,701,705,709,713,717,721],{"type":25,"tag":134,"props":677,"children":678},{"style":149},[679],{"type":31,"value":267},{"type":25,"tag":134,"props":681,"children":682},{"style":149},[683],{"type":31,"value":627},{"type":25,"tag":134,"props":685,"children":686},{"style":160},[687],{"type":31,"value":632},{"type":25,"tag":134,"props":689,"children":690},{"style":200},[691],{"type":31,"value":692}," _carrier",{"type":25,"tag":134,"props":694,"children":695},{"style":170},[696],{"type":31,"value":237},{"type":25,"tag":134,"props":698,"children":699},{"style":149},[700],{"type":31,"value":646},{"type":25,"tag":134,"props":702,"children":703},{"style":170},[704],{"type":31,"value":651},{"type":25,"tag":134,"props":706,"children":707},{"style":170},[708],{"type":31,"value":208},{"type":25,"tag":134,"props":710,"children":711},{"style":392},[712],{"type":31,"value":203},{"type":25,"tag":134,"props":714,"children":715},{"style":170},[716],{"type":31,"value":237},{"type":25,"tag":134,"props":718,"children":719},{"style":240},[720],{"type":31,"value":243},{"type":25,"tag":134,"props":722,"children":723},{"style":170},[724],{"type":31,"value":672},{"type":25,"tag":134,"props":726,"children":727},{"class":136,"line":185},[728],{"type":25,"tag":134,"props":729,"children":730},{"emptyLinePlaceholder":255},[731],{"type":31,"value":258},{"type":25,"tag":134,"props":733,"children":734},{"class":136,"line":251},[735],{"type":25,"tag":134,"props":736,"children":737},{"style":140},[738],{"type":31,"value":739},"    // 変調指数 I。倍音の豊かさを決める。\n",{"type":25,"tag":134,"props":741,"children":742},{"class":136,"line":261},[743,747,751,756,760,764,768,772,776,780,784,789],{"type":25,"tag":134,"props":744,"children":745},{"style":149},[746],{"type":31,"value":191},{"type":25,"tag":134,"props":748,"children":749},{"style":194},[750],{"type":31,"value":197},{"type":25,"tag":134,"props":752,"children":753},{"style":200},[754],{"type":31,"value":755}," ModulationIndex",{"type":25,"tag":134,"props":757,"children":758},{"style":170},[759],{"type":31,"value":208},{"type":25,"tag":134,"props":761,"children":762},{"style":149},[763],{"type":31,"value":213},{"type":25,"tag":134,"props":765,"children":766},{"style":170},[767],{"type":31,"value":218},{"type":25,"tag":134,"props":769,"children":770},{"style":149},[771],{"type":31,"value":223},{"type":25,"tag":134,"props":773,"children":774},{"style":170},[775],{"type":31,"value":218},{"type":25,"tag":134,"props":777,"children":778},{"style":170},[779],{"type":31,"value":232},{"type":25,"tag":134,"props":781,"children":782},{"style":170},[783],{"type":31,"value":237},{"type":25,"tag":134,"props":785,"children":786},{"style":240},[787],{"type":31,"value":788}," 2.0",{"type":25,"tag":134,"props":790,"children":791},{"style":170},[792],{"type":31,"value":248},{"type":25,"tag":134,"props":794,"children":795},{"class":136,"line":283},[796],{"type":25,"tag":134,"props":797,"children":798},{"emptyLinePlaceholder":255},[799],{"type":31,"value":258},{"type":25,"tag":134,"props":801,"children":802},{"class":136,"line":291},[803,807,811,815,819,823,827,831,835,839],{"type":25,"tag":134,"props":804,"children":805},{"style":149},[806],{"type":31,"value":191},{"type":25,"tag":134,"props":808,"children":809},{"style":194},[810],{"type":31,"value":197},{"type":25,"tag":134,"props":812,"children":813},{"style":200},[814],{"type":31,"value":314},{"type":25,"tag":134,"props":816,"children":817},{"style":170},[818],{"type":31,"value":319},{"type":25,"tag":134,"props":820,"children":821},{"style":194},[822],{"type":31,"value":324},{"type":25,"tag":134,"props":824,"children":825},{"style":200},[826],{"type":31,"value":329},{"type":25,"tag":134,"props":828,"children":829},{"style":170},[830],{"type":31,"value":334},{"type":25,"tag":134,"props":832,"children":833},{"style":194},[834],{"type":31,"value":339},{"type":25,"tag":134,"props":836,"children":837},{"style":200},[838],{"type":31,"value":344},{"type":25,"tag":134,"props":840,"children":841},{"style":170},[842],{"type":31,"value":362},{"type":25,"tag":134,"props":844,"children":845},{"class":136,"line":300},[846],{"type":25,"tag":134,"props":847,"children":848},{"style":170},[849],{"type":31,"value":371},{"type":25,"tag":134,"props":851,"children":852},{"class":136,"line":365},[853],{"type":25,"tag":134,"props":854,"children":855},{"style":140},[856],{"type":31,"value":857},"        // モジュレータは素のサイン波（変調入力なし）\n",{"type":25,"tag":134,"props":859,"children":860},{"class":136,"line":374},[861,865,870,874,878,882,886,890,895,899,903,907,912,917,921,925],{"type":25,"tag":134,"props":862,"children":863},{"style":149},[864],{"type":31,"value":380},{"type":25,"tag":134,"props":866,"children":867},{"style":200},[868],{"type":31,"value":869}," mod",{"type":25,"tag":134,"props":871,"children":872},{"style":170},[873],{"type":31,"value":237},{"type":25,"tag":134,"props":875,"children":876},{"style":392},[877],{"type":31,"value":637},{"type":25,"tag":134,"props":879,"children":880},{"style":170},[881],{"type":31,"value":400},{"type":25,"tag":134,"props":883,"children":884},{"style":200},[885],{"type":31,"value":557},{"type":25,"tag":134,"props":887,"children":888},{"style":170},[889],{"type":31,"value":319},{"type":25,"tag":134,"props":891,"children":892},{"style":392},[893],{"type":31,"value":894},"baseHertz",{"type":25,"tag":134,"props":896,"children":897},{"style":170},[898],{"type":31,"value":334},{"type":25,"tag":134,"props":900,"children":901},{"style":392},[902],{"type":31,"value":344},{"type":25,"tag":134,"props":904,"children":905},{"style":170},[906],{"type":31,"value":334},{"type":25,"tag":134,"props":908,"children":909},{"style":240},[910],{"type":31,"value":911}," 0",{"type":25,"tag":134,"props":913,"children":914},{"style":170},[915],{"type":31,"value":916},")",{"type":25,"tag":134,"props":918,"children":919},{"style":149},[920],{"type":31,"value":419},{"type":25,"tag":134,"props":922,"children":923},{"style":392},[924],{"type":31,"value":755},{"type":25,"tag":134,"props":926,"children":927},{"style":170},[928],{"type":31,"value":248},{"type":25,"tag":134,"props":930,"children":931},{"class":136,"line":457},[932],{"type":25,"tag":134,"props":933,"children":934},{"style":140},[935],{"type":31,"value":936},"        // キャリアの位相に mod を足し込む = 周波数変調\n",{"type":25,"tag":134,"props":938,"children":939},{"class":136,"line":496},[940,944,948,952,956,960,964,968,972,976,980],{"type":25,"tag":134,"props":941,"children":942},{"style":194},[943],{"type":31,"value":502},{"type":25,"tag":134,"props":945,"children":946},{"style":392},[947],{"type":31,"value":692},{"type":25,"tag":134,"props":949,"children":950},{"style":170},[951],{"type":31,"value":400},{"type":25,"tag":134,"props":953,"children":954},{"style":200},[955],{"type":31,"value":557},{"type":25,"tag":134,"props":957,"children":958},{"style":170},[959],{"type":31,"value":319},{"type":25,"tag":134,"props":961,"children":962},{"style":392},[963],{"type":31,"value":894},{"type":25,"tag":134,"props":965,"children":966},{"style":170},[967],{"type":31,"value":334},{"type":25,"tag":134,"props":969,"children":970},{"style":392},[971],{"type":31,"value":344},{"type":25,"tag":134,"props":973,"children":974},{"style":170},[975],{"type":31,"value":334},{"type":25,"tag":134,"props":977,"children":978},{"style":392},[979],{"type":31,"value":869},{"type":25,"tag":134,"props":981,"children":982},{"style":170},[983],{"type":31,"value":454},{"type":25,"tag":134,"props":985,"children":986},{"class":136,"line":513},[987],{"type":25,"tag":134,"props":988,"children":989},{"style":170},[990],{"type":31,"value":519},{"type":25,"tag":134,"props":992,"children":993},{"class":136,"line":522},[994],{"type":25,"tag":134,"props":995,"children":996},{"style":170},[997],{"type":31,"value":528},{"type":25,"tag":33,"props":999,"children":1000},{},[1001,1003,1008],{"type":31,"value":1002},"この ",{"type":25,"tag":46,"props":1004,"children":1006},{"className":1005},[],[1007],{"type":31,"value":557},{"type":31,"value":1009}," の中身を1行で表すと、",{"type":25,"tag":124,"props":1011,"children":1013},{"code":1012},"out = sin(2π·(fc)·t + I·sin(2π·(fm)·t))\n",[1014],{"type":25,"tag":46,"props":1015,"children":1016},{"__ignoreMap":8},[1017],{"type":31,"value":1012},{"type":25,"tag":33,"props":1019,"children":1020},{},[1021,1023,1029,1031,1037,1039,1045,1047,1053,1055,1061],{"type":31,"value":1022},"になります。",{"type":25,"tag":46,"props":1024,"children":1026},{"className":1025},[],[1027],{"type":31,"value":1028},"_carrier",{"type":31,"value":1030}," の位相が ",{"type":25,"tag":46,"props":1032,"children":1034},{"className":1033},[],[1035],{"type":31,"value":1036},"2π·fc·t",{"type":31,"value":1038}," に、",{"type":25,"tag":46,"props":1040,"children":1042},{"className":1041},[],[1043],{"type":31,"value":1044},"mod",{"type":31,"value":1046},"（＝",{"type":25,"tag":46,"props":1048,"children":1050},{"className":1049},[],[1051],{"type":31,"value":1052},"I·sin(2π·fm·t)",{"type":31,"value":1054},"）がキャリアへの変調入力に対応します。前回の式が、そっくりそのままコードになっているのが見て取れるはずです。",{"type":25,"tag":46,"props":1056,"children":1058},{"className":1057},[],[1059],{"type":31,"value":1060},"ModulationIndex",{"type":31,"value":1062}," が大きいほどキャリアの位相が大きく揺さぶられ、倍音が豊かになります。",{"type":25,"tag":26,"props":1064,"children":1066},{"id":1065},"サンプル単位のループで1音を埋める",[1067],{"type":31,"value":1065},{"type":25,"tag":33,"props":1069,"children":1070},{},[1071,1073,1078,1080,1086,1088,1093,1095,1101,1103,1109],{"type":31,"value":1072},"あとは、欲しい長さ（サンプル数）のバッファを用意して、",{"type":25,"tag":46,"props":1074,"children":1076},{"className":1075},[],[1077],{"type":31,"value":557},{"type":31,"value":1079}," を呼び続けて埋めるだけです。出力は ",{"type":25,"tag":46,"props":1081,"children":1083},{"className":1082},[],[1084],{"type":31,"value":1085},"-1.0〜1.0",{"type":31,"value":1087}," の ",{"type":25,"tag":46,"props":1089,"children":1091},{"className":1090},[],[1092],{"type":31,"value":324},{"type":31,"value":1094}," なので、16bit PCM（",{"type":25,"tag":46,"props":1096,"children":1098},{"className":1097},[],[1099],{"type":31,"value":1100},"short",{"type":31,"value":1102},"）に変換するために ",{"type":25,"tag":46,"props":1104,"children":1106},{"className":1105},[],[1107],{"type":31,"value":1108},"short.MaxValue",{"type":31,"value":1110}," を掛けます。",{"type":25,"tag":124,"props":1112,"children":1114},{"code":1113,"language":127,"meta":8,"className":128,"style":8},"public static short[] Generate2OpFm(double hertz, int sampleRate, int length, int volume)\n{\n    var fm = new TwoOperatorFm { ModulationIndex = 2.0 };\n    var result = new short[length];\n    var volumeMagnification = volume / 100d;\n\n    for (var i = 0; i \u003C length; i++)\n    {\n        var sample = fm.Next(hertz, sampleRate);\n        result[i] = (short)(short.MaxValue * volumeMagnification * sample);\n    }\n    return result;\n}\n",[1115],{"type":25,"tag":46,"props":1116,"children":1117},{"__ignoreMap":8},[1118,1200,1207,1253,1292,1325,1332,1397,1404,1452,1524,1531,1547],{"type":25,"tag":134,"props":1119,"children":1120},{"class":136,"line":18},[1121,1125,1130,1135,1140,1145,1149,1153,1158,1162,1166,1170,1174,1178,1183,1187,1191,1196],{"type":25,"tag":134,"props":1122,"children":1123},{"style":149},[1124],{"type":31,"value":152},{"type":25,"tag":134,"props":1126,"children":1127},{"style":149},[1128],{"type":31,"value":1129}," static",{"type":25,"tag":134,"props":1131,"children":1132},{"style":194},[1133],{"type":31,"value":1134}," short",{"type":25,"tag":134,"props":1136,"children":1137},{"style":170},[1138],{"type":31,"value":1139},"[]",{"type":25,"tag":134,"props":1141,"children":1142},{"style":200},[1143],{"type":31,"value":1144}," Generate2OpFm",{"type":25,"tag":134,"props":1146,"children":1147},{"style":170},[1148],{"type":31,"value":319},{"type":25,"tag":134,"props":1150,"children":1151},{"style":194},[1152],{"type":31,"value":324},{"type":25,"tag":134,"props":1154,"children":1155},{"style":200},[1156],{"type":31,"value":1157}," hertz",{"type":25,"tag":134,"props":1159,"children":1160},{"style":170},[1161],{"type":31,"value":334},{"type":25,"tag":134,"props":1163,"children":1164},{"style":194},[1165],{"type":31,"value":339},{"type":25,"tag":134,"props":1167,"children":1168},{"style":200},[1169],{"type":31,"value":344},{"type":25,"tag":134,"props":1171,"children":1172},{"style":170},[1173],{"type":31,"value":334},{"type":25,"tag":134,"props":1175,"children":1176},{"style":194},[1177],{"type":31,"value":339},{"type":25,"tag":134,"props":1179,"children":1180},{"style":200},[1181],{"type":31,"value":1182}," length",{"type":25,"tag":134,"props":1184,"children":1185},{"style":170},[1186],{"type":31,"value":334},{"type":25,"tag":134,"props":1188,"children":1189},{"style":194},[1190],{"type":31,"value":339},{"type":25,"tag":134,"props":1192,"children":1193},{"style":200},[1194],{"type":31,"value":1195}," volume",{"type":25,"tag":134,"props":1197,"children":1198},{"style":170},[1199],{"type":31,"value":362},{"type":25,"tag":134,"props":1201,"children":1202},{"class":136,"line":19},[1203],{"type":25,"tag":134,"props":1204,"children":1205},{"style":170},[1206],{"type":31,"value":173},{"type":25,"tag":134,"props":1208,"children":1209},{"class":136,"line":166},[1210,1215,1220,1224,1228,1233,1237,1241,1245,1249],{"type":25,"tag":134,"props":1211,"children":1212},{"style":149},[1213],{"type":31,"value":1214},"    var",{"type":25,"tag":134,"props":1216,"children":1217},{"style":200},[1218],{"type":31,"value":1219}," fm",{"type":25,"tag":134,"props":1221,"children":1222},{"style":170},[1223],{"type":31,"value":237},{"type":25,"tag":134,"props":1225,"children":1226},{"style":149},[1227],{"type":31,"value":646},{"type":25,"tag":134,"props":1229,"children":1230},{"style":160},[1231],{"type":31,"value":1232}," TwoOperatorFm",{"type":25,"tag":134,"props":1234,"children":1235},{"style":170},[1236],{"type":31,"value":208},{"type":25,"tag":134,"props":1238,"children":1239},{"style":392},[1240],{"type":31,"value":755},{"type":25,"tag":134,"props":1242,"children":1243},{"style":170},[1244],{"type":31,"value":237},{"type":25,"tag":134,"props":1246,"children":1247},{"style":240},[1248],{"type":31,"value":788},{"type":25,"tag":134,"props":1250,"children":1251},{"style":170},[1252],{"type":31,"value":672},{"type":25,"tag":134,"props":1254,"children":1255},{"class":136,"line":176},[1256,1260,1265,1269,1273,1277,1282,1287],{"type":25,"tag":134,"props":1257,"children":1258},{"style":149},[1259],{"type":31,"value":1214},{"type":25,"tag":134,"props":1261,"children":1262},{"style":200},[1263],{"type":31,"value":1264}," result",{"type":25,"tag":134,"props":1266,"children":1267},{"style":170},[1268],{"type":31,"value":237},{"type":25,"tag":134,"props":1270,"children":1271},{"style":149},[1272],{"type":31,"value":646},{"type":25,"tag":134,"props":1274,"children":1275},{"style":194},[1276],{"type":31,"value":1134},{"type":25,"tag":134,"props":1278,"children":1279},{"style":170},[1280],{"type":31,"value":1281},"[",{"type":25,"tag":134,"props":1283,"children":1284},{"style":392},[1285],{"type":31,"value":1286},"length",{"type":25,"tag":134,"props":1288,"children":1289},{"style":170},[1290],{"type":31,"value":1291},"];\n",{"type":25,"tag":134,"props":1293,"children":1294},{"class":136,"line":185},[1295,1299,1304,1308,1312,1316,1321],{"type":25,"tag":134,"props":1296,"children":1297},{"style":149},[1298],{"type":31,"value":1214},{"type":25,"tag":134,"props":1300,"children":1301},{"style":200},[1302],{"type":31,"value":1303}," volumeMagnification",{"type":25,"tag":134,"props":1305,"children":1306},{"style":170},[1307],{"type":31,"value":237},{"type":25,"tag":134,"props":1309,"children":1310},{"style":392},[1311],{"type":31,"value":1195},{"type":25,"tag":134,"props":1313,"children":1314},{"style":149},[1315],{"type":31,"value":485},{"type":25,"tag":134,"props":1317,"children":1318},{"style":240},[1319],{"type":31,"value":1320}," 100d",{"type":25,"tag":134,"props":1322,"children":1323},{"style":170},[1324],{"type":31,"value":248},{"type":25,"tag":134,"props":1326,"children":1327},{"class":136,"line":251},[1328],{"type":25,"tag":134,"props":1329,"children":1330},{"emptyLinePlaceholder":255},[1331],{"type":31,"value":258},{"type":25,"tag":134,"props":1333,"children":1334},{"class":136,"line":261},[1335,1340,1345,1350,1355,1359,1363,1367,1371,1376,1380,1384,1388,1393],{"type":25,"tag":134,"props":1336,"children":1337},{"style":194},[1338],{"type":31,"value":1339},"    for",{"type":25,"tag":134,"props":1341,"children":1342},{"style":170},[1343],{"type":31,"value":1344}," (",{"type":25,"tag":134,"props":1346,"children":1347},{"style":149},[1348],{"type":31,"value":1349},"var",{"type":25,"tag":134,"props":1351,"children":1352},{"style":200},[1353],{"type":31,"value":1354}," i",{"type":25,"tag":134,"props":1356,"children":1357},{"style":170},[1358],{"type":31,"value":237},{"type":25,"tag":134,"props":1360,"children":1361},{"style":240},[1362],{"type":31,"value":911},{"type":25,"tag":134,"props":1364,"children":1365},{"style":170},[1366],{"type":31,"value":218},{"type":25,"tag":134,"props":1368,"children":1369},{"style":392},[1370],{"type":31,"value":1354},{"type":25,"tag":134,"props":1372,"children":1373},{"style":170},[1374],{"type":31,"value":1375}," \u003C",{"type":25,"tag":134,"props":1377,"children":1378},{"style":392},[1379],{"type":31,"value":1182},{"type":25,"tag":134,"props":1381,"children":1382},{"style":170},[1383],{"type":31,"value":218},{"type":25,"tag":134,"props":1385,"children":1386},{"style":392},[1387],{"type":31,"value":1354},{"type":25,"tag":134,"props":1389,"children":1390},{"style":149},[1391],{"type":31,"value":1392},"++",{"type":25,"tag":134,"props":1394,"children":1395},{"style":170},[1396],{"type":31,"value":362},{"type":25,"tag":134,"props":1398,"children":1399},{"class":136,"line":283},[1400],{"type":25,"tag":134,"props":1401,"children":1402},{"style":170},[1403],{"type":31,"value":371},{"type":25,"tag":134,"props":1405,"children":1406},{"class":136,"line":291},[1407,1411,1416,1420,1424,1428,1432,1436,1440,1444,1448],{"type":25,"tag":134,"props":1408,"children":1409},{"style":149},[1410],{"type":31,"value":380},{"type":25,"tag":134,"props":1412,"children":1413},{"style":200},[1414],{"type":31,"value":1415}," sample",{"type":25,"tag":134,"props":1417,"children":1418},{"style":170},[1419],{"type":31,"value":237},{"type":25,"tag":134,"props":1421,"children":1422},{"style":392},[1423],{"type":31,"value":1219},{"type":25,"tag":134,"props":1425,"children":1426},{"style":170},[1427],{"type":31,"value":400},{"type":25,"tag":134,"props":1429,"children":1430},{"style":200},[1431],{"type":31,"value":557},{"type":25,"tag":134,"props":1433,"children":1434},{"style":170},[1435],{"type":31,"value":319},{"type":25,"tag":134,"props":1437,"children":1438},{"style":392},[1439],{"type":31,"value":113},{"type":25,"tag":134,"props":1441,"children":1442},{"style":170},[1443],{"type":31,"value":334},{"type":25,"tag":134,"props":1445,"children":1446},{"style":392},[1447],{"type":31,"value":344},{"type":25,"tag":134,"props":1449,"children":1450},{"style":170},[1451],{"type":31,"value":454},{"type":25,"tag":134,"props":1453,"children":1454},{"class":136,"line":300},[1455,1460,1464,1469,1474,1478,1482,1486,1491,1495,1499,1504,1508,1512,1516,1520],{"type":25,"tag":134,"props":1456,"children":1457},{"style":392},[1458],{"type":31,"value":1459},"        result",{"type":25,"tag":134,"props":1461,"children":1462},{"style":170},[1463],{"type":31,"value":1281},{"type":25,"tag":134,"props":1465,"children":1466},{"style":392},[1467],{"type":31,"value":1468},"i",{"type":25,"tag":134,"props":1470,"children":1471},{"style":170},[1472],{"type":31,"value":1473},"]",{"type":25,"tag":134,"props":1475,"children":1476},{"style":170},[1477],{"type":31,"value":237},{"type":25,"tag":134,"props":1479,"children":1480},{"style":170},[1481],{"type":31,"value":1344},{"type":25,"tag":134,"props":1483,"children":1484},{"style":194},[1485],{"type":31,"value":1100},{"type":25,"tag":134,"props":1487,"children":1488},{"style":170},[1489],{"type":31,"value":1490},")(",{"type":25,"tag":134,"props":1492,"children":1493},{"style":194},[1494],{"type":31,"value":1100},{"type":25,"tag":134,"props":1496,"children":1497},{"style":170},[1498],{"type":31,"value":400},{"type":25,"tag":134,"props":1500,"children":1501},{"style":392},[1502],{"type":31,"value":1503},"MaxValue",{"type":25,"tag":134,"props":1505,"children":1506},{"style":149},[1507],{"type":31,"value":419},{"type":25,"tag":134,"props":1509,"children":1510},{"style":392},[1511],{"type":31,"value":1303},{"type":25,"tag":134,"props":1513,"children":1514},{"style":149},[1515],{"type":31,"value":419},{"type":25,"tag":134,"props":1517,"children":1518},{"style":392},[1519],{"type":31,"value":1415},{"type":25,"tag":134,"props":1521,"children":1522},{"style":170},[1523],{"type":31,"value":454},{"type":25,"tag":134,"props":1525,"children":1526},{"class":136,"line":365},[1527],{"type":25,"tag":134,"props":1528,"children":1529},{"style":170},[1530],{"type":31,"value":519},{"type":25,"tag":134,"props":1532,"children":1533},{"class":136,"line":374},[1534,1539,1543],{"type":25,"tag":134,"props":1535,"children":1536},{"style":194},[1537],{"type":31,"value":1538},"    return",{"type":25,"tag":134,"props":1540,"children":1541},{"style":392},[1542],{"type":31,"value":1264},{"type":25,"tag":134,"props":1544,"children":1545},{"style":170},[1546],{"type":31,"value":248},{"type":25,"tag":134,"props":1548,"children":1549},{"class":136,"line":457},[1550],{"type":25,"tag":134,"props":1551,"children":1552},{"style":170},[1553],{"type":31,"value":528},{"type":25,"tag":33,"props":1555,"children":1556},{},[1557,1562,1564,1570],{"type":25,"tag":46,"props":1558,"children":1560},{"className":1559},[],[1561],{"type":31,"value":1286},{"type":31,"value":1563}," は「鳴らしたい秒数 × サンプリングレート」で決まります。たとえば44100Hzで0.5秒なら22050サンプルです。このループを回すと、1音ぶんのFM波形が ",{"type":25,"tag":46,"props":1565,"children":1567},{"className":1566},[],[1568],{"type":31,"value":1569},"short[]",{"type":31,"value":1571}," に詰まります。これをWAVのデータ部に書き出せば、ブラウザやスピーカーで再生できます。PICOMでは、こうして作ったPCMをWAVバイナリに包んでWeb Audio APIで鳴らしています。",{"type":25,"tag":1573,"props":1574,"children":1575},"caution-box",{},[1576],{"type":25,"tag":33,"props":1577,"children":1578},{},[1579],{"type":31,"value":1580},"最小実装では音量を固定にしています。実際にはこのままだと音の出だしと終わりで波形がいきなり立ち上がり・途切れるため、「プツッ」というクリックノイズが乗りがちです。音の輪郭を時間で整える仕組みがエンベロープ（ADSR）で、これを入れると音が滑らかに立ち上がって減衰します。今回は範囲を絞るため固定音量にとどめ、エンベロープは最終回の4オペレータ実装でまとめて扱います。",{"type":25,"tag":26,"props":1582,"children":1584},{"id":1583},"なぜ直列なのかそして次回へ",[1585],{"type":31,"value":1586},"なぜ「直列」なのか、そして次回へ",{"type":25,"tag":33,"props":1588,"children":1589},{},[1590],{"type":31,"value":1591},"今回繋いだのは「モジュレータ → キャリア」という1本の直列です。2オペレータでできる接続は、実質これだけです。だから今回はアルゴリズムという言葉を一度も使いませんでした。繋ぎ方が1通りしかないなら、繋ぎ方を選ぶという概念がそもそも要らないからです。",{"type":25,"tag":33,"props":1593,"children":1594},{},[1595],{"type":31,"value":1596},"ところが、オペレータを3個4個と増やすと、「どれをどれに繋ぐか」の組み合わせが一気に増えます。直列で深く繋げば歪んだ複雑な音に、並列で足し合わせればオルガンのような音になります。この繋ぎ方のパターンこそがアルゴリズムで、FM音源の表現力の本体です。",{"type":25,"tag":33,"props":1598,"children":1599},{},[1600],{"type":31,"value":1601},"次回は、2オペレータでは何が足りないのか、オペレータを増やすと何ができるようになるのかを、アルゴリズムという軸で見ていきます。",{"type":25,"tag":26,"props":1603,"children":1605},{"id":1604},"まとめ",[1606],{"type":31,"value":1604},{"type":25,"tag":1608,"props":1609,"children":1610},"ul",{},[1611,1617,1629,1634,1646],{"type":25,"tag":1612,"props":1613,"children":1614},"li",{},[1615],{"type":31,"value":1616},"オペレータは「位相を毎サンプル進めてsinを引く」だけの1ユニットで、状態は位相のみ",{"type":25,"tag":1612,"props":1618,"children":1619},{},[1620,1622,1627],{"type":31,"value":1621},"周波数は絶対値でなく基準ピッチに対する比 ",{"type":25,"tag":46,"props":1623,"children":1625},{"className":1624},[],[1626],{"type":31,"value":105},{"type":31,"value":1628}," で持つと、音の高さを変えても音色が保たれる",{"type":25,"tag":1612,"props":1630,"children":1631},{},[1632],{"type":31,"value":1633},"モジュレータのsin出力をキャリアの位相に足し込むのが、前回の式そのもの",{"type":25,"tag":1612,"props":1635,"children":1636},{},[1637,1639,1644],{"type":31,"value":1638},"サンプル単位のループで ",{"type":25,"tag":46,"props":1640,"children":1642},{"className":1641},[],[1643],{"type":31,"value":73},{"type":31,"value":1645}," と進めながら埋めれば、1音分のPCMが完成する",{"type":25,"tag":1612,"props":1647,"children":1648},{},[1649],{"type":31,"value":1650},"2オペレータの接続は直列1通りしかないので、アルゴリズムという概念はまだ要らない",{"type":25,"tag":33,"props":1652,"children":1653},{},[1654,1659,1661],{"type":25,"tag":37,"props":1655,"children":1656},{"href":39},[1657],{"type":31,"value":1658},"← 第1回：FM音源とは？",{"type":31,"value":1660}," ｜ ",{"type":25,"tag":37,"props":1662,"children":1664},{"href":1663},"/articles/tech/blazor/fm-synthesis-4op-vs-2op",[1665],{"type":31,"value":1666},"第3回：4オペレータFM vs 2オペレータ →",{"type":25,"tag":1668,"props":1669,"children":1670},"style",{},[1671],{"type":31,"value":1672},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":8,"searchDepth":19,"depth":19,"links":1674},[1675,1676,1677,1678,1679,1680],{"id":28,"depth":19,"text":28},{"id":78,"depth":19,"text":81},{"id":570,"depth":19,"text":573},{"id":1065,"depth":19,"text":1065},{"id":1583,"depth":19,"text":1586},{"id":1604,"depth":19,"text":1604},"markdown","content:articles:tech:blazor:fm-synthesis-2op-implementation.md","content","articles/tech/blazor/fm-synthesis-2op-implementation.md","articles/tech/blazor/fm-synthesis-2op-implementation","md",{"_path":1688,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":1689,"description":1690,"date":11,"tags":1691,"rowTypeId":18,"seriesOrder":176,"sitemap":1692,"body":1693,"_type":1681,"_id":7537,"_source":1683,"_file":7538,"_stem":7539,"_extension":1686},"/articles/tech/blazor/fm-synthesis-4op-implementation","4オペレータFM音源をC#で実装する｜アルゴリズム・フィードバック・ADSR","FM音源シリーズ最終回。前回までの概念を全部コードにします。PICOMの実装をもとに、FMOperatorクラス、4つのオペレータとアルゴリズム・フィードバックを持つFMParameters、Alg0〜7をswitchで切り替える波形生成ループ、OP1セルフフィードバック、各オペレータのADSRエンベロープを解説します。第2回の2オペレータ実装をどう一般化したかを辿り、動く4オペレータFM音源を完成させます。",[13,14,15,16,17],{"loc":1688,"lastmod":11,"priority":18},{"type":22,"children":1694,"toc":7526},[1695,1699,1725,1730,1737,1777,1783,1802,2519,2576,2582,2601,3344,3363,3391,3396,3591,3597,3624,4995,5037,5042,5052,6334,6347,6435,6448,6454,6467,6593,6610,6616,6635,7333,7368,7373,7388,7394,7413,7433,7446,7450,7507,7522],{"type":25,"tag":26,"props":1696,"children":1697},{"id":28},[1698],{"type":31,"value":28},{"type":25,"tag":33,"props":1700,"children":1701},{},[1702,1704,1709,1711,1716,1718,1723],{"type":31,"value":1703},"シリーズ最終回です。",{"type":25,"tag":37,"props":1705,"children":1706},{"href":39},[1707],{"type":31,"value":1708},"第1回",{"type":31,"value":1710},"で原理を、",{"type":25,"tag":37,"props":1712,"children":1713},{"href":5},[1714],{"type":31,"value":1715},"第2回",{"type":31,"value":1717},"で2オペレータの最小実装を、",{"type":25,"tag":37,"props":1719,"children":1720},{"href":1663},[1721],{"type":31,"value":1722},"第3回",{"type":31,"value":1724},"でアルゴリズムの概念を見てきました。今回はそれを全部コードにして、PICOMで実際に動いている4オペレータFM音源を完成させます。",{"type":25,"tag":33,"props":1726,"children":1727},{},[1728],{"type":31,"value":1729},"この記事のコードは、PICOMのリポジトリにある実装そのものです。第2回で作った2オペレータの最小構成を土台に、「どう4オペレータへ一般化したか」を辿る形で進めます。",{"type":25,"tag":1731,"props":1732,"children":1736},"external-link-card",{"description":1733,"image":1734,"title":17,"to":1735},"8bit風サウンドを簡単に作成できる.NETライブラリ","/images/external/SoundMaker.jpg","https://github.com/AutumnSky1010/SoundMaker",[],{"type":25,"tag":60,"props":1738,"children":1739},{},[1740],{"type":25,"tag":33,"props":1741,"children":1742},{},[1743,1745,1751,1753,1759,1761,1767,1769,1775],{"type":31,"value":1744},"オペレータのパラメータ（周波数比・出力レベル・ADSR）を持つ",{"type":25,"tag":46,"props":1746,"children":1748},{"className":1747},[],[1749],{"type":31,"value":1750},"FMOperator",{"type":31,"value":1752},"、4つのオペレータとアルゴリズム・フィードバックをまとめる",{"type":25,"tag":46,"props":1754,"children":1756},{"className":1755},[],[1757],{"type":31,"value":1758},"FMParameters",{"type":31,"value":1760},"、そして毎サンプルでアルゴリズムに応じた変調を計算する",{"type":25,"tag":46,"props":1762,"children":1764},{"className":1763},[],[1765],{"type":31,"value":1766},"FMWave",{"type":31,"value":1768},"の3つで構成します。第2回の「位相を進めてsinを引く」ループはそのまま生き、増えたのは4本ぶんの位相配列、",{"type":25,"tag":46,"props":1770,"children":1772},{"className":1771},[],[1773],{"type":31,"value":1774},"switch",{"type":31,"value":1776},"によるアルゴリズム分岐、OP1のセルフフィードバック、そしてADSRエンベロープです。",{"type":25,"tag":26,"props":1778,"children":1780},{"id":1779},"オペレータのパラメータを持つfmoperator",[1781],{"type":31,"value":1782},"オペレータのパラメータを持つFMOperator",{"type":25,"tag":33,"props":1784,"children":1785},{},[1786,1788,1793,1795,1800],{"type":31,"value":1787},"第2回のオペレータは位相と",{"type":25,"tag":46,"props":1789,"children":1791},{"className":1790},[],[1792],{"type":31,"value":105},{"type":31,"value":1794},"だけでした。4オペレータでは、各オペレータに出力レベルとエンベロープを持たせます。PICOMの",{"type":25,"tag":46,"props":1796,"children":1798},{"className":1797},[],[1799],{"type":31,"value":1750},{"type":31,"value":1801},"は次のとおりです。",{"type":25,"tag":124,"props":1803,"children":1805},{"className":128,"code":1804,"language":127,"meta":8,"style":8},"public class FMOperator : ObservableObject\n{\n    private double _ratio = 1.0;\n    public double Ratio { get => _ratio; set => SetProperty(ref _ratio, value); }\n\n    private double _outputLevel = 1.0;\n    public double OutputLevel { get => _outputLevel; set => SetProperty(ref _outputLevel, value); }\n\n    private double _attack = 0.0;\n    public double Attack { get => _attack; set => SetProperty(ref _attack, value); }\n\n    private double _decay = 0.3;\n    public double Decay { get => _decay; set => SetProperty(ref _decay, value); }\n\n    private double _sustain = 1.0;\n    public double Sustain { get => _sustain; set => SetProperty(ref _sustain, value); }\n\n    private double _release = 0.1;\n    public double Release { get => _release; set => SetProperty(ref _release, value); }\n}\n",[1806],{"type":25,"tag":46,"props":1807,"children":1808},{"__ignoreMap":8},[1809,1835,1842,1870,1950,1957,1985,2061,2068,2097,2173,2180,2209,2285,2292,2320,2396,2404,2434,2511],{"type":25,"tag":134,"props":1810,"children":1811},{"class":136,"line":18},[1812,1816,1820,1825,1830],{"type":25,"tag":134,"props":1813,"children":1814},{"style":149},[1815],{"type":31,"value":152},{"type":25,"tag":134,"props":1817,"children":1818},{"style":149},[1819],{"type":31,"value":157},{"type":25,"tag":134,"props":1821,"children":1822},{"style":160},[1823],{"type":31,"value":1824}," FMOperator",{"type":25,"tag":134,"props":1826,"children":1827},{"style":170},[1828],{"type":31,"value":1829}," :",{"type":25,"tag":134,"props":1831,"children":1832},{"style":160},[1833],{"type":31,"value":1834}," ObservableObject\n",{"type":25,"tag":134,"props":1836,"children":1837},{"class":136,"line":19},[1838],{"type":25,"tag":134,"props":1839,"children":1840},{"style":170},[1841],{"type":31,"value":173},{"type":25,"tag":134,"props":1843,"children":1844},{"class":136,"line":166},[1845,1849,1853,1858,1862,1866],{"type":25,"tag":134,"props":1846,"children":1847},{"style":149},[1848],{"type":31,"value":267},{"type":25,"tag":134,"props":1850,"children":1851},{"style":194},[1852],{"type":31,"value":197},{"type":25,"tag":134,"props":1854,"children":1855},{"style":200},[1856],{"type":31,"value":1857}," _ratio",{"type":25,"tag":134,"props":1859,"children":1860},{"style":170},[1861],{"type":31,"value":237},{"type":25,"tag":134,"props":1863,"children":1864},{"style":240},[1865],{"type":31,"value":243},{"type":25,"tag":134,"props":1867,"children":1868},{"style":170},[1869],{"type":31,"value":248},{"type":25,"tag":134,"props":1871,"children":1872},{"class":136,"line":176},[1873,1877,1881,1885,1889,1893,1898,1902,1906,1910,1914,1919,1923,1928,1932,1936,1940,1945],{"type":25,"tag":134,"props":1874,"children":1875},{"style":149},[1876],{"type":31,"value":191},{"type":25,"tag":134,"props":1878,"children":1879},{"style":194},[1880],{"type":31,"value":197},{"type":25,"tag":134,"props":1882,"children":1883},{"style":200},[1884],{"type":31,"value":203},{"type":25,"tag":134,"props":1886,"children":1887},{"style":170},[1888],{"type":31,"value":208},{"type":25,"tag":134,"props":1890,"children":1891},{"style":149},[1892],{"type":31,"value":213},{"type":25,"tag":134,"props":1894,"children":1895},{"style":149},[1896],{"type":31,"value":1897}," =>",{"type":25,"tag":134,"props":1899,"children":1900},{"style":392},[1901],{"type":31,"value":1857},{"type":25,"tag":134,"props":1903,"children":1904},{"style":170},[1905],{"type":31,"value":218},{"type":25,"tag":134,"props":1907,"children":1908},{"style":149},[1909],{"type":31,"value":223},{"type":25,"tag":134,"props":1911,"children":1912},{"style":149},[1913],{"type":31,"value":1897},{"type":25,"tag":134,"props":1915,"children":1916},{"style":200},[1917],{"type":31,"value":1918}," SetProperty",{"type":25,"tag":134,"props":1920,"children":1921},{"style":170},[1922],{"type":31,"value":319},{"type":25,"tag":134,"props":1924,"children":1925},{"style":149},[1926],{"type":31,"value":1927},"ref",{"type":25,"tag":134,"props":1929,"children":1930},{"style":392},[1931],{"type":31,"value":1857},{"type":25,"tag":134,"props":1933,"children":1934},{"style":170},[1935],{"type":31,"value":334},{"type":25,"tag":134,"props":1937,"children":1938},{"style":392},[1939],{"type":31,"value":385},{"type":25,"tag":134,"props":1941,"children":1942},{"style":170},[1943],{"type":31,"value":1944},");",{"type":25,"tag":134,"props":1946,"children":1947},{"style":170},[1948],{"type":31,"value":1949}," }\n",{"type":25,"tag":134,"props":1951,"children":1952},{"class":136,"line":185},[1953],{"type":25,"tag":134,"props":1954,"children":1955},{"emptyLinePlaceholder":255},[1956],{"type":31,"value":258},{"type":25,"tag":134,"props":1958,"children":1959},{"class":136,"line":251},[1960,1964,1968,1973,1977,1981],{"type":25,"tag":134,"props":1961,"children":1962},{"style":149},[1963],{"type":31,"value":267},{"type":25,"tag":134,"props":1965,"children":1966},{"style":194},[1967],{"type":31,"value":197},{"type":25,"tag":134,"props":1969,"children":1970},{"style":200},[1971],{"type":31,"value":1972}," _outputLevel",{"type":25,"tag":134,"props":1974,"children":1975},{"style":170},[1976],{"type":31,"value":237},{"type":25,"tag":134,"props":1978,"children":1979},{"style":240},[1980],{"type":31,"value":243},{"type":25,"tag":134,"props":1982,"children":1983},{"style":170},[1984],{"type":31,"value":248},{"type":25,"tag":134,"props":1986,"children":1987},{"class":136,"line":261},[1988,1992,1996,2001,2005,2009,2013,2017,2021,2025,2029,2033,2037,2041,2045,2049,2053,2057],{"type":25,"tag":134,"props":1989,"children":1990},{"style":149},[1991],{"type":31,"value":191},{"type":25,"tag":134,"props":1993,"children":1994},{"style":194},[1995],{"type":31,"value":197},{"type":25,"tag":134,"props":1997,"children":1998},{"style":200},[1999],{"type":31,"value":2000}," OutputLevel",{"type":25,"tag":134,"props":2002,"children":2003},{"style":170},[2004],{"type":31,"value":208},{"type":25,"tag":134,"props":2006,"children":2007},{"style":149},[2008],{"type":31,"value":213},{"type":25,"tag":134,"props":2010,"children":2011},{"style":149},[2012],{"type":31,"value":1897},{"type":25,"tag":134,"props":2014,"children":2015},{"style":392},[2016],{"type":31,"value":1972},{"type":25,"tag":134,"props":2018,"children":2019},{"style":170},[2020],{"type":31,"value":218},{"type":25,"tag":134,"props":2022,"children":2023},{"style":149},[2024],{"type":31,"value":223},{"type":25,"tag":134,"props":2026,"children":2027},{"style":149},[2028],{"type":31,"value":1897},{"type":25,"tag":134,"props":2030,"children":2031},{"style":200},[2032],{"type":31,"value":1918},{"type":25,"tag":134,"props":2034,"children":2035},{"style":170},[2036],{"type":31,"value":319},{"type":25,"tag":134,"props":2038,"children":2039},{"style":149},[2040],{"type":31,"value":1927},{"type":25,"tag":134,"props":2042,"children":2043},{"style":392},[2044],{"type":31,"value":1972},{"type":25,"tag":134,"props":2046,"children":2047},{"style":170},[2048],{"type":31,"value":334},{"type":25,"tag":134,"props":2050,"children":2051},{"style":392},[2052],{"type":31,"value":385},{"type":25,"tag":134,"props":2054,"children":2055},{"style":170},[2056],{"type":31,"value":1944},{"type":25,"tag":134,"props":2058,"children":2059},{"style":170},[2060],{"type":31,"value":1949},{"type":25,"tag":134,"props":2062,"children":2063},{"class":136,"line":283},[2064],{"type":25,"tag":134,"props":2065,"children":2066},{"emptyLinePlaceholder":255},[2067],{"type":31,"value":258},{"type":25,"tag":134,"props":2069,"children":2070},{"class":136,"line":291},[2071,2075,2079,2084,2088,2093],{"type":25,"tag":134,"props":2072,"children":2073},{"style":149},[2074],{"type":31,"value":267},{"type":25,"tag":134,"props":2076,"children":2077},{"style":194},[2078],{"type":31,"value":197},{"type":25,"tag":134,"props":2080,"children":2081},{"style":200},[2082],{"type":31,"value":2083}," _attack",{"type":25,"tag":134,"props":2085,"children":2086},{"style":170},[2087],{"type":31,"value":237},{"type":25,"tag":134,"props":2089,"children":2090},{"style":240},[2091],{"type":31,"value":2092}," 0.0",{"type":25,"tag":134,"props":2094,"children":2095},{"style":170},[2096],{"type":31,"value":248},{"type":25,"tag":134,"props":2098,"children":2099},{"class":136,"line":300},[2100,2104,2108,2113,2117,2121,2125,2129,2133,2137,2141,2145,2149,2153,2157,2161,2165,2169],{"type":25,"tag":134,"props":2101,"children":2102},{"style":149},[2103],{"type":31,"value":191},{"type":25,"tag":134,"props":2105,"children":2106},{"style":194},[2107],{"type":31,"value":197},{"type":25,"tag":134,"props":2109,"children":2110},{"style":200},[2111],{"type":31,"value":2112}," Attack",{"type":25,"tag":134,"props":2114,"children":2115},{"style":170},[2116],{"type":31,"value":208},{"type":25,"tag":134,"props":2118,"children":2119},{"style":149},[2120],{"type":31,"value":213},{"type":25,"tag":134,"props":2122,"children":2123},{"style":149},[2124],{"type":31,"value":1897},{"type":25,"tag":134,"props":2126,"children":2127},{"style":392},[2128],{"type":31,"value":2083},{"type":25,"tag":134,"props":2130,"children":2131},{"style":170},[2132],{"type":31,"value":218},{"type":25,"tag":134,"props":2134,"children":2135},{"style":149},[2136],{"type":31,"value":223},{"type":25,"tag":134,"props":2138,"children":2139},{"style":149},[2140],{"type":31,"value":1897},{"type":25,"tag":134,"props":2142,"children":2143},{"style":200},[2144],{"type":31,"value":1918},{"type":25,"tag":134,"props":2146,"children":2147},{"style":170},[2148],{"type":31,"value":319},{"type":25,"tag":134,"props":2150,"children":2151},{"style":149},[2152],{"type":31,"value":1927},{"type":25,"tag":134,"props":2154,"children":2155},{"style":392},[2156],{"type":31,"value":2083},{"type":25,"tag":134,"props":2158,"children":2159},{"style":170},[2160],{"type":31,"value":334},{"type":25,"tag":134,"props":2162,"children":2163},{"style":392},[2164],{"type":31,"value":385},{"type":25,"tag":134,"props":2166,"children":2167},{"style":170},[2168],{"type":31,"value":1944},{"type":25,"tag":134,"props":2170,"children":2171},{"style":170},[2172],{"type":31,"value":1949},{"type":25,"tag":134,"props":2174,"children":2175},{"class":136,"line":365},[2176],{"type":25,"tag":134,"props":2177,"children":2178},{"emptyLinePlaceholder":255},[2179],{"type":31,"value":258},{"type":25,"tag":134,"props":2181,"children":2182},{"class":136,"line":374},[2183,2187,2191,2196,2200,2205],{"type":25,"tag":134,"props":2184,"children":2185},{"style":149},[2186],{"type":31,"value":267},{"type":25,"tag":134,"props":2188,"children":2189},{"style":194},[2190],{"type":31,"value":197},{"type":25,"tag":134,"props":2192,"children":2193},{"style":200},[2194],{"type":31,"value":2195}," _decay",{"type":25,"tag":134,"props":2197,"children":2198},{"style":170},[2199],{"type":31,"value":237},{"type":25,"tag":134,"props":2201,"children":2202},{"style":240},[2203],{"type":31,"value":2204}," 0.3",{"type":25,"tag":134,"props":2206,"children":2207},{"style":170},[2208],{"type":31,"value":248},{"type":25,"tag":134,"props":2210,"children":2211},{"class":136,"line":457},[2212,2216,2220,2225,2229,2233,2237,2241,2245,2249,2253,2257,2261,2265,2269,2273,2277,2281],{"type":25,"tag":134,"props":2213,"children":2214},{"style":149},[2215],{"type":31,"value":191},{"type":25,"tag":134,"props":2217,"children":2218},{"style":194},[2219],{"type":31,"value":197},{"type":25,"tag":134,"props":2221,"children":2222},{"style":200},[2223],{"type":31,"value":2224}," Decay",{"type":25,"tag":134,"props":2226,"children":2227},{"style":170},[2228],{"type":31,"value":208},{"type":25,"tag":134,"props":2230,"children":2231},{"style":149},[2232],{"type":31,"value":213},{"type":25,"tag":134,"props":2234,"children":2235},{"style":149},[2236],{"type":31,"value":1897},{"type":25,"tag":134,"props":2238,"children":2239},{"style":392},[2240],{"type":31,"value":2195},{"type":25,"tag":134,"props":2242,"children":2243},{"style":170},[2244],{"type":31,"value":218},{"type":25,"tag":134,"props":2246,"children":2247},{"style":149},[2248],{"type":31,"value":223},{"type":25,"tag":134,"props":2250,"children":2251},{"style":149},[2252],{"type":31,"value":1897},{"type":25,"tag":134,"props":2254,"children":2255},{"style":200},[2256],{"type":31,"value":1918},{"type":25,"tag":134,"props":2258,"children":2259},{"style":170},[2260],{"type":31,"value":319},{"type":25,"tag":134,"props":2262,"children":2263},{"style":149},[2264],{"type":31,"value":1927},{"type":25,"tag":134,"props":2266,"children":2267},{"style":392},[2268],{"type":31,"value":2195},{"type":25,"tag":134,"props":2270,"children":2271},{"style":170},[2272],{"type":31,"value":334},{"type":25,"tag":134,"props":2274,"children":2275},{"style":392},[2276],{"type":31,"value":385},{"type":25,"tag":134,"props":2278,"children":2279},{"style":170},[2280],{"type":31,"value":1944},{"type":25,"tag":134,"props":2282,"children":2283},{"style":170},[2284],{"type":31,"value":1949},{"type":25,"tag":134,"props":2286,"children":2287},{"class":136,"line":496},[2288],{"type":25,"tag":134,"props":2289,"children":2290},{"emptyLinePlaceholder":255},[2291],{"type":31,"value":258},{"type":25,"tag":134,"props":2293,"children":2294},{"class":136,"line":513},[2295,2299,2303,2308,2312,2316],{"type":25,"tag":134,"props":2296,"children":2297},{"style":149},[2298],{"type":31,"value":267},{"type":25,"tag":134,"props":2300,"children":2301},{"style":194},[2302],{"type":31,"value":197},{"type":25,"tag":134,"props":2304,"children":2305},{"style":200},[2306],{"type":31,"value":2307}," _sustain",{"type":25,"tag":134,"props":2309,"children":2310},{"style":170},[2311],{"type":31,"value":237},{"type":25,"tag":134,"props":2313,"children":2314},{"style":240},[2315],{"type":31,"value":243},{"type":25,"tag":134,"props":2317,"children":2318},{"style":170},[2319],{"type":31,"value":248},{"type":25,"tag":134,"props":2321,"children":2322},{"class":136,"line":522},[2323,2327,2331,2336,2340,2344,2348,2352,2356,2360,2364,2368,2372,2376,2380,2384,2388,2392],{"type":25,"tag":134,"props":2324,"children":2325},{"style":149},[2326],{"type":31,"value":191},{"type":25,"tag":134,"props":2328,"children":2329},{"style":194},[2330],{"type":31,"value":197},{"type":25,"tag":134,"props":2332,"children":2333},{"style":200},[2334],{"type":31,"value":2335}," Sustain",{"type":25,"tag":134,"props":2337,"children":2338},{"style":170},[2339],{"type":31,"value":208},{"type":25,"tag":134,"props":2341,"children":2342},{"style":149},[2343],{"type":31,"value":213},{"type":25,"tag":134,"props":2345,"children":2346},{"style":149},[2347],{"type":31,"value":1897},{"type":25,"tag":134,"props":2349,"children":2350},{"style":392},[2351],{"type":31,"value":2307},{"type":25,"tag":134,"props":2353,"children":2354},{"style":170},[2355],{"type":31,"value":218},{"type":25,"tag":134,"props":2357,"children":2358},{"style":149},[2359],{"type":31,"value":223},{"type":25,"tag":134,"props":2361,"children":2362},{"style":149},[2363],{"type":31,"value":1897},{"type":25,"tag":134,"props":2365,"children":2366},{"style":200},[2367],{"type":31,"value":1918},{"type":25,"tag":134,"props":2369,"children":2370},{"style":170},[2371],{"type":31,"value":319},{"type":25,"tag":134,"props":2373,"children":2374},{"style":149},[2375],{"type":31,"value":1927},{"type":25,"tag":134,"props":2377,"children":2378},{"style":392},[2379],{"type":31,"value":2307},{"type":25,"tag":134,"props":2381,"children":2382},{"style":170},[2383],{"type":31,"value":334},{"type":25,"tag":134,"props":2385,"children":2386},{"style":392},[2387],{"type":31,"value":385},{"type":25,"tag":134,"props":2389,"children":2390},{"style":170},[2391],{"type":31,"value":1944},{"type":25,"tag":134,"props":2393,"children":2394},{"style":170},[2395],{"type":31,"value":1949},{"type":25,"tag":134,"props":2397,"children":2399},{"class":136,"line":2398},17,[2400],{"type":25,"tag":134,"props":2401,"children":2402},{"emptyLinePlaceholder":255},[2403],{"type":31,"value":258},{"type":25,"tag":134,"props":2405,"children":2407},{"class":136,"line":2406},18,[2408,2412,2416,2421,2425,2430],{"type":25,"tag":134,"props":2409,"children":2410},{"style":149},[2411],{"type":31,"value":267},{"type":25,"tag":134,"props":2413,"children":2414},{"style":194},[2415],{"type":31,"value":197},{"type":25,"tag":134,"props":2417,"children":2418},{"style":200},[2419],{"type":31,"value":2420}," _release",{"type":25,"tag":134,"props":2422,"children":2423},{"style":170},[2424],{"type":31,"value":237},{"type":25,"tag":134,"props":2426,"children":2427},{"style":240},[2428],{"type":31,"value":2429}," 0.1",{"type":25,"tag":134,"props":2431,"children":2432},{"style":170},[2433],{"type":31,"value":248},{"type":25,"tag":134,"props":2435,"children":2437},{"class":136,"line":2436},19,[2438,2442,2446,2451,2455,2459,2463,2467,2471,2475,2479,2483,2487,2491,2495,2499,2503,2507],{"type":25,"tag":134,"props":2439,"children":2440},{"style":149},[2441],{"type":31,"value":191},{"type":25,"tag":134,"props":2443,"children":2444},{"style":194},[2445],{"type":31,"value":197},{"type":25,"tag":134,"props":2447,"children":2448},{"style":200},[2449],{"type":31,"value":2450}," Release",{"type":25,"tag":134,"props":2452,"children":2453},{"style":170},[2454],{"type":31,"value":208},{"type":25,"tag":134,"props":2456,"children":2457},{"style":149},[2458],{"type":31,"value":213},{"type":25,"tag":134,"props":2460,"children":2461},{"style":149},[2462],{"type":31,"value":1897},{"type":25,"tag":134,"props":2464,"children":2465},{"style":392},[2466],{"type":31,"value":2420},{"type":25,"tag":134,"props":2468,"children":2469},{"style":170},[2470],{"type":31,"value":218},{"type":25,"tag":134,"props":2472,"children":2473},{"style":149},[2474],{"type":31,"value":223},{"type":25,"tag":134,"props":2476,"children":2477},{"style":149},[2478],{"type":31,"value":1897},{"type":25,"tag":134,"props":2480,"children":2481},{"style":200},[2482],{"type":31,"value":1918},{"type":25,"tag":134,"props":2484,"children":2485},{"style":170},[2486],{"type":31,"value":319},{"type":25,"tag":134,"props":2488,"children":2489},{"style":149},[2490],{"type":31,"value":1927},{"type":25,"tag":134,"props":2492,"children":2493},{"style":392},[2494],{"type":31,"value":2420},{"type":25,"tag":134,"props":2496,"children":2497},{"style":170},[2498],{"type":31,"value":334},{"type":25,"tag":134,"props":2500,"children":2501},{"style":392},[2502],{"type":31,"value":385},{"type":25,"tag":134,"props":2504,"children":2505},{"style":170},[2506],{"type":31,"value":1944},{"type":25,"tag":134,"props":2508,"children":2509},{"style":170},[2510],{"type":31,"value":1949},{"type":25,"tag":134,"props":2512,"children":2514},{"class":136,"line":2513},20,[2515],{"type":25,"tag":134,"props":2516,"children":2517},{"style":170},[2518],{"type":31,"value":528},{"type":25,"tag":33,"props":2520,"children":2521},{},[2522,2527,2529,2535,2537,2542,2544,2550,2552,2558,2560,2566,2568,2574],{"type":25,"tag":46,"props":2523,"children":2525},{"className":2524},[],[2526],{"type":31,"value":105},{"type":31,"value":2528},"は第2回と同じ周波数比です。",{"type":25,"tag":46,"props":2530,"children":2532},{"className":2531},[],[2533],{"type":31,"value":2534},"OutputLevel",{"type":31,"value":2536},"は、そのオペレータの出力の大きさです。ここが重要で、",{"type":25,"tag":46,"props":2538,"children":2540},{"className":2539},[],[2541],{"type":31,"value":2534},{"type":31,"value":2543},"はオペレータがキャリアかモジュレータかで意味が変わります。キャリアなら音量、モジュレータなら変調の深さ、つまり第2回でいう変調指数 ",{"type":25,"tag":46,"props":2545,"children":2547},{"className":2546},[],[2548],{"type":31,"value":2549},"I",{"type":31,"value":2551}," に相当します。",{"type":25,"tag":46,"props":2553,"children":2555},{"className":2554},[],[2556],{"type":31,"value":2557},"Attack",{"type":31,"value":2559},"〜",{"type":25,"tag":46,"props":2561,"children":2563},{"className":2562},[],[2564],{"type":31,"value":2565},"Release",{"type":31,"value":2567},"はエンベロープのパラメータで、これは後半で扱います。",{"type":25,"tag":46,"props":2569,"children":2571},{"className":2570},[],[2572],{"type":31,"value":2573},"ObservableObject",{"type":31,"value":2575},"を継承しているのは、UIのスライダーと双方向に同期するためです。",{"type":25,"tag":26,"props":2577,"children":2579},{"id":2578},"_4つをまとめるfmparameters",[2580],{"type":31,"value":2581},"4つをまとめるFMParameters",{"type":25,"tag":33,"props":2583,"children":2584},{},[2585,2587,2592,2594,2599],{"type":31,"value":2586},"4つの",{"type":25,"tag":46,"props":2588,"children":2590},{"className":2589},[],[2591],{"type":31,"value":1750},{"type":31,"value":2593},"と、アルゴリズム・フィードバックをまとめるのが",{"type":25,"tag":46,"props":2595,"children":2597},{"className":2596},[],[2598],{"type":31,"value":1758},{"type":31,"value":2600},"です。",{"type":25,"tag":124,"props":2602,"children":2604},{"className":128,"code":2603,"language":127,"meta":8,"style":8},"public class FMParameters : ObservableObject\n{\n    public const int OperatorCount = 4;\n\n    public FMOperator[] Operators { get; }\n\n    private FMAlgorithm _algorithm = FMAlgorithm.Alg4;\n    public FMAlgorithm Algorithm { get => _algorithm; set => SetProperty(ref _algorithm, value); }\n\n    private double _feedback = 0.0;\n    public double Feedback { get => _feedback; set => SetProperty(ref _feedback, value); }\n\n    public FMParameters()\n    {\n        Operators = new FMOperator[OperatorCount];\n        for (var i = 0; i \u003C OperatorCount; i++)\n        {\n            Operators[i] = new FMOperator();\n            Operators[i].PropertyChanged += OnOperatorChanged;\n        }\n        // 既定 Algorithm 4 = (OP1→OP2)+(OP3→OP4)\n        // OP1, OP3 が modulator、OP2, OP4 が carrier\n        Operators[0].OutputLevel = 0.5;\n        Operators[1].OutputLevel = 1.0;\n        Operators[2].OutputLevel = 0.0;\n        Operators[3].OutputLevel = 0.0;\n    }\n}\n",[2605],{"type":25,"tag":46,"props":2606,"children":2607},{"__ignoreMap":8},[2608,2632,2639,2673,2680,2716,2723,2761,2837,2844,2872,2948,2955,2971,2978,3011,3071,3079,3116,3154,3162,3171,3180,3218,3255,3291,3328,3336],{"type":25,"tag":134,"props":2609,"children":2610},{"class":136,"line":18},[2611,2615,2619,2624,2628],{"type":25,"tag":134,"props":2612,"children":2613},{"style":149},[2614],{"type":31,"value":152},{"type":25,"tag":134,"props":2616,"children":2617},{"style":149},[2618],{"type":31,"value":157},{"type":25,"tag":134,"props":2620,"children":2621},{"style":160},[2622],{"type":31,"value":2623}," FMParameters",{"type":25,"tag":134,"props":2625,"children":2626},{"style":170},[2627],{"type":31,"value":1829},{"type":25,"tag":134,"props":2629,"children":2630},{"style":160},[2631],{"type":31,"value":1834},{"type":25,"tag":134,"props":2633,"children":2634},{"class":136,"line":19},[2635],{"type":25,"tag":134,"props":2636,"children":2637},{"style":170},[2638],{"type":31,"value":173},{"type":25,"tag":134,"props":2640,"children":2641},{"class":136,"line":166},[2642,2646,2651,2655,2660,2664,2669],{"type":25,"tag":134,"props":2643,"children":2644},{"style":149},[2645],{"type":31,"value":191},{"type":25,"tag":134,"props":2647,"children":2648},{"style":149},[2649],{"type":31,"value":2650}," const",{"type":25,"tag":134,"props":2652,"children":2653},{"style":194},[2654],{"type":31,"value":339},{"type":25,"tag":134,"props":2656,"children":2657},{"style":200},[2658],{"type":31,"value":2659}," OperatorCount",{"type":25,"tag":134,"props":2661,"children":2662},{"style":170},[2663],{"type":31,"value":237},{"type":25,"tag":134,"props":2665,"children":2666},{"style":240},[2667],{"type":31,"value":2668}," 4",{"type":25,"tag":134,"props":2670,"children":2671},{"style":170},[2672],{"type":31,"value":248},{"type":25,"tag":134,"props":2674,"children":2675},{"class":136,"line":176},[2676],{"type":25,"tag":134,"props":2677,"children":2678},{"emptyLinePlaceholder":255},[2679],{"type":31,"value":258},{"type":25,"tag":134,"props":2681,"children":2682},{"class":136,"line":185},[2683,2687,2691,2695,2700,2704,2708,2712],{"type":25,"tag":134,"props":2684,"children":2685},{"style":149},[2686],{"type":31,"value":191},{"type":25,"tag":134,"props":2688,"children":2689},{"style":160},[2690],{"type":31,"value":1824},{"type":25,"tag":134,"props":2692,"children":2693},{"style":170},[2694],{"type":31,"value":1139},{"type":25,"tag":134,"props":2696,"children":2697},{"style":200},[2698],{"type":31,"value":2699}," Operators",{"type":25,"tag":134,"props":2701,"children":2702},{"style":170},[2703],{"type":31,"value":208},{"type":25,"tag":134,"props":2705,"children":2706},{"style":149},[2707],{"type":31,"value":213},{"type":25,"tag":134,"props":2709,"children":2710},{"style":170},[2711],{"type":31,"value":218},{"type":25,"tag":134,"props":2713,"children":2714},{"style":170},[2715],{"type":31,"value":1949},{"type":25,"tag":134,"props":2717,"children":2718},{"class":136,"line":251},[2719],{"type":25,"tag":134,"props":2720,"children":2721},{"emptyLinePlaceholder":255},[2722],{"type":31,"value":258},{"type":25,"tag":134,"props":2724,"children":2725},{"class":136,"line":261},[2726,2730,2735,2740,2744,2748,2752,2757],{"type":25,"tag":134,"props":2727,"children":2728},{"style":149},[2729],{"type":31,"value":267},{"type":25,"tag":134,"props":2731,"children":2732},{"style":160},[2733],{"type":31,"value":2734}," FMAlgorithm",{"type":25,"tag":134,"props":2736,"children":2737},{"style":200},[2738],{"type":31,"value":2739}," _algorithm",{"type":25,"tag":134,"props":2741,"children":2742},{"style":170},[2743],{"type":31,"value":237},{"type":25,"tag":134,"props":2745,"children":2746},{"style":392},[2747],{"type":31,"value":2734},{"type":25,"tag":134,"props":2749,"children":2750},{"style":170},[2751],{"type":31,"value":400},{"type":25,"tag":134,"props":2753,"children":2754},{"style":392},[2755],{"type":31,"value":2756},"Alg4",{"type":25,"tag":134,"props":2758,"children":2759},{"style":170},[2760],{"type":31,"value":248},{"type":25,"tag":134,"props":2762,"children":2763},{"class":136,"line":283},[2764,2768,2772,2777,2781,2785,2789,2793,2797,2801,2805,2809,2813,2817,2821,2825,2829,2833],{"type":25,"tag":134,"props":2765,"children":2766},{"style":149},[2767],{"type":31,"value":191},{"type":25,"tag":134,"props":2769,"children":2770},{"style":160},[2771],{"type":31,"value":2734},{"type":25,"tag":134,"props":2773,"children":2774},{"style":200},[2775],{"type":31,"value":2776}," Algorithm",{"type":25,"tag":134,"props":2778,"children":2779},{"style":170},[2780],{"type":31,"value":208},{"type":25,"tag":134,"props":2782,"children":2783},{"style":149},[2784],{"type":31,"value":213},{"type":25,"tag":134,"props":2786,"children":2787},{"style":149},[2788],{"type":31,"value":1897},{"type":25,"tag":134,"props":2790,"children":2791},{"style":392},[2792],{"type":31,"value":2739},{"type":25,"tag":134,"props":2794,"children":2795},{"style":170},[2796],{"type":31,"value":218},{"type":25,"tag":134,"props":2798,"children":2799},{"style":149},[2800],{"type":31,"value":223},{"type":25,"tag":134,"props":2802,"children":2803},{"style":149},[2804],{"type":31,"value":1897},{"type":25,"tag":134,"props":2806,"children":2807},{"style":200},[2808],{"type":31,"value":1918},{"type":25,"tag":134,"props":2810,"children":2811},{"style":170},[2812],{"type":31,"value":319},{"type":25,"tag":134,"props":2814,"children":2815},{"style":149},[2816],{"type":31,"value":1927},{"type":25,"tag":134,"props":2818,"children":2819},{"style":392},[2820],{"type":31,"value":2739},{"type":25,"tag":134,"props":2822,"children":2823},{"style":170},[2824],{"type":31,"value":334},{"type":25,"tag":134,"props":2826,"children":2827},{"style":392},[2828],{"type":31,"value":385},{"type":25,"tag":134,"props":2830,"children":2831},{"style":170},[2832],{"type":31,"value":1944},{"type":25,"tag":134,"props":2834,"children":2835},{"style":170},[2836],{"type":31,"value":1949},{"type":25,"tag":134,"props":2838,"children":2839},{"class":136,"line":291},[2840],{"type":25,"tag":134,"props":2841,"children":2842},{"emptyLinePlaceholder":255},[2843],{"type":31,"value":258},{"type":25,"tag":134,"props":2845,"children":2846},{"class":136,"line":300},[2847,2851,2855,2860,2864,2868],{"type":25,"tag":134,"props":2848,"children":2849},{"style":149},[2850],{"type":31,"value":267},{"type":25,"tag":134,"props":2852,"children":2853},{"style":194},[2854],{"type":31,"value":197},{"type":25,"tag":134,"props":2856,"children":2857},{"style":200},[2858],{"type":31,"value":2859}," _feedback",{"type":25,"tag":134,"props":2861,"children":2862},{"style":170},[2863],{"type":31,"value":237},{"type":25,"tag":134,"props":2865,"children":2866},{"style":240},[2867],{"type":31,"value":2092},{"type":25,"tag":134,"props":2869,"children":2870},{"style":170},[2871],{"type":31,"value":248},{"type":25,"tag":134,"props":2873,"children":2874},{"class":136,"line":365},[2875,2879,2883,2888,2892,2896,2900,2904,2908,2912,2916,2920,2924,2928,2932,2936,2940,2944],{"type":25,"tag":134,"props":2876,"children":2877},{"style":149},[2878],{"type":31,"value":191},{"type":25,"tag":134,"props":2880,"children":2881},{"style":194},[2882],{"type":31,"value":197},{"type":25,"tag":134,"props":2884,"children":2885},{"style":200},[2886],{"type":31,"value":2887}," Feedback",{"type":25,"tag":134,"props":2889,"children":2890},{"style":170},[2891],{"type":31,"value":208},{"type":25,"tag":134,"props":2893,"children":2894},{"style":149},[2895],{"type":31,"value":213},{"type":25,"tag":134,"props":2897,"children":2898},{"style":149},[2899],{"type":31,"value":1897},{"type":25,"tag":134,"props":2901,"children":2902},{"style":392},[2903],{"type":31,"value":2859},{"type":25,"tag":134,"props":2905,"children":2906},{"style":170},[2907],{"type":31,"value":218},{"type":25,"tag":134,"props":2909,"children":2910},{"style":149},[2911],{"type":31,"value":223},{"type":25,"tag":134,"props":2913,"children":2914},{"style":149},[2915],{"type":31,"value":1897},{"type":25,"tag":134,"props":2917,"children":2918},{"style":200},[2919],{"type":31,"value":1918},{"type":25,"tag":134,"props":2921,"children":2922},{"style":170},[2923],{"type":31,"value":319},{"type":25,"tag":134,"props":2925,"children":2926},{"style":149},[2927],{"type":31,"value":1927},{"type":25,"tag":134,"props":2929,"children":2930},{"style":392},[2931],{"type":31,"value":2859},{"type":25,"tag":134,"props":2933,"children":2934},{"style":170},[2935],{"type":31,"value":334},{"type":25,"tag":134,"props":2937,"children":2938},{"style":392},[2939],{"type":31,"value":385},{"type":25,"tag":134,"props":2941,"children":2942},{"style":170},[2943],{"type":31,"value":1944},{"type":25,"tag":134,"props":2945,"children":2946},{"style":170},[2947],{"type":31,"value":1949},{"type":25,"tag":134,"props":2949,"children":2950},{"class":136,"line":374},[2951],{"type":25,"tag":134,"props":2952,"children":2953},{"emptyLinePlaceholder":255},[2954],{"type":31,"value":258},{"type":25,"tag":134,"props":2956,"children":2957},{"class":136,"line":457},[2958,2962,2966],{"type":25,"tag":134,"props":2959,"children":2960},{"style":149},[2961],{"type":31,"value":191},{"type":25,"tag":134,"props":2963,"children":2964},{"style":200},[2965],{"type":31,"value":2623},{"type":25,"tag":134,"props":2967,"children":2968},{"style":170},[2969],{"type":31,"value":2970},"()\n",{"type":25,"tag":134,"props":2972,"children":2973},{"class":136,"line":496},[2974],{"type":25,"tag":134,"props":2975,"children":2976},{"style":170},[2977],{"type":31,"value":371},{"type":25,"tag":134,"props":2979,"children":2980},{"class":136,"line":513},[2981,2986,2990,2994,2998,3002,3007],{"type":25,"tag":134,"props":2982,"children":2983},{"style":392},[2984],{"type":31,"value":2985},"        Operators",{"type":25,"tag":134,"props":2987,"children":2988},{"style":170},[2989],{"type":31,"value":237},{"type":25,"tag":134,"props":2991,"children":2992},{"style":149},[2993],{"type":31,"value":646},{"type":25,"tag":134,"props":2995,"children":2996},{"style":160},[2997],{"type":31,"value":1824},{"type":25,"tag":134,"props":2999,"children":3000},{"style":170},[3001],{"type":31,"value":1281},{"type":25,"tag":134,"props":3003,"children":3004},{"style":392},[3005],{"type":31,"value":3006},"OperatorCount",{"type":25,"tag":134,"props":3008,"children":3009},{"style":170},[3010],{"type":31,"value":1291},{"type":25,"tag":134,"props":3012,"children":3013},{"class":136,"line":522},[3014,3019,3023,3027,3031,3035,3039,3043,3047,3051,3055,3059,3063,3067],{"type":25,"tag":134,"props":3015,"children":3016},{"style":194},[3017],{"type":31,"value":3018},"        for",{"type":25,"tag":134,"props":3020,"children":3021},{"style":170},[3022],{"type":31,"value":1344},{"type":25,"tag":134,"props":3024,"children":3025},{"style":149},[3026],{"type":31,"value":1349},{"type":25,"tag":134,"props":3028,"children":3029},{"style":200},[3030],{"type":31,"value":1354},{"type":25,"tag":134,"props":3032,"children":3033},{"style":170},[3034],{"type":31,"value":237},{"type":25,"tag":134,"props":3036,"children":3037},{"style":240},[3038],{"type":31,"value":911},{"type":25,"tag":134,"props":3040,"children":3041},{"style":170},[3042],{"type":31,"value":218},{"type":25,"tag":134,"props":3044,"children":3045},{"style":392},[3046],{"type":31,"value":1354},{"type":25,"tag":134,"props":3048,"children":3049},{"style":170},[3050],{"type":31,"value":1375},{"type":25,"tag":134,"props":3052,"children":3053},{"style":392},[3054],{"type":31,"value":2659},{"type":25,"tag":134,"props":3056,"children":3057},{"style":170},[3058],{"type":31,"value":218},{"type":25,"tag":134,"props":3060,"children":3061},{"style":392},[3062],{"type":31,"value":1354},{"type":25,"tag":134,"props":3064,"children":3065},{"style":149},[3066],{"type":31,"value":1392},{"type":25,"tag":134,"props":3068,"children":3069},{"style":170},[3070],{"type":31,"value":362},{"type":25,"tag":134,"props":3072,"children":3073},{"class":136,"line":2398},[3074],{"type":25,"tag":134,"props":3075,"children":3076},{"style":170},[3077],{"type":31,"value":3078},"        {\n",{"type":25,"tag":134,"props":3080,"children":3081},{"class":136,"line":2406},[3082,3087,3091,3095,3099,3103,3107,3111],{"type":25,"tag":134,"props":3083,"children":3084},{"style":392},[3085],{"type":31,"value":3086},"            Operators",{"type":25,"tag":134,"props":3088,"children":3089},{"style":170},[3090],{"type":31,"value":1281},{"type":25,"tag":134,"props":3092,"children":3093},{"style":392},[3094],{"type":31,"value":1468},{"type":25,"tag":134,"props":3096,"children":3097},{"style":170},[3098],{"type":31,"value":1473},{"type":25,"tag":134,"props":3100,"children":3101},{"style":170},[3102],{"type":31,"value":237},{"type":25,"tag":134,"props":3104,"children":3105},{"style":149},[3106],{"type":31,"value":646},{"type":25,"tag":134,"props":3108,"children":3109},{"style":160},[3110],{"type":31,"value":1824},{"type":25,"tag":134,"props":3112,"children":3113},{"style":170},[3114],{"type":31,"value":3115},"();\n",{"type":25,"tag":134,"props":3117,"children":3118},{"class":136,"line":2436},[3119,3123,3127,3131,3136,3141,3145,3150],{"type":25,"tag":134,"props":3120,"children":3121},{"style":392},[3122],{"type":31,"value":3086},{"type":25,"tag":134,"props":3124,"children":3125},{"style":170},[3126],{"type":31,"value":1281},{"type":25,"tag":134,"props":3128,"children":3129},{"style":392},[3130],{"type":31,"value":1468},{"type":25,"tag":134,"props":3132,"children":3133},{"style":170},[3134],{"type":31,"value":3135},"].",{"type":25,"tag":134,"props":3137,"children":3138},{"style":392},[3139],{"type":31,"value":3140},"PropertyChanged",{"type":25,"tag":134,"props":3142,"children":3143},{"style":149},[3144],{"type":31,"value":468},{"type":25,"tag":134,"props":3146,"children":3147},{"style":392},[3148],{"type":31,"value":3149}," OnOperatorChanged",{"type":25,"tag":134,"props":3151,"children":3152},{"style":170},[3153],{"type":31,"value":248},{"type":25,"tag":134,"props":3155,"children":3156},{"class":136,"line":2513},[3157],{"type":25,"tag":134,"props":3158,"children":3159},{"style":170},[3160],{"type":31,"value":3161},"        }\n",{"type":25,"tag":134,"props":3163,"children":3165},{"class":136,"line":3164},21,[3166],{"type":25,"tag":134,"props":3167,"children":3168},{"style":140},[3169],{"type":31,"value":3170},"        // 既定 Algorithm 4 = (OP1→OP2)+(OP3→OP4)\n",{"type":25,"tag":134,"props":3172,"children":3174},{"class":136,"line":3173},22,[3175],{"type":25,"tag":134,"props":3176,"children":3177},{"style":140},[3178],{"type":31,"value":3179},"        // OP1, OP3 が modulator、OP2, OP4 が carrier\n",{"type":25,"tag":134,"props":3181,"children":3183},{"class":136,"line":3182},23,[3184,3188,3192,3197,3201,3205,3209,3214],{"type":25,"tag":134,"props":3185,"children":3186},{"style":392},[3187],{"type":31,"value":2985},{"type":25,"tag":134,"props":3189,"children":3190},{"style":170},[3191],{"type":31,"value":1281},{"type":25,"tag":134,"props":3193,"children":3194},{"style":240},[3195],{"type":31,"value":3196},"0",{"type":25,"tag":134,"props":3198,"children":3199},{"style":170},[3200],{"type":31,"value":3135},{"type":25,"tag":134,"props":3202,"children":3203},{"style":392},[3204],{"type":31,"value":2534},{"type":25,"tag":134,"props":3206,"children":3207},{"style":170},[3208],{"type":31,"value":237},{"type":25,"tag":134,"props":3210,"children":3211},{"style":240},[3212],{"type":31,"value":3213}," 0.5",{"type":25,"tag":134,"props":3215,"children":3216},{"style":170},[3217],{"type":31,"value":248},{"type":25,"tag":134,"props":3219,"children":3221},{"class":136,"line":3220},24,[3222,3226,3230,3235,3239,3243,3247,3251],{"type":25,"tag":134,"props":3223,"children":3224},{"style":392},[3225],{"type":31,"value":2985},{"type":25,"tag":134,"props":3227,"children":3228},{"style":170},[3229],{"type":31,"value":1281},{"type":25,"tag":134,"props":3231,"children":3232},{"style":240},[3233],{"type":31,"value":3234},"1",{"type":25,"tag":134,"props":3236,"children":3237},{"style":170},[3238],{"type":31,"value":3135},{"type":25,"tag":134,"props":3240,"children":3241},{"style":392},[3242],{"type":31,"value":2534},{"type":25,"tag":134,"props":3244,"children":3245},{"style":170},[3246],{"type":31,"value":237},{"type":25,"tag":134,"props":3248,"children":3249},{"style":240},[3250],{"type":31,"value":243},{"type":25,"tag":134,"props":3252,"children":3253},{"style":170},[3254],{"type":31,"value":248},{"type":25,"tag":134,"props":3256,"children":3258},{"class":136,"line":3257},25,[3259,3263,3267,3271,3275,3279,3283,3287],{"type":25,"tag":134,"props":3260,"children":3261},{"style":392},[3262],{"type":31,"value":2985},{"type":25,"tag":134,"props":3264,"children":3265},{"style":170},[3266],{"type":31,"value":1281},{"type":25,"tag":134,"props":3268,"children":3269},{"style":240},[3270],{"type":31,"value":414},{"type":25,"tag":134,"props":3272,"children":3273},{"style":170},[3274],{"type":31,"value":3135},{"type":25,"tag":134,"props":3276,"children":3277},{"style":392},[3278],{"type":31,"value":2534},{"type":25,"tag":134,"props":3280,"children":3281},{"style":170},[3282],{"type":31,"value":237},{"type":25,"tag":134,"props":3284,"children":3285},{"style":240},[3286],{"type":31,"value":2092},{"type":25,"tag":134,"props":3288,"children":3289},{"style":170},[3290],{"type":31,"value":248},{"type":25,"tag":134,"props":3292,"children":3294},{"class":136,"line":3293},26,[3295,3299,3303,3308,3312,3316,3320,3324],{"type":25,"tag":134,"props":3296,"children":3297},{"style":392},[3298],{"type":31,"value":2985},{"type":25,"tag":134,"props":3300,"children":3301},{"style":170},[3302],{"type":31,"value":1281},{"type":25,"tag":134,"props":3304,"children":3305},{"style":240},[3306],{"type":31,"value":3307},"3",{"type":25,"tag":134,"props":3309,"children":3310},{"style":170},[3311],{"type":31,"value":3135},{"type":25,"tag":134,"props":3313,"children":3314},{"style":392},[3315],{"type":31,"value":2534},{"type":25,"tag":134,"props":3317,"children":3318},{"style":170},[3319],{"type":31,"value":237},{"type":25,"tag":134,"props":3321,"children":3322},{"style":240},[3323],{"type":31,"value":2092},{"type":25,"tag":134,"props":3325,"children":3326},{"style":170},[3327],{"type":31,"value":248},{"type":25,"tag":134,"props":3329,"children":3331},{"class":136,"line":3330},27,[3332],{"type":25,"tag":134,"props":3333,"children":3334},{"style":170},[3335],{"type":31,"value":519},{"type":25,"tag":134,"props":3337,"children":3339},{"class":136,"line":3338},28,[3340],{"type":25,"tag":134,"props":3341,"children":3342},{"style":170},[3343],{"type":31,"value":528},{"type":25,"tag":33,"props":3345,"children":3346},{},[3347,3353,3355,3361],{"type":25,"tag":46,"props":3348,"children":3350},{"className":3349},[],[3351],{"type":31,"value":3352},"Algorithm",{"type":31,"value":3354},"は第3回で見たAlg0〜7のenumです。",{"type":25,"tag":46,"props":3356,"children":3358},{"className":3357},[],[3359],{"type":31,"value":3360},"Feedback",{"type":31,"value":3362},"はOP1が自分自身を変調する量で、これも後で出てきます。",{"type":25,"tag":33,"props":3364,"children":3365},{},[3366,3368,3374,3376,3382,3384,3389],{"type":31,"value":3367},"既定値が第3回で「バランス型」と紹介したAlg4になっているのに注目してください。コンストラクタでOP1（モジュレータ）に",{"type":25,"tag":46,"props":3369,"children":3371},{"className":3370},[],[3372],{"type":31,"value":3373},"0.5",{"type":31,"value":3375},"、OP2（キャリア）に",{"type":25,"tag":46,"props":3377,"children":3379},{"className":3378},[],[3380],{"type":31,"value":3381},"1.0",{"type":31,"value":3383},"の出力レベルを与え、OP3・OP4は",{"type":25,"tag":46,"props":3385,"children":3387},{"className":3386},[],[3388],{"type":31,"value":3196},{"type":31,"value":3390},"にしています。つまり初期状態は、第2回で作った「モジュレータ→キャリア」の2オペレータFMが1組だけ鳴る設定です。第2回の到達点が、そのまま4オペレータ実装の初期値として埋め込まれているわけです。",{"type":25,"tag":33,"props":3392,"children":3393},{},[3394],{"type":31,"value":3395},"アルゴリズムのenumは、第3回の接続図をdocコメントとして持っています。",{"type":25,"tag":124,"props":3397,"children":3399},{"className":128,"code":3398,"language":127,"meta":8,"style":8},"public enum FMAlgorithm\n{\n    /// \u003Csummary>OP1 → OP2 → OP3 → OP4（OP4 がキャリア）\u003C/summary>\n    Alg0 = 0,\n    /// \u003Csummary>(OP1 + OP2) → OP3 → OP4\u003C/summary>\n    Alg1 = 1,\n    // ... Alg2〜Alg6 ...\n    /// \u003Csummary>OP1 + OP2 + OP3 + OP4（全並列）\u003C/summary>\n    Alg7 = 7,\n}\n",[3400],{"type":25,"tag":46,"props":3401,"children":3402},{"__ignoreMap":8},[3403,3420,3427,3469,3490,3526,3547,3555,3563,3584],{"type":25,"tag":134,"props":3404,"children":3405},{"class":136,"line":18},[3406,3410,3415],{"type":25,"tag":134,"props":3407,"children":3408},{"style":149},[3409],{"type":31,"value":152},{"type":25,"tag":134,"props":3411,"children":3412},{"style":149},[3413],{"type":31,"value":3414}," enum",{"type":25,"tag":134,"props":3416,"children":3417},{"style":160},[3418],{"type":31,"value":3419}," FMAlgorithm\n",{"type":25,"tag":134,"props":3421,"children":3422},{"class":136,"line":19},[3423],{"type":25,"tag":134,"props":3424,"children":3425},{"style":170},[3426],{"type":31,"value":173},{"type":25,"tag":134,"props":3428,"children":3429},{"class":136,"line":166},[3430,3435,3440,3445,3450,3455,3460,3464],{"type":25,"tag":134,"props":3431,"children":3432},{"style":140},[3433],{"type":31,"value":3434},"    /// ",{"type":25,"tag":134,"props":3436,"children":3437},{"style":170},[3438],{"type":31,"value":3439},"\u003C",{"type":25,"tag":134,"props":3441,"children":3442},{"style":194},[3443],{"type":31,"value":3444},"summary",{"type":25,"tag":134,"props":3446,"children":3447},{"style":170},[3448],{"type":31,"value":3449},">",{"type":25,"tag":134,"props":3451,"children":3452},{"style":140},[3453],{"type":31,"value":3454},"OP1 → OP2 → OP3 → OP4（OP4 がキャリア）",{"type":25,"tag":134,"props":3456,"children":3457},{"style":170},[3458],{"type":31,"value":3459},"\u003C/",{"type":25,"tag":134,"props":3461,"children":3462},{"style":194},[3463],{"type":31,"value":3444},{"type":25,"tag":134,"props":3465,"children":3466},{"style":170},[3467],{"type":31,"value":3468},">\n",{"type":25,"tag":134,"props":3470,"children":3471},{"class":136,"line":176},[3472,3477,3481,3485],{"type":25,"tag":134,"props":3473,"children":3474},{"style":200},[3475],{"type":31,"value":3476},"    Alg0",{"type":25,"tag":134,"props":3478,"children":3479},{"style":170},[3480],{"type":31,"value":237},{"type":25,"tag":134,"props":3482,"children":3483},{"style":240},[3484],{"type":31,"value":911},{"type":25,"tag":134,"props":3486,"children":3487},{"style":170},[3488],{"type":31,"value":3489},",\n",{"type":25,"tag":134,"props":3491,"children":3492},{"class":136,"line":185},[3493,3497,3501,3505,3509,3514,3518,3522],{"type":25,"tag":134,"props":3494,"children":3495},{"style":140},[3496],{"type":31,"value":3434},{"type":25,"tag":134,"props":3498,"children":3499},{"style":170},[3500],{"type":31,"value":3439},{"type":25,"tag":134,"props":3502,"children":3503},{"style":194},[3504],{"type":31,"value":3444},{"type":25,"tag":134,"props":3506,"children":3507},{"style":170},[3508],{"type":31,"value":3449},{"type":25,"tag":134,"props":3510,"children":3511},{"style":140},[3512],{"type":31,"value":3513},"(OP1 + OP2) → OP3 → OP4",{"type":25,"tag":134,"props":3515,"children":3516},{"style":170},[3517],{"type":31,"value":3459},{"type":25,"tag":134,"props":3519,"children":3520},{"style":194},[3521],{"type":31,"value":3444},{"type":25,"tag":134,"props":3523,"children":3524},{"style":170},[3525],{"type":31,"value":3468},{"type":25,"tag":134,"props":3527,"children":3528},{"class":136,"line":251},[3529,3534,3538,3543],{"type":25,"tag":134,"props":3530,"children":3531},{"style":200},[3532],{"type":31,"value":3533},"    Alg1",{"type":25,"tag":134,"props":3535,"children":3536},{"style":170},[3537],{"type":31,"value":237},{"type":25,"tag":134,"props":3539,"children":3540},{"style":240},[3541],{"type":31,"value":3542}," 1",{"type":25,"tag":134,"props":3544,"children":3545},{"style":170},[3546],{"type":31,"value":3489},{"type":25,"tag":134,"props":3548,"children":3549},{"class":136,"line":261},[3550],{"type":25,"tag":134,"props":3551,"children":3552},{"style":140},[3553],{"type":31,"value":3554},"    // ... Alg2〜Alg6 ...\n",{"type":25,"tag":134,"props":3556,"children":3557},{"class":136,"line":283},[3558],{"type":25,"tag":134,"props":3559,"children":3560},{"style":140},[3561],{"type":31,"value":3562},"    /// \u003Csummary>OP1 + OP2 + OP3 + OP4（全並列）\u003C/summary>\n",{"type":25,"tag":134,"props":3564,"children":3565},{"class":136,"line":291},[3566,3571,3575,3580],{"type":25,"tag":134,"props":3567,"children":3568},{"style":200},[3569],{"type":31,"value":3570},"    Alg7",{"type":25,"tag":134,"props":3572,"children":3573},{"style":170},[3574],{"type":31,"value":237},{"type":25,"tag":134,"props":3576,"children":3577},{"style":240},[3578],{"type":31,"value":3579}," 7",{"type":25,"tag":134,"props":3581,"children":3582},{"style":170},[3583],{"type":31,"value":3489},{"type":25,"tag":134,"props":3585,"children":3586},{"class":136,"line":300},[3587],{"type":25,"tag":134,"props":3588,"children":3589},{"style":170},[3590],{"type":31,"value":528},{"type":25,"tag":26,"props":3592,"children":3594},{"id":3593},"波形生成第2回のループを4本に広げる",[3595],{"type":31,"value":3596},"波形生成：第2回のループを4本に広げる",{"type":25,"tag":33,"props":3598,"children":3599},{},[3600,3602,3607,3609,3615,3617,3622],{"type":31,"value":3601},"中心となるのが",{"type":25,"tag":46,"props":3603,"children":3605},{"className":3604},[],[3606],{"type":31,"value":1766},{"type":31,"value":3608},"の",{"type":25,"tag":46,"props":3610,"children":3612},{"className":3611},[],[3613],{"type":31,"value":3614},"GenerateWave",{"type":31,"value":3616},"です。第2回のループとの違いを意識しながら見てください。位相は4本ぶんの配列になり、それぞれ",{"type":25,"tag":46,"props":3618,"children":3620},{"className":3619},[],[3621],{"type":31,"value":105},{"type":31,"value":3623},"から周波数を決めます。",{"type":25,"tag":124,"props":3625,"children":3627},{"className":128,"code":3626,"language":127,"meta":8,"style":8},"public override short[] GenerateWave(SoundFormat format, int length, int volume, double hertz)\n{\n    var result = new short[length];\n    var sampleRate = (int)format.SamplingFrequency;\n    var volumeMagnification = volume / 100d;\n    const double twoPi = 2 * Math.PI;\n\n    Span\u003Cdouble> phases = stackalloc double[4];\n    Span\u003Cdouble> freqs = stackalloc double[4];\n    for (var i = 0; i \u003C 4; i++)\n    {\n        freqs[i] = hertz * _ops[i].Ratio;\n    }\n\n    double lastOp1 = 0;\n    Span\u003Cdouble> envs = stackalloc double[4];\n    var noteDuration = (double)length / sampleRate;\n\n    for (var i = 0; i \u003C length; i++)\n    {\n        var t = (double)i / sampleRate;\n        for (var k = 0; k \u003C 4; k++)\n        {\n            envs[k] = _ops[k].EnvelopeAt(t, noteDuration) * _ops[k].OutputLevel;\n        }\n\n        double op1, op2, op3, op4, output;\n        switch (_algorithm)\n        {\n            // ... アルゴリズムごとの分岐（次節）...\n        }\n\n        // 複数キャリアの和で振幅が溢れるのを防ぐクリップ\n        if (output > 1.0) output = 1.0;\n        else if (output \u003C -1.0) output = -1.0;\n\n        result[i] = (short)(short.MaxValue * volumeMagnification * output);\n\n        for (var k = 0; k \u003C 4; k++)\n        {\n            phases[k] += freqs[k] / sampleRate;\n        }\n    }\n    return result;\n}\n",[3628],{"type":25,"tag":46,"props":3629,"children":3630},{"__ignoreMap":8},[3631,3710,3717,3752,3798,3829,3875,3882,3933,3981,4040,4047,4104,4111,4118,4143,4191,4235,4242,4301,4308,4352,4412,4419,4514,4521,4528,4581,4602,4610,4619,4627,4635,4644,4691,4750,4758,4826,4834,4894,4902,4955,4963,4971,4987],{"type":25,"tag":134,"props":3632,"children":3633},{"class":136,"line":18},[3634,3638,3643,3647,3651,3656,3660,3665,3670,3674,3678,3682,3686,3690,3694,3698,3702,3706],{"type":25,"tag":134,"props":3635,"children":3636},{"style":149},[3637],{"type":31,"value":152},{"type":25,"tag":134,"props":3639,"children":3640},{"style":149},[3641],{"type":31,"value":3642}," override",{"type":25,"tag":134,"props":3644,"children":3645},{"style":194},[3646],{"type":31,"value":1134},{"type":25,"tag":134,"props":3648,"children":3649},{"style":170},[3650],{"type":31,"value":1139},{"type":25,"tag":134,"props":3652,"children":3653},{"style":200},[3654],{"type":31,"value":3655}," GenerateWave",{"type":25,"tag":134,"props":3657,"children":3658},{"style":170},[3659],{"type":31,"value":319},{"type":25,"tag":134,"props":3661,"children":3662},{"style":160},[3663],{"type":31,"value":3664},"SoundFormat",{"type":25,"tag":134,"props":3666,"children":3667},{"style":200},[3668],{"type":31,"value":3669}," format",{"type":25,"tag":134,"props":3671,"children":3672},{"style":170},[3673],{"type":31,"value":334},{"type":25,"tag":134,"props":3675,"children":3676},{"style":194},[3677],{"type":31,"value":339},{"type":25,"tag":134,"props":3679,"children":3680},{"style":200},[3681],{"type":31,"value":1182},{"type":25,"tag":134,"props":3683,"children":3684},{"style":170},[3685],{"type":31,"value":334},{"type":25,"tag":134,"props":3687,"children":3688},{"style":194},[3689],{"type":31,"value":339},{"type":25,"tag":134,"props":3691,"children":3692},{"style":200},[3693],{"type":31,"value":1195},{"type":25,"tag":134,"props":3695,"children":3696},{"style":170},[3697],{"type":31,"value":334},{"type":25,"tag":134,"props":3699,"children":3700},{"style":194},[3701],{"type":31,"value":197},{"type":25,"tag":134,"props":3703,"children":3704},{"style":200},[3705],{"type":31,"value":1157},{"type":25,"tag":134,"props":3707,"children":3708},{"style":170},[3709],{"type":31,"value":362},{"type":25,"tag":134,"props":3711,"children":3712},{"class":136,"line":19},[3713],{"type":25,"tag":134,"props":3714,"children":3715},{"style":170},[3716],{"type":31,"value":173},{"type":25,"tag":134,"props":3718,"children":3719},{"class":136,"line":166},[3720,3724,3728,3732,3736,3740,3744,3748],{"type":25,"tag":134,"props":3721,"children":3722},{"style":149},[3723],{"type":31,"value":1214},{"type":25,"tag":134,"props":3725,"children":3726},{"style":200},[3727],{"type":31,"value":1264},{"type":25,"tag":134,"props":3729,"children":3730},{"style":170},[3731],{"type":31,"value":237},{"type":25,"tag":134,"props":3733,"children":3734},{"style":149},[3735],{"type":31,"value":646},{"type":25,"tag":134,"props":3737,"children":3738},{"style":194},[3739],{"type":31,"value":1134},{"type":25,"tag":134,"props":3741,"children":3742},{"style":170},[3743],{"type":31,"value":1281},{"type":25,"tag":134,"props":3745,"children":3746},{"style":392},[3747],{"type":31,"value":1286},{"type":25,"tag":134,"props":3749,"children":3750},{"style":170},[3751],{"type":31,"value":1291},{"type":25,"tag":134,"props":3753,"children":3754},{"class":136,"line":176},[3755,3759,3763,3767,3771,3776,3780,3785,3789,3794],{"type":25,"tag":134,"props":3756,"children":3757},{"style":149},[3758],{"type":31,"value":1214},{"type":25,"tag":134,"props":3760,"children":3761},{"style":200},[3762],{"type":31,"value":344},{"type":25,"tag":134,"props":3764,"children":3765},{"style":170},[3766],{"type":31,"value":237},{"type":25,"tag":134,"props":3768,"children":3769},{"style":170},[3770],{"type":31,"value":1344},{"type":25,"tag":134,"props":3772,"children":3773},{"style":194},[3774],{"type":31,"value":3775},"int",{"type":25,"tag":134,"props":3777,"children":3778},{"style":170},[3779],{"type":31,"value":916},{"type":25,"tag":134,"props":3781,"children":3782},{"style":392},[3783],{"type":31,"value":3784},"format",{"type":25,"tag":134,"props":3786,"children":3787},{"style":170},[3788],{"type":31,"value":400},{"type":25,"tag":134,"props":3790,"children":3791},{"style":392},[3792],{"type":31,"value":3793},"SamplingFrequency",{"type":25,"tag":134,"props":3795,"children":3796},{"style":170},[3797],{"type":31,"value":248},{"type":25,"tag":134,"props":3799,"children":3800},{"class":136,"line":185},[3801,3805,3809,3813,3817,3821,3825],{"type":25,"tag":134,"props":3802,"children":3803},{"style":149},[3804],{"type":31,"value":1214},{"type":25,"tag":134,"props":3806,"children":3807},{"style":200},[3808],{"type":31,"value":1303},{"type":25,"tag":134,"props":3810,"children":3811},{"style":170},[3812],{"type":31,"value":237},{"type":25,"tag":134,"props":3814,"children":3815},{"style":392},[3816],{"type":31,"value":1195},{"type":25,"tag":134,"props":3818,"children":3819},{"style":149},[3820],{"type":31,"value":485},{"type":25,"tag":134,"props":3822,"children":3823},{"style":240},[3824],{"type":31,"value":1320},{"type":25,"tag":134,"props":3826,"children":3827},{"style":170},[3828],{"type":31,"value":248},{"type":25,"tag":134,"props":3830,"children":3831},{"class":136,"line":251},[3832,3837,3841,3846,3850,3855,3859,3863,3867,3871],{"type":25,"tag":134,"props":3833,"children":3834},{"style":149},[3835],{"type":31,"value":3836},"    const",{"type":25,"tag":134,"props":3838,"children":3839},{"style":194},[3840],{"type":31,"value":197},{"type":25,"tag":134,"props":3842,"children":3843},{"style":200},[3844],{"type":31,"value":3845}," twoPi",{"type":25,"tag":134,"props":3847,"children":3848},{"style":170},[3849],{"type":31,"value":237},{"type":25,"tag":134,"props":3851,"children":3852},{"style":240},[3853],{"type":31,"value":3854}," 2",{"type":25,"tag":134,"props":3856,"children":3857},{"style":149},[3858],{"type":31,"value":419},{"type":25,"tag":134,"props":3860,"children":3861},{"style":392},[3862],{"type":31,"value":395},{"type":25,"tag":134,"props":3864,"children":3865},{"style":170},[3866],{"type":31,"value":400},{"type":25,"tag":134,"props":3868,"children":3869},{"style":392},[3870],{"type":31,"value":432},{"type":25,"tag":134,"props":3872,"children":3873},{"style":170},[3874],{"type":31,"value":248},{"type":25,"tag":134,"props":3876,"children":3877},{"class":136,"line":261},[3878],{"type":25,"tag":134,"props":3879,"children":3880},{"emptyLinePlaceholder":255},[3881],{"type":31,"value":258},{"type":25,"tag":134,"props":3883,"children":3884},{"class":136,"line":283},[3885,3890,3894,3898,3902,3907,3911,3916,3920,3924,3929],{"type":25,"tag":134,"props":3886,"children":3887},{"style":160},[3888],{"type":31,"value":3889},"    Span",{"type":25,"tag":134,"props":3891,"children":3892},{"style":170},[3893],{"type":31,"value":3439},{"type":25,"tag":134,"props":3895,"children":3896},{"style":194},[3897],{"type":31,"value":324},{"type":25,"tag":134,"props":3899,"children":3900},{"style":170},[3901],{"type":31,"value":3449},{"type":25,"tag":134,"props":3903,"children":3904},{"style":200},[3905],{"type":31,"value":3906}," phases",{"type":25,"tag":134,"props":3908,"children":3909},{"style":170},[3910],{"type":31,"value":237},{"type":25,"tag":134,"props":3912,"children":3913},{"style":149},[3914],{"type":31,"value":3915}," stackalloc",{"type":25,"tag":134,"props":3917,"children":3918},{"style":194},[3919],{"type":31,"value":197},{"type":25,"tag":134,"props":3921,"children":3922},{"style":170},[3923],{"type":31,"value":1281},{"type":25,"tag":134,"props":3925,"children":3926},{"style":240},[3927],{"type":31,"value":3928},"4",{"type":25,"tag":134,"props":3930,"children":3931},{"style":170},[3932],{"type":31,"value":1291},{"type":25,"tag":134,"props":3934,"children":3935},{"class":136,"line":291},[3936,3940,3944,3948,3952,3957,3961,3965,3969,3973,3977],{"type":25,"tag":134,"props":3937,"children":3938},{"style":160},[3939],{"type":31,"value":3889},{"type":25,"tag":134,"props":3941,"children":3942},{"style":170},[3943],{"type":31,"value":3439},{"type":25,"tag":134,"props":3945,"children":3946},{"style":194},[3947],{"type":31,"value":324},{"type":25,"tag":134,"props":3949,"children":3950},{"style":170},[3951],{"type":31,"value":3449},{"type":25,"tag":134,"props":3953,"children":3954},{"style":200},[3955],{"type":31,"value":3956}," freqs",{"type":25,"tag":134,"props":3958,"children":3959},{"style":170},[3960],{"type":31,"value":237},{"type":25,"tag":134,"props":3962,"children":3963},{"style":149},[3964],{"type":31,"value":3915},{"type":25,"tag":134,"props":3966,"children":3967},{"style":194},[3968],{"type":31,"value":197},{"type":25,"tag":134,"props":3970,"children":3971},{"style":170},[3972],{"type":31,"value":1281},{"type":25,"tag":134,"props":3974,"children":3975},{"style":240},[3976],{"type":31,"value":3928},{"type":25,"tag":134,"props":3978,"children":3979},{"style":170},[3980],{"type":31,"value":1291},{"type":25,"tag":134,"props":3982,"children":3983},{"class":136,"line":300},[3984,3988,3992,3996,4000,4004,4008,4012,4016,4020,4024,4028,4032,4036],{"type":25,"tag":134,"props":3985,"children":3986},{"style":194},[3987],{"type":31,"value":1339},{"type":25,"tag":134,"props":3989,"children":3990},{"style":170},[3991],{"type":31,"value":1344},{"type":25,"tag":134,"props":3993,"children":3994},{"style":149},[3995],{"type":31,"value":1349},{"type":25,"tag":134,"props":3997,"children":3998},{"style":200},[3999],{"type":31,"value":1354},{"type":25,"tag":134,"props":4001,"children":4002},{"style":170},[4003],{"type":31,"value":237},{"type":25,"tag":134,"props":4005,"children":4006},{"style":240},[4007],{"type":31,"value":911},{"type":25,"tag":134,"props":4009,"children":4010},{"style":170},[4011],{"type":31,"value":218},{"type":25,"tag":134,"props":4013,"children":4014},{"style":392},[4015],{"type":31,"value":1354},{"type":25,"tag":134,"props":4017,"children":4018},{"style":170},[4019],{"type":31,"value":1375},{"type":25,"tag":134,"props":4021,"children":4022},{"style":240},[4023],{"type":31,"value":2668},{"type":25,"tag":134,"props":4025,"children":4026},{"style":170},[4027],{"type":31,"value":218},{"type":25,"tag":134,"props":4029,"children":4030},{"style":392},[4031],{"type":31,"value":1354},{"type":25,"tag":134,"props":4033,"children":4034},{"style":149},[4035],{"type":31,"value":1392},{"type":25,"tag":134,"props":4037,"children":4038},{"style":170},[4039],{"type":31,"value":362},{"type":25,"tag":134,"props":4041,"children":4042},{"class":136,"line":365},[4043],{"type":25,"tag":134,"props":4044,"children":4045},{"style":170},[4046],{"type":31,"value":371},{"type":25,"tag":134,"props":4048,"children":4049},{"class":136,"line":374},[4050,4055,4059,4063,4067,4071,4075,4079,4084,4088,4092,4096,4100],{"type":25,"tag":134,"props":4051,"children":4052},{"style":392},[4053],{"type":31,"value":4054},"        freqs",{"type":25,"tag":134,"props":4056,"children":4057},{"style":170},[4058],{"type":31,"value":1281},{"type":25,"tag":134,"props":4060,"children":4061},{"style":392},[4062],{"type":31,"value":1468},{"type":25,"tag":134,"props":4064,"children":4065},{"style":170},[4066],{"type":31,"value":1473},{"type":25,"tag":134,"props":4068,"children":4069},{"style":170},[4070],{"type":31,"value":237},{"type":25,"tag":134,"props":4072,"children":4073},{"style":392},[4074],{"type":31,"value":1157},{"type":25,"tag":134,"props":4076,"children":4077},{"style":149},[4078],{"type":31,"value":419},{"type":25,"tag":134,"props":4080,"children":4081},{"style":392},[4082],{"type":31,"value":4083}," _ops",{"type":25,"tag":134,"props":4085,"children":4086},{"style":170},[4087],{"type":31,"value":1281},{"type":25,"tag":134,"props":4089,"children":4090},{"style":392},[4091],{"type":31,"value":1468},{"type":25,"tag":134,"props":4093,"children":4094},{"style":170},[4095],{"type":31,"value":3135},{"type":25,"tag":134,"props":4097,"children":4098},{"style":392},[4099],{"type":31,"value":105},{"type":25,"tag":134,"props":4101,"children":4102},{"style":170},[4103],{"type":31,"value":248},{"type":25,"tag":134,"props":4105,"children":4106},{"class":136,"line":457},[4107],{"type":25,"tag":134,"props":4108,"children":4109},{"style":170},[4110],{"type":31,"value":519},{"type":25,"tag":134,"props":4112,"children":4113},{"class":136,"line":496},[4114],{"type":25,"tag":134,"props":4115,"children":4116},{"emptyLinePlaceholder":255},[4117],{"type":31,"value":258},{"type":25,"tag":134,"props":4119,"children":4120},{"class":136,"line":513},[4121,4126,4131,4135,4139],{"type":25,"tag":134,"props":4122,"children":4123},{"style":194},[4124],{"type":31,"value":4125},"    double",{"type":25,"tag":134,"props":4127,"children":4128},{"style":200},[4129],{"type":31,"value":4130}," lastOp1",{"type":25,"tag":134,"props":4132,"children":4133},{"style":170},[4134],{"type":31,"value":237},{"type":25,"tag":134,"props":4136,"children":4137},{"style":240},[4138],{"type":31,"value":911},{"type":25,"tag":134,"props":4140,"children":4141},{"style":170},[4142],{"type":31,"value":248},{"type":25,"tag":134,"props":4144,"children":4145},{"class":136,"line":522},[4146,4150,4154,4158,4162,4167,4171,4175,4179,4183,4187],{"type":25,"tag":134,"props":4147,"children":4148},{"style":160},[4149],{"type":31,"value":3889},{"type":25,"tag":134,"props":4151,"children":4152},{"style":170},[4153],{"type":31,"value":3439},{"type":25,"tag":134,"props":4155,"children":4156},{"style":194},[4157],{"type":31,"value":324},{"type":25,"tag":134,"props":4159,"children":4160},{"style":170},[4161],{"type":31,"value":3449},{"type":25,"tag":134,"props":4163,"children":4164},{"style":200},[4165],{"type":31,"value":4166}," envs",{"type":25,"tag":134,"props":4168,"children":4169},{"style":170},[4170],{"type":31,"value":237},{"type":25,"tag":134,"props":4172,"children":4173},{"style":149},[4174],{"type":31,"value":3915},{"type":25,"tag":134,"props":4176,"children":4177},{"style":194},[4178],{"type":31,"value":197},{"type":25,"tag":134,"props":4180,"children":4181},{"style":170},[4182],{"type":31,"value":1281},{"type":25,"tag":134,"props":4184,"children":4185},{"style":240},[4186],{"type":31,"value":3928},{"type":25,"tag":134,"props":4188,"children":4189},{"style":170},[4190],{"type":31,"value":1291},{"type":25,"tag":134,"props":4192,"children":4193},{"class":136,"line":2398},[4194,4198,4203,4207,4211,4215,4219,4223,4227,4231],{"type":25,"tag":134,"props":4195,"children":4196},{"style":149},[4197],{"type":31,"value":1214},{"type":25,"tag":134,"props":4199,"children":4200},{"style":200},[4201],{"type":31,"value":4202}," noteDuration",{"type":25,"tag":134,"props":4204,"children":4205},{"style":170},[4206],{"type":31,"value":237},{"type":25,"tag":134,"props":4208,"children":4209},{"style":170},[4210],{"type":31,"value":1344},{"type":25,"tag":134,"props":4212,"children":4213},{"style":194},[4214],{"type":31,"value":324},{"type":25,"tag":134,"props":4216,"children":4217},{"style":170},[4218],{"type":31,"value":916},{"type":25,"tag":134,"props":4220,"children":4221},{"style":392},[4222],{"type":31,"value":1286},{"type":25,"tag":134,"props":4224,"children":4225},{"style":149},[4226],{"type":31,"value":485},{"type":25,"tag":134,"props":4228,"children":4229},{"style":392},[4230],{"type":31,"value":344},{"type":25,"tag":134,"props":4232,"children":4233},{"style":170},[4234],{"type":31,"value":248},{"type":25,"tag":134,"props":4236,"children":4237},{"class":136,"line":2406},[4238],{"type":25,"tag":134,"props":4239,"children":4240},{"emptyLinePlaceholder":255},[4241],{"type":31,"value":258},{"type":25,"tag":134,"props":4243,"children":4244},{"class":136,"line":2436},[4245,4249,4253,4257,4261,4265,4269,4273,4277,4281,4285,4289,4293,4297],{"type":25,"tag":134,"props":4246,"children":4247},{"style":194},[4248],{"type":31,"value":1339},{"type":25,"tag":134,"props":4250,"children":4251},{"style":170},[4252],{"type":31,"value":1344},{"type":25,"tag":134,"props":4254,"children":4255},{"style":149},[4256],{"type":31,"value":1349},{"type":25,"tag":134,"props":4258,"children":4259},{"style":200},[4260],{"type":31,"value":1354},{"type":25,"tag":134,"props":4262,"children":4263},{"style":170},[4264],{"type":31,"value":237},{"type":25,"tag":134,"props":4266,"children":4267},{"style":240},[4268],{"type":31,"value":911},{"type":25,"tag":134,"props":4270,"children":4271},{"style":170},[4272],{"type":31,"value":218},{"type":25,"tag":134,"props":4274,"children":4275},{"style":392},[4276],{"type":31,"value":1354},{"type":25,"tag":134,"props":4278,"children":4279},{"style":170},[4280],{"type":31,"value":1375},{"type":25,"tag":134,"props":4282,"children":4283},{"style":392},[4284],{"type":31,"value":1182},{"type":25,"tag":134,"props":4286,"children":4287},{"style":170},[4288],{"type":31,"value":218},{"type":25,"tag":134,"props":4290,"children":4291},{"style":392},[4292],{"type":31,"value":1354},{"type":25,"tag":134,"props":4294,"children":4295},{"style":149},[4296],{"type":31,"value":1392},{"type":25,"tag":134,"props":4298,"children":4299},{"style":170},[4300],{"type":31,"value":362},{"type":25,"tag":134,"props":4302,"children":4303},{"class":136,"line":2513},[4304],{"type":25,"tag":134,"props":4305,"children":4306},{"style":170},[4307],{"type":31,"value":371},{"type":25,"tag":134,"props":4309,"children":4310},{"class":136,"line":3164},[4311,4315,4320,4324,4328,4332,4336,4340,4344,4348],{"type":25,"tag":134,"props":4312,"children":4313},{"style":149},[4314],{"type":31,"value":380},{"type":25,"tag":134,"props":4316,"children":4317},{"style":200},[4318],{"type":31,"value":4319}," t",{"type":25,"tag":134,"props":4321,"children":4322},{"style":170},[4323],{"type":31,"value":237},{"type":25,"tag":134,"props":4325,"children":4326},{"style":170},[4327],{"type":31,"value":1344},{"type":25,"tag":134,"props":4329,"children":4330},{"style":194},[4331],{"type":31,"value":324},{"type":25,"tag":134,"props":4333,"children":4334},{"style":170},[4335],{"type":31,"value":916},{"type":25,"tag":134,"props":4337,"children":4338},{"style":392},[4339],{"type":31,"value":1468},{"type":25,"tag":134,"props":4341,"children":4342},{"style":149},[4343],{"type":31,"value":485},{"type":25,"tag":134,"props":4345,"children":4346},{"style":392},[4347],{"type":31,"value":344},{"type":25,"tag":134,"props":4349,"children":4350},{"style":170},[4351],{"type":31,"value":248},{"type":25,"tag":134,"props":4353,"children":4354},{"class":136,"line":3173},[4355,4359,4363,4367,4372,4376,4380,4384,4388,4392,4396,4400,4404,4408],{"type":25,"tag":134,"props":4356,"children":4357},{"style":194},[4358],{"type":31,"value":3018},{"type":25,"tag":134,"props":4360,"children":4361},{"style":170},[4362],{"type":31,"value":1344},{"type":25,"tag":134,"props":4364,"children":4365},{"style":149},[4366],{"type":31,"value":1349},{"type":25,"tag":134,"props":4368,"children":4369},{"style":200},[4370],{"type":31,"value":4371}," k",{"type":25,"tag":134,"props":4373,"children":4374},{"style":170},[4375],{"type":31,"value":237},{"type":25,"tag":134,"props":4377,"children":4378},{"style":240},[4379],{"type":31,"value":911},{"type":25,"tag":134,"props":4381,"children":4382},{"style":170},[4383],{"type":31,"value":218},{"type":25,"tag":134,"props":4385,"children":4386},{"style":392},[4387],{"type":31,"value":4371},{"type":25,"tag":134,"props":4389,"children":4390},{"style":170},[4391],{"type":31,"value":1375},{"type":25,"tag":134,"props":4393,"children":4394},{"style":240},[4395],{"type":31,"value":2668},{"type":25,"tag":134,"props":4397,"children":4398},{"style":170},[4399],{"type":31,"value":218},{"type":25,"tag":134,"props":4401,"children":4402},{"style":392},[4403],{"type":31,"value":4371},{"type":25,"tag":134,"props":4405,"children":4406},{"style":149},[4407],{"type":31,"value":1392},{"type":25,"tag":134,"props":4409,"children":4410},{"style":170},[4411],{"type":31,"value":362},{"type":25,"tag":134,"props":4413,"children":4414},{"class":136,"line":3182},[4415],{"type":25,"tag":134,"props":4416,"children":4417},{"style":170},[4418],{"type":31,"value":3078},{"type":25,"tag":134,"props":4420,"children":4421},{"class":136,"line":3220},[4422,4427,4431,4436,4440,4444,4448,4452,4456,4460,4465,4469,4474,4478,4482,4486,4490,4494,4498,4502,4506,4510],{"type":25,"tag":134,"props":4423,"children":4424},{"style":392},[4425],{"type":31,"value":4426},"            envs",{"type":25,"tag":134,"props":4428,"children":4429},{"style":170},[4430],{"type":31,"value":1281},{"type":25,"tag":134,"props":4432,"children":4433},{"style":392},[4434],{"type":31,"value":4435},"k",{"type":25,"tag":134,"props":4437,"children":4438},{"style":170},[4439],{"type":31,"value":1473},{"type":25,"tag":134,"props":4441,"children":4442},{"style":170},[4443],{"type":31,"value":237},{"type":25,"tag":134,"props":4445,"children":4446},{"style":392},[4447],{"type":31,"value":4083},{"type":25,"tag":134,"props":4449,"children":4450},{"style":170},[4451],{"type":31,"value":1281},{"type":25,"tag":134,"props":4453,"children":4454},{"style":392},[4455],{"type":31,"value":4435},{"type":25,"tag":134,"props":4457,"children":4458},{"style":170},[4459],{"type":31,"value":3135},{"type":25,"tag":134,"props":4461,"children":4462},{"style":200},[4463],{"type":31,"value":4464},"EnvelopeAt",{"type":25,"tag":134,"props":4466,"children":4467},{"style":170},[4468],{"type":31,"value":319},{"type":25,"tag":134,"props":4470,"children":4471},{"style":392},[4472],{"type":31,"value":4473},"t",{"type":25,"tag":134,"props":4475,"children":4476},{"style":170},[4477],{"type":31,"value":334},{"type":25,"tag":134,"props":4479,"children":4480},{"style":392},[4481],{"type":31,"value":4202},{"type":25,"tag":134,"props":4483,"children":4484},{"style":170},[4485],{"type":31,"value":916},{"type":25,"tag":134,"props":4487,"children":4488},{"style":149},[4489],{"type":31,"value":419},{"type":25,"tag":134,"props":4491,"children":4492},{"style":392},[4493],{"type":31,"value":4083},{"type":25,"tag":134,"props":4495,"children":4496},{"style":170},[4497],{"type":31,"value":1281},{"type":25,"tag":134,"props":4499,"children":4500},{"style":392},[4501],{"type":31,"value":4435},{"type":25,"tag":134,"props":4503,"children":4504},{"style":170},[4505],{"type":31,"value":3135},{"type":25,"tag":134,"props":4507,"children":4508},{"style":392},[4509],{"type":31,"value":2534},{"type":25,"tag":134,"props":4511,"children":4512},{"style":170},[4513],{"type":31,"value":248},{"type":25,"tag":134,"props":4515,"children":4516},{"class":136,"line":3257},[4517],{"type":25,"tag":134,"props":4518,"children":4519},{"style":170},[4520],{"type":31,"value":3161},{"type":25,"tag":134,"props":4522,"children":4523},{"class":136,"line":3293},[4524],{"type":25,"tag":134,"props":4525,"children":4526},{"emptyLinePlaceholder":255},[4527],{"type":31,"value":258},{"type":25,"tag":134,"props":4529,"children":4530},{"class":136,"line":3330},[4531,4536,4541,4545,4550,4554,4559,4563,4568,4572,4577],{"type":25,"tag":134,"props":4532,"children":4533},{"style":194},[4534],{"type":31,"value":4535},"        double",{"type":25,"tag":134,"props":4537,"children":4538},{"style":200},[4539],{"type":31,"value":4540}," op1",{"type":25,"tag":134,"props":4542,"children":4543},{"style":170},[4544],{"type":31,"value":334},{"type":25,"tag":134,"props":4546,"children":4547},{"style":200},[4548],{"type":31,"value":4549}," op2",{"type":25,"tag":134,"props":4551,"children":4552},{"style":170},[4553],{"type":31,"value":334},{"type":25,"tag":134,"props":4555,"children":4556},{"style":200},[4557],{"type":31,"value":4558}," op3",{"type":25,"tag":134,"props":4560,"children":4561},{"style":170},[4562],{"type":31,"value":334},{"type":25,"tag":134,"props":4564,"children":4565},{"style":200},[4566],{"type":31,"value":4567}," op4",{"type":25,"tag":134,"props":4569,"children":4570},{"style":170},[4571],{"type":31,"value":334},{"type":25,"tag":134,"props":4573,"children":4574},{"style":200},[4575],{"type":31,"value":4576}," output",{"type":25,"tag":134,"props":4578,"children":4579},{"style":170},[4580],{"type":31,"value":248},{"type":25,"tag":134,"props":4582,"children":4583},{"class":136,"line":3338},[4584,4589,4593,4598],{"type":25,"tag":134,"props":4585,"children":4586},{"style":194},[4587],{"type":31,"value":4588},"        switch",{"type":25,"tag":134,"props":4590,"children":4591},{"style":170},[4592],{"type":31,"value":1344},{"type":25,"tag":134,"props":4594,"children":4595},{"style":392},[4596],{"type":31,"value":4597},"_algorithm",{"type":25,"tag":134,"props":4599,"children":4600},{"style":170},[4601],{"type":31,"value":362},{"type":25,"tag":134,"props":4603,"children":4605},{"class":136,"line":4604},29,[4606],{"type":25,"tag":134,"props":4607,"children":4608},{"style":170},[4609],{"type":31,"value":3078},{"type":25,"tag":134,"props":4611,"children":4613},{"class":136,"line":4612},30,[4614],{"type":25,"tag":134,"props":4615,"children":4616},{"style":140},[4617],{"type":31,"value":4618},"            // ... アルゴリズムごとの分岐（次節）...\n",{"type":25,"tag":134,"props":4620,"children":4622},{"class":136,"line":4621},31,[4623],{"type":25,"tag":134,"props":4624,"children":4625},{"style":170},[4626],{"type":31,"value":3161},{"type":25,"tag":134,"props":4628,"children":4630},{"class":136,"line":4629},32,[4631],{"type":25,"tag":134,"props":4632,"children":4633},{"emptyLinePlaceholder":255},[4634],{"type":31,"value":258},{"type":25,"tag":134,"props":4636,"children":4638},{"class":136,"line":4637},33,[4639],{"type":25,"tag":134,"props":4640,"children":4641},{"style":140},[4642],{"type":31,"value":4643},"        // 複数キャリアの和で振幅が溢れるのを防ぐクリップ\n",{"type":25,"tag":134,"props":4645,"children":4647},{"class":136,"line":4646},34,[4648,4653,4657,4662,4667,4671,4675,4679,4683,4687],{"type":25,"tag":134,"props":4649,"children":4650},{"style":194},[4651],{"type":31,"value":4652},"        if",{"type":25,"tag":134,"props":4654,"children":4655},{"style":170},[4656],{"type":31,"value":1344},{"type":25,"tag":134,"props":4658,"children":4659},{"style":392},[4660],{"type":31,"value":4661},"output",{"type":25,"tag":134,"props":4663,"children":4664},{"style":170},[4665],{"type":31,"value":4666}," >",{"type":25,"tag":134,"props":4668,"children":4669},{"style":240},[4670],{"type":31,"value":243},{"type":25,"tag":134,"props":4672,"children":4673},{"style":170},[4674],{"type":31,"value":916},{"type":25,"tag":134,"props":4676,"children":4677},{"style":392},[4678],{"type":31,"value":4576},{"type":25,"tag":134,"props":4680,"children":4681},{"style":170},[4682],{"type":31,"value":237},{"type":25,"tag":134,"props":4684,"children":4685},{"style":240},[4686],{"type":31,"value":243},{"type":25,"tag":134,"props":4688,"children":4689},{"style":170},[4690],{"type":31,"value":248},{"type":25,"tag":134,"props":4692,"children":4694},{"class":136,"line":4693},35,[4695,4700,4705,4709,4713,4717,4722,4726,4730,4734,4738,4742,4746],{"type":25,"tag":134,"props":4696,"children":4697},{"style":194},[4698],{"type":31,"value":4699},"        else",{"type":25,"tag":134,"props":4701,"children":4702},{"style":194},[4703],{"type":31,"value":4704}," if",{"type":25,"tag":134,"props":4706,"children":4707},{"style":170},[4708],{"type":31,"value":1344},{"type":25,"tag":134,"props":4710,"children":4711},{"style":392},[4712],{"type":31,"value":4661},{"type":25,"tag":134,"props":4714,"children":4715},{"style":170},[4716],{"type":31,"value":1375},{"type":25,"tag":134,"props":4718,"children":4719},{"style":149},[4720],{"type":31,"value":4721}," -",{"type":25,"tag":134,"props":4723,"children":4724},{"style":240},[4725],{"type":31,"value":3381},{"type":25,"tag":134,"props":4727,"children":4728},{"style":170},[4729],{"type":31,"value":916},{"type":25,"tag":134,"props":4731,"children":4732},{"style":392},[4733],{"type":31,"value":4576},{"type":25,"tag":134,"props":4735,"children":4736},{"style":170},[4737],{"type":31,"value":237},{"type":25,"tag":134,"props":4739,"children":4740},{"style":149},[4741],{"type":31,"value":4721},{"type":25,"tag":134,"props":4743,"children":4744},{"style":240},[4745],{"type":31,"value":3381},{"type":25,"tag":134,"props":4747,"children":4748},{"style":170},[4749],{"type":31,"value":248},{"type":25,"tag":134,"props":4751,"children":4753},{"class":136,"line":4752},36,[4754],{"type":25,"tag":134,"props":4755,"children":4756},{"emptyLinePlaceholder":255},[4757],{"type":31,"value":258},{"type":25,"tag":134,"props":4759,"children":4761},{"class":136,"line":4760},37,[4762,4766,4770,4774,4778,4782,4786,4790,4794,4798,4802,4806,4810,4814,4818,4822],{"type":25,"tag":134,"props":4763,"children":4764},{"style":392},[4765],{"type":31,"value":1459},{"type":25,"tag":134,"props":4767,"children":4768},{"style":170},[4769],{"type":31,"value":1281},{"type":25,"tag":134,"props":4771,"children":4772},{"style":392},[4773],{"type":31,"value":1468},{"type":25,"tag":134,"props":4775,"children":4776},{"style":170},[4777],{"type":31,"value":1473},{"type":25,"tag":134,"props":4779,"children":4780},{"style":170},[4781],{"type":31,"value":237},{"type":25,"tag":134,"props":4783,"children":4784},{"style":170},[4785],{"type":31,"value":1344},{"type":25,"tag":134,"props":4787,"children":4788},{"style":194},[4789],{"type":31,"value":1100},{"type":25,"tag":134,"props":4791,"children":4792},{"style":170},[4793],{"type":31,"value":1490},{"type":25,"tag":134,"props":4795,"children":4796},{"style":194},[4797],{"type":31,"value":1100},{"type":25,"tag":134,"props":4799,"children":4800},{"style":170},[4801],{"type":31,"value":400},{"type":25,"tag":134,"props":4803,"children":4804},{"style":392},[4805],{"type":31,"value":1503},{"type":25,"tag":134,"props":4807,"children":4808},{"style":149},[4809],{"type":31,"value":419},{"type":25,"tag":134,"props":4811,"children":4812},{"style":392},[4813],{"type":31,"value":1303},{"type":25,"tag":134,"props":4815,"children":4816},{"style":149},[4817],{"type":31,"value":419},{"type":25,"tag":134,"props":4819,"children":4820},{"style":392},[4821],{"type":31,"value":4576},{"type":25,"tag":134,"props":4823,"children":4824},{"style":170},[4825],{"type":31,"value":454},{"type":25,"tag":134,"props":4827,"children":4829},{"class":136,"line":4828},38,[4830],{"type":25,"tag":134,"props":4831,"children":4832},{"emptyLinePlaceholder":255},[4833],{"type":31,"value":258},{"type":25,"tag":134,"props":4835,"children":4837},{"class":136,"line":4836},39,[4838,4842,4846,4850,4854,4858,4862,4866,4870,4874,4878,4882,4886,4890],{"type":25,"tag":134,"props":4839,"children":4840},{"style":194},[4841],{"type":31,"value":3018},{"type":25,"tag":134,"props":4843,"children":4844},{"style":170},[4845],{"type":31,"value":1344},{"type":25,"tag":134,"props":4847,"children":4848},{"style":149},[4849],{"type":31,"value":1349},{"type":25,"tag":134,"props":4851,"children":4852},{"style":200},[4853],{"type":31,"value":4371},{"type":25,"tag":134,"props":4855,"children":4856},{"style":170},[4857],{"type":31,"value":237},{"type":25,"tag":134,"props":4859,"children":4860},{"style":240},[4861],{"type":31,"value":911},{"type":25,"tag":134,"props":4863,"children":4864},{"style":170},[4865],{"type":31,"value":218},{"type":25,"tag":134,"props":4867,"children":4868},{"style":392},[4869],{"type":31,"value":4371},{"type":25,"tag":134,"props":4871,"children":4872},{"style":170},[4873],{"type":31,"value":1375},{"type":25,"tag":134,"props":4875,"children":4876},{"style":240},[4877],{"type":31,"value":2668},{"type":25,"tag":134,"props":4879,"children":4880},{"style":170},[4881],{"type":31,"value":218},{"type":25,"tag":134,"props":4883,"children":4884},{"style":392},[4885],{"type":31,"value":4371},{"type":25,"tag":134,"props":4887,"children":4888},{"style":149},[4889],{"type":31,"value":1392},{"type":25,"tag":134,"props":4891,"children":4892},{"style":170},[4893],{"type":31,"value":362},{"type":25,"tag":134,"props":4895,"children":4897},{"class":136,"line":4896},40,[4898],{"type":25,"tag":134,"props":4899,"children":4900},{"style":170},[4901],{"type":31,"value":3078},{"type":25,"tag":134,"props":4903,"children":4905},{"class":136,"line":4904},41,[4906,4911,4915,4919,4923,4927,4931,4935,4939,4943,4947,4951],{"type":25,"tag":134,"props":4907,"children":4908},{"style":392},[4909],{"type":31,"value":4910},"            phases",{"type":25,"tag":134,"props":4912,"children":4913},{"style":170},[4914],{"type":31,"value":1281},{"type":25,"tag":134,"props":4916,"children":4917},{"style":392},[4918],{"type":31,"value":4435},{"type":25,"tag":134,"props":4920,"children":4921},{"style":170},[4922],{"type":31,"value":1473},{"type":25,"tag":134,"props":4924,"children":4925},{"style":149},[4926],{"type":31,"value":468},{"type":25,"tag":134,"props":4928,"children":4929},{"style":392},[4930],{"type":31,"value":3956},{"type":25,"tag":134,"props":4932,"children":4933},{"style":170},[4934],{"type":31,"value":1281},{"type":25,"tag":134,"props":4936,"children":4937},{"style":392},[4938],{"type":31,"value":4435},{"type":25,"tag":134,"props":4940,"children":4941},{"style":170},[4942],{"type":31,"value":1473},{"type":25,"tag":134,"props":4944,"children":4945},{"style":149},[4946],{"type":31,"value":485},{"type":25,"tag":134,"props":4948,"children":4949},{"style":392},[4950],{"type":31,"value":344},{"type":25,"tag":134,"props":4952,"children":4953},{"style":170},[4954],{"type":31,"value":248},{"type":25,"tag":134,"props":4956,"children":4958},{"class":136,"line":4957},42,[4959],{"type":25,"tag":134,"props":4960,"children":4961},{"style":170},[4962],{"type":31,"value":3161},{"type":25,"tag":134,"props":4964,"children":4966},{"class":136,"line":4965},43,[4967],{"type":25,"tag":134,"props":4968,"children":4969},{"style":170},[4970],{"type":31,"value":519},{"type":25,"tag":134,"props":4972,"children":4974},{"class":136,"line":4973},44,[4975,4979,4983],{"type":25,"tag":134,"props":4976,"children":4977},{"style":194},[4978],{"type":31,"value":1538},{"type":25,"tag":134,"props":4980,"children":4981},{"style":392},[4982],{"type":31,"value":1264},{"type":25,"tag":134,"props":4984,"children":4985},{"style":170},[4986],{"type":31,"value":248},{"type":25,"tag":134,"props":4988,"children":4990},{"class":136,"line":4989},45,[4991],{"type":25,"tag":134,"props":4992,"children":4993},{"style":170},[4994],{"type":31,"value":528},{"type":25,"tag":33,"props":4996,"children":4997},{},[4998,5000,5006,5008,5014,5016,5021,5023,5028,5030,5035],{"type":31,"value":4999},"骨格は第2回とまったく同じです。サンプルごとに各オペレータの値を計算し、最後に位相を",{"type":25,"tag":46,"props":5001,"children":5003},{"className":5002},[],[5004],{"type":31,"value":5005},"phases[k] += freqs[k] / sampleRate",{"type":31,"value":5007},"で進める。違いは、位相が4本になったこと、各サンプルでエンベロープ",{"type":25,"tag":46,"props":5009,"children":5011},{"className":5010},[],[5012],{"type":31,"value":5013},"envs[k]",{"type":31,"value":5015},"を計算していること、そして変調の繋ぎ方を",{"type":25,"tag":46,"props":5017,"children":5019},{"className":5018},[],[5020],{"type":31,"value":1774},{"type":31,"value":5022},"で切り替えていることだけです。",{"type":25,"tag":46,"props":5024,"children":5026},{"className":5025},[],[5027],{"type":31,"value":5013},{"type":31,"value":5029},"はエンベロープに",{"type":25,"tag":46,"props":5031,"children":5033},{"className":5032},[],[5034],{"type":31,"value":2534},{"type":31,"value":5036},"を掛けた値で、これが第2回の変調指数や音量の役割を一手に担います。",{"type":25,"tag":26,"props":5038,"children":5040},{"id":5039},"アルゴリズムをswitchで切り替える",[5041],{"type":31,"value":5039},{"type":25,"tag":33,"props":5043,"children":5044},{},[5045,5050],{"type":25,"tag":46,"props":5046,"children":5048},{"className":5047},[],[5049],{"type":31,"value":1774},{"type":31,"value":5051},"の中身が、第3回で図にした接続をそのままコードにしたものです。両極端と既定の3つを並べます。",{"type":25,"tag":124,"props":5053,"children":5055},{"className":128,"code":5054,"language":127,"meta":8,"style":8},"case FMAlgorithm.Alg0: // 1→2→3→4\n    op1 = Math.Sin(twoPi * phases[0] + _feedback * lastOp1) * envs[0];\n    op2 = Math.Sin(twoPi * phases[1] + op1) * envs[1];\n    op3 = Math.Sin(twoPi * phases[2] + op2) * envs[2];\n    op4 = Math.Sin(twoPi * phases[3] + op3) * envs[3];\n    output = op4;\n    lastOp1 = op1;\n    break;\n\ncase FMAlgorithm.Alg4: // (1→2)+(3→4)\n    op1 = Math.Sin(twoPi * phases[0] + _feedback * lastOp1) * envs[0];\n    op2 = Math.Sin(twoPi * phases[1] + op1) * envs[1];\n    op3 = Math.Sin(twoPi * phases[2]) * envs[2];\n    op4 = Math.Sin(twoPi * phases[3] + op3) * envs[3];\n    output = op2 + op4;\n    lastOp1 = op1;\n    break;\n\ncase FMAlgorithm.Alg7: // 1+2+3+4（全並列）\ndefault:\n    op1 = Math.Sin(twoPi * phases[0] + _feedback * lastOp1) * envs[0];\n    op2 = Math.Sin(twoPi * phases[1]) * envs[1];\n    op3 = Math.Sin(twoPi * phases[2]) * envs[2];\n    op4 = Math.Sin(twoPi * phases[3]) * envs[3];\n    output = op1 + op2 + op3 + op4;\n    lastOp1 = op1;\n    break;\n",[5056],{"type":25,"tag":46,"props":5057,"children":5058},{"__ignoreMap":8},[5059,5090,5183,5267,5351,5435,5455,5475,5487,5494,5522,5613,5696,5768,5851,5878,5897,5908,5915,5944,5957,6048,6119,6190,6261,6304,6323],{"type":25,"tag":134,"props":5060,"children":5061},{"class":136,"line":18},[5062,5067,5071,5075,5080,5085],{"type":25,"tag":134,"props":5063,"children":5064},{"style":392},[5065],{"type":31,"value":5066},"case",{"type":25,"tag":134,"props":5068,"children":5069},{"style":392},[5070],{"type":31,"value":2734},{"type":25,"tag":134,"props":5072,"children":5073},{"style":170},[5074],{"type":31,"value":400},{"type":25,"tag":134,"props":5076,"children":5077},{"style":392},[5078],{"type":31,"value":5079},"Alg0",{"type":25,"tag":134,"props":5081,"children":5082},{"style":149},[5083],{"type":31,"value":5084},":",{"type":25,"tag":134,"props":5086,"children":5087},{"style":140},[5088],{"type":31,"value":5089}," // 1→2→3→4\n",{"type":25,"tag":134,"props":5091,"children":5092},{"class":136,"line":19},[5093,5098,5102,5106,5110,5114,5118,5123,5127,5131,5135,5139,5143,5147,5151,5155,5159,5163,5167,5171,5175,5179],{"type":25,"tag":134,"props":5094,"children":5095},{"style":392},[5096],{"type":31,"value":5097},"    op1",{"type":25,"tag":134,"props":5099,"children":5100},{"style":170},[5101],{"type":31,"value":237},{"type":25,"tag":134,"props":5103,"children":5104},{"style":392},[5105],{"type":31,"value":395},{"type":25,"tag":134,"props":5107,"children":5108},{"style":170},[5109],{"type":31,"value":400},{"type":25,"tag":134,"props":5111,"children":5112},{"style":200},[5113],{"type":31,"value":405},{"type":25,"tag":134,"props":5115,"children":5116},{"style":170},[5117],{"type":31,"value":319},{"type":25,"tag":134,"props":5119,"children":5120},{"style":392},[5121],{"type":31,"value":5122},"twoPi",{"type":25,"tag":134,"props":5124,"children":5125},{"style":149},[5126],{"type":31,"value":419},{"type":25,"tag":134,"props":5128,"children":5129},{"style":392},[5130],{"type":31,"value":3906},{"type":25,"tag":134,"props":5132,"children":5133},{"style":170},[5134],{"type":31,"value":1281},{"type":25,"tag":134,"props":5136,"children":5137},{"style":240},[5138],{"type":31,"value":3196},{"type":25,"tag":134,"props":5140,"children":5141},{"style":170},[5142],{"type":31,"value":1473},{"type":25,"tag":134,"props":5144,"children":5145},{"style":149},[5146],{"type":31,"value":445},{"type":25,"tag":134,"props":5148,"children":5149},{"style":392},[5150],{"type":31,"value":2859},{"type":25,"tag":134,"props":5152,"children":5153},{"style":149},[5154],{"type":31,"value":419},{"type":25,"tag":134,"props":5156,"children":5157},{"style":392},[5158],{"type":31,"value":4130},{"type":25,"tag":134,"props":5160,"children":5161},{"style":170},[5162],{"type":31,"value":916},{"type":25,"tag":134,"props":5164,"children":5165},{"style":149},[5166],{"type":31,"value":419},{"type":25,"tag":134,"props":5168,"children":5169},{"style":392},[5170],{"type":31,"value":4166},{"type":25,"tag":134,"props":5172,"children":5173},{"style":170},[5174],{"type":31,"value":1281},{"type":25,"tag":134,"props":5176,"children":5177},{"style":240},[5178],{"type":31,"value":3196},{"type":25,"tag":134,"props":5180,"children":5181},{"style":170},[5182],{"type":31,"value":1291},{"type":25,"tag":134,"props":5184,"children":5185},{"class":136,"line":166},[5186,5191,5195,5199,5203,5207,5211,5215,5219,5223,5227,5231,5235,5239,5243,5247,5251,5255,5259,5263],{"type":25,"tag":134,"props":5187,"children":5188},{"style":392},[5189],{"type":31,"value":5190},"    op2",{"type":25,"tag":134,"props":5192,"children":5193},{"style":170},[5194],{"type":31,"value":237},{"type":25,"tag":134,"props":5196,"children":5197},{"style":392},[5198],{"type":31,"value":395},{"type":25,"tag":134,"props":5200,"children":5201},{"style":170},[5202],{"type":31,"value":400},{"type":25,"tag":134,"props":5204,"children":5205},{"style":200},[5206],{"type":31,"value":405},{"type":25,"tag":134,"props":5208,"children":5209},{"style":170},[5210],{"type":31,"value":319},{"type":25,"tag":134,"props":5212,"children":5213},{"style":392},[5214],{"type":31,"value":5122},{"type":25,"tag":134,"props":5216,"children":5217},{"style":149},[5218],{"type":31,"value":419},{"type":25,"tag":134,"props":5220,"children":5221},{"style":392},[5222],{"type":31,"value":3906},{"type":25,"tag":134,"props":5224,"children":5225},{"style":170},[5226],{"type":31,"value":1281},{"type":25,"tag":134,"props":5228,"children":5229},{"style":240},[5230],{"type":31,"value":3234},{"type":25,"tag":134,"props":5232,"children":5233},{"style":170},[5234],{"type":31,"value":1473},{"type":25,"tag":134,"props":5236,"children":5237},{"style":149},[5238],{"type":31,"value":445},{"type":25,"tag":134,"props":5240,"children":5241},{"style":392},[5242],{"type":31,"value":4540},{"type":25,"tag":134,"props":5244,"children":5245},{"style":170},[5246],{"type":31,"value":916},{"type":25,"tag":134,"props":5248,"children":5249},{"style":149},[5250],{"type":31,"value":419},{"type":25,"tag":134,"props":5252,"children":5253},{"style":392},[5254],{"type":31,"value":4166},{"type":25,"tag":134,"props":5256,"children":5257},{"style":170},[5258],{"type":31,"value":1281},{"type":25,"tag":134,"props":5260,"children":5261},{"style":240},[5262],{"type":31,"value":3234},{"type":25,"tag":134,"props":5264,"children":5265},{"style":170},[5266],{"type":31,"value":1291},{"type":25,"tag":134,"props":5268,"children":5269},{"class":136,"line":176},[5270,5275,5279,5283,5287,5291,5295,5299,5303,5307,5311,5315,5319,5323,5327,5331,5335,5339,5343,5347],{"type":25,"tag":134,"props":5271,"children":5272},{"style":392},[5273],{"type":31,"value":5274},"    op3",{"type":25,"tag":134,"props":5276,"children":5277},{"style":170},[5278],{"type":31,"value":237},{"type":25,"tag":134,"props":5280,"children":5281},{"style":392},[5282],{"type":31,"value":395},{"type":25,"tag":134,"props":5284,"children":5285},{"style":170},[5286],{"type":31,"value":400},{"type":25,"tag":134,"props":5288,"children":5289},{"style":200},[5290],{"type":31,"value":405},{"type":25,"tag":134,"props":5292,"children":5293},{"style":170},[5294],{"type":31,"value":319},{"type":25,"tag":134,"props":5296,"children":5297},{"style":392},[5298],{"type":31,"value":5122},{"type":25,"tag":134,"props":5300,"children":5301},{"style":149},[5302],{"type":31,"value":419},{"type":25,"tag":134,"props":5304,"children":5305},{"style":392},[5306],{"type":31,"value":3906},{"type":25,"tag":134,"props":5308,"children":5309},{"style":170},[5310],{"type":31,"value":1281},{"type":25,"tag":134,"props":5312,"children":5313},{"style":240},[5314],{"type":31,"value":414},{"type":25,"tag":134,"props":5316,"children":5317},{"style":170},[5318],{"type":31,"value":1473},{"type":25,"tag":134,"props":5320,"children":5321},{"style":149},[5322],{"type":31,"value":445},{"type":25,"tag":134,"props":5324,"children":5325},{"style":392},[5326],{"type":31,"value":4549},{"type":25,"tag":134,"props":5328,"children":5329},{"style":170},[5330],{"type":31,"value":916},{"type":25,"tag":134,"props":5332,"children":5333},{"style":149},[5334],{"type":31,"value":419},{"type":25,"tag":134,"props":5336,"children":5337},{"style":392},[5338],{"type":31,"value":4166},{"type":25,"tag":134,"props":5340,"children":5341},{"style":170},[5342],{"type":31,"value":1281},{"type":25,"tag":134,"props":5344,"children":5345},{"style":240},[5346],{"type":31,"value":414},{"type":25,"tag":134,"props":5348,"children":5349},{"style":170},[5350],{"type":31,"value":1291},{"type":25,"tag":134,"props":5352,"children":5353},{"class":136,"line":185},[5354,5359,5363,5367,5371,5375,5379,5383,5387,5391,5395,5399,5403,5407,5411,5415,5419,5423,5427,5431],{"type":25,"tag":134,"props":5355,"children":5356},{"style":392},[5357],{"type":31,"value":5358},"    op4",{"type":25,"tag":134,"props":5360,"children":5361},{"style":170},[5362],{"type":31,"value":237},{"type":25,"tag":134,"props":5364,"children":5365},{"style":392},[5366],{"type":31,"value":395},{"type":25,"tag":134,"props":5368,"children":5369},{"style":170},[5370],{"type":31,"value":400},{"type":25,"tag":134,"props":5372,"children":5373},{"style":200},[5374],{"type":31,"value":405},{"type":25,"tag":134,"props":5376,"children":5377},{"style":170},[5378],{"type":31,"value":319},{"type":25,"tag":134,"props":5380,"children":5381},{"style":392},[5382],{"type":31,"value":5122},{"type":25,"tag":134,"props":5384,"children":5385},{"style":149},[5386],{"type":31,"value":419},{"type":25,"tag":134,"props":5388,"children":5389},{"style":392},[5390],{"type":31,"value":3906},{"type":25,"tag":134,"props":5392,"children":5393},{"style":170},[5394],{"type":31,"value":1281},{"type":25,"tag":134,"props":5396,"children":5397},{"style":240},[5398],{"type":31,"value":3307},{"type":25,"tag":134,"props":5400,"children":5401},{"style":170},[5402],{"type":31,"value":1473},{"type":25,"tag":134,"props":5404,"children":5405},{"style":149},[5406],{"type":31,"value":445},{"type":25,"tag":134,"props":5408,"children":5409},{"style":392},[5410],{"type":31,"value":4558},{"type":25,"tag":134,"props":5412,"children":5413},{"style":170},[5414],{"type":31,"value":916},{"type":25,"tag":134,"props":5416,"children":5417},{"style":149},[5418],{"type":31,"value":419},{"type":25,"tag":134,"props":5420,"children":5421},{"style":392},[5422],{"type":31,"value":4166},{"type":25,"tag":134,"props":5424,"children":5425},{"style":170},[5426],{"type":31,"value":1281},{"type":25,"tag":134,"props":5428,"children":5429},{"style":240},[5430],{"type":31,"value":3307},{"type":25,"tag":134,"props":5432,"children":5433},{"style":170},[5434],{"type":31,"value":1291},{"type":25,"tag":134,"props":5436,"children":5437},{"class":136,"line":251},[5438,5443,5447,5451],{"type":25,"tag":134,"props":5439,"children":5440},{"style":392},[5441],{"type":31,"value":5442},"    output",{"type":25,"tag":134,"props":5444,"children":5445},{"style":170},[5446],{"type":31,"value":237},{"type":25,"tag":134,"props":5448,"children":5449},{"style":392},[5450],{"type":31,"value":4567},{"type":25,"tag":134,"props":5452,"children":5453},{"style":170},[5454],{"type":31,"value":248},{"type":25,"tag":134,"props":5456,"children":5457},{"class":136,"line":261},[5458,5463,5467,5471],{"type":25,"tag":134,"props":5459,"children":5460},{"style":392},[5461],{"type":31,"value":5462},"    lastOp1",{"type":25,"tag":134,"props":5464,"children":5465},{"style":170},[5466],{"type":31,"value":237},{"type":25,"tag":134,"props":5468,"children":5469},{"style":392},[5470],{"type":31,"value":4540},{"type":25,"tag":134,"props":5472,"children":5473},{"style":170},[5474],{"type":31,"value":248},{"type":25,"tag":134,"props":5476,"children":5477},{"class":136,"line":283},[5478,5483],{"type":25,"tag":134,"props":5479,"children":5480},{"style":194},[5481],{"type":31,"value":5482},"    break",{"type":25,"tag":134,"props":5484,"children":5485},{"style":170},[5486],{"type":31,"value":248},{"type":25,"tag":134,"props":5488,"children":5489},{"class":136,"line":291},[5490],{"type":25,"tag":134,"props":5491,"children":5492},{"emptyLinePlaceholder":255},[5493],{"type":31,"value":258},{"type":25,"tag":134,"props":5495,"children":5496},{"class":136,"line":300},[5497,5501,5505,5509,5513,5517],{"type":25,"tag":134,"props":5498,"children":5499},{"style":392},[5500],{"type":31,"value":5066},{"type":25,"tag":134,"props":5502,"children":5503},{"style":392},[5504],{"type":31,"value":2734},{"type":25,"tag":134,"props":5506,"children":5507},{"style":170},[5508],{"type":31,"value":400},{"type":25,"tag":134,"props":5510,"children":5511},{"style":392},[5512],{"type":31,"value":2756},{"type":25,"tag":134,"props":5514,"children":5515},{"style":149},[5516],{"type":31,"value":5084},{"type":25,"tag":134,"props":5518,"children":5519},{"style":140},[5520],{"type":31,"value":5521}," // (1→2)+(3→4)\n",{"type":25,"tag":134,"props":5523,"children":5524},{"class":136,"line":365},[5525,5529,5533,5537,5541,5545,5549,5553,5557,5561,5565,5569,5573,5577,5581,5585,5589,5593,5597,5601,5605,5609],{"type":25,"tag":134,"props":5526,"children":5527},{"style":392},[5528],{"type":31,"value":5097},{"type":25,"tag":134,"props":5530,"children":5531},{"style":170},[5532],{"type":31,"value":237},{"type":25,"tag":134,"props":5534,"children":5535},{"style":392},[5536],{"type":31,"value":395},{"type":25,"tag":134,"props":5538,"children":5539},{"style":170},[5540],{"type":31,"value":400},{"type":25,"tag":134,"props":5542,"children":5543},{"style":200},[5544],{"type":31,"value":405},{"type":25,"tag":134,"props":5546,"children":5547},{"style":170},[5548],{"type":31,"value":319},{"type":25,"tag":134,"props":5550,"children":5551},{"style":392},[5552],{"type":31,"value":5122},{"type":25,"tag":134,"props":5554,"children":5555},{"style":149},[5556],{"type":31,"value":419},{"type":25,"tag":134,"props":5558,"children":5559},{"style":392},[5560],{"type":31,"value":3906},{"type":25,"tag":134,"props":5562,"children":5563},{"style":170},[5564],{"type":31,"value":1281},{"type":25,"tag":134,"props":5566,"children":5567},{"style":240},[5568],{"type":31,"value":3196},{"type":25,"tag":134,"props":5570,"children":5571},{"style":170},[5572],{"type":31,"value":1473},{"type":25,"tag":134,"props":5574,"children":5575},{"style":149},[5576],{"type":31,"value":445},{"type":25,"tag":134,"props":5578,"children":5579},{"style":392},[5580],{"type":31,"value":2859},{"type":25,"tag":134,"props":5582,"children":5583},{"style":149},[5584],{"type":31,"value":419},{"type":25,"tag":134,"props":5586,"children":5587},{"style":392},[5588],{"type":31,"value":4130},{"type":25,"tag":134,"props":5590,"children":5591},{"style":170},[5592],{"type":31,"value":916},{"type":25,"tag":134,"props":5594,"children":5595},{"style":149},[5596],{"type":31,"value":419},{"type":25,"tag":134,"props":5598,"children":5599},{"style":392},[5600],{"type":31,"value":4166},{"type":25,"tag":134,"props":5602,"children":5603},{"style":170},[5604],{"type":31,"value":1281},{"type":25,"tag":134,"props":5606,"children":5607},{"style":240},[5608],{"type":31,"value":3196},{"type":25,"tag":134,"props":5610,"children":5611},{"style":170},[5612],{"type":31,"value":1291},{"type":25,"tag":134,"props":5614,"children":5615},{"class":136,"line":374},[5616,5620,5624,5628,5632,5636,5640,5644,5648,5652,5656,5660,5664,5668,5672,5676,5680,5684,5688,5692],{"type":25,"tag":134,"props":5617,"children":5618},{"style":392},[5619],{"type":31,"value":5190},{"type":25,"tag":134,"props":5621,"children":5622},{"style":170},[5623],{"type":31,"value":237},{"type":25,"tag":134,"props":5625,"children":5626},{"style":392},[5627],{"type":31,"value":395},{"type":25,"tag":134,"props":5629,"children":5630},{"style":170},[5631],{"type":31,"value":400},{"type":25,"tag":134,"props":5633,"children":5634},{"style":200},[5635],{"type":31,"value":405},{"type":25,"tag":134,"props":5637,"children":5638},{"style":170},[5639],{"type":31,"value":319},{"type":25,"tag":134,"props":5641,"children":5642},{"style":392},[5643],{"type":31,"value":5122},{"type":25,"tag":134,"props":5645,"children":5646},{"style":149},[5647],{"type":31,"value":419},{"type":25,"tag":134,"props":5649,"children":5650},{"style":392},[5651],{"type":31,"value":3906},{"type":25,"tag":134,"props":5653,"children":5654},{"style":170},[5655],{"type":31,"value":1281},{"type":25,"tag":134,"props":5657,"children":5658},{"style":240},[5659],{"type":31,"value":3234},{"type":25,"tag":134,"props":5661,"children":5662},{"style":170},[5663],{"type":31,"value":1473},{"type":25,"tag":134,"props":5665,"children":5666},{"style":149},[5667],{"type":31,"value":445},{"type":25,"tag":134,"props":5669,"children":5670},{"style":392},[5671],{"type":31,"value":4540},{"type":25,"tag":134,"props":5673,"children":5674},{"style":170},[5675],{"type":31,"value":916},{"type":25,"tag":134,"props":5677,"children":5678},{"style":149},[5679],{"type":31,"value":419},{"type":25,"tag":134,"props":5681,"children":5682},{"style":392},[5683],{"type":31,"value":4166},{"type":25,"tag":134,"props":5685,"children":5686},{"style":170},[5687],{"type":31,"value":1281},{"type":25,"tag":134,"props":5689,"children":5690},{"style":240},[5691],{"type":31,"value":3234},{"type":25,"tag":134,"props":5693,"children":5694},{"style":170},[5695],{"type":31,"value":1291},{"type":25,"tag":134,"props":5697,"children":5698},{"class":136,"line":457},[5699,5703,5707,5711,5715,5719,5723,5727,5731,5735,5739,5743,5748,5752,5756,5760,5764],{"type":25,"tag":134,"props":5700,"children":5701},{"style":392},[5702],{"type":31,"value":5274},{"type":25,"tag":134,"props":5704,"children":5705},{"style":170},[5706],{"type":31,"value":237},{"type":25,"tag":134,"props":5708,"children":5709},{"style":392},[5710],{"type":31,"value":395},{"type":25,"tag":134,"props":5712,"children":5713},{"style":170},[5714],{"type":31,"value":400},{"type":25,"tag":134,"props":5716,"children":5717},{"style":200},[5718],{"type":31,"value":405},{"type":25,"tag":134,"props":5720,"children":5721},{"style":170},[5722],{"type":31,"value":319},{"type":25,"tag":134,"props":5724,"children":5725},{"style":392},[5726],{"type":31,"value":5122},{"type":25,"tag":134,"props":5728,"children":5729},{"style":149},[5730],{"type":31,"value":419},{"type":25,"tag":134,"props":5732,"children":5733},{"style":392},[5734],{"type":31,"value":3906},{"type":25,"tag":134,"props":5736,"children":5737},{"style":170},[5738],{"type":31,"value":1281},{"type":25,"tag":134,"props":5740,"children":5741},{"style":240},[5742],{"type":31,"value":414},{"type":25,"tag":134,"props":5744,"children":5745},{"style":170},[5746],{"type":31,"value":5747},"])",{"type":25,"tag":134,"props":5749,"children":5750},{"style":149},[5751],{"type":31,"value":419},{"type":25,"tag":134,"props":5753,"children":5754},{"style":392},[5755],{"type":31,"value":4166},{"type":25,"tag":134,"props":5757,"children":5758},{"style":170},[5759],{"type":31,"value":1281},{"type":25,"tag":134,"props":5761,"children":5762},{"style":240},[5763],{"type":31,"value":414},{"type":25,"tag":134,"props":5765,"children":5766},{"style":170},[5767],{"type":31,"value":1291},{"type":25,"tag":134,"props":5769,"children":5770},{"class":136,"line":496},[5771,5775,5779,5783,5787,5791,5795,5799,5803,5807,5811,5815,5819,5823,5827,5831,5835,5839,5843,5847],{"type":25,"tag":134,"props":5772,"children":5773},{"style":392},[5774],{"type":31,"value":5358},{"type":25,"tag":134,"props":5776,"children":5777},{"style":170},[5778],{"type":31,"value":237},{"type":25,"tag":134,"props":5780,"children":5781},{"style":392},[5782],{"type":31,"value":395},{"type":25,"tag":134,"props":5784,"children":5785},{"style":170},[5786],{"type":31,"value":400},{"type":25,"tag":134,"props":5788,"children":5789},{"style":200},[5790],{"type":31,"value":405},{"type":25,"tag":134,"props":5792,"children":5793},{"style":170},[5794],{"type":31,"value":319},{"type":25,"tag":134,"props":5796,"children":5797},{"style":392},[5798],{"type":31,"value":5122},{"type":25,"tag":134,"props":5800,"children":5801},{"style":149},[5802],{"type":31,"value":419},{"type":25,"tag":134,"props":5804,"children":5805},{"style":392},[5806],{"type":31,"value":3906},{"type":25,"tag":134,"props":5808,"children":5809},{"style":170},[5810],{"type":31,"value":1281},{"type":25,"tag":134,"props":5812,"children":5813},{"style":240},[5814],{"type":31,"value":3307},{"type":25,"tag":134,"props":5816,"children":5817},{"style":170},[5818],{"type":31,"value":1473},{"type":25,"tag":134,"props":5820,"children":5821},{"style":149},[5822],{"type":31,"value":445},{"type":25,"tag":134,"props":5824,"children":5825},{"style":392},[5826],{"type":31,"value":4558},{"type":25,"tag":134,"props":5828,"children":5829},{"style":170},[5830],{"type":31,"value":916},{"type":25,"tag":134,"props":5832,"children":5833},{"style":149},[5834],{"type":31,"value":419},{"type":25,"tag":134,"props":5836,"children":5837},{"style":392},[5838],{"type":31,"value":4166},{"type":25,"tag":134,"props":5840,"children":5841},{"style":170},[5842],{"type":31,"value":1281},{"type":25,"tag":134,"props":5844,"children":5845},{"style":240},[5846],{"type":31,"value":3307},{"type":25,"tag":134,"props":5848,"children":5849},{"style":170},[5850],{"type":31,"value":1291},{"type":25,"tag":134,"props":5852,"children":5853},{"class":136,"line":513},[5854,5858,5862,5866,5870,5874],{"type":25,"tag":134,"props":5855,"children":5856},{"style":392},[5857],{"type":31,"value":5442},{"type":25,"tag":134,"props":5859,"children":5860},{"style":170},[5861],{"type":31,"value":237},{"type":25,"tag":134,"props":5863,"children":5864},{"style":392},[5865],{"type":31,"value":4549},{"type":25,"tag":134,"props":5867,"children":5868},{"style":149},[5869],{"type":31,"value":445},{"type":25,"tag":134,"props":5871,"children":5872},{"style":392},[5873],{"type":31,"value":4567},{"type":25,"tag":134,"props":5875,"children":5876},{"style":170},[5877],{"type":31,"value":248},{"type":25,"tag":134,"props":5879,"children":5880},{"class":136,"line":522},[5881,5885,5889,5893],{"type":25,"tag":134,"props":5882,"children":5883},{"style":392},[5884],{"type":31,"value":5462},{"type":25,"tag":134,"props":5886,"children":5887},{"style":170},[5888],{"type":31,"value":237},{"type":25,"tag":134,"props":5890,"children":5891},{"style":392},[5892],{"type":31,"value":4540},{"type":25,"tag":134,"props":5894,"children":5895},{"style":170},[5896],{"type":31,"value":248},{"type":25,"tag":134,"props":5898,"children":5899},{"class":136,"line":2398},[5900,5904],{"type":25,"tag":134,"props":5901,"children":5902},{"style":194},[5903],{"type":31,"value":5482},{"type":25,"tag":134,"props":5905,"children":5906},{"style":170},[5907],{"type":31,"value":248},{"type":25,"tag":134,"props":5909,"children":5910},{"class":136,"line":2406},[5911],{"type":25,"tag":134,"props":5912,"children":5913},{"emptyLinePlaceholder":255},[5914],{"type":31,"value":258},{"type":25,"tag":134,"props":5916,"children":5917},{"class":136,"line":2436},[5918,5922,5926,5930,5935,5939],{"type":25,"tag":134,"props":5919,"children":5920},{"style":392},[5921],{"type":31,"value":5066},{"type":25,"tag":134,"props":5923,"children":5924},{"style":392},[5925],{"type":31,"value":2734},{"type":25,"tag":134,"props":5927,"children":5928},{"style":170},[5929],{"type":31,"value":400},{"type":25,"tag":134,"props":5931,"children":5932},{"style":392},[5933],{"type":31,"value":5934},"Alg7",{"type":25,"tag":134,"props":5936,"children":5937},{"style":149},[5938],{"type":31,"value":5084},{"type":25,"tag":134,"props":5940,"children":5941},{"style":140},[5942],{"type":31,"value":5943}," // 1+2+3+4（全並列）\n",{"type":25,"tag":134,"props":5945,"children":5946},{"class":136,"line":2513},[5947,5952],{"type":25,"tag":134,"props":5948,"children":5949},{"style":200},[5950],{"type":31,"value":5951},"default",{"type":25,"tag":134,"props":5953,"children":5954},{"style":170},[5955],{"type":31,"value":5956},":\n",{"type":25,"tag":134,"props":5958,"children":5959},{"class":136,"line":3164},[5960,5964,5968,5972,5976,5980,5984,5988,5992,5996,6000,6004,6008,6012,6016,6020,6024,6028,6032,6036,6040,6044],{"type":25,"tag":134,"props":5961,"children":5962},{"style":392},[5963],{"type":31,"value":5097},{"type":25,"tag":134,"props":5965,"children":5966},{"style":170},[5967],{"type":31,"value":237},{"type":25,"tag":134,"props":5969,"children":5970},{"style":392},[5971],{"type":31,"value":395},{"type":25,"tag":134,"props":5973,"children":5974},{"style":170},[5975],{"type":31,"value":400},{"type":25,"tag":134,"props":5977,"children":5978},{"style":200},[5979],{"type":31,"value":405},{"type":25,"tag":134,"props":5981,"children":5982},{"style":170},[5983],{"type":31,"value":319},{"type":25,"tag":134,"props":5985,"children":5986},{"style":392},[5987],{"type":31,"value":5122},{"type":25,"tag":134,"props":5989,"children":5990},{"style":149},[5991],{"type":31,"value":419},{"type":25,"tag":134,"props":5993,"children":5994},{"style":392},[5995],{"type":31,"value":3906},{"type":25,"tag":134,"props":5997,"children":5998},{"style":170},[5999],{"type":31,"value":1281},{"type":25,"tag":134,"props":6001,"children":6002},{"style":240},[6003],{"type":31,"value":3196},{"type":25,"tag":134,"props":6005,"children":6006},{"style":170},[6007],{"type":31,"value":1473},{"type":25,"tag":134,"props":6009,"children":6010},{"style":149},[6011],{"type":31,"value":445},{"type":25,"tag":134,"props":6013,"children":6014},{"style":392},[6015],{"type":31,"value":2859},{"type":25,"tag":134,"props":6017,"children":6018},{"style":149},[6019],{"type":31,"value":419},{"type":25,"tag":134,"props":6021,"children":6022},{"style":392},[6023],{"type":31,"value":4130},{"type":25,"tag":134,"props":6025,"children":6026},{"style":170},[6027],{"type":31,"value":916},{"type":25,"tag":134,"props":6029,"children":6030},{"style":149},[6031],{"type":31,"value":419},{"type":25,"tag":134,"props":6033,"children":6034},{"style":392},[6035],{"type":31,"value":4166},{"type":25,"tag":134,"props":6037,"children":6038},{"style":170},[6039],{"type":31,"value":1281},{"type":25,"tag":134,"props":6041,"children":6042},{"style":240},[6043],{"type":31,"value":3196},{"type":25,"tag":134,"props":6045,"children":6046},{"style":170},[6047],{"type":31,"value":1291},{"type":25,"tag":134,"props":6049,"children":6050},{"class":136,"line":3173},[6051,6055,6059,6063,6067,6071,6075,6079,6083,6087,6091,6095,6099,6103,6107,6111,6115],{"type":25,"tag":134,"props":6052,"children":6053},{"style":392},[6054],{"type":31,"value":5190},{"type":25,"tag":134,"props":6056,"children":6057},{"style":170},[6058],{"type":31,"value":237},{"type":25,"tag":134,"props":6060,"children":6061},{"style":392},[6062],{"type":31,"value":395},{"type":25,"tag":134,"props":6064,"children":6065},{"style":170},[6066],{"type":31,"value":400},{"type":25,"tag":134,"props":6068,"children":6069},{"style":200},[6070],{"type":31,"value":405},{"type":25,"tag":134,"props":6072,"children":6073},{"style":170},[6074],{"type":31,"value":319},{"type":25,"tag":134,"props":6076,"children":6077},{"style":392},[6078],{"type":31,"value":5122},{"type":25,"tag":134,"props":6080,"children":6081},{"style":149},[6082],{"type":31,"value":419},{"type":25,"tag":134,"props":6084,"children":6085},{"style":392},[6086],{"type":31,"value":3906},{"type":25,"tag":134,"props":6088,"children":6089},{"style":170},[6090],{"type":31,"value":1281},{"type":25,"tag":134,"props":6092,"children":6093},{"style":240},[6094],{"type":31,"value":3234},{"type":25,"tag":134,"props":6096,"children":6097},{"style":170},[6098],{"type":31,"value":5747},{"type":25,"tag":134,"props":6100,"children":6101},{"style":149},[6102],{"type":31,"value":419},{"type":25,"tag":134,"props":6104,"children":6105},{"style":392},[6106],{"type":31,"value":4166},{"type":25,"tag":134,"props":6108,"children":6109},{"style":170},[6110],{"type":31,"value":1281},{"type":25,"tag":134,"props":6112,"children":6113},{"style":240},[6114],{"type":31,"value":3234},{"type":25,"tag":134,"props":6116,"children":6117},{"style":170},[6118],{"type":31,"value":1291},{"type":25,"tag":134,"props":6120,"children":6121},{"class":136,"line":3182},[6122,6126,6130,6134,6138,6142,6146,6150,6154,6158,6162,6166,6170,6174,6178,6182,6186],{"type":25,"tag":134,"props":6123,"children":6124},{"style":392},[6125],{"type":31,"value":5274},{"type":25,"tag":134,"props":6127,"children":6128},{"style":170},[6129],{"type":31,"value":237},{"type":25,"tag":134,"props":6131,"children":6132},{"style":392},[6133],{"type":31,"value":395},{"type":25,"tag":134,"props":6135,"children":6136},{"style":170},[6137],{"type":31,"value":400},{"type":25,"tag":134,"props":6139,"children":6140},{"style":200},[6141],{"type":31,"value":405},{"type":25,"tag":134,"props":6143,"children":6144},{"style":170},[6145],{"type":31,"value":319},{"type":25,"tag":134,"props":6147,"children":6148},{"style":392},[6149],{"type":31,"value":5122},{"type":25,"tag":134,"props":6151,"children":6152},{"style":149},[6153],{"type":31,"value":419},{"type":25,"tag":134,"props":6155,"children":6156},{"style":392},[6157],{"type":31,"value":3906},{"type":25,"tag":134,"props":6159,"children":6160},{"style":170},[6161],{"type":31,"value":1281},{"type":25,"tag":134,"props":6163,"children":6164},{"style":240},[6165],{"type":31,"value":414},{"type":25,"tag":134,"props":6167,"children":6168},{"style":170},[6169],{"type":31,"value":5747},{"type":25,"tag":134,"props":6171,"children":6172},{"style":149},[6173],{"type":31,"value":419},{"type":25,"tag":134,"props":6175,"children":6176},{"style":392},[6177],{"type":31,"value":4166},{"type":25,"tag":134,"props":6179,"children":6180},{"style":170},[6181],{"type":31,"value":1281},{"type":25,"tag":134,"props":6183,"children":6184},{"style":240},[6185],{"type":31,"value":414},{"type":25,"tag":134,"props":6187,"children":6188},{"style":170},[6189],{"type":31,"value":1291},{"type":25,"tag":134,"props":6191,"children":6192},{"class":136,"line":3220},[6193,6197,6201,6205,6209,6213,6217,6221,6225,6229,6233,6237,6241,6245,6249,6253,6257],{"type":25,"tag":134,"props":6194,"children":6195},{"style":392},[6196],{"type":31,"value":5358},{"type":25,"tag":134,"props":6198,"children":6199},{"style":170},[6200],{"type":31,"value":237},{"type":25,"tag":134,"props":6202,"children":6203},{"style":392},[6204],{"type":31,"value":395},{"type":25,"tag":134,"props":6206,"children":6207},{"style":170},[6208],{"type":31,"value":400},{"type":25,"tag":134,"props":6210,"children":6211},{"style":200},[6212],{"type":31,"value":405},{"type":25,"tag":134,"props":6214,"children":6215},{"style":170},[6216],{"type":31,"value":319},{"type":25,"tag":134,"props":6218,"children":6219},{"style":392},[6220],{"type":31,"value":5122},{"type":25,"tag":134,"props":6222,"children":6223},{"style":149},[6224],{"type":31,"value":419},{"type":25,"tag":134,"props":6226,"children":6227},{"style":392},[6228],{"type":31,"value":3906},{"type":25,"tag":134,"props":6230,"children":6231},{"style":170},[6232],{"type":31,"value":1281},{"type":25,"tag":134,"props":6234,"children":6235},{"style":240},[6236],{"type":31,"value":3307},{"type":25,"tag":134,"props":6238,"children":6239},{"style":170},[6240],{"type":31,"value":5747},{"type":25,"tag":134,"props":6242,"children":6243},{"style":149},[6244],{"type":31,"value":419},{"type":25,"tag":134,"props":6246,"children":6247},{"style":392},[6248],{"type":31,"value":4166},{"type":25,"tag":134,"props":6250,"children":6251},{"style":170},[6252],{"type":31,"value":1281},{"type":25,"tag":134,"props":6254,"children":6255},{"style":240},[6256],{"type":31,"value":3307},{"type":25,"tag":134,"props":6258,"children":6259},{"style":170},[6260],{"type":31,"value":1291},{"type":25,"tag":134,"props":6262,"children":6263},{"class":136,"line":3257},[6264,6268,6272,6276,6280,6284,6288,6292,6296,6300],{"type":25,"tag":134,"props":6265,"children":6266},{"style":392},[6267],{"type":31,"value":5442},{"type":25,"tag":134,"props":6269,"children":6270},{"style":170},[6271],{"type":31,"value":237},{"type":25,"tag":134,"props":6273,"children":6274},{"style":392},[6275],{"type":31,"value":4540},{"type":25,"tag":134,"props":6277,"children":6278},{"style":149},[6279],{"type":31,"value":445},{"type":25,"tag":134,"props":6281,"children":6282},{"style":392},[6283],{"type":31,"value":4549},{"type":25,"tag":134,"props":6285,"children":6286},{"style":149},[6287],{"type":31,"value":445},{"type":25,"tag":134,"props":6289,"children":6290},{"style":392},[6291],{"type":31,"value":4558},{"type":25,"tag":134,"props":6293,"children":6294},{"style":149},[6295],{"type":31,"value":445},{"type":25,"tag":134,"props":6297,"children":6298},{"style":392},[6299],{"type":31,"value":4567},{"type":25,"tag":134,"props":6301,"children":6302},{"style":170},[6303],{"type":31,"value":248},{"type":25,"tag":134,"props":6305,"children":6306},{"class":136,"line":3293},[6307,6311,6315,6319],{"type":25,"tag":134,"props":6308,"children":6309},{"style":392},[6310],{"type":31,"value":5462},{"type":25,"tag":134,"props":6312,"children":6313},{"style":170},[6314],{"type":31,"value":237},{"type":25,"tag":134,"props":6316,"children":6317},{"style":392},[6318],{"type":31,"value":4540},{"type":25,"tag":134,"props":6320,"children":6321},{"style":170},[6322],{"type":31,"value":248},{"type":25,"tag":134,"props":6324,"children":6325},{"class":136,"line":3330},[6326,6330],{"type":25,"tag":134,"props":6327,"children":6328},{"style":194},[6329],{"type":31,"value":5482},{"type":25,"tag":134,"props":6331,"children":6332},{"style":170},[6333],{"type":31,"value":248},{"type":25,"tag":33,"props":6335,"children":6336},{},[6337,6339,6345],{"type":31,"value":6338},"読み方は単純です。あるオペレータが別のオペレータを変調するとき、変調する側の出力を、される側の",{"type":25,"tag":46,"props":6340,"children":6342},{"className":6341},[],[6343],{"type":31,"value":6344},"Math.Sin(twoPi * phases[...] + ここ)",{"type":31,"value":6346},"に足し込む。これは第2回でモジュレータの出力をキャリアの位相に足したのと、まったく同じ操作です。",{"type":25,"tag":33,"props":6348,"children":6349},{},[6350,6352,6358,6360,6366,6368,6373,6374,6380,6382,6387,6388,6394,6396,6401,6403,6409,6411,6417,6419,6425,6427,6433],{"type":31,"value":6351},"Alg0では",{"type":25,"tag":46,"props":6353,"children":6355},{"className":6354},[],[6356],{"type":31,"value":6357},"op1",{"type":31,"value":6359},"が",{"type":25,"tag":46,"props":6361,"children":6363},{"className":6362},[],[6364],{"type":31,"value":6365},"op2",{"type":31,"value":6367},"の位相に、",{"type":25,"tag":46,"props":6369,"children":6371},{"className":6370},[],[6372],{"type":31,"value":6365},{"type":31,"value":6359},{"type":25,"tag":46,"props":6375,"children":6377},{"className":6376},[],[6378],{"type":31,"value":6379},"op3",{"type":31,"value":6381},"に、",{"type":25,"tag":46,"props":6383,"children":6385},{"className":6384},[],[6386],{"type":31,"value":6379},{"type":31,"value":6359},{"type":25,"tag":46,"props":6389,"children":6391},{"className":6390},[],[6392],{"type":31,"value":6393},"op4",{"type":31,"value":6395},"に足し込まれ、変調が4段直列に連なります。出力は最後の",{"type":25,"tag":46,"props":6397,"children":6399},{"className":6398},[],[6400],{"type":31,"value":6393},{"type":31,"value":6402},"だけ。Alg7では誰も誰も変調せず、4本をそのまま",{"type":25,"tag":46,"props":6404,"children":6406},{"className":6405},[],[6407],{"type":31,"value":6408},"op1 + op2 + op3 + op4",{"type":31,"value":6410},"と足すだけ。Alg4は",{"type":25,"tag":46,"props":6412,"children":6414},{"className":6413},[],[6415],{"type":31,"value":6416},"op1→op2",{"type":31,"value":6418},"と",{"type":25,"tag":46,"props":6420,"children":6422},{"className":6421},[],[6423],{"type":31,"value":6424},"op3→op4",{"type":31,"value":6426},"の2ペアを作り、2つのキャリア",{"type":25,"tag":46,"props":6428,"children":6430},{"className":6429},[],[6431],{"type":31,"value":6432},"op2 + op4",{"type":31,"value":6434},"を足します。第3回の3つの図が、そのまま3つのcaseになっているのが見て取れるはずです。",{"type":25,"tag":33,"props":6436,"children":6437},{},[6438,6440,6446],{"type":31,"value":6439},"並列のキャリアを足すアルゴリズムでは出力が1を超えうるので、ループ末尾で",{"type":25,"tag":46,"props":6441,"children":6443},{"className":6442},[],[6444],{"type":31,"value":6445},"[-1, 1]",{"type":31,"value":6447},"にクリップしています。第3回の最後で触れた振幅管理が、この2行です。",{"type":25,"tag":26,"props":6449,"children":6451},{"id":6450},"op1のセルフフィードバック",[6452],{"type":31,"value":6453},"OP1のセルフフィードバック",{"type":25,"tag":33,"props":6455,"children":6456},{},[6457,6459,6465],{"type":31,"value":6458},"どのcaseにも共通して、OP1にだけ",{"type":25,"tag":46,"props":6460,"children":6462},{"className":6461},[],[6463],{"type":31,"value":6464},"_feedback * lastOp1",{"type":31,"value":6466},"が足されています。",{"type":25,"tag":124,"props":6468,"children":6470},{"className":128,"code":6469,"language":127,"meta":8,"style":8},"op1 = Math.Sin(twoPi * phases[0] + _feedback * lastOp1) * envs[0];\n// ...\nlastOp1 = op1;\n",[6471],{"type":25,"tag":46,"props":6472,"children":6473},{"__ignoreMap":8},[6474,6565,6573],{"type":25,"tag":134,"props":6475,"children":6476},{"class":136,"line":18},[6477,6481,6485,6489,6493,6497,6501,6505,6509,6513,6517,6521,6525,6529,6533,6537,6541,6545,6549,6553,6557,6561],{"type":25,"tag":134,"props":6478,"children":6479},{"style":392},[6480],{"type":31,"value":6357},{"type":25,"tag":134,"props":6482,"children":6483},{"style":170},[6484],{"type":31,"value":237},{"type":25,"tag":134,"props":6486,"children":6487},{"style":392},[6488],{"type":31,"value":395},{"type":25,"tag":134,"props":6490,"children":6491},{"style":170},[6492],{"type":31,"value":400},{"type":25,"tag":134,"props":6494,"children":6495},{"style":200},[6496],{"type":31,"value":405},{"type":25,"tag":134,"props":6498,"children":6499},{"style":170},[6500],{"type":31,"value":319},{"type":25,"tag":134,"props":6502,"children":6503},{"style":392},[6504],{"type":31,"value":5122},{"type":25,"tag":134,"props":6506,"children":6507},{"style":149},[6508],{"type":31,"value":419},{"type":25,"tag":134,"props":6510,"children":6511},{"style":392},[6512],{"type":31,"value":3906},{"type":25,"tag":134,"props":6514,"children":6515},{"style":170},[6516],{"type":31,"value":1281},{"type":25,"tag":134,"props":6518,"children":6519},{"style":240},[6520],{"type":31,"value":3196},{"type":25,"tag":134,"props":6522,"children":6523},{"style":170},[6524],{"type":31,"value":1473},{"type":25,"tag":134,"props":6526,"children":6527},{"style":149},[6528],{"type":31,"value":445},{"type":25,"tag":134,"props":6530,"children":6531},{"style":392},[6532],{"type":31,"value":2859},{"type":25,"tag":134,"props":6534,"children":6535},{"style":149},[6536],{"type":31,"value":419},{"type":25,"tag":134,"props":6538,"children":6539},{"style":392},[6540],{"type":31,"value":4130},{"type":25,"tag":134,"props":6542,"children":6543},{"style":170},[6544],{"type":31,"value":916},{"type":25,"tag":134,"props":6546,"children":6547},{"style":149},[6548],{"type":31,"value":419},{"type":25,"tag":134,"props":6550,"children":6551},{"style":392},[6552],{"type":31,"value":4166},{"type":25,"tag":134,"props":6554,"children":6555},{"style":170},[6556],{"type":31,"value":1281},{"type":25,"tag":134,"props":6558,"children":6559},{"style":240},[6560],{"type":31,"value":3196},{"type":25,"tag":134,"props":6562,"children":6563},{"style":170},[6564],{"type":31,"value":1291},{"type":25,"tag":134,"props":6566,"children":6567},{"class":136,"line":19},[6568],{"type":25,"tag":134,"props":6569,"children":6570},{"style":140},[6571],{"type":31,"value":6572},"// ...\n",{"type":25,"tag":134,"props":6574,"children":6575},{"class":136,"line":166},[6576,6581,6585,6589],{"type":25,"tag":134,"props":6577,"children":6578},{"style":392},[6579],{"type":31,"value":6580},"lastOp1",{"type":25,"tag":134,"props":6582,"children":6583},{"style":170},[6584],{"type":31,"value":237},{"type":25,"tag":134,"props":6586,"children":6587},{"style":392},[6588],{"type":31,"value":4540},{"type":25,"tag":134,"props":6590,"children":6591},{"style":170},[6592],{"type":31,"value":248},{"type":25,"tag":33,"props":6594,"children":6595},{},[6596,6601,6603,6608],{"type":25,"tag":46,"props":6597,"children":6599},{"className":6598},[],[6600],{"type":31,"value":6580},{"type":31,"value":6602},"は1サンプル前のOP1の出力です。それを",{"type":25,"tag":46,"props":6604,"children":6606},{"className":6605},[],[6607],{"type":31,"value":3360},{"type":31,"value":6609},"の量だけ自分の位相に戻すことで、OP1が自分自身を変調します。これがフィードバックで、OPNA系FM音源の特徴的な機能です。フィードバックを上げると、単一オペレータでもノコギリ波に近い倍音リッチな波形が得られ、ベースやディストーション系の音作りで効いてきます。1サンプル前の値を次に渡すだけで実現できるのが、いかにもデジタルらしい仕組みです。",{"type":25,"tag":26,"props":6611,"children":6613},{"id":6612},"adsrエンベロープで音の輪郭を作る",[6614],{"type":31,"value":6615},"ADSRエンベロープで音の輪郭を作る",{"type":25,"tag":33,"props":6617,"children":6618},{},[6619,6621,6626,6628,6633],{"type":31,"value":6620},"第2回では固定音量にして、出だしと終わりのクリックノイズを保留にしていました。最終回ではそれをADSRエンベロープで解決します。各サンプルの",{"type":25,"tag":46,"props":6622,"children":6624},{"className":6623},[],[6625],{"type":31,"value":5013},{"type":31,"value":6627},"を計算していた",{"type":25,"tag":46,"props":6629,"children":6631},{"className":6630},[],[6632],{"type":31,"value":4464},{"type":31,"value":6634},"の中身がこれです。",{"type":25,"tag":124,"props":6636,"children":6638},{"className":128,"code":6637,"language":127,"meta":8,"style":8},"public double EnvelopeAt(double t, double noteDuration)\n{\n    var adsLevel = AdsLevelAt(t);\n    if (Release > 0)\n    {\n        var releaseStart = noteDuration - Release;\n        if (t >= releaseStart)\n        {\n            var fadeOut = 1.0 - (t - releaseStart) / Release;\n            return fadeOut > 0 ? adsLevel * fadeOut : 0;\n        }\n    }\n    return adsLevel;\n}\n\nprivate double AdsLevelAt(double t)\n{\n    if (Attack > 0 && t \u003C Attack)\n    {\n        return t / Attack;\n    }\n    var afterAttack = t - Attack;\n    if (Decay > 0 && afterAttack \u003C Decay)\n    {\n        // 1.0 から Sustain へ向かう指数減衰\n        var tau = Decay / 3.0; // t = Decay で約95%まで到達\n        return Sustain + (1.0 - Sustain) * Math.Exp(-afterAttack / tau);\n    }\n    return Sustain;\n}\n",[6639],{"type":25,"tag":46,"props":6640,"children":6641},{"__ignoreMap":8},[6642,6686,6693,6726,6754,6761,6793,6821,6828,6885,6934,6941,6948,6963,6970,6977,7009,7016,7060,7067,7090,7097,7129,7173,7180,7188,7226,7304,7311,7326],{"type":25,"tag":134,"props":6643,"children":6644},{"class":136,"line":18},[6645,6649,6653,6658,6662,6666,6670,6674,6678,6682],{"type":25,"tag":134,"props":6646,"children":6647},{"style":149},[6648],{"type":31,"value":152},{"type":25,"tag":134,"props":6650,"children":6651},{"style":194},[6652],{"type":31,"value":197},{"type":25,"tag":134,"props":6654,"children":6655},{"style":200},[6656],{"type":31,"value":6657}," EnvelopeAt",{"type":25,"tag":134,"props":6659,"children":6660},{"style":170},[6661],{"type":31,"value":319},{"type":25,"tag":134,"props":6663,"children":6664},{"style":194},[6665],{"type":31,"value":324},{"type":25,"tag":134,"props":6667,"children":6668},{"style":200},[6669],{"type":31,"value":4319},{"type":25,"tag":134,"props":6671,"children":6672},{"style":170},[6673],{"type":31,"value":334},{"type":25,"tag":134,"props":6675,"children":6676},{"style":194},[6677],{"type":31,"value":197},{"type":25,"tag":134,"props":6679,"children":6680},{"style":200},[6681],{"type":31,"value":4202},{"type":25,"tag":134,"props":6683,"children":6684},{"style":170},[6685],{"type":31,"value":362},{"type":25,"tag":134,"props":6687,"children":6688},{"class":136,"line":19},[6689],{"type":25,"tag":134,"props":6690,"children":6691},{"style":170},[6692],{"type":31,"value":173},{"type":25,"tag":134,"props":6694,"children":6695},{"class":136,"line":166},[6696,6700,6705,6709,6714,6718,6722],{"type":25,"tag":134,"props":6697,"children":6698},{"style":149},[6699],{"type":31,"value":1214},{"type":25,"tag":134,"props":6701,"children":6702},{"style":200},[6703],{"type":31,"value":6704}," adsLevel",{"type":25,"tag":134,"props":6706,"children":6707},{"style":170},[6708],{"type":31,"value":237},{"type":25,"tag":134,"props":6710,"children":6711},{"style":200},[6712],{"type":31,"value":6713}," AdsLevelAt",{"type":25,"tag":134,"props":6715,"children":6716},{"style":170},[6717],{"type":31,"value":319},{"type":25,"tag":134,"props":6719,"children":6720},{"style":392},[6721],{"type":31,"value":4473},{"type":25,"tag":134,"props":6723,"children":6724},{"style":170},[6725],{"type":31,"value":454},{"type":25,"tag":134,"props":6727,"children":6728},{"class":136,"line":176},[6729,6734,6738,6742,6746,6750],{"type":25,"tag":134,"props":6730,"children":6731},{"style":194},[6732],{"type":31,"value":6733},"    if",{"type":25,"tag":134,"props":6735,"children":6736},{"style":170},[6737],{"type":31,"value":1344},{"type":25,"tag":134,"props":6739,"children":6740},{"style":392},[6741],{"type":31,"value":2565},{"type":25,"tag":134,"props":6743,"children":6744},{"style":170},[6745],{"type":31,"value":4666},{"type":25,"tag":134,"props":6747,"children":6748},{"style":240},[6749],{"type":31,"value":911},{"type":25,"tag":134,"props":6751,"children":6752},{"style":170},[6753],{"type":31,"value":362},{"type":25,"tag":134,"props":6755,"children":6756},{"class":136,"line":185},[6757],{"type":25,"tag":134,"props":6758,"children":6759},{"style":170},[6760],{"type":31,"value":371},{"type":25,"tag":134,"props":6762,"children":6763},{"class":136,"line":251},[6764,6768,6773,6777,6781,6785,6789],{"type":25,"tag":134,"props":6765,"children":6766},{"style":149},[6767],{"type":31,"value":380},{"type":25,"tag":134,"props":6769,"children":6770},{"style":200},[6771],{"type":31,"value":6772}," releaseStart",{"type":25,"tag":134,"props":6774,"children":6775},{"style":170},[6776],{"type":31,"value":237},{"type":25,"tag":134,"props":6778,"children":6779},{"style":392},[6780],{"type":31,"value":4202},{"type":25,"tag":134,"props":6782,"children":6783},{"style":149},[6784],{"type":31,"value":4721},{"type":25,"tag":134,"props":6786,"children":6787},{"style":392},[6788],{"type":31,"value":2450},{"type":25,"tag":134,"props":6790,"children":6791},{"style":170},[6792],{"type":31,"value":248},{"type":25,"tag":134,"props":6794,"children":6795},{"class":136,"line":261},[6796,6800,6804,6808,6813,6817],{"type":25,"tag":134,"props":6797,"children":6798},{"style":194},[6799],{"type":31,"value":4652},{"type":25,"tag":134,"props":6801,"children":6802},{"style":170},[6803],{"type":31,"value":1344},{"type":25,"tag":134,"props":6805,"children":6806},{"style":392},[6807],{"type":31,"value":4473},{"type":25,"tag":134,"props":6809,"children":6810},{"style":170},[6811],{"type":31,"value":6812}," >=",{"type":25,"tag":134,"props":6814,"children":6815},{"style":392},[6816],{"type":31,"value":6772},{"type":25,"tag":134,"props":6818,"children":6819},{"style":170},[6820],{"type":31,"value":362},{"type":25,"tag":134,"props":6822,"children":6823},{"class":136,"line":283},[6824],{"type":25,"tag":134,"props":6825,"children":6826},{"style":170},[6827],{"type":31,"value":3078},{"type":25,"tag":134,"props":6829,"children":6830},{"class":136,"line":291},[6831,6836,6841,6845,6849,6853,6857,6861,6865,6869,6873,6877,6881],{"type":25,"tag":134,"props":6832,"children":6833},{"style":149},[6834],{"type":31,"value":6835},"            var",{"type":25,"tag":134,"props":6837,"children":6838},{"style":200},[6839],{"type":31,"value":6840}," fadeOut",{"type":25,"tag":134,"props":6842,"children":6843},{"style":170},[6844],{"type":31,"value":237},{"type":25,"tag":134,"props":6846,"children":6847},{"style":240},[6848],{"type":31,"value":243},{"type":25,"tag":134,"props":6850,"children":6851},{"style":149},[6852],{"type":31,"value":4721},{"type":25,"tag":134,"props":6854,"children":6855},{"style":170},[6856],{"type":31,"value":1344},{"type":25,"tag":134,"props":6858,"children":6859},{"style":392},[6860],{"type":31,"value":4473},{"type":25,"tag":134,"props":6862,"children":6863},{"style":149},[6864],{"type":31,"value":4721},{"type":25,"tag":134,"props":6866,"children":6867},{"style":392},[6868],{"type":31,"value":6772},{"type":25,"tag":134,"props":6870,"children":6871},{"style":170},[6872],{"type":31,"value":916},{"type":25,"tag":134,"props":6874,"children":6875},{"style":149},[6876],{"type":31,"value":485},{"type":25,"tag":134,"props":6878,"children":6879},{"style":392},[6880],{"type":31,"value":2450},{"type":25,"tag":134,"props":6882,"children":6883},{"style":170},[6884],{"type":31,"value":248},{"type":25,"tag":134,"props":6886,"children":6887},{"class":136,"line":300},[6888,6893,6897,6901,6905,6910,6914,6918,6922,6926,6930],{"type":25,"tag":134,"props":6889,"children":6890},{"style":194},[6891],{"type":31,"value":6892},"            return",{"type":25,"tag":134,"props":6894,"children":6895},{"style":392},[6896],{"type":31,"value":6840},{"type":25,"tag":134,"props":6898,"children":6899},{"style":170},[6900],{"type":31,"value":4666},{"type":25,"tag":134,"props":6902,"children":6903},{"style":240},[6904],{"type":31,"value":911},{"type":25,"tag":134,"props":6906,"children":6907},{"style":149},[6908],{"type":31,"value":6909}," ?",{"type":25,"tag":134,"props":6911,"children":6912},{"style":392},[6913],{"type":31,"value":6704},{"type":25,"tag":134,"props":6915,"children":6916},{"style":149},[6917],{"type":31,"value":419},{"type":25,"tag":134,"props":6919,"children":6920},{"style":392},[6921],{"type":31,"value":6840},{"type":25,"tag":134,"props":6923,"children":6924},{"style":149},[6925],{"type":31,"value":1829},{"type":25,"tag":134,"props":6927,"children":6928},{"style":240},[6929],{"type":31,"value":911},{"type":25,"tag":134,"props":6931,"children":6932},{"style":170},[6933],{"type":31,"value":248},{"type":25,"tag":134,"props":6935,"children":6936},{"class":136,"line":365},[6937],{"type":25,"tag":134,"props":6938,"children":6939},{"style":170},[6940],{"type":31,"value":3161},{"type":25,"tag":134,"props":6942,"children":6943},{"class":136,"line":374},[6944],{"type":25,"tag":134,"props":6945,"children":6946},{"style":170},[6947],{"type":31,"value":519},{"type":25,"tag":134,"props":6949,"children":6950},{"class":136,"line":457},[6951,6955,6959],{"type":25,"tag":134,"props":6952,"children":6953},{"style":194},[6954],{"type":31,"value":1538},{"type":25,"tag":134,"props":6956,"children":6957},{"style":392},[6958],{"type":31,"value":6704},{"type":25,"tag":134,"props":6960,"children":6961},{"style":170},[6962],{"type":31,"value":248},{"type":25,"tag":134,"props":6964,"children":6965},{"class":136,"line":496},[6966],{"type":25,"tag":134,"props":6967,"children":6968},{"style":170},[6969],{"type":31,"value":528},{"type":25,"tag":134,"props":6971,"children":6972},{"class":136,"line":513},[6973],{"type":25,"tag":134,"props":6974,"children":6975},{"emptyLinePlaceholder":255},[6976],{"type":31,"value":258},{"type":25,"tag":134,"props":6978,"children":6979},{"class":136,"line":522},[6980,6985,6989,6993,6997,7001,7005],{"type":25,"tag":134,"props":6981,"children":6982},{"style":149},[6983],{"type":31,"value":6984},"private",{"type":25,"tag":134,"props":6986,"children":6987},{"style":194},[6988],{"type":31,"value":197},{"type":25,"tag":134,"props":6990,"children":6991},{"style":200},[6992],{"type":31,"value":6713},{"type":25,"tag":134,"props":6994,"children":6995},{"style":170},[6996],{"type":31,"value":319},{"type":25,"tag":134,"props":6998,"children":6999},{"style":194},[7000],{"type":31,"value":324},{"type":25,"tag":134,"props":7002,"children":7003},{"style":200},[7004],{"type":31,"value":4319},{"type":25,"tag":134,"props":7006,"children":7007},{"style":170},[7008],{"type":31,"value":362},{"type":25,"tag":134,"props":7010,"children":7011},{"class":136,"line":2398},[7012],{"type":25,"tag":134,"props":7013,"children":7014},{"style":170},[7015],{"type":31,"value":173},{"type":25,"tag":134,"props":7017,"children":7018},{"class":136,"line":2406},[7019,7023,7027,7031,7035,7039,7044,7048,7052,7056],{"type":25,"tag":134,"props":7020,"children":7021},{"style":194},[7022],{"type":31,"value":6733},{"type":25,"tag":134,"props":7024,"children":7025},{"style":170},[7026],{"type":31,"value":1344},{"type":25,"tag":134,"props":7028,"children":7029},{"style":392},[7030],{"type":31,"value":2557},{"type":25,"tag":134,"props":7032,"children":7033},{"style":170},[7034],{"type":31,"value":4666},{"type":25,"tag":134,"props":7036,"children":7037},{"style":240},[7038],{"type":31,"value":911},{"type":25,"tag":134,"props":7040,"children":7041},{"style":149},[7042],{"type":31,"value":7043}," &&",{"type":25,"tag":134,"props":7045,"children":7046},{"style":392},[7047],{"type":31,"value":4319},{"type":25,"tag":134,"props":7049,"children":7050},{"style":170},[7051],{"type":31,"value":1375},{"type":25,"tag":134,"props":7053,"children":7054},{"style":392},[7055],{"type":31,"value":2112},{"type":25,"tag":134,"props":7057,"children":7058},{"style":170},[7059],{"type":31,"value":362},{"type":25,"tag":134,"props":7061,"children":7062},{"class":136,"line":2436},[7063],{"type":25,"tag":134,"props":7064,"children":7065},{"style":170},[7066],{"type":31,"value":371},{"type":25,"tag":134,"props":7068,"children":7069},{"class":136,"line":2513},[7070,7074,7078,7082,7086],{"type":25,"tag":134,"props":7071,"children":7072},{"style":194},[7073],{"type":31,"value":502},{"type":25,"tag":134,"props":7075,"children":7076},{"style":392},[7077],{"type":31,"value":4319},{"type":25,"tag":134,"props":7079,"children":7080},{"style":149},[7081],{"type":31,"value":485},{"type":25,"tag":134,"props":7083,"children":7084},{"style":392},[7085],{"type":31,"value":2112},{"type":25,"tag":134,"props":7087,"children":7088},{"style":170},[7089],{"type":31,"value":248},{"type":25,"tag":134,"props":7091,"children":7092},{"class":136,"line":3164},[7093],{"type":25,"tag":134,"props":7094,"children":7095},{"style":170},[7096],{"type":31,"value":519},{"type":25,"tag":134,"props":7098,"children":7099},{"class":136,"line":3173},[7100,7104,7109,7113,7117,7121,7125],{"type":25,"tag":134,"props":7101,"children":7102},{"style":149},[7103],{"type":31,"value":1214},{"type":25,"tag":134,"props":7105,"children":7106},{"style":200},[7107],{"type":31,"value":7108}," afterAttack",{"type":25,"tag":134,"props":7110,"children":7111},{"style":170},[7112],{"type":31,"value":237},{"type":25,"tag":134,"props":7114,"children":7115},{"style":392},[7116],{"type":31,"value":4319},{"type":25,"tag":134,"props":7118,"children":7119},{"style":149},[7120],{"type":31,"value":4721},{"type":25,"tag":134,"props":7122,"children":7123},{"style":392},[7124],{"type":31,"value":2112},{"type":25,"tag":134,"props":7126,"children":7127},{"style":170},[7128],{"type":31,"value":248},{"type":25,"tag":134,"props":7130,"children":7131},{"class":136,"line":3182},[7132,7136,7140,7145,7149,7153,7157,7161,7165,7169],{"type":25,"tag":134,"props":7133,"children":7134},{"style":194},[7135],{"type":31,"value":6733},{"type":25,"tag":134,"props":7137,"children":7138},{"style":170},[7139],{"type":31,"value":1344},{"type":25,"tag":134,"props":7141,"children":7142},{"style":392},[7143],{"type":31,"value":7144},"Decay",{"type":25,"tag":134,"props":7146,"children":7147},{"style":170},[7148],{"type":31,"value":4666},{"type":25,"tag":134,"props":7150,"children":7151},{"style":240},[7152],{"type":31,"value":911},{"type":25,"tag":134,"props":7154,"children":7155},{"style":149},[7156],{"type":31,"value":7043},{"type":25,"tag":134,"props":7158,"children":7159},{"style":392},[7160],{"type":31,"value":7108},{"type":25,"tag":134,"props":7162,"children":7163},{"style":170},[7164],{"type":31,"value":1375},{"type":25,"tag":134,"props":7166,"children":7167},{"style":392},[7168],{"type":31,"value":2224},{"type":25,"tag":134,"props":7170,"children":7171},{"style":170},[7172],{"type":31,"value":362},{"type":25,"tag":134,"props":7174,"children":7175},{"class":136,"line":3220},[7176],{"type":25,"tag":134,"props":7177,"children":7178},{"style":170},[7179],{"type":31,"value":371},{"type":25,"tag":134,"props":7181,"children":7182},{"class":136,"line":3257},[7183],{"type":25,"tag":134,"props":7184,"children":7185},{"style":140},[7186],{"type":31,"value":7187},"        // 1.0 から Sustain へ向かう指数減衰\n",{"type":25,"tag":134,"props":7189,"children":7190},{"class":136,"line":3293},[7191,7195,7200,7204,7208,7212,7217,7221],{"type":25,"tag":134,"props":7192,"children":7193},{"style":149},[7194],{"type":31,"value":380},{"type":25,"tag":134,"props":7196,"children":7197},{"style":200},[7198],{"type":31,"value":7199}," tau",{"type":25,"tag":134,"props":7201,"children":7202},{"style":170},[7203],{"type":31,"value":237},{"type":25,"tag":134,"props":7205,"children":7206},{"style":392},[7207],{"type":31,"value":2224},{"type":25,"tag":134,"props":7209,"children":7210},{"style":149},[7211],{"type":31,"value":485},{"type":25,"tag":134,"props":7213,"children":7214},{"style":240},[7215],{"type":31,"value":7216}," 3.0",{"type":25,"tag":134,"props":7218,"children":7219},{"style":170},[7220],{"type":31,"value":218},{"type":25,"tag":134,"props":7222,"children":7223},{"style":140},[7224],{"type":31,"value":7225}," // t = Decay で約95%まで到達\n",{"type":25,"tag":134,"props":7227,"children":7228},{"class":136,"line":3330},[7229,7233,7237,7241,7245,7249,7253,7257,7261,7265,7269,7273,7278,7282,7287,7292,7296,7300],{"type":25,"tag":134,"props":7230,"children":7231},{"style":194},[7232],{"type":31,"value":502},{"type":25,"tag":134,"props":7234,"children":7235},{"style":392},[7236],{"type":31,"value":2335},{"type":25,"tag":134,"props":7238,"children":7239},{"style":149},[7240],{"type":31,"value":445},{"type":25,"tag":134,"props":7242,"children":7243},{"style":170},[7244],{"type":31,"value":1344},{"type":25,"tag":134,"props":7246,"children":7247},{"style":240},[7248],{"type":31,"value":3381},{"type":25,"tag":134,"props":7250,"children":7251},{"style":149},[7252],{"type":31,"value":4721},{"type":25,"tag":134,"props":7254,"children":7255},{"style":392},[7256],{"type":31,"value":2335},{"type":25,"tag":134,"props":7258,"children":7259},{"style":170},[7260],{"type":31,"value":916},{"type":25,"tag":134,"props":7262,"children":7263},{"style":149},[7264],{"type":31,"value":419},{"type":25,"tag":134,"props":7266,"children":7267},{"style":392},[7268],{"type":31,"value":395},{"type":25,"tag":134,"props":7270,"children":7271},{"style":170},[7272],{"type":31,"value":400},{"type":25,"tag":134,"props":7274,"children":7275},{"style":200},[7276],{"type":31,"value":7277},"Exp",{"type":25,"tag":134,"props":7279,"children":7280},{"style":170},[7281],{"type":31,"value":319},{"type":25,"tag":134,"props":7283,"children":7284},{"style":149},[7285],{"type":31,"value":7286},"-",{"type":25,"tag":134,"props":7288,"children":7289},{"style":392},[7290],{"type":31,"value":7291},"afterAttack",{"type":25,"tag":134,"props":7293,"children":7294},{"style":149},[7295],{"type":31,"value":485},{"type":25,"tag":134,"props":7297,"children":7298},{"style":392},[7299],{"type":31,"value":7199},{"type":25,"tag":134,"props":7301,"children":7302},{"style":170},[7303],{"type":31,"value":454},{"type":25,"tag":134,"props":7305,"children":7306},{"class":136,"line":3338},[7307],{"type":25,"tag":134,"props":7308,"children":7309},{"style":170},[7310],{"type":31,"value":519},{"type":25,"tag":134,"props":7312,"children":7313},{"class":136,"line":4604},[7314,7318,7322],{"type":25,"tag":134,"props":7315,"children":7316},{"style":194},[7317],{"type":31,"value":1538},{"type":25,"tag":134,"props":7319,"children":7320},{"style":392},[7321],{"type":31,"value":2335},{"type":25,"tag":134,"props":7323,"children":7324},{"style":170},[7325],{"type":31,"value":248},{"type":25,"tag":134,"props":7327,"children":7328},{"class":136,"line":4612},[7329],{"type":25,"tag":134,"props":7330,"children":7331},{"style":170},[7332],{"type":31,"value":528},{"type":25,"tag":33,"props":7334,"children":7335},{},[7336,7338,7344,7346,7352,7354,7359,7361,7366],{"type":31,"value":7337},"エンベロープは音量を時間で形づくる係数（0〜1）です。",{"type":25,"tag":46,"props":7339,"children":7341},{"className":7340},[],[7342],{"type":31,"value":7343},"AdsLevelAt",{"type":31,"value":7345},"がアタック・ディケイ・サステインを担います。アタック期間は",{"type":25,"tag":46,"props":7347,"children":7349},{"className":7348},[],[7350],{"type":31,"value":7351},"t / Attack",{"type":31,"value":7353},"で0から1へ線形に立ち上がり、ディケイ期間は1.0からサステイン値へ指数的に減衰し、その後はサステイン値を保ちます。",{"type":25,"tag":46,"props":7355,"children":7357},{"className":7356},[],[7358],{"type":31,"value":4464},{"type":31,"value":7360},"は、音の末尾",{"type":25,"tag":46,"props":7362,"children":7364},{"className":7363},[],[7365],{"type":31,"value":2565},{"type":31,"value":7367},"秒で線形にフェードアウトを掛け、音の終わりをちょうど0に着地させます。",{"type":25,"tag":33,"props":7369,"children":7370},{},[7371],{"type":31,"value":7372},"これを各オペレータの出力に毎サンプル掛けることで、音が滑らかに立ち上がって減衰し、クリックノイズが消えます。モジュレータ側にエンベロープを掛ければ、時間とともに倍音が変化する（アタックは明るく、減衰すると丸くなる）といったFMらしい音作りもできます。",{"type":25,"tag":1573,"props":7374,"children":7375},{},[7376],{"type":25,"tag":33,"props":7377,"children":7378},{},[7379,7381,7386],{"type":31,"value":7380},"PICOMのこの実装は、発音時間があらかじめ決まっている（ノート長が固定の）モデルです。",{"type":25,"tag":46,"props":7382,"children":7384},{"className":7383},[],[7385],{"type":31,"value":2565},{"type":31,"value":7387},"はノート末尾から逆算してフェードを始めます。鍵盤を押している間ずっとサステインを保ち、離した瞬間からリリースに入る、というリアルタイム楽器型のエンベロープとは設計が異なります。楽譜から各音の長さが決まっているPICOMの用途では、この方式の方が単純で扱いやすくなります。",{"type":25,"tag":26,"props":7389,"children":7391},{"id":7390},"完成そして次の展開",[7392],{"type":31,"value":7393},"完成、そして次の展開",{"type":25,"tag":33,"props":7395,"children":7396},{},[7397,7399,7404,7406,7411],{"type":31,"value":7398},"これで第3回までの概念がすべてコードになりました。4つのオペレータ、アルゴリズムによる接続の切り替え、フィードバック、各オペレータの",{"type":25,"tag":46,"props":7400,"children":7402},{"className":7401},[],[7403],{"type":31,"value":105},{"type":31,"value":7405},"・出力レベル・ADSR。第2回の2オペレータ実装が、位相配列の拡張と",{"type":25,"tag":46,"props":7407,"children":7409},{"className":7408},[],[7410],{"type":31,"value":1774},{"type":31,"value":7412},"の追加だけで、ちゃんと4オペレータへ地続きに一般化されているのが確認できたはずです。",{"type":25,"tag":33,"props":7414,"children":7415},{},[7416,7418,7424,7426,7431],{"type":31,"value":7417},"実は、ここまで作ると次にやりたくなるのが「既存の名作音色を再現したい」という欲です。PC-98のFM音源には、PMDなどのドライバで使われた音色データ（",{"type":25,"tag":46,"props":7419,"children":7421},{"className":7420},[],[7422],{"type":31,"value":7423},".ff",{"type":31,"value":7425},"形式やJSON）という資産があります。OPNAのレジスタ値（AR/DR/SR/RR/TL/MLなど）を、この記事で作った",{"type":25,"tag":46,"props":7427,"children":7429},{"className":7428},[],[7430],{"type":31,"value":1750},{"type":31,"value":7432},"のパラメータへ変換して読み込めば、当時の音色をそのまま鳴らせます。",{"type":25,"tag":33,"props":7434,"children":7435},{},[7436,7438,7444],{"type":31,"value":7437},"ただし音色データの変換ロジックや、データそのものの著作権の扱いは、それだけで1本の記事になる重さです。FM音源の仕組みを作るという本シリーズの範囲はここまでとして、音色ローダー（",{"type":25,"tag":46,"props":7439,"children":7441},{"className":7440},[],[7442],{"type":31,"value":7443},"IFMVoiceLoader",{"type":31,"value":7445},"構想）とOPNA音色の再現は、別記事として改めて書く予定です。",{"type":25,"tag":26,"props":7447,"children":7448},{"id":1604},[7449],{"type":31,"value":1604},{"type":25,"tag":1608,"props":7451,"children":7452},{},[7453,7470,7480,7492,7497,7502],{"type":25,"tag":1612,"props":7454,"children":7455},{},[7456,7461,7463,7468],{"type":25,"tag":46,"props":7457,"children":7459},{"className":7458},[],[7460],{"type":31,"value":1750},{"type":31,"value":7462},"は周波数比・出力レベル・ADSRを持ち、",{"type":25,"tag":46,"props":7464,"children":7466},{"className":7465},[],[7467],{"type":31,"value":2534},{"type":31,"value":7469},"はキャリアでは音量・モジュレータでは変調の深さを意味する",{"type":25,"tag":1612,"props":7471,"children":7472},{},[7473,7478],{"type":25,"tag":46,"props":7474,"children":7476},{"className":7475},[],[7477],{"type":31,"value":1758},{"type":31,"value":7479},"は4つのオペレータとアルゴリズム・フィードバックをまとめ、既定はAlg4（第2回の2オペレータFMが初期値）",{"type":25,"tag":1612,"props":7481,"children":7482},{},[7483,7485,7490],{"type":31,"value":7484},"波形生成ループの骨格は第2回と同じで、位相を4本に広げ",{"type":25,"tag":46,"props":7486,"children":7488},{"className":7487},[],[7489],{"type":31,"value":1774},{"type":31,"value":7491},"でアルゴリズムを切り替えるだけ",{"type":25,"tag":1612,"props":7493,"children":7494},{},[7495],{"type":31,"value":7496},"変調は「変調する側の出力を、される側のsinの位相に足す」操作で、第2回とまったく同じ",{"type":25,"tag":1612,"props":7498,"children":7499},{},[7500],{"type":31,"value":7501},"OP1のセルフフィードバックと各オペレータのADSRで、倍音リッチな音やクリックのない滑らかな発音が得られる",{"type":25,"tag":1612,"props":7503,"children":7504},{},[7505],{"type":31,"value":7506},"OPNA音色データのロードは別記事に切り出す",{"type":25,"tag":33,"props":7508,"children":7509},{},[7510,7515,7516],{"type":25,"tag":37,"props":7511,"children":7512},{"href":1663},[7513],{"type":31,"value":7514},"← 第3回：4オペレータFM vs 2オペレータ",{"type":31,"value":1660},{"type":25,"tag":37,"props":7517,"children":7519},{"href":7518},"/series/fm-synthesis",[7520],{"type":31,"value":7521},"第1回からのシリーズ目次",{"type":25,"tag":1668,"props":7523,"children":7524},{},[7525],{"type":31,"value":1672},{"title":8,"searchDepth":19,"depth":19,"links":7527},[7528,7529,7530,7531,7532,7533,7534,7535,7536],{"id":28,"depth":19,"text":28},{"id":1779,"depth":19,"text":1782},{"id":2578,"depth":19,"text":2581},{"id":3593,"depth":19,"text":3596},{"id":5039,"depth":19,"text":5039},{"id":6450,"depth":19,"text":6453},{"id":6612,"depth":19,"text":6615},{"id":7390,"depth":19,"text":7393},{"id":1604,"depth":19,"text":1604},"content:articles:tech:blazor:fm-synthesis-4op-implementation.md","articles/tech/blazor/fm-synthesis-4op-implementation.md","articles/tech/blazor/fm-synthesis-4op-implementation",{"_path":1663,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":7541,"description":7542,"date":11,"tags":7543,"rowTypeId":18,"seriesOrder":166,"sitemap":7544,"body":7545,"_type":1681,"_id":8061,"_source":1683,"_file":8062,"_stem":8063,"_extension":1686},"4オペレータFM vs 2オペレータ｜アルゴリズムとは何かを理解する","FM音源シリーズ第3回。2オペレータでは出せない音があるのはなぜか、オペレータを4個に増やすと何ができるのかを「接続の組み合わせ＝アルゴリズム」という軸で解説します。OPNA準拠のAlg0〜7の接続パターンを図で紹介し、直列寄りは歪んだ複雑な音・並列寄りはオルガン的な加算合成という音色傾向を整理。接続の自由度・倍音の複雑さ・計算コストの3軸で2opと4opを比較します。",[13,14,15,16],{"loc":1663,"lastmod":11,"priority":18},{"type":22,"children":7546,"toc":8053},[7547,7551,7560,7565,7573,7579,7584,7589,7594,7599,7605,7618,7631,7636,7644,7649,7654,7662,7667,7672,7680,7685,7691,7711,7885,7890,7896,7901,7982,7987,8002,8006,8034,8039],{"type":25,"tag":26,"props":7548,"children":7549},{"id":28},[7550],{"type":31,"value":28},{"type":25,"tag":33,"props":7552,"children":7553},{},[7554,7558],{"type":25,"tag":37,"props":7555,"children":7556},{"href":5},[7557],{"type":31,"value":1715},{"type":31,"value":7559},"では、モジュレータとキャリアを直列に繋いだ2オペレータFMで1音を鳴らしました。あのときは接続の繋ぎ方が1通りしかなかったので、アルゴリズムという言葉を一度も使いませんでした。",{"type":25,"tag":33,"props":7561,"children":7562},{},[7563],{"type":31,"value":7564},"今回はオペレータを4個に増やします。すると「どれをどれに繋ぐか」の組み合わせが一気に増え、その繋ぎ方のパターンがFM音源の表現力の本体になります。これがアルゴリズムです。この記事は概念回なので、フルコードは出しません。フルコードは最終回でPICOMの実装として一気に書きます。ここでは「なぜ4オペレータが必要か」「アルゴリズムとは何か」を、図と比較で理解することに集中します。",{"type":25,"tag":60,"props":7566,"children":7567},{},[7568],{"type":25,"tag":33,"props":7569,"children":7570},{},[7571],{"type":31,"value":7572},"2オペレータの接続は「モジュレータ→キャリア」の直列1通りしかなく、出せる音の方向性が限られます。オペレータを4個に増やすと、直列・並列・その混合という多様な繋ぎ方が可能になります。この繋ぎ方の選択肢がアルゴリズムで、PICOMはOPNA（YM2608）準拠のAlg0〜7の8種類を持ちます。直列寄りのアルゴリズムは倍音が深く歪んだ複雑な音に、並列寄りは複数のサイン波を足すオルガン的な加算合成になります。",{"type":25,"tag":26,"props":7574,"children":7576},{"id":7575},"_2オペレータの限界",[7577],{"type":31,"value":7578},"2オペレータの限界",{"type":25,"tag":33,"props":7580,"children":7581},{},[7582],{"type":31,"value":7583},"2オペレータでできるのは、1つのモジュレータで1つのキャリアを揺さぶることだけです。これでもエレピやベルなど多くの音は作れますが、限界もはっきりしています。",{"type":25,"tag":33,"props":7585,"children":7586},{},[7587],{"type":31,"value":7588},"ひとつは倍音の作り込みの浅さです。揺さぶる側（モジュレータ）が1段しかないので、複雑な倍音の塊を作ろうとすると変調指数を上げるしかなく、音が単調にジリジリと濁る方向にしか動きません。",{"type":25,"tag":33,"props":7590,"children":7591},{},[7592],{"type":31,"value":7593},"もうひとつは音の重ね合わせができないことです。たとえば「芯のあるエレピの音」に「キラキラした金属的なアタック」を別系統で混ぜたい、といった音作りは、独立した2つの発音系統が要るので2オペレータでは表現できません。",{"type":25,"tag":33,"props":7595,"children":7596},{},[7597],{"type":31,"value":7598},"この2つの限界を超えるために、オペレータを増やし、繋ぎ方を選べるようにします。",{"type":25,"tag":26,"props":7600,"children":7602},{"id":7601},"アルゴリズム-オペレータの繋ぎ方の地図",[7603],{"type":31,"value":7604},"アルゴリズム ＝ オペレータの繋ぎ方の地図",{"type":25,"tag":33,"props":7606,"children":7607},{},[7608,7610,7616],{"type":31,"value":7609},"4つのオペレータ（OP1〜OP4と呼びます）をどう繋ぐかには、いくつもの定番パターンがあります。PICOMはOPNA（YM2608）と同じ8種類を採用していて、",{"type":25,"tag":46,"props":7611,"children":7613},{"className":7612},[],[7614],{"type":31,"value":7615},"FMAlgorithm",{"type":31,"value":7617}," というenumで Alg0〜Alg7 として定義されています。",{"type":25,"tag":33,"props":7619,"children":7620},{},[7621,7623,7629],{"type":31,"value":7622},"繋ぎ方を読むコツは2つです。矢印 ",{"type":25,"tag":46,"props":7624,"children":7626},{"className":7625},[],[7627],{"type":31,"value":7628},"→",{"type":31,"value":7630}," は「変調する」（左が右を揺さぶる）を表し、最終的に音として出てくるオペレータをキャリアと呼びます。直列に深く繋ぐほど倍音が複雑になり、並列に並べて足すほど純粋なサイン波の足し算（加算合成）に近づきます。",{"type":25,"tag":33,"props":7632,"children":7633},{},[7634],{"type":31,"value":7635},"両極端の2つを図で見てみます。まず、4つすべてを1本に繋いだ最も直列的な Alg0 です。",{"type":25,"tag":124,"props":7637,"children":7639},{"code":7638},"Alg0 : OP1 → OP2 → OP3 → OP4 →(出力)\n\n  [OP1]→[OP2]→[OP3]→[OP4]→ out\n   mod   mod   mod   carrier\n",[7640],{"type":25,"tag":46,"props":7641,"children":7642},{"__ignoreMap":8},[7643],{"type":31,"value":7638},{"type":25,"tag":33,"props":7645,"children":7646},{},[7647],{"type":31,"value":7648},"OP1がOP2を、OP2がOP3を、OP3がOP4を揺さぶり、最後のOP4だけが音になります。変調が3段重なるので倍音が深く、歪んだ・金属的な・激しい音になりやすい構成です。",{"type":25,"tag":33,"props":7650,"children":7651},{},[7652],{"type":31,"value":7653},"対して、4つを一切繋がず全部そのまま足すのが Alg7 です。",{"type":25,"tag":124,"props":7655,"children":7657},{"code":7656},"Alg7 : OP1 + OP2 + OP3 + OP4 →(出力)\n\n  [OP1]─┐\n  [OP2]─┤\n  [OP3]─┼→ out （4本のサイン波の単純な和）\n  [OP4]─┘\n",[7658],{"type":25,"tag":46,"props":7659,"children":7660},{"__ignoreMap":8},[7661],{"type":31,"value":7656},{"type":25,"tag":33,"props":7663,"children":7664},{},[7665],{"type":31,"value":7666},"これは変調がまったく無く、4本のサイン波を足しているだけです。倍音をサイン波の重ね合わせで作る加算合成そのもので、オルガンのような澄んだ音になります。FMでありながらFM変調を使わないという、両極のもう一方です。",{"type":25,"tag":33,"props":7668,"children":7669},{},[7670],{"type":31,"value":7671},"PICOMの既定値である Alg4 は、その中間にあるバランス型です。",{"type":25,"tag":124,"props":7673,"children":7675},{"code":7674},"Alg4 : (OP1 → OP2) + (OP3 → OP4) →(出力)\n\n  [OP1]→[OP2]─┐\n              ├→ out\n  [OP3]→[OP4]─┘\n",[7676],{"type":25,"tag":46,"props":7677,"children":7678},{"__ignoreMap":8},[7679],{"type":31,"value":7674},{"type":25,"tag":33,"props":7681,"children":7682},{},[7683],{"type":31,"value":7684},"「モジュレータ→キャリア」の2オペレータのペアが2組あり、その2つの音を足し合わせます。つまり第2回で作った2オペレータFMを2つ並列に鳴らしているのと同じで、独立した2系統を混ぜられます。先ほど挙げた「エレピの芯＋別系統のアタック」のような音作りが、ここで初めて可能になります。",{"type":25,"tag":26,"props":7686,"children":7688},{"id":7687},"alg07-の全体像",[7689],{"type":31,"value":7690},"Alg0〜7 の全体像",{"type":25,"tag":33,"props":7692,"children":7693},{},[7694,7696,7701,7703,7709],{"type":31,"value":7695},"残りも含めた8種類は、直列の深さと並列の数のグラデーションとして並びます。表記の ",{"type":25,"tag":46,"props":7697,"children":7699},{"className":7698},[],[7700],{"type":31,"value":7628},{"type":31,"value":7702}," は変調、",{"type":25,"tag":46,"props":7704,"children":7706},{"className":7705},[],[7707],{"type":31,"value":7708},"+",{"type":31,"value":7710}," は加算（出力での足し合わせ）です。",{"type":25,"tag":7712,"props":7713,"children":7714},"table",{},[7715,7739],{"type":25,"tag":7716,"props":7717,"children":7718},"thead",{},[7719],{"type":25,"tag":7720,"props":7721,"children":7722},"tr",{},[7723,7729,7734],{"type":25,"tag":7724,"props":7725,"children":7726},"th",{},[7727],{"type":31,"value":7728},"アルゴリズム",{"type":25,"tag":7724,"props":7730,"children":7731},{},[7732],{"type":31,"value":7733},"接続",{"type":25,"tag":7724,"props":7735,"children":7736},{},[7737],{"type":31,"value":7738},"性格",{"type":25,"tag":7740,"props":7741,"children":7742},"tbody",{},[7743,7761,7779,7797,7815,7832,7850,7868],{"type":25,"tag":7720,"props":7744,"children":7745},{},[7746,7751,7756],{"type":25,"tag":7747,"props":7748,"children":7749},"td",{},[7750],{"type":31,"value":5079},{"type":25,"tag":7747,"props":7752,"children":7753},{},[7754],{"type":31,"value":7755},"OP1→OP2→OP3→OP4",{"type":25,"tag":7747,"props":7757,"children":7758},{},[7759],{"type":31,"value":7760},"最も直列。倍音が深く歪んだ複雑な音",{"type":25,"tag":7720,"props":7762,"children":7763},{},[7764,7769,7774],{"type":25,"tag":7747,"props":7765,"children":7766},{},[7767],{"type":31,"value":7768},"Alg1",{"type":25,"tag":7747,"props":7770,"children":7771},{},[7772],{"type":31,"value":7773},"(OP1+OP2)→OP3→OP4",{"type":25,"tag":7747,"props":7775,"children":7776},{},[7777],{"type":31,"value":7778},"2つのモジュレータで深く変調する直列寄り",{"type":25,"tag":7720,"props":7780,"children":7781},{},[7782,7787,7792],{"type":25,"tag":7747,"props":7783,"children":7784},{},[7785],{"type":31,"value":7786},"Alg2",{"type":25,"tag":7747,"props":7788,"children":7789},{},[7790],{"type":31,"value":7791},"OP1+(OP2→OP3)→OP4",{"type":25,"tag":7747,"props":7793,"children":7794},{},[7795],{"type":31,"value":7796},"直列の枝と単独モジュレータを合流",{"type":25,"tag":7720,"props":7798,"children":7799},{},[7800,7805,7810],{"type":25,"tag":7747,"props":7801,"children":7802},{},[7803],{"type":31,"value":7804},"Alg3",{"type":25,"tag":7747,"props":7806,"children":7807},{},[7808],{"type":31,"value":7809},"(OP1→OP2)+OP3→OP4",{"type":25,"tag":7747,"props":7811,"children":7812},{},[7813],{"type":31,"value":7814},"変調済みの枝と素のオペレータを合流",{"type":25,"tag":7720,"props":7816,"children":7817},{},[7818,7822,7827],{"type":25,"tag":7747,"props":7819,"children":7820},{},[7821],{"type":31,"value":2756},{"type":25,"tag":7747,"props":7823,"children":7824},{},[7825],{"type":31,"value":7826},"(OP1→OP2)+(OP3→OP4)",{"type":25,"tag":7747,"props":7828,"children":7829},{},[7830],{"type":31,"value":7831},"2オペレータのペア×2。バランス型（PICOM既定）",{"type":25,"tag":7720,"props":7833,"children":7834},{},[7835,7840,7845],{"type":25,"tag":7747,"props":7836,"children":7837},{},[7838],{"type":31,"value":7839},"Alg5",{"type":25,"tag":7747,"props":7841,"children":7842},{},[7843],{"type":31,"value":7844},"OP1→(OP2+OP3+OP4)",{"type":25,"tag":7747,"props":7846,"children":7847},{},[7848],{"type":31,"value":7849},"1つのモジュレータで3つのキャリアを揺さぶる",{"type":25,"tag":7720,"props":7851,"children":7852},{},[7853,7858,7863],{"type":25,"tag":7747,"props":7854,"children":7855},{},[7856],{"type":31,"value":7857},"Alg6",{"type":25,"tag":7747,"props":7859,"children":7860},{},[7861],{"type":31,"value":7862},"(OP1→OP2)+OP3+OP4",{"type":25,"tag":7747,"props":7864,"children":7865},{},[7866],{"type":31,"value":7867},"1組だけ変調、残り2つは素のサイン波を加算",{"type":25,"tag":7720,"props":7869,"children":7870},{},[7871,7875,7880],{"type":25,"tag":7747,"props":7872,"children":7873},{},[7874],{"type":31,"value":5934},{"type":25,"tag":7747,"props":7876,"children":7877},{},[7878],{"type":31,"value":7879},"OP1+OP2+OP3+OP4",{"type":25,"tag":7747,"props":7881,"children":7882},{},[7883],{"type":31,"value":7884},"最も並列。加算合成でオルガン的な澄んだ音",{"type":25,"tag":33,"props":7886,"children":7887},{},[7888],{"type":31,"value":7889},"上から下へ向かうほど、直列の支配から並列の支配へと移っていきます。Alg0付近は変調段が深く倍音リッチで攻撃的、Alg7付近はサイン波の足し算に近く澄んだ音、という地図として捉えておくと、最終回で実際のコードを読むときに見通しが効きます。",{"type":25,"tag":26,"props":7891,"children":7893},{"id":7892},"_3軸で比較する2op-vs-4op",[7894],{"type":31,"value":7895},"3軸で比較する：2op vs 4op",{"type":25,"tag":33,"props":7897,"children":7898},{},[7899],{"type":31,"value":7900},"2オペレータと4オペレータの違いを、接続の自由度・倍音の複雑さ・計算コストの3軸で整理します。",{"type":25,"tag":7712,"props":7902,"children":7903},{},[7904,7925],{"type":25,"tag":7716,"props":7905,"children":7906},{},[7907],{"type":25,"tag":7720,"props":7908,"children":7909},{},[7910,7915,7920],{"type":25,"tag":7724,"props":7911,"children":7912},{},[7913],{"type":31,"value":7914},"観点",{"type":25,"tag":7724,"props":7916,"children":7917},{},[7918],{"type":31,"value":7919},"2オペレータ",{"type":25,"tag":7724,"props":7921,"children":7922},{},[7923],{"type":31,"value":7924},"4オペレータ",{"type":25,"tag":7740,"props":7926,"children":7927},{},[7928,7946,7964],{"type":25,"tag":7720,"props":7929,"children":7930},{},[7931,7936,7941],{"type":25,"tag":7747,"props":7932,"children":7933},{},[7934],{"type":31,"value":7935},"接続の自由度",{"type":25,"tag":7747,"props":7937,"children":7938},{},[7939],{"type":31,"value":7940},"直列1通りのみ（アルゴリズムの概念が不要）",{"type":25,"tag":7747,"props":7942,"children":7943},{},[7944],{"type":31,"value":7945},"Alg0〜7の8通り。直列・並列・混合を選べる",{"type":25,"tag":7720,"props":7947,"children":7948},{},[7949,7954,7959],{"type":25,"tag":7747,"props":7950,"children":7951},{},[7952],{"type":31,"value":7953},"倍音の複雑さ",{"type":25,"tag":7747,"props":7955,"children":7956},{},[7957],{"type":31,"value":7958},"モジュレータ1段ぶん。変調指数で調整するのが主",{"type":25,"tag":7747,"props":7960,"children":7961},{},[7962],{"type":31,"value":7963},"変調を多段に重ねたり、複数系統を加算したりできる",{"type":25,"tag":7720,"props":7965,"children":7966},{},[7967,7972,7977],{"type":25,"tag":7747,"props":7968,"children":7969},{},[7970],{"type":31,"value":7971},"計算コスト",{"type":25,"tag":7747,"props":7973,"children":7974},{},[7975],{"type":31,"value":7976},"sin計算2回／サンプル",{"type":25,"tag":7747,"props":7978,"children":7979},{},[7980],{"type":31,"value":7981},"sin計算4回／サンプル（おおむね2倍）",{"type":25,"tag":33,"props":7983,"children":7984},{},[7985],{"type":31,"value":7986},"要点は、4オペレータの価値は単に「オペレータが2倍になった」ことではなく、「繋ぎ方を選べるようになった」ことにある、という点です。計算コストはおよそ2倍で済むのに、表現できる音の幅は接続の自由度のぶん桁違いに広がります。これが、当時の音源チップが2オペレータではなく4オペレータを主流にした理由でもあります。",{"type":25,"tag":1573,"props":7988,"children":7989},{},[7990],{"type":25,"tag":33,"props":7991,"children":7992},{},[7993,7995,8000],{"type":31,"value":7994},"オペレータを増やすほど良い、という単純な話ではありません。並列のキャリアが増えると出力の振幅が単純な和で大きくなり、そのままでは音が割れます。PICOMの実装でも、複数キャリアを足したあとに出力を ",{"type":25,"tag":134,"props":7996,"children":7997},{},[7998],{"type":31,"value":7999},"-1, 1",{"type":31,"value":8001}," にクリップする処理が入っています。この振幅管理を含めた実際のコードは、次の最終回で扱います。",{"type":25,"tag":26,"props":8003,"children":8004},{"id":1604},[8005],{"type":31,"value":1604},{"type":25,"tag":1608,"props":8007,"children":8008},{},[8009,8014,8019,8024,8029],{"type":25,"tag":1612,"props":8010,"children":8011},{},[8012],{"type":31,"value":8013},"2オペレータは「モジュレータ→キャリア」の直列1通りで、倍音の作り込みも音の重ね合わせも限界がある",{"type":25,"tag":1612,"props":8015,"children":8016},{},[8017],{"type":31,"value":8018},"オペレータを4個に増やすと繋ぎ方の選択肢が生まれ、その繋ぎ方のパターンがアルゴリズム",{"type":25,"tag":1612,"props":8020,"children":8021},{},[8022],{"type":31,"value":8023},"PICOMはOPNA準拠のAlg0〜7を持ち、直列寄りは歪んだ複雑な音、並列寄りは加算合成的な澄んだ音になる",{"type":25,"tag":1612,"props":8025,"children":8026},{},[8027],{"type":31,"value":8028},"既定のAlg4は2オペレータFMのペアを2組並列にした構成で、独立した2系統を混ぜられる",{"type":25,"tag":1612,"props":8030,"children":8031},{},[8032],{"type":31,"value":8033},"4オペレータの本質的な価値は接続の自由度にあり、計算コストはおよそ2倍に収まる",{"type":25,"tag":33,"props":8035,"children":8036},{},[8037],{"type":31,"value":8038},"次回はいよいよ最終回。この8アルゴリズムとフィードバック、ADSRエンベロープを全部コードにして、PICOMの動く4オペレータFM音源を実装します。",{"type":25,"tag":33,"props":8040,"children":8041},{},[8042,8047,8048],{"type":25,"tag":37,"props":8043,"children":8044},{"href":5},[8045],{"type":31,"value":8046},"← 第2回：2オペレータFMの実装",{"type":31,"value":1660},{"type":25,"tag":37,"props":8049,"children":8050},{"href":1688},[8051],{"type":31,"value":8052},"最終回：4オペレータFMの実装 →",{"title":8,"searchDepth":19,"depth":19,"links":8054},[8055,8056,8057,8058,8059,8060],{"id":28,"depth":19,"text":28},{"id":7575,"depth":19,"text":7578},{"id":7601,"depth":19,"text":7604},{"id":7687,"depth":19,"text":7690},{"id":7892,"depth":19,"text":7895},{"id":1604,"depth":19,"text":1604},"content:articles:tech:blazor:fm-synthesis-4op-vs-2op.md","articles/tech/blazor/fm-synthesis-4op-vs-2op.md","articles/tech/blazor/fm-synthesis-4op-vs-2op",{"_path":39,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":8065,"description":8066,"date":11,"tags":8067,"rowTypeId":18,"seriesOrder":18,"sitemap":8068,"body":8069,"_type":1681,"_id":8431,"_source":1683,"_file":8432,"_stem":8433,"_extension":1686},"FM音源とは？なぜ1個のサイン波からあれだけ多彩な音色が出るのか","チップチューン音楽アプリPICOMで使っているFM音源（周波数変調合成）の原理を、数式1本だけで直感的に解説します。サイン波が単一倍音であること、変調で側帯波が生まれて倍音が増えること、変調指数と周波数比が音色をどう変えるかを、コードを使わず言葉で結びます。DX7やPC-98のOPNAといった歴史的文脈にも触れる、全4回シリーズの第1回です。",[13,14,15,16],{"loc":39,"lastmod":11,"priority":18},{"type":22,"children":8070,"toc":8419},[8071,8075,8088,8093,8098,8106,8112,8117,8122,8127,8133,8154,8159,8167,8172,8178,8183,8191,8201,8222,8234,8239,8244,8256,8263,8280,8305,8317,8323,8328,8333,8338,8346,8352,8357,8362,8367,8371,8406,8411],{"type":25,"tag":26,"props":8072,"children":8073},{"id":28},[8074],{"type":31,"value":28},{"type":25,"tag":33,"props":8076,"children":8077},{},[8078,8080,8086],{"type":31,"value":8079},"チップチューン音楽を作れるWebアプリ「PICOM」には、矩形波や三角波だけでなく",{"type":25,"tag":8081,"props":8082,"children":8084},"tooltip",{"content":8083},"Frequency Modulation（周波数変調）方式の音源。サイン波の周波数を別のサイン波で揺さぶって複雑な倍音を作る",[8085],{"type":31,"value":14},{"type":31,"value":8087},"のトラックがあります。FM音源は、たった数個のサイン波の組み合わせで、ベル・エレピ・ベース・金属的なシンセリードまで、驚くほど幅広い音色を出せます。",{"type":25,"tag":33,"props":8089,"children":8090},{},[8091],{"type":31,"value":8092},"この「なぜ単純なサイン波の組み合わせから、あれだけ多彩な音が出るのか」という直感を、この記事では数式1本だけで説明します。コードは一切出しません。実装は第2回以降でじっくりやるので、ここでは「FM音源の音作りの仕組みを、自分の言葉で人に説明できる」状態を目指します。",{"type":25,"tag":33,"props":8094,"children":8095},{},[8096],{"type":31,"value":8097},"これはFM音源を題材にした全4回シリーズの第1回です。第1回（この記事）で原理を、第2回で最小構成の実装を、第3回でオペレータを増やす意味を、最終回でPICOMの4オペレータ実装を扱います。",{"type":25,"tag":60,"props":8099,"children":8100},{},[8101],{"type":25,"tag":33,"props":8102,"children":8103},{},[8104],{"type":31,"value":8105},"サイン波は倍音を1つしか持たない「最も素朴な音」です。その周波数を別のサイン波で揺さぶる（変調する）と、左右に側帯波（サイドバンド）と呼ばれる新しい倍音が次々に生まれます。揺さぶりの深さ（変調指数 I）で倍音の豊かさが、揺さぶる側と揺さぶられる側の周波数比（fc:fm）で倍音の並び方が決まります。この2つのパラメータを動かすだけで、音色が大きく変わるのがFM音源です。",{"type":25,"tag":26,"props":8107,"children":8109},{"id":8108},"サイン波は倍音が1つだけの音",[8110],{"type":31,"value":8111},"サイン波は「倍音が1つだけ」の音",{"type":25,"tag":33,"props":8113,"children":8114},{},[8115],{"type":31,"value":8116},"音の「音色」の正体は、含まれる倍音（基音の整数倍の周波数成分）の構成です。同じ高さ（ピッチ）でも、バイオリンとフルートで音が違って聞こえるのは、倍音の混ざり方が違うからです。",{"type":25,"tag":33,"props":8118,"children":8119},{},[8120],{"type":31,"value":8121},"その観点で見ると、サイン波は特別な波形です。サイン波は基音だけを持ち、倍音を1つも含みません。だからサイン波は「ポー」という、まろやかで芯のない、いちばん素朴な音に聞こえます。逆に言えば、サイン波は音色を作るための真っ白なキャンバスです。ここに倍音をどう足していくかが、すべてのシンセシスの出発点になります。",{"type":25,"tag":33,"props":8123,"children":8124},{},[8125],{"type":31,"value":8126},"FM音源は、このサイン波に倍音を足す方法として「周波数を揺さぶる」というアプローチを取ります。",{"type":25,"tag":26,"props":8128,"children":8130},{"id":8129},"揺さぶると倍音が生まれる側帯波",[8131],{"type":31,"value":8132},"揺さぶると倍音が生まれる：側帯波",{"type":25,"tag":33,"props":8134,"children":8135},{},[8136,8138,8144,8146,8152],{"type":31,"value":8137},"ラジオのFM放送と同じ言葉ですが、原理も同じです。ある周波数のサイン波（これを",{"type":25,"tag":8081,"props":8139,"children":8141},{"content":8140},"Carrier。最終的に耳に届く側のサイン波。基準ピッチを担う",[8142],{"type":31,"value":8143},"キャリア",{"type":31,"value":8145},"と呼びます）の周波数を、別のサイン波（",{"type":25,"tag":8081,"props":8147,"children":8149},{"content":8148},"Modulator。キャリアの周波数を揺さぶる側のサイン波。直接は聞こえない",[8150],{"type":31,"value":8151},"モジュレータ",{"type":31,"value":8153},"と呼びます）で速く揺さぶります。",{"type":25,"tag":33,"props":8155,"children":8156},{},[8157],{"type":31,"value":8158},"すると不思議なことに、キャリアの周波数の左右に、モジュレータの周波数の間隔で、新しい周波数成分が次々と現れます。これが側帯波（サイドバンド）です。キャリアの周波数を fc、モジュレータの周波数を fm とすると、",{"type":25,"tag":124,"props":8160,"children":8162},{"code":8161},"fc, fc ± fm, fc ± 2·fm, fc ± 3·fm, ...\n",[8163],{"type":25,"tag":46,"props":8164,"children":8165},{"__ignoreMap":8},[8166],{"type":31,"value":8161},{"type":25,"tag":33,"props":8168,"children":8169},{},[8170],{"type":31,"value":8171},"という位置に成分が並びます。元はサイン波2本だけだったのに、揺さぶった結果として、たくさんの周波数成分＝倍音が湧き出てくるわけです。これがFM音源が少ない素材で複雑な音を作れる理由の核心です。",{"type":25,"tag":26,"props":8173,"children":8175},{"id":8174},"式はこれ1本だけ",[8176],{"type":31,"value":8177},"式は、これ1本だけ",{"type":25,"tag":33,"props":8179,"children":8180},{},[8181],{"type":31,"value":8182},"ここまでの話は、次の1本の式にすべて入っています。",{"type":25,"tag":124,"props":8184,"children":8186},{"code":8185},"out = sin(2π·fc·t + I·sin(2π·fm·t))\n",[8187],{"type":25,"tag":46,"props":8188,"children":8189},{"__ignoreMap":8},[8190],{"type":31,"value":8185},{"type":25,"tag":33,"props":8192,"children":8193},{},[8194,8199],{"type":25,"tag":46,"props":8195,"children":8197},{"className":8196},[],[8198],{"type":31,"value":4473},{"type":31,"value":8200}," は時間です。落ち着いて分解すると、構造はとても素直です。",{"type":25,"tag":33,"props":8202,"children":8203},{},[8204,8206,8212,8214,8220],{"type":31,"value":8205},"いちばん外側の ",{"type":25,"tag":46,"props":8207,"children":8209},{"className":8208},[],[8210],{"type":31,"value":8211},"sin(2π·fc·t + ...)",{"type":31,"value":8213}," は、周波数 fc のキャリアのサイン波です。もし中身の ",{"type":25,"tag":46,"props":8215,"children":8217},{"className":8216},[],[8218],{"type":31,"value":8219},"+ ...",{"type":31,"value":8221}," が無ければ、これはただのサイン波（倍音なし）になります。",{"type":25,"tag":33,"props":8223,"children":8224},{},[8225,8227,8232],{"type":31,"value":8226},"そのキャリアの位相（カッコの中身）に、",{"type":25,"tag":46,"props":8228,"children":8230},{"className":8229},[],[8231],{"type":31,"value":1052},{"type":31,"value":8233}," というモジュレータのサイン波を足し込んでいます。位相に揺さぶりを加えるとは、瞬間ごとにキャリアの進み方を速くしたり遅くしたりすることで、結果として周波数を揺さぶることと同じになります。",{"type":25,"tag":33,"props":8235,"children":8236},{},[8237],{"type":31,"value":8238},"つまりこの式は、「キャリアのサイン波を、モジュレータのサイン波で揺さぶる」を、そのまま数式にしただけです。FM音源で出てくる式は、突き詰めればこの1本だけです。この先のシリーズは、この式を増やしたり繋ぎ替えたりしているにすぎません。",{"type":25,"tag":26,"props":8240,"children":8242},{"id":8241},"パラメータが音にどう効くか",[8243],{"type":31,"value":8241},{"type":25,"tag":33,"props":8245,"children":8246},{},[8247,8249,8254],{"type":31,"value":8248},"式の中で音色を決めるのは、",{"type":25,"tag":46,"props":8250,"children":8252},{"className":8251},[],[8253],{"type":31,"value":2549},{"type":31,"value":8255},"（変調指数）と、fc と fm の比です。それぞれが耳にどう効くかを言葉で結びます。",{"type":25,"tag":8257,"props":8258,"children":8260},"h3",{"id":8259},"変調指数-i-倍音の豊かさ",[8261],{"type":31,"value":8262},"変調指数 I ＝ 倍音の「豊かさ」",{"type":25,"tag":33,"props":8264,"children":8265},{},[8266,8271,8273,8278],{"type":25,"tag":46,"props":8267,"children":8269},{"className":8268},[],[8270],{"type":31,"value":2549},{"type":31,"value":8272}," は揺さぶりの深さです。",{"type":25,"tag":46,"props":8274,"children":8276},{"className":8275},[],[8277],{"type":31,"value":2549},{"type":31,"value":8279}," を大きくするほど、遠く（fc から離れた高い倍音）まで側帯波のエネルギーが届きます。",{"type":25,"tag":33,"props":8281,"children":8282},{},[8283,8289,8291,8296,8298,8303],{"type":25,"tag":46,"props":8284,"children":8286},{"className":8285},[],[8287],{"type":31,"value":8288},"I = 0",{"type":31,"value":8290}," なら揺さぶりはゼロで、キャリアは素のサイン波のまま、まろやかな「ポー」という音です。",{"type":25,"tag":46,"props":8292,"children":8294},{"className":8293},[],[8295],{"type":31,"value":2549},{"type":31,"value":8297}," を上げていくと、近くの倍音から順にエネルギーが乗り始め、音はだんだん明るく・ジリジリした金属的な質感へ変わります。",{"type":25,"tag":46,"props":8299,"children":8301},{"className":8300},[],[8302],{"type":31,"value":2549},{"type":31,"value":8304}," をさらに大きくすると、倍音が高域まで広がってノイジーで激しい音になります。",{"type":25,"tag":33,"props":8306,"children":8307},{},[8308,8310,8315],{"type":31,"value":8309},"シンセの音作りで「明るさ」「アタックの鋭さ」を調整するつまみは、おおむねこの ",{"type":25,"tag":46,"props":8311,"children":8313},{"className":8312},[],[8314],{"type":31,"value":2549},{"type":31,"value":8316}," を時間的に動かしているものだと考えると見通しが良くなります。",{"type":25,"tag":8257,"props":8318,"children":8320},{"id":8319},"周波数比-fcfm-倍音の並び方",[8321],{"type":31,"value":8322},"周波数比 fc:fm ＝ 倍音の「並び方」",{"type":25,"tag":33,"props":8324,"children":8325},{},[8326],{"type":31,"value":8327},"倍音の位置は fc ± n·fm でした。だから fc と fm の比が、生まれる倍音の並び方を決めます。",{"type":25,"tag":33,"props":8329,"children":8330},{},[8331],{"type":31,"value":8332},"fc:fm が 1:1、1:2、2:1 のような単純な整数比のとき、側帯波は基音の整数倍にきれいに重なります。すると倍音が音楽的に整列し、ピッチのはっきりした「楽器らしい」音になります。エレピやベルのような、音程感のある音はこの領域です。",{"type":25,"tag":33,"props":8334,"children":8335},{},[8336],{"type":31,"value":8337},"比が整数からずれると、側帯波は基音の整数倍に乗らず、不協和でピッチ感の薄い金属音・打楽器的な音になります。鐘やゴング、効果音的なサウンドはこの領域です。",{"type":25,"tag":1573,"props":8339,"children":8340},{},[8341],{"type":25,"tag":33,"props":8342,"children":8343},{},[8344],{"type":31,"value":8345},"FM音源では、音の高さ（ピッチ）を変えても音色を保ちたいので、fm はふつう「fc に対する比（レシオ）」で指定します。fm を固定の周波数で持ってしまうと、高い音と低い音で倍音の並びが変わり、音色が破綻します。PICOMの実装でもモジュレータは絶対周波数ではなく比で持っており、これは第2回以降で実際のコードとして出てきます。",{"type":25,"tag":26,"props":8347,"children":8349},{"id":8348},"なぜ歴史に名を刻んだのかdx7とopna",[8350],{"type":31,"value":8351},"なぜ歴史に名を刻んだのか：DX7とOPNA",{"type":25,"tag":33,"props":8353,"children":8354},{},[8355],{"type":31,"value":8356},"FM音源を一気に有名にしたのが、1983年のヤマハDX7です。スタンフォード大学のジョン・チャウニング博士が見つけたFM合成の手法を製品化したもので、それまでのアナログシンセでは難しかったエレピ・ベル・金属的な音を、デジタルで安定して、しかも少ない計算量で出せたことが衝撃でした。1980年代のヒット曲のエレピは、かなりの割合がDX7です。",{"type":25,"tag":33,"props":8358,"children":8359},{},[8360],{"type":31,"value":8361},"日本のレトロPCに親しんだ人には、PC-98シリーズに載っていた音源チップ、ヤマハのOPNA（YM2608）の方が馴染み深いかもしれません。OPNAは4つのオペレータ（サイン波生成ユニット）を持つFM音源で、当時のゲームミュージックの土台でした。PICOMが目指している「チップチューンらしいFMの音」は、まさにこのOPNA系の4オペレータFMの系譜です。",{"type":25,"tag":33,"props":8363,"children":8364},{},[8365],{"type":31,"value":8366},"少ない計算量で多彩な音が出せるというFM音源の長所は、CPUもメモリも貧弱だった時代に決定的でした。そしてその仕組みは、今ブラウザ上のC#で実装しても、まったく同じ式で動きます。このシリーズは、その式を実際に鳴るコードへ落としていく記録です。",{"type":25,"tag":26,"props":8368,"children":8369},{"id":1604},[8370],{"type":31,"value":1604},{"type":25,"tag":1608,"props":8372,"children":8373},{},[8374,8379,8384,8396,8401],{"type":25,"tag":1612,"props":8375,"children":8376},{},[8377],{"type":31,"value":8378},"サイン波は倍音を持たない最も素朴な音で、音作りのキャンバスになる",{"type":25,"tag":1612,"props":8380,"children":8381},{},[8382],{"type":31,"value":8383},"キャリアの周波数をモジュレータで揺さぶると、fc ± n·fm の位置に側帯波（倍音）が次々生まれる",{"type":25,"tag":1612,"props":8385,"children":8386},{},[8387,8389,8394],{"type":31,"value":8388},"音色を決める式は ",{"type":25,"tag":46,"props":8390,"children":8392},{"className":8391},[],[8393],{"type":31,"value":51},{"type":31,"value":8395}," の1本だけ",{"type":25,"tag":1612,"props":8397,"children":8398},{},[8399],{"type":31,"value":8400},"変調指数 I は倍音の豊かさ（明るさ・激しさ）を、周波数比 fc:fm は倍音の並び方（楽器的か金属的か）を決める",{"type":25,"tag":1612,"props":8402,"children":8403},{},[8404],{"type":31,"value":8405},"少ない素材で多彩な音を出せる長所が、DX7やPC-98のOPNAでFM音源を時代の主役にした",{"type":25,"tag":33,"props":8407,"children":8408},{},[8409],{"type":31,"value":8410},"次回は、この式をそのままC#のコードに落として、キャリアとモジュレータ2個だけの最小のFM音源で実際に1音鳴らします。",{"type":25,"tag":33,"props":8412,"children":8413},{},[8414],{"type":25,"tag":37,"props":8415,"children":8416},{"href":5},[8417],{"type":31,"value":8418},"第2回：2オペレータFMの実装 →",{"title":8,"searchDepth":19,"depth":19,"links":8420},[8421,8422,8423,8424,8425,8429,8430],{"id":28,"depth":19,"text":28},{"id":8108,"depth":19,"text":8111},{"id":8129,"depth":19,"text":8132},{"id":8174,"depth":19,"text":8177},{"id":8241,"depth":19,"text":8241,"children":8426},[8427,8428],{"id":8259,"depth":166,"text":8262},{"id":8319,"depth":166,"text":8322},{"id":8348,"depth":19,"text":8351},{"id":1604,"depth":19,"text":1604},"content:articles:tech:blazor:fm-synthesis-basics.md","articles/tech/blazor/fm-synthesis-basics.md","articles/tech/blazor/fm-synthesis-basics",1782003916566]