mandioca-tabs-mcp 0.2.11 → 0.2.12

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.
Files changed (2) hide show
  1. package/index.mjs +44 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -13362,6 +13362,8 @@ function normalizarFigura(crudo) {
13362
13362
  palanca: lista(crudo.palanca)
13363
13363
  };
13364
13364
  if (typeof crudo.acorde === "string" && crudo.acorde !== "") salida.acorde = crudo.acorde;
13365
+ if (typeof crudo.octava === "number" && crudo.octava !== SIN_OCTAVA) salida.octava = crudo.octava;
13366
+ if (typeof crudo.tempo === "number" && crudo.tempo > 0) salida.tempo = crudo.tempo;
13365
13367
  if (typeof crudo.textoSegundaTipografia === "string") salida.textoSegundaTipografia = crudo.textoSegundaTipografia;
13366
13368
  if (typeof crudo.acordeSegundaTipografia === "string") salida.acordeSegundaTipografia = crudo.acordeSegundaTipografia;
13367
13369
  return salida;
@@ -13415,6 +13417,7 @@ function normalizarPista(crudo) {
13415
13417
  balance: numero(crudo.balance, 8),
13416
13418
  // Ausente = 1 pentagrama, lo único que existía antes del 2026-11-09.
13417
13419
  ...typeof crudo.pentagramas === "number" && crudo.pentagramas > 1 ? { pentagramas: crudo.pentagramas } : {},
13420
+ ...typeof crudo.transposicion === "number" && crudo.transposicion !== 0 ? { transposicion: crudo.transposicion } : {},
13418
13421
  // Las marcas de la segunda tipografía (2026-10-19): sólo si están, como `acorde`.
13419
13422
  ...typeof crudo.nombreSegundaTipografia === "string" ? { nombreSegundaTipografia: crudo.nombreSegundaTipografia } : {},
13420
13423
  ...typeof crudo.nombreCortoSegundaTipografia === "string" ? { nombreCortoSegundaTipografia: crudo.nombreCortoSegundaTipografia } : {}
@@ -88862,7 +88865,10 @@ function importarScore(score, opciones = {}, datos = {}) {
88862
88865
  // la destapó la comparación de píxeles, porque la mezcla no se dibuja: se oye.
88863
88866
  volumen: pista.playbackInfo?.volume ?? 16,
88864
88867
  balance: pista.playbackInfo?.balance ?? 8,
88865
- ...unInstrumento && pista.staves.length > 1 ? { pentagramas: pista.staves.length } : {}
88868
+ ...unInstrumento && pista.staves.length > 1 ? { pentagramas: pista.staves.length } : {},
88869
+ // ⛔ La transposición de lectura (`<transpose>` de un clarinete o un saxo) se perdía: el
88870
+ // instrumento se dibujaba en altura real en vez de como se lee (2026-11-09).
88871
+ ...pentagrama.displayTranspositionPitch ? { transposicion: pentagrama.displayTranspositionPitch } : {}
88866
88872
  });
88867
88873
  idDelInstrumento = idPista;
88868
88874
  for (const [indice, compasDeAlphaTab] of pentagrama.bars.entries()) {
@@ -88889,6 +88895,12 @@ function importarScore(score, opciones = {}, datos = {}) {
88889
88895
  }
88890
88896
  }
88891
88897
  const ticsDelCompas = 960 * 4 * (maestroDelCompas?.timeSignatureNumerator ?? 4) / (maestroDelCompas?.timeSignatureDenominator ?? 4);
88898
+ const temposAMitad = /* @__PURE__ */ new Map();
88899
+ if (pista.index === 0 && numeroDePentagrama === 0) {
88900
+ for (const a of maestroDelCompas?.tempoAutomations ?? []) {
88901
+ if (a.ratioPosition > 0) temposAMitad.set(Math.round(a.ratioPosition * ticsDelCompas), a.value);
88902
+ }
88903
+ }
88892
88904
  const pedalesDelCompas = /* @__PURE__ */ new Map();
88893
88905
  for (const marcador of compasDeAlphaTab.sustainPedals ?? []) {
88894
88906
  pedalesDelCompas.set(Math.round(marcador.ratioPosition * ticsDelCompas), marcador.pedalType + 1);
@@ -88925,6 +88937,9 @@ function importarScore(score, opciones = {}, datos = {}) {
88925
88937
  // sin aviso. El bajo («C/E») lo lee `leerDelArchivo`, porque alphaTab lo tira.
88926
88938
  acorde: acordeDelGolpe(golpe, pentagrama, datos.bajos, pista.index, numeroDePentagrama, indice),
88927
88939
  dinamica: golpe.dynamics,
88940
+ // ⛔ El 8va / 8vb / 15ma se perdía: la notación salía una octava corrida (2026-11-09).
88941
+ octava: golpe.ottava,
88942
+ tempo: tempoDelGolpe(golpe, voz.index === 0 ? temposAMitad : void 0),
88928
88943
  // ═══════════════════════════════════════════════════════════════════
88929
88944
  // ★★★ LOS SIGNOS DE GUITAR PRO — hasta hoy se perdían TODOS en silencio
88930
88945
  // ═══════════════════════════════════════════════════════════════════
@@ -89112,6 +89127,11 @@ function acordeDelGolpe(golpe, pentagrama, bajos, parte, numeroDePentagrama, com
89112
89127
  const bajo = bajos?.get(`${parte}|${numeroDePentagrama}|${compas}|${golpe.displayStart}`) ?? "";
89113
89128
  return bajo && !nombre.endsWith(bajo) ? nombre + bajo : nombre;
89114
89129
  }
89130
+ function tempoDelGolpe(golpe, delMaestro) {
89131
+ if (golpe.displayStart === 0) return void 0;
89132
+ const propio = golpe.automations?.find((a) => a.type === _barrel_exports$4.AutomationType.Tempo)?.value;
89133
+ return propio ?? delMaestro?.get(golpe.displayStart);
89134
+ }
89115
89135
  function normalizarTuplet(valor) {
89116
89136
  return valor === void 0 || valor <= 0 ? 1 : valor;
89117
89137
  }
@@ -89133,6 +89153,11 @@ function formatoQueNecesita(documento) {
89133
89153
  for (const pista of documento.pistas.values()) {
89134
89154
  const pentagramas = pista.get("pentagramas");
89135
89155
  if (typeof pentagramas === "number" && pentagramas > 1) return 5;
89156
+ const transposicion = pista.get("transposicion");
89157
+ if (typeof transposicion === "number" && transposicion !== 0) return 5;
89158
+ }
89159
+ for (const figura of documento.figuras.values()) {
89160
+ if (figura.get("octava") !== void 0 || figura.get("tempo") !== void 0) return 5;
89136
89161
  }
89137
89162
  return 4;
89138
89163
  }
@@ -90017,7 +90042,7 @@ var VERSION_DEL_CONECTOR;
90017
90042
  var init_version = __esm({
90018
90043
  "apps/mcp/src/version.ts"() {
90019
90044
  "use strict";
90020
- VERSION_DEL_CONECTOR = true ? "0.2.11" : null;
90045
+ VERSION_DEL_CONECTOR = true ? "0.2.12" : null;
90021
90046
  }
90022
90047
  });
90023
90048
 
@@ -98042,6 +98067,7 @@ function proyectar(documento, opciones = {}) {
98042
98067
  if (lista2) lista2.push(nota);
98043
98068
  else notasPorFigura.set(nota.figuraId, [nota]);
98044
98069
  }
98070
+ const temposAMitad = [];
98045
98071
  const pistasEnOrden = [...documento.pistasEnOrden()];
98046
98072
  const canales = canalesDeLasPistas(
98047
98073
  pistasEnOrden.map(({ datos }) => normalizarPista(datos).tipo)
@@ -98063,6 +98089,7 @@ function proyectar(documento, opciones = {}) {
98063
98089
  const valores = [...pista.afinacion].reverse();
98064
98090
  pentagrama.stringTuning = _barrel_exports$4.Tuning.findTuning(valores) ?? new _barrel_exports$4.Tuning("", valores, false);
98065
98091
  pentagrama.capo = pista.capo;
98092
+ pentagrama.displayTranspositionPitch = pista.transposicion ?? 0;
98066
98093
  pentagrama.showTablature = pista.tipo === "trastes";
98067
98094
  pentagrama.showStandardNotation = true;
98068
98095
  pentagrama.isPercussion = pista.tipo === "percusion";
@@ -98125,6 +98152,8 @@ function proyectar(documento, opciones = {}) {
98125
98152
  const golpe = new _barrel_exports$4.Beat();
98126
98153
  golpe.duration = figura.valor;
98127
98154
  golpe.dots = figura.puntillos;
98155
+ if (figura.octava !== void 0) golpe.ottava = figura.octava;
98156
+ if (figura.tempo !== void 0) temposAMitad.push({ compas: indiceDeCompas2, tiempo: figura.tiempo, valor: figura.tempo, tics: ticsDelCompas });
98128
98157
  if (figura.tupletNumerador > 1) {
98129
98158
  golpe.tupletNumerator = figura.tupletNumerador;
98130
98159
  golpe.tupletDenominator = figura.tupletDenominador;
@@ -98271,6 +98300,19 @@ function proyectar(documento, opciones = {}) {
98271
98300
  });
98272
98301
  }
98273
98302
  }
98303
+ const yaPuestos = /* @__PURE__ */ new Set();
98304
+ for (const t of temposAMitad.sort((a, b) => a.compas - b.compas || a.tiempo - b.tiempo)) {
98305
+ const clave = `${t.compas}|${t.tiempo}`;
98306
+ const maestro = score.masterBars[t.compas];
98307
+ if (!maestro || yaPuestos.has(clave) || t.tics <= 0) continue;
98308
+ yaPuestos.add(clave);
98309
+ const automatizacion = new _barrel_exports$4.Automation();
98310
+ automatizacion.isLinear = false;
98311
+ automatizacion.type = _barrel_exports$4.AutomationType.Tempo;
98312
+ automatizacion.value = t.valor;
98313
+ automatizacion.ratioPosition = t.tiempo / t.tics;
98314
+ maestro.tempoAutomations.push(automatizacion);
98315
+ }
98274
98316
  const { saltosDeRenglon } = documento.leerPresentacion();
98275
98317
  if (saltosDeRenglon.size > 0) {
98276
98318
  maestros.forEach((maestro, indice) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mandioca-tabs-mcp",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Conector MCP de Mandioca Tabs: tu IA lee y escribe la partitura que tienes abierta en tabs.mandioca-records.com.",
5
5
  "type": "module",
6
6
  "bin": {