mandioca-tabs-mcp 0.2.12 → 0.2.14

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 +38 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -21849,6 +21849,11 @@ var init_paneles = __esm({
21849
21849
  principiante: "Empieza la separaci\xF3n con la cantidad elegida. Las partes aparecen como grabaciones nuevas de la obra.",
21850
21850
  profesional: "Lanza la separaci\xF3n."
21851
21851
  },
21852
+ "audio.letra-cerrar": {
21853
+ nombre: "Cerrar la letra",
21854
+ principiante: "Cierra el panel de la letra y vuelve a la partitura. Lo escrito se queda.",
21855
+ profesional: "Cierra el panel de letra."
21856
+ },
21852
21857
  "audio.letra-cancelar": {
21853
21858
  nombre: "Cancelar la sincronizaci\xF3n",
21854
21859
  principiante: "Detiene la sincronizaci\xF3n. La letra escrita se queda y no se cambia nada en la obra.",
@@ -88632,6 +88637,7 @@ function leerOrtografia(xml) {
88632
88637
  function leerDelArchivo(xml) {
88633
88638
  const ortografia = /* @__PURE__ */ new Map();
88634
88639
  const bajos = /* @__PURE__ */ new Map();
88640
+ const matices = /* @__PURE__ */ new Map();
88635
88641
  let iParte = -1;
88636
88642
  for (const parte of xml.matchAll(/<part\b[^>]*>([\s\S]*?)<\/part>/g)) {
88637
88643
  iParte++;
@@ -88643,9 +88649,20 @@ function leerDelArchivo(xml) {
88643
88649
  let tic = 0;
88644
88650
  let ticAnterior = 0;
88645
88651
  let bajoPendiente = null;
88646
- for (const el of compas[1].matchAll(/<(note|backup|forward|attributes|harmony)\b[\s\S]*?<\/\1>/g)) {
88652
+ for (const el of compas[1].matchAll(/<(note|backup|forward|attributes|harmony|direction)\b[\s\S]*?<\/\1>/g)) {
88647
88653
  const bloque = el[0];
88648
88654
  const tipo = el[1];
88655
+ if (tipo === "direction") {
88656
+ const nombre = /<dynamics\b[^>]*>\s*<([a-z]+)\s*\/>/.exec(bloque)?.[1];
88657
+ if (nombre) {
88658
+ const pent2 = (entero(bloque, /<staff>\s*(\d+)\s*<\/staff>/) ?? 1) - 1;
88659
+ const clave2 = `${iParte}|${pent2}`;
88660
+ const lista2 = matices.get(clave2) ?? [];
88661
+ lista2.push({ compas: iCompas, tic: Math.round(tic * TICS_POR_NEGRA2 / divisiones), nombre });
88662
+ matices.set(clave2, lista2);
88663
+ }
88664
+ continue;
88665
+ }
88649
88666
  if (tipo === "attributes") {
88650
88667
  divisiones = entero(bloque, /<divisions>\s*(\d+)\s*<\/divisions>/) ?? divisiones;
88651
88668
  const transponer2 = /<transpose\b[^>]*>([\s\S]*?)<\/transpose>/.exec(bloque)?.[1];
@@ -88700,7 +88717,7 @@ function leerDelArchivo(xml) {
88700
88717
  }
88701
88718
  }
88702
88719
  }
88703
- return { ortografia, bajos };
88720
+ return { ortografia, bajos, matices };
88704
88721
  }
88705
88722
  var MODO_DE_ALTERACION, MODO_POR_ALTER, SEMITONOS, TICS_POR_NEGRA2, entero, HIJO_QUE_SE_MUEVE, ATRIBUTOS_DE_SALTO, NEGRAS_POR_FIGURA;
88706
88723
  var init_musicxmlEntrada = __esm({
@@ -88751,7 +88768,7 @@ function importarGp(bytes, opciones = {}) {
88751
88768
  const preparado = prepararMusicXml(xml);
88752
88769
  const score = _barrel_exports$1.ScoreLoader.loadScoreFromBytes(preparado.bytes);
88753
88770
  const leido = leerDelArchivo(preparado.xml);
88754
- const resultado = importarScore(score, opciones, { ortografia: leido.ortografia, bajos: leido.bajos });
88771
+ const resultado = importarScore(score, opciones, { ortografia: leido.ortografia, bajos: leido.bajos, matices: leido.matices });
88755
88772
  resultado.avisos.push(...preparado.correcciones);
88756
88773
  return resultado;
88757
88774
  }
@@ -88936,7 +88953,7 @@ function importarScore(score, opciones = {}, datos = {}) {
88936
88953
  // `<harmony>` de MusicXML) y este traductor no los leía: «Am», «G7», todo afuera,
88937
88954
  // sin aviso. El bajo («C/E») lo lee `leerDelArchivo`, porque alphaTab lo tira.
88938
88955
  acorde: acordeDelGolpe(golpe, pentagrama, datos.bajos, pista.index, numeroDePentagrama, indice),
88939
- dinamica: golpe.dynamics,
88956
+ dinamica: maticeDelGolpe(datos.matices, pista.index, numeroDePentagrama, pista.staves.length, indice, golpe.displayStart) ?? golpe.dynamics,
88940
88957
  // ⛔ El 8va / 8vb / 15ma se perdía: la notación salía una octava corrida (2026-11-09).
88941
88958
  octava: golpe.ottava,
88942
88959
  tempo: tempoDelGolpe(golpe, voz.index === 0 ? temposAMitad : void 0),
@@ -89132,6 +89149,19 @@ function tempoDelGolpe(golpe, delMaestro) {
89132
89149
  const propio = golpe.automations?.find((a) => a.type === _barrel_exports$4.AutomationType.Tempo)?.value;
89133
89150
  return propio ?? delMaestro?.get(golpe.displayStart);
89134
89151
  }
89152
+ function maticeDelGolpe(matices, parte, pentagrama, pentagramas, compas, tic) {
89153
+ if (!matices || matices.size === 0) return void 0;
89154
+ let lista2 = matices.get(`${parte}|${pentagrama}`);
89155
+ for (let otro = 0; otro < pentagramas && !lista2?.length; otro++) lista2 = matices.get(`${parte}|${otro}`);
89156
+ if (!lista2?.length) return void 0;
89157
+ let vigente = "f";
89158
+ for (const m of lista2) {
89159
+ if (m.compas < compas || m.compas === compas && m.tic <= tic) vigente = m.nombre;
89160
+ else break;
89161
+ }
89162
+ const valor = _barrel_exports$4.DynamicValue[vigente.toUpperCase()];
89163
+ return typeof valor === "number" ? valor : void 0;
89164
+ }
89135
89165
  function normalizarTuplet(valor) {
89136
89166
  return valor === void 0 || valor <= 0 ? 1 : valor;
89137
89167
  }
@@ -90042,7 +90072,7 @@ var VERSION_DEL_CONECTOR;
90042
90072
  var init_version = __esm({
90043
90073
  "apps/mcp/src/version.ts"() {
90044
90074
  "use strict";
90045
- VERSION_DEL_CONECTOR = true ? "0.2.12" : null;
90075
+ VERSION_DEL_CONECTOR = true ? "0.2.14" : null;
90046
90076
  }
90047
90077
  });
90048
90078
 
@@ -97987,6 +98017,7 @@ function proyectar(documento, opciones = {}) {
97987
98017
  score.album = marcado(cabecera.get("album") ?? "", marcasDe(cabecera, "album"));
97988
98018
  const tempoDeCabecera = documento.cabecera.get("tempo") || 120;
97989
98019
  score.stylesheet.hideDynamics = documento.cabecera.get("mostrarMatices") === false;
98020
+ score.stylesheet.barNumberDisplay = _barrel_exports$4.BarNumberDisplay.AllBars;
97990
98021
  const estiloDeLaObra = documento.leerEstilo();
97991
98022
  aplicarEstiloAlDibujo(score, ajustes, estiloDeLaObra);
97992
98023
  score.stylesheet.firstSystemTrackNameMode = _barrel_exports$4.TrackNameMode.FullName;
@@ -98098,6 +98129,8 @@ function proyectar(documento, opciones = {}) {
98098
98129
  track.playbackInfo.secondaryChannel = 9;
98099
98130
  track.percussionArticulations = KIT.map((pieza) => {
98100
98131
  const art = new _barrel_exports$4.InstrumentArticulation();
98132
+ art.elementType = pieza.nombre;
98133
+ art.id = pieza.indice;
98101
98134
  art.outputMidiNumber = pieza.midi;
98102
98135
  art.staffLine = pieza.linea;
98103
98136
  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.14",
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": {