> ## Documentation Index
> Fetch the complete documentation index at: https://docs.makkii.jp/llms.txt
> Use this file to discover all available pages before exploring further.

# プロジェクト JSON スキーマ

> パケット設定を表す JSON の形式

[JSON インポート/エクスポート](/codec-compiler/guides/import-export) や [HTTP API](/codec-compiler/guides/ai-export#http-api) でやり取りされる JSON は、1 パケットぶんの設定を表します。複数パケットをまとめて 1 つの JSON に持たせる仕組みはありません。

```json theme={null}
{
  "version": 1,
  "id": "unique_project_id",
  "name": "VehicleControl",
  "description": "任意の説明文",
  "backend": "pure",
  "senderChannels": "28,29,30,31,32",
  "receiverChannels": "28,29,30,31,32",
  "receiverTable": "rx",
  "fields": [
    {
      "id": "unique_field_id",
      "name": "seat_ad",
      "kind": "number",
      "min": "-1",
      "max": "1",
      "step": "1",
      "rounding": "nearest",
      "threshold": "0.5",
      "rangeMode": "assume",
      "sourceType": "number",
      "sourceChannel": 1
    }
  ]
}
```

## 項目の補足

* `min`/`max`/`step`/`threshold` は文字列です。浮動小数点ではなく厳密な小数として解釈されるため、`0.125` や `0.005` のような刻み幅も誤差なく量子化されます。
* `sourceChannel` は送信側 MC 上でこのフィールドの値を読み出すチャンネルです。`input.getNumber(sourceChannel)` / `input.getBool(sourceChannel)` に対応し、パッキング後の値が実際に流れる `senderChannels`/`receiverChannels` とは独立です。
* フィールドの `name` は、受信側で `<receiverTable>.<name>` として書き込まれる Lua の変数名としても使われます。送信側と受信側で別のキー名を持つ仕組みはありません。不正な文字は生成時にサニタイズされます。
* `rounding: "threshold"` のときだけ `threshold` (0〜1) が使われます。それ以外の `rounding` では無視されます。
* `kind: "bool"` のフィールドは `min`/`max`/`step`/`rangeMode`/`rounding`/`threshold` を無視します。
* `backend` は `"pure"` (既定) または `"raw32"` です。詳細は [パッキング方式](/codec-compiler/reference/packing-modes) を参照してください。

各項目の意味と既定値の一覧は [フィールド設定リファレンス](/codec-compiler/reference/field-settings) を参照してください。


## Related topics

- [JSON インポート/エクスポート](/codec-compiler/guides/import-export.md)
- [FAQ・トラブルシューティング](/codec-compiler/faq.md)
- [AI アシスタント連携](/codec-compiler/guides/ai-export.md)
- [フィールド設定リファレンス](/codec-compiler/reference/field-settings.md)
- [CLI の使い方](/stormmin/guides/cli-usage.md)
