mandioca-tabs-mcp 0.2.12 → 0.2.13

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 +33 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -88632,6 +88632,7 @@ function leerOrtografia(xml) {
88632
88632
  function leerDelArchivo(xml) {
88633
88633
  const ortografia = /* @__PURE__ */ new Map();
88634
88634
  const bajos = /* @__PURE__ */ new Map();
88635
+ const matices = /* @__PURE__ */ new Map();
88635
88636
  let iParte = -1;
88636
88637
  for (const parte of xml.matchAll(/<part\b[^>]*>([\s\S]*?)<\/part>/g)) {
88637
88638
  iParte++;
@@ -88643,9 +88644,20 @@ function leerDelArchivo(xml) {
88643
88644
  let tic = 0;
88644
88645
  let ticAnterior = 0;
88645
88646
  let bajoPendiente = null;
88646
- for (const el of compas[1].matchAll(/<(note|backup|forward|attributes|harmony)\b[\s\S]*?<\/\1>/g)) {
88647
+ for (const el of compas[1].matchAll(/<(note|backup|forward|attributes|harmony|direction)\b[\s\S]*?<\/\1>/g)) {
88647
88648
  const bloque = el[0];
88648
88649
  const tipo = el[1];
88650
+ if (tipo === "direction") {
88651
+ const nombre = /<dynamics\b[^>]*>\s*<([a-z]+)\s*\/>/.exec(bloque)?.[1];
88652
+ if (nombre) {
88653
+ const pent2 = (entero(bloque, /<staff>\s*(\d+)\s*<\/staff>/) ?? 1) - 1;
88654
+ const clave2 = `${iParte}|${pent2}`;
88655
+ const lista2 = matices.get(clave2) ?? [];
88656
+ lista2.push({ compas: iCompas, tic: Math.round(tic * TICS_POR_NEGRA2 / divisiones), nombre });
88657
+ matices.set(clave2, lista2);
88658
+ }
88659
+ continue;
88660
+ }
88649
88661
  if (tipo === "attributes") {
88650
88662
  divisiones = entero(bloque, /<divisions>\s*(\d+)\s*<\/divisions>/) ?? divisiones;
88651
88663
  const transponer2 = /<transpose\b[^>]*>([\s\S]*?)<\/transpose>/.exec(bloque)?.[1];
@@ -88700,7 +88712,7 @@ function leerDelArchivo(xml) {
88700
88712
  }
88701
88713
  }
88702
88714
  }
88703
- return { ortografia, bajos };
88715
+ return { ortografia, bajos, matices };
88704
88716
  }
88705
88717
  var MODO_DE_ALTERACION, MODO_POR_ALTER, SEMITONOS, TICS_POR_NEGRA2, entero, HIJO_QUE_SE_MUEVE, ATRIBUTOS_DE_SALTO, NEGRAS_POR_FIGURA;
88706
88718
  var init_musicxmlEntrada = __esm({
@@ -88751,7 +88763,7 @@ function importarGp(bytes, opciones = {}) {
88751
88763
  const preparado = prepararMusicXml(xml);
88752
88764
  const score = _barrel_exports$1.ScoreLoader.loadScoreFromBytes(preparado.bytes);
88753
88765
  const leido = leerDelArchivo(preparado.xml);
88754
- const resultado = importarScore(score, opciones, { ortografia: leido.ortografia, bajos: leido.bajos });
88766
+ const resultado = importarScore(score, opciones, { ortografia: leido.ortografia, bajos: leido.bajos, matices: leido.matices });
88755
88767
  resultado.avisos.push(...preparado.correcciones);
88756
88768
  return resultado;
88757
88769
  }
@@ -88936,7 +88948,7 @@ function importarScore(score, opciones = {}, datos = {}) {
88936
88948
  // `<harmony>` de MusicXML) y este traductor no los leía: «Am», «G7», todo afuera,
88937
88949
  // sin aviso. El bajo («C/E») lo lee `leerDelArchivo`, porque alphaTab lo tira.
88938
88950
  acorde: acordeDelGolpe(golpe, pentagrama, datos.bajos, pista.index, numeroDePentagrama, indice),
88939
- dinamica: golpe.dynamics,
88951
+ dinamica: maticeDelGolpe(datos.matices, pista.index, numeroDePentagrama, pista.staves.length, indice, golpe.displayStart) ?? golpe.dynamics,
88940
88952
  // ⛔ El 8va / 8vb / 15ma se perdía: la notación salía una octava corrida (2026-11-09).
88941
88953
  octava: golpe.ottava,
88942
88954
  tempo: tempoDelGolpe(golpe, voz.index === 0 ? temposAMitad : void 0),
@@ -89132,6 +89144,19 @@ function tempoDelGolpe(golpe, delMaestro) {
89132
89144
  const propio = golpe.automations?.find((a) => a.type === _barrel_exports$4.AutomationType.Tempo)?.value;
89133
89145
  return propio ?? delMaestro?.get(golpe.displayStart);
89134
89146
  }
89147
+ function maticeDelGolpe(matices, parte, pentagrama, pentagramas, compas, tic) {
89148
+ if (!matices || matices.size === 0) return void 0;
89149
+ let lista2 = matices.get(`${parte}|${pentagrama}`);
89150
+ for (let otro = 0; otro < pentagramas && !lista2?.length; otro++) lista2 = matices.get(`${parte}|${otro}`);
89151
+ if (!lista2?.length) return void 0;
89152
+ let vigente = "f";
89153
+ for (const m of lista2) {
89154
+ if (m.compas < compas || m.compas === compas && m.tic <= tic) vigente = m.nombre;
89155
+ else break;
89156
+ }
89157
+ const valor = _barrel_exports$4.DynamicValue[vigente.toUpperCase()];
89158
+ return typeof valor === "number" ? valor : void 0;
89159
+ }
89135
89160
  function normalizarTuplet(valor) {
89136
89161
  return valor === void 0 || valor <= 0 ? 1 : valor;
89137
89162
  }
@@ -90042,7 +90067,7 @@ var VERSION_DEL_CONECTOR;
90042
90067
  var init_version = __esm({
90043
90068
  "apps/mcp/src/version.ts"() {
90044
90069
  "use strict";
90045
- VERSION_DEL_CONECTOR = true ? "0.2.12" : null;
90070
+ VERSION_DEL_CONECTOR = true ? "0.2.13" : null;
90046
90071
  }
90047
90072
  });
90048
90073
 
@@ -97987,6 +98012,7 @@ function proyectar(documento, opciones = {}) {
97987
98012
  score.album = marcado(cabecera.get("album") ?? "", marcasDe(cabecera, "album"));
97988
98013
  const tempoDeCabecera = documento.cabecera.get("tempo") || 120;
97989
98014
  score.stylesheet.hideDynamics = documento.cabecera.get("mostrarMatices") === false;
98015
+ score.stylesheet.barNumberDisplay = _barrel_exports$4.BarNumberDisplay.AllBars;
97990
98016
  const estiloDeLaObra = documento.leerEstilo();
97991
98017
  aplicarEstiloAlDibujo(score, ajustes, estiloDeLaObra);
97992
98018
  score.stylesheet.firstSystemTrackNameMode = _barrel_exports$4.TrackNameMode.FullName;
@@ -98098,6 +98124,8 @@ function proyectar(documento, opciones = {}) {
98098
98124
  track.playbackInfo.secondaryChannel = 9;
98099
98125
  track.percussionArticulations = KIT.map((pieza) => {
98100
98126
  const art = new _barrel_exports$4.InstrumentArticulation();
98127
+ art.elementType = pieza.nombre;
98128
+ art.id = pieza.indice;
98101
98129
  art.outputMidiNumber = pieza.midi;
98102
98130
  art.staffLine = pieza.linea;
98103
98131
  art.noteHeadDefault = pieza.cabeza === "x" ? _barrel_exports$4.MusicFontSymbol.NoteheadXBlack : _barrel_exports$4.MusicFontSymbol.NoteheadBlack;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mandioca-tabs-mcp",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
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": {