@hidechae/eztab-mcp 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -103,6 +103,7 @@ Run standalone for testing: `task mcp` (or `npx tsx mcp/server.ts`).
103
103
  | `set_tuning` | Replace tuning / string count (`track` で対象パートを指定) |
104
104
  | `add_track` / `remove_track` | パート(ベース・2本目のギターなど)の追加・削除。メインを含めて最大4、track 0(メイン)は削除不可 |
105
105
  | `set_tone` | パートの再生音色を設定する(`track` で対象パートを指定)。`add_track` でも `tone` を指定できる |
106
+ | `set_backing_style` | 伴奏(コード)の音を設定する: `pad`(既定)/ `guitar` / `piano` / `bass`(ルートのみ) |
106
107
 
107
108
  ### 複数パート(トラック)
108
109
 
@@ -131,6 +132,14 @@ Run standalone for testing: `task mcp` (or `npx tsx mcp/server.ts`).
131
132
  (1パートのタブでは `tone=distortion`)
132
133
  - 0.5.2以前のMCPは、クリーン以外の音色を持つタブを編集・送信できない
133
134
 
135
+ ### 伴奏の音
136
+
137
+ 0.7.0以降は伴奏(コード)の音(docs/design/0011-backing-styles.md)を `set_backing_style` で設定できます。
138
+
139
+ - `pad`(既定。従来の音)/ `guitar` / `piano` / `bass`(コードの構成音を鳴らさず、ルートだけをベースで弾く。分数コードは分母の音)
140
+ - `get_tab` はパッド以外のとき、先頭行に `backing=guitar` のように表示する
141
+ - 形式リビジョンは変わらない。0.6.1以前のMCPでも、設定されたタブを編集・送信でき、値は保持される
142
+
134
143
  ### 小節メモの保持
135
144
 
136
145
  0.5.1以降はアプリで入力した小節共通メモ(形式リビジョン5)を保持して編集・送信できます。
package/dist/server.js CHANGED
@@ -28,6 +28,15 @@ function normalizeTone(raw) {
28
28
  return raw !== "clean" && TONES.includes(raw) ? raw : void 0;
29
29
  }
30
30
  var DEFAULT_MAIN_TRACK_NAME = "Guitar";
31
+ var BACKING_STYLES = ["pad", "guitar", "piano", "bass"];
32
+ function normalizeBackingStyle(raw) {
33
+ return raw !== "pad" && BACKING_STYLES.includes(raw) ? raw : void 0;
34
+ }
35
+ function withBackingStyle(doc, style) {
36
+ const { backingStyle: _old, ...rest } = doc;
37
+ const stored = normalizeBackingStyle(style);
38
+ return stored ? { ...rest, backingStyle: stored } : rest;
39
+ }
31
40
  var DEFAULT_TEMPO = 120;
32
41
  var MIN_TEMPO = 20;
33
42
  var MAX_TEMPO = 400;
@@ -328,6 +337,9 @@ function normalizeDocument(data) {
328
337
  if (!data.mix || typeof data.mix.melody !== "number") {
329
338
  data.mix = { ...DEFAULT_MIX };
330
339
  }
340
+ const backingStyle = normalizeBackingStyle(data.backingStyle);
341
+ if (backingStyle) data.backingStyle = backingStyle;
342
+ else delete data.backingStyle;
331
343
  normalizeTracks(data);
332
344
  data.version = TAB_FILE_VERSION;
333
345
  return data;
@@ -1100,7 +1112,9 @@ function render(doc, from = 0, to = doc.measures.length - 1, track) {
1100
1112
  const main = bodies[0];
1101
1113
  const shown = bodies.map((_, i) => i).filter((i) => track == null || i === track);
1102
1114
  const lines = [];
1103
- lines.push(`Title: ${doc.title}${doc.artist ? ` \u2014 ${doc.artist}` : ""} tempo=${doc.tempo}`);
1115
+ lines.push(
1116
+ `Title: ${doc.title}${doc.artist ? ` \u2014 ${doc.artist}` : ""} tempo=${doc.tempo}${doc.backingStyle ? ` backing=${doc.backingStyle}` : ""}`
1117
+ );
1104
1118
  if (multi) {
1105
1119
  lines.push(`Tracks (track index: name, tuning top\u2192bottom) measures=${main.measures.length}`);
1106
1120
  metas.forEach((t, i) => {
@@ -1220,7 +1234,7 @@ var state = {
1220
1234
  source: null
1221
1235
  };
1222
1236
  var server = new McpServer(
1223
- { name: "eztab", version: "0.6.1" },
1237
+ { name: "eztab", version: "0.7.0" },
1224
1238
  {
1225
1239
  instructions: "All indices are 0-based: measure 0 is the first measure, string 0 is the top (highest) string, and column 0 is the first column. Notes and chords share the same column grid. Subdivisions are per beat and can differ within a measure (e.g. [2,2,3,2] mixes a triplet beat into straight eighths), so columns per measure = the sum of its per-beat subdivisions; get_tab's ruler shows the column indices. add_measures `at` is a 0-based insert position too. No need to ask the user about indexing. Exception: write_measures uses guitar string numbers (1 = top line), matching the labels get_tab prints. To write whole measures (e.g. transcribing a score or an image), prefer write_measures over set_cells \u2014 it takes one string per beat and does the column arithmetic for you. For transcribing from an image, follow the import_tab_from_image prompt. To deliver a result to the EZTab app, call send_to_eztab; to fix an existing tab, list_tabs \u2192 open_tab \u2192 edit \u2192 send_to_eztab. A tab can hold up to 4 tracks (parts, e.g. guitar + bass); track 0 is the main track. Tools that edit notes take an optional 0-based `track` (default 0). Measures and time signatures are shared by all tracks (adding/removing a measure affects every track); subdivisions are per track; chords belong to track 0 and use its columns."
1226
1240
  }
@@ -1734,6 +1748,17 @@ server.tool(
1734
1748
  return text(render(state.doc));
1735
1749
  }
1736
1750
  );
1751
+ server.tool(
1752
+ "set_backing_style",
1753
+ "Set how the chord backing (the chords written with set_chords / @Name) sounds in playback: pad (the default soft pad), guitar, piano, or bass (only the root \u2014 or a slash chord's bass note \u2014 on a bass).",
1754
+ { style: z.enum(BACKING_STYLES) },
1755
+ async (a) => {
1756
+ const doc = edit(0, () => {
1757
+ });
1758
+ state.doc = withBackingStyle(doc, a.style);
1759
+ return text(render(state.doc));
1760
+ }
1761
+ );
1737
1762
  var TRACK_PRESETS = [
1738
1763
  "Guitar (6)",
1739
1764
  "Guitar (7)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hidechae/eztab-mcp",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "MCP server for EZTab — lets an AI agent build and edit guitar/bass tablature.",
5
5
  "type": "module",
6
6
  "bin": {