「VexFlow タブ譜 コードフォーム」の版間の差分

提供:yonewiki
 
(同じ利用者による、間の92版が非表示)
6行目: 6行目:
[[VexFlow 使い方]]に戻る。
[[VexFlow 使い方]]に戻る。
== '''概要''' ==
== '''概要''' ==
 
 コードフォームをタブ譜に載せるという手法もありまして、コードが一小節で2種類くらいしか無いような曲で見られる描画方法です。その場合、五線譜には同一コード用の音符を使ってリズムだけをハタ棒とハタあるいは連桁で表現します。管理人は左利きなので、左利き用のコードフォームを表示してみました。人生初くらいだな。左利き向けのコードフォームタブ譜なんて見たことなかった。もちろん、作成したフォントには右利き向けのグリフも登録してあります。あとちょっとで完成しそうですね。フォントファイル。もうちょっとで配布できるようになる。駆け抜けたい。でもこの先まだまだ難しいタブ譜作成技術の紹介が残っています。手ごわい。アーム操作の曲線とかどうするべって感じ。VexFlowも不完全だし、機能追加にも疲れてきたっすね。
 
 
 1小節に2コードある場合、矢印でどの部分からがそのコードかを示す矢印を描く関数を追加しました。矢印を描くのって数学の知識いるよね。プログラムの世界だけにあるatan2関数とかね。三角関数を使いこなせないと、矢印をひくのは難しい。


 
 
26行目: 29行目:
const Vocal = new Position();
const Vocal = new Position();
const Guitar1Inst = new Position();
const Guitar1Inst = new Position();
const Guitar1tab_1st = new Position();
const Guitar1tab_2st = new Position();
const Guitar1tab_3st = new Position();
const Guitar1tab_4st = new Position();
const Guitar2Inst = new Position();
const Guitar2Inst = new Position();
const Guitar2Tab1 = new Position();
const Guitar2Tab1 = new Position();
const Guitar2tab_1st = new Position();
const Guitar2tab_2st = new Position();
const Guitar2tab_3st = new Position();
const Guitar2tab_4st = new Position();
const BaseInst = new Position();
const BaseInst = new Position();
const BaseTab1 = new Position();
const BaseTab1 = new Position();
44行目: 60行目:
var shiftGuitar1_tab4_tr;
var shiftGuitar1_tab4_tr;


var shiftGuitar1_tab1;
var shiftGuitar1_1st;
var shiftGuitar1_tab2;
var shiftGuitar1_2st;
var shiftGuitar1_tab3;
var shiftGuitar1_3st;
var shiftGuitar1_tab4;
var shiftGuitar1_4st;
 
var shiftGuitar1tab_1st;
var shiftGuitar1tab_2st;
var shiftGuitar1tab_3st;
var shiftGuitar1tab_4st;


var shiftGuitar2_St1;
var shiftGuitar2_1st;
var shiftGuitar2_St2;
var shiftGuitar2_2st;
var shiftGuitar2_St3;
var shiftGuitar2_3st;
var shiftGuitar2_St4;
var shiftGuitar2_4st;


var shiftGuitar2_Tab1;
var shiftGuitar2tab_1st;
var shiftGuitar2_Tab2;
var shiftGuitar2tab_2st;
var shiftGuitar2_Tab3;
var shiftGuitar2tab_3st;
var shiftGuitar2_Tab4;
var shiftGuitar2tab_4st;


var shiftDrum1;
var shiftDrum1;
90行目: 111行目:
   svgElement.appendChild(newGroup);
   svgElement.appendChild(newGroup);
}
}
function insertArrowPathToSVG(StartPos, EndPos) {
  var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
  newGroup.setAttribute('transform', 'translate(0, 0)');
  var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  var arrowLength = 10;
  var angle = Math.atan2(EndPos.y - StartPos.y, EndPos.x - StartPos.x);
  var arrowAngle = 20 * (Math.PI / 180);
  // 矢印のポイント1を計算
  var arrowX1 = EndPos.x - arrowLength * Math.cos(angle - arrowAngle);
  var arrowY1 = EndPos.y - arrowLength * Math.sin(angle - arrowAngle);
   
  // 矢印のポイント2を計算
  var arrowX2 = EndPos.x - arrowLength * Math.cos(angle + arrowAngle);
  var arrowY2 = EndPos.y - arrowLength * Math.sin(angle + arrowAngle);
  var pathStr = "M " + StartPos.x + " " + StartPos.y + " L " + EndPos.x + " " + EndPos.y + " M " + EndPos.x + " " + EndPos.y + " L " + arrowX1 + " " + arrowY1 + " M " + EndPos.x + " " + EndPos.y + " L " + arrowX2 + " " + arrowY2;
  path.setAttribute('d', pathStr);
  path.setAttribute('stroke', 'black');
  path.setAttribute('stroke-width', '1');
  path.setAttribute('fill', 'none');
  newGroup.appendChild(path);
  svgElement.appendChild(newGroup);
}


function insertTrilPathToSVG(Shift, Direction = 1) {
function insertTrilPathToSVG(Shift, Direction = 1) {
304行目: 353行目:
         //typeが"notehead"であるかチェックし、idを取得
         //typeが"notehead"であるかチェックし、idを取得
         if (child.attrs){
         if (child.attrs){
          if(child.attrs.type === "Stem") {
            uniqueIds.add(child.attrs.id);
          }
           if(child.attrs.type === "NoteHead") {
           if(child.attrs.type === "NoteHead") {
             uniqueIds.add(child.attrs.id);
             uniqueIds.add(child.attrs.id);
474行目: 526行目:
VocalSt3.draw();
VocalSt3.draw();


const VocalSt4 = new Stave(VocalSt3.width + VocalSt3.x, VocalSt1.y, nStaveWidth).setContext(ctx);
const VocalSt4 = new VF.Stave(VocalSt3.width + VocalSt3.x, VocalSt1.y, nStaveWidth).setContext(ctx);
VocalSt4.setMeasure(4);
VocalSt4.setMeasure(4);
VocalSt4.draw();
VocalSt4.draw();


const Guitar1St1 = new Stave(VocalSt1.x, VocalSt1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
const Guitar1St1 = new VF.Stave(VocalSt1.x, VocalSt1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar1St1.addClef("treble").setContext(ctx);
Guitar1St1.addClef("treble").setContext(ctx);
Guitar1St1.addTimeSignature('4/4').setContext(ctx);
Guitar1St1.addTimeSignature('4/4').setContext(ctx);
484行目: 536行目:
Guitar1St1.draw();
Guitar1St1.draw();


const Guitar1_notes1_1 = [
const Guitar1_St1_notes_1 = [
   new VF.StaveNote({ keys: ["a/3", "e/4", "a/4", "c/5"], duration: "2" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "4" }),
   new VF.StaveNote({ keys: ["e/5"], duration: "8", stem_direction: -1 }),
 
   dotted(new VF.StaveNote({ keys: ["c/6"], duration: "4d", stem_direction: -1 })),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
const Guitar1_notes1_2 = [
 
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St1_notes_2 = [
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
511行目: 570行目:


];
];
var Guitar1_St1_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
UniqueIds = getUniqueNoteheadIds(Guitar1_St1_notes_1, [0, 1, 2, 3, 4, 5, 6]);
Guitar1_St1_1Voice.setStrict(true);
allUniqueIds = updateAllUniqueIds(UniqueIds);
Guitar1_St1_1Voice.addTickables(Guitar1_notes1_1);
 
const Guitar1_St1_beam_1 = new VF.Beam([Guitar1_St1_notes_1[1], Guitar1_St1_notes_1[2]]);
const Guitar1_St1_beam_2 = new VF.Beam([
  Guitar1_St1_notes_1[3], Guitar1_St1_notes_1[4], Guitar1_St1_notes_1[5], Guitar1_St1_notes_1[6]
  ]);
 
var Guitar1_St1_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St1_Voice_1.setStrict(true);
Guitar1_St1_Voice_1.addTickables(Guitar1_St1_notes_1);
 
var Guitar1_St1_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St1_Voice_2.setStrict(true);
Guitar1_St1_Voice_2.addTickables(Guitar1_St1_notes_2);
 
var formatterGuitar1_St1 = new VF.Formatter().joinVoices([Guitar1_St1_Voice_1, Guitar1_St1_Voice_2]);
formatterGuitar1_St1.format([Guitar1_St1_Voice_1, Guitar1_St1_Voice_2], nStaveWidth - 40 - 10);
Guitar1_St1_Voice_1.draw(ctx, Guitar1St1);
Guitar1_St1_Voice_2.draw(ctx, Guitar1St1);
 
Guitar1_St1_beam_1.setContext(ctx).draw();
Guitar1_St1_beam_2.setContext(ctx).draw();
 
shiftGuitar1_1st= addShift(
  Guitar1_St1_notes_1,
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3]
);


var Guitar1_St1_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St1_2Voice.setStrict(true);
Guitar1_St1_2Voice.addTickables(Guitar1_notes1_2);


var formatterGuitar1_St1_1 = new Vex.Flow.Formatter().joinVoices([Guitar1_St1_2Voice, Guitar1_St1_1Voice]);
formatterGuitar1_St1_1.format([Guitar1_St1_2Voice, Guitar1_St1_1Voice], nStaveWidth - 20 - 10);
Guitar1_St1_1Voice.draw(ctx, Guitar1St1);
Guitar1_St1_2Voice.draw(ctx, Guitar1St1);


const Guitar1St2 = new Stave(Guitar1St1.width + Guitar1St1.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
const Guitar1St2 = new Stave(Guitar1St1.width + Guitar1St1.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Guitar1St2.draw();
Guitar1St2.draw();


const Guitar1_gracenotes2 = [
const Guitar1_St2_notes_1 = [
   new VF.GraceNote({ keys: ['e/5', 'g/5'], duration: '8', slash: true })
   new VF.StaveNote({ keys: ["b/4"], duration: "4" }),
   .addModifier(new VF.Accidental('#'), 1)
 
];
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),


const Guitar1_notes2_1 = [
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["f/5", "a/5"], duration: "8", stem_direction: -1 })
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  .addModifier(new VF.Accidental('n'), 0),
  new VF.StaveNote({ keys: ["e/5", "g/5"], duration: "8", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["f/5"], duration: "8", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["e/5"], duration: "8", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4", "d/5"], duration: "8" }),
  new VF.StaveNote({ keys: ["g/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["f/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["e/4"], duration: "8" }),
];
];
const Guitar1_notes2_2 = [
const Guitar1_St2_notes_2 = [
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
565行目: 639行目:


];
];
Guitar1_notes2_1[0].addModifier(new VF.Articulation('a.').setPosition(3));
UniqueIds = getUniqueNoteheadIds(Guitar1_St2_notes_1, [0, 1, 2, 3, 4, 5, 6]);
Guitar1_notes2_1[1].addModifier(new VF.Articulation('a.').setPosition(3));
allUniqueIds = updateAllUniqueIds(UniqueIds);
Guitar1_notes2_1[2].addModifier(new VF.Articulation('a.').setPosition(3));
Guitar1_notes2_1[3].addModifier(new VF.Articulation('a.').setPosition(3));
Guitar1_notes2_1[4].addModifier(new VF.Articulation('a.').setPosition(4));
Guitar1_notes2_1[5].addModifier(new VF.Articulation('a.').setPosition(4));
Guitar1_notes2_1[6].addModifier(new VF.Articulation('a.').setPosition(4));
Guitar1_notes2_1[7].addModifier(new VF.Articulation('a.').setPosition(4));
Guitar1_notes2_1[0].addModifier(new VF.GraceNoteGroup(Guitar1_gracenotes2, true), 0);


const Guitar1_beam1_1 = new VF.Beam([Guitar1_notes2_1[0], Guitar1_notes2_1[1], Guitar1_notes2_1[2], Guitar1_notes2_1[3]]);
const Guitar1_St2_beam_1 = new VF.Beam([Guitar1_St2_notes_1[1], Guitar1_St2_notes_1[2]]);
const Guitar1_beam1_2 = new VF.Beam([Guitar1_notes2_1[4], Guitar1_notes2_1[5], Guitar1_notes2_1[6], Guitar1_notes2_1[7]]);
const Guitar1_St2_beam_2 = new VF.Beam([
  Guitar1_St2_notes_1[3], Guitar1_St2_notes_1[4], Guitar1_St2_notes_1[5], Guitar1_St2_notes_1[6]
  ]);


var Guitar1_St2_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar1_St2_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St2_1Voice.setStrict(true);
Guitar1_St2_Voice_1.setStrict(true);
Guitar1_St2_1Voice.addTickables(Guitar1_notes2_1);
Guitar1_St2_Voice_1.addTickables(Guitar1_St2_notes_1);


var Guitar1_St2_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar1_St2_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St2_2Voice.setStrict(true);
Guitar1_St2_Voice_2.setStrict(true);
Guitar1_St2_2Voice.addTickables(Guitar1_notes2_2);
Guitar1_St2_Voice_2.addTickables(Guitar1_St2_notes_2);


var formatterGuitar1_St2_1 = new Vex.Flow.Formatter().joinVoices([Guitar1_St2_2Voice, Guitar1_St2_1Voice]);
var formatterGuitar1_St2 = new VF.Formatter().joinVoices([Guitar1_St2_Voice_1, Guitar1_St2_Voice_2]);
formatterGuitar1_St2_1.format([Guitar1_St2_2Voice, Guitar1_St2_1Voice], nStaveWidth - 30);
formatterGuitar1_St2.format([Guitar1_St2_Voice_1, Guitar1_St2_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St2_1Voice.draw(ctx, Guitar1St2);
Guitar1_St2_Voice_1.draw(ctx, Guitar1St2);
Guitar1_St2_2Voice.draw(ctx, Guitar1St2);
Guitar1_St2_Voice_2.draw(ctx, Guitar1St2);


Guitar1_beam1_1.setContext(ctx).draw();
Guitar1_St2_beam_1.setContext(ctx).draw();
Guitar1_beam1_2.setContext(ctx).draw();
Guitar1_St2_beam_2.setContext(ctx).draw();


const Guitar1St3 = new Stave(Guitar1St2.width + Guitar1St2.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
shiftGuitar1_2st= addShift(
  Guitar1_St2_notes_1,
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3.8]
);
 
 
 
const Guitar1St3 = new Stave(Guitar1St2.width + Guitar1St2.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Guitar1St3.draw();
Guitar1St3.draw();


const Guitar1_notes3_1 = [
const Guitar1_St3_notes_1 = [
   new VF.StaveNote({ keys: ["g/4"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "4" }),
   new VF.StaveNote({ keys: ["a/4"], duration: "16" }),
 
   new VF.StaveNote({ keys: ["g/4"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["a/4"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["g/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["e/4"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["e/4"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["e/4"], duration: "2" }),
 
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
];
const Guitar1_notes3_2 = [
const Guitar1_St3_notes_2 = [
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
629行目: 708行目:


];
];
const Guitar1_beam3_1 = new VF.Beam([Guitar1_notes3_1[0], Guitar1_notes3_1[1], Guitar1_notes3_1[2], Guitar1_notes3_1[3]]);
UniqueIds = getUniqueNoteheadIds(Guitar1_St3_notes_1, [0, 1, 2, 3, 4, 5, 6]);
const Guitar1_beam3_2 = new VF.Beam([Guitar1_notes3_1[4], Guitar1_notes3_1[5], Guitar1_notes3_1[6]]);
allUniqueIds = updateAllUniqueIds(UniqueIds);


var Guitar1_St3_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
const Guitar1_St3_beam_1 = new VF.Beam([Guitar1_St3_notes_1[1], Guitar1_St3_notes_1[2]]);
Guitar1_St3_1Voice.setStrict(true);
const Guitar1_St3_beam_2 = new VF.Beam([
Guitar1_St3_1Voice.addTickables(Guitar1_notes3_1);
  Guitar1_St3_notes_1[3], Guitar1_St3_notes_1[4], Guitar1_St3_notes_1[5], Guitar1_St3_notes_1[6]
  ]);


var Guitar1_St3_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar1_St3_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St3_2Voice.setStrict(true);
Guitar1_St3_Voice_1.setStrict(true);
Guitar1_St3_2Voice.addTickables(Guitar1_notes3_2);
Guitar1_St3_Voice_1.addTickables(Guitar1_St3_notes_1);


var formatterGuitar1_St3_1 = new Vex.Flow.Formatter().joinVoices([Guitar1_St3_2Voice, Guitar1_St3_1Voice]);
var Guitar1_St3_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
formatterGuitar1_St3_1.format([Guitar1_St3_2Voice, Guitar1_St3_1Voice], nStaveWidth - 30);
Guitar1_St3_Voice_2.setStrict(true);
Guitar1_St3_1Voice.draw(ctx, Guitar1St3);
Guitar1_St3_Voice_2.addTickables(Guitar1_St3_notes_2);
Guitar1_St3_2Voice.draw(ctx, Guitar1St3);


Guitar1_beam3_1.setContext(ctx).draw();
var formatterGuitar1_St3 = new VF.Formatter().joinVoices([Guitar1_St3_Voice_1, Guitar1_St3_Voice_2]);
Guitar1_beam3_2.setContext(ctx).draw();
formatterGuitar1_St3.format([Guitar1_St3_Voice_1, Guitar1_St3_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St3_Voice_1.draw(ctx, Guitar1St3);
Guitar1_St3_Voice_2.draw(ctx, Guitar1St3);
 
Guitar1_St3_beam_1.setContext(ctx).draw();
Guitar1_St3_beam_2.setContext(ctx).draw();
 
shiftGuitar1_3st= addShift(
  Guitar1_St3_notes_1,
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3.8]
);


const Guitar1_ties3 = [
    new StaveTie({
        first_note: Guitar1_notes3_1[0],
        last_note: Guitar1_notes3_1[1],
        first_indices: [0],
        last_indices: [0],
    }),
    new StaveTie({
        first_note: Guitar1_notes3_1[1],
        last_note: Guitar1_notes3_1[2],
        first_indices: [0],
        last_indices: [0],
    }),
    new StaveTie({
        first_note: Guitar1_notes3_1[2],
        last_note: Guitar1_notes3_1[3],
        first_indices: [0],
        last_indices: [0],
    }),
    new StaveTie({
        first_note: Guitar1_notes3_1[3],
        last_note: Guitar1_notes3_1[4],
        first_indices: [0],
        last_indices: [0],
    }),
    new StaveTie({
        first_note: Guitar1_notes3_1[6],
        last_note: Guitar1_notes3_1[7],
        first_indices: [0],
        last_indices: [0],
    }),
];


Guitar1_ties3.forEach((t) => {
    t.setContext(ctx).draw();
});


var Guitar1_vibrato3 = new VF.VibratoBracket({
  start: Guitar1_notes3_1[7],
  stop: null,
});
Guitar1_vibrato3.setLine(0);
Guitar1_vibrato3.setHarsh(true);
Guitar1_vibrato3.setContext(ctx).draw();


const Guitar1St4 = new Stave(Guitar1St3.width + Guitar1St3.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
const Guitar1St4 = new Stave(Guitar1St3.width + Guitar1St3.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Guitar1St4.draw();
Guitar1St4.draw();


const Guitar1_gracenotes4 = [
const Guitar1_St4_notes_1 = [
   new VF.GraceNote({ keys: ['a/4'], duration: '8', slash: true })
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),


const Guitar1_notes4_1 = [
  new VF.StaveNote({ keys: ["g/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["a/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["g/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "4" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: -1 }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }),
];
];
const Guitar1_notes4_2 = [
const Guitar1_St4_notes_2 = [
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
732行目: 779行目:


];
];
Guitar1_notes4_1[7].addModifier(new VF.Articulation('a.').setPosition(3));
UniqueIds = getUniqueNoteheadIds(Guitar1_St4_notes_1, [0, 1, 2, 3, 4, 5, 6, 7]);
Guitar1_notes4_1[3].addModifier(new VF.GraceNoteGroup(Guitar1_gracenotes4, true), 0);
allUniqueIds = updateAllUniqueIds(UniqueIds);


SteveNoteUniqueIds = getUniqueStaveNotesIds(Guitar1_notes4_1, [0, 1]);
const Guitar1_St4_beam_1 = new VF.Beam([
allFlagUniqueIds = updateAllFlagUniqueIds(SteveNoteUniqueIds);
  Guitar1_St4_notes_1[0], Guitar1_St4_notes_1[1], Guitar1_St4_notes_1[2], Guitar1_St4_notes_1[3]
  ]);
const Guitar1_St4_beam_2 = new VF.Beam([
  Guitar1_St4_notes_1[4], Guitar1_St4_notes_1[5], Guitar1_St4_notes_1[6], Guitar1_St4_notes_1[7]
  ]);


const Guitar1_beam4_1 = new VF.Beam([Guitar1_notes4_1[2], Guitar1_notes4_1[3]]);
var Guitar1_St4_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
const Guitar1_beam4_2 = new VF.Beam([Guitar1_notes4_1[5], Guitar1_notes4_1[6], Guitar1_notes4_1[7]]);
Guitar1_St4_Voice_1.setStrict(true);
Guitar1_St4_Voice_1.addTickables(Guitar1_St4_notes_1);


var Guitar1_St4_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar1_St4_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St4_1Voice.setStrict(true);
Guitar1_St4_Voice_2.setStrict(true);
Guitar1_St4_1Voice.addTickables(Guitar1_notes4_1);
Guitar1_St4_Voice_2.addTickables(Guitar1_St4_notes_2);


var Guitar1_St4_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var formatterGuitar1_St4 = new VF.Formatter().joinVoices([Guitar1_St4_Voice_1, Guitar1_St4_Voice_2]);
Guitar1_St4_2Voice.setStrict(true);
formatterGuitar1_St4.format([Guitar1_St4_Voice_1, Guitar1_St4_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St4_2Voice.addTickables(Guitar1_notes4_2);
Guitar1_St4_Voice_1.draw(ctx, Guitar1St4);
Guitar1_St4_Voice_2.draw(ctx, Guitar1St4);


var formatterGuitar1_St4_1 = new Vex.Flow.Formatter().joinVoices([Guitar1_St4_2Voice, Guitar1_St4_1Voice]);
Guitar1_St4_beam_1.setContext(ctx).draw();
formatterGuitar1_St4_1.format([Guitar1_St4_2Voice, Guitar1_St4_1Voice], nStaveWidth - 30);
Guitar1_St4_beam_2.setContext(ctx).draw();
Guitar1_St4_1Voice.draw(ctx, Guitar1St4);
Guitar1_St4_2Voice.draw(ctx, Guitar1St4);


Guitar1_beam4_1.setContext(ctx).draw();
shiftGuitar1_4st= addShift(
Guitar1_beam4_2.setContext(ctx).draw();
   Guitar1_St4_notes_1,  
 
   [0, 1, 2, 3, 4, 5, 6, 7],
shiftGuitar1_1 = addShift(
   [3, 3, 3, 3, 3, 3, 3, 3.8]
   Guitar1_notes4_1,  
   [0, 1],
   [4, 3.5]
);
);


const Guitar1_ties4 = [
    new StaveTie({
        first_note: Guitar1_notes4_1[0],
        last_note: Guitar1_notes4_1[1],
        first_indices: [0],
        last_indices: [0],
    }),
    new StaveTie({
        first_note: Guitar1_notes4_1[1],
        last_note: Guitar1_notes4_1[2],
        first_indices: [0],
        last_indices: [0],
    }),
    new StaveTie({
        first_note: Guitar1_notes4_1[3],
        last_note: Guitar1_notes4_1[4],
        first_indices: [0],
        last_indices: [0],
    }),
    new StaveTie({
        first_note: Guitar1_notes4_1[5],
        last_note: Guitar1_notes4_1[6],
        first_indices: [0],
        last_indices: [0],
    }),
];
Guitar1_ties4.forEach((t) => {
    t.setContext(ctx).draw();
});




822行目: 840行目:
}
}
Guitar1_tab4.draw();
Guitar1_tab4.draw();


const Guitar1_Tab1 = new Stave(Guitar1St1.x, Guitar1St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
const Guitar1_Tab1 = new Stave(Guitar1St1.x, Guitar1St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
838行目: 854行目:
Guitar1Inst.x = VocalSt1.x - 30;
Guitar1Inst.x = VocalSt1.x - 30;
Guitar1Inst.y = Guitar1St1.y + ((Guitar1_Tab1.y - Guitar1St1.y) / 2) + 90;  
Guitar1Inst.y = Guitar1St1.y + ((Guitar1_Tab1.y - Guitar1St1.y) / 2) + 90;  


const Guitar1_Tab1_1 = new Stave(Guitar1_Tab1.x + nHeadMargin + 20, Guitar1_Tab1.y, 0).setContext(ctx);
const Guitar1_Tab1_1 = new Stave(Guitar1_Tab1.x + nHeadMargin + 20, Guitar1_Tab1.y, 0).setContext(ctx);
845行目: 860行目:
Guitar1_Tab1_1.draw();
Guitar1_Tab1_1.draw();


const Guitar1_tab_notes1_1 = [
Guitar1tab_1st.x = Guitar1_Tab1_1.x
  new VF.GhostNote({ keys: ["a/3", "e/4", "a/4", "c/5"], duration: "2" }),
Guitar1tab_1st.y = Guitar1_Tab1_1.y
  new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }),
 
   dotted(new VF.StaveNote({ keys: ["f/5"], duration: "4d", stem_direction: -1 })),
 
 
const Guitar1_Tab2 = new Stave(Guitar1_Tab1.width + Guitar1_Tab1.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab2.draw();
 
Guitar1tab_2st.x = Guitar1_Tab2.x
Guitar1tab_2st.y = Guitar1_Tab2.y
 
const Guitar1_Tab3 = new Stave(Guitar1_Tab2.width + Guitar1_Tab2.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab3.draw();
 
Guitar1tab_3st.x = Guitar1_Tab3.x
Guitar1tab_3st.y = Guitar1_Tab3.y
 
const Guitar1_Tab4 = new Stave(Guitar1_Tab3.width + Guitar1_Tab3.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab4.draw();
 
Guitar1tab_4st.x = Guitar1_Tab4.x
Guitar1tab_4st.y = Guitar1_Tab4.y
 
 
const Guitar2_St1 = new Stave(Guitar1_Tab1.x, Guitar1_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar2_St1.addClef("treble").setContext(ctx);
Guitar2_St1.addTimeSignature('4/4').setContext(ctx);
Guitar2_St1.addKeySignature('D').setContext(ctx);
Guitar2_St1.draw();
 
const Guitar2_St1_notes_1 = [
   new VF.StaveNote({ keys: ["b/4"], duration: "1" }),
];
];
const Guitar1_tab_notes1_2 = [
const Guitar2_St1_notes_2 = [
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
872行目: 915行目:


];
];
UniqueIds = getUniqueNoteheadIds(Guitar1_tab_notes1_1, [1, 2]);
UniqueIds = getUniqueNoteheadIds(Guitar2_St1_notes_1, [0]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
allUniqueIds = updateAllUniqueIds(UniqueIds);


var Guitar1_tab_St1_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar2_St1_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_tab_St1_1Voice.setStrict(true);
Guitar2_St1_Voice_1.setStrict(true);
Guitar1_tab_St1_1Voice.addTickables(Guitar1_tab_notes1_1);
Guitar2_St1_Voice_1.addTickables(Guitar2_St1_notes_1);


var Guitar1_tab_St1_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar2_St1_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_tab_St1_2Voice.setStrict(true);
Guitar2_St1_Voice_2.setStrict(true);
Guitar1_tab_St1_2Voice.addTickables(Guitar1_tab_notes1_2);
Guitar2_St1_Voice_2.addTickables(Guitar2_St1_notes_2);


var formatterGuitar1_tab_St1_1 = new Vex.Flow.Formatter().joinVoices([Guitar1_tab_St1_2Voice, Guitar1_tab_St1_1Voice]);
var formatterGuitar2_St1 = new VF.Formatter().joinVoices([Guitar2_St1_Voice_1, Guitar2_St1_Voice_2]);
formatterGuitar1_tab_St1_1.format([Guitar1_tab_St1_2Voice, Guitar1_tab_St1_1Voice], nStaveWidth - 20 - 10);
formatterGuitar2_St1.format([Guitar2_St1_Voice_1, Guitar2_St1_Voice_2], nStaveWidth - 20 - 10);
Guitar1_tab_St1_1Voice.draw(ctx, Guitar1_Tab1_1);
Guitar2_St1_Voice_1.draw(ctx, Guitar2_St1);
Guitar1_tab_St1_2Voice.draw(ctx, Guitar1_Tab1_1);
Guitar2_St1_Voice_2.draw(ctx, Guitar2_St1);


shiftGuitar1_tab1 = addShift(
shiftGuitar2_1st= addShift(
   Guitar1_tab_notes1_1,  
   Guitar2_St1_notes_1,  
   [0, 0, 0, 0, 1,  2],
   [0],
   [3, 2, 1, 0, 1, -1]
   [3]
);
);


const Guitar2_St2 = new Stave(Guitar2_St1.width + Guitar2_St1.x, Guitar2_St1.y, nStaveWidth).setContext(ctx);
Guitar2_St2.draw();


 
const Guitar2_St2_notes_1 = [
const Guitar1_Tab2 = new Stave(Guitar1_Tab1.width + Guitar1_Tab1.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
   new VF.StaveNote({ keys: ["b/4"], duration: "2" }),
Guitar1_Tab2.draw();
   new VF.StaveNote({ keys: ["b/4"], duration: "2" }),
 
const Guitar1_tab_gracenotes2 = [
  new VF.GraceNote({ keys: ['a/5'], duration: '8', slash: true })
  .addModifier(new VF.Accidental('#'), 0)
];
 
const Guitar1_tab_notes2_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 })
  .addModifier(new VF.Accidental('n'), 0),
  new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["d/5"], duration: "8", stem_direction: -1 }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["f/5"], duration: "8" }),
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
];
const Guitar1_tab_notes2_2 = [
const Guitar2_St2_notes_2 = [
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
937行目: 966行目:


];
];
Guitar1_tab_notes2_1[0].addModifier(new VF.GraceNoteGroup(Guitar1_tab_gracenotes2, false), 0);
UniqueIds = getUniqueNoteheadIds(Guitar2_St2_notes_1, [0, 1]);
 
UniqueIds = getUniqueNoteheadIds(Guitar1_tab_notes2_1, [0, 1, 2, 3, 4, 5, 6, 7]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
allUniqueIds = updateAllUniqueIds(UniqueIds);


const Guitar1_tab_beam2_1 = new VF.Beam([Guitar1_tab_notes2_1[0], Guitar1_tab_notes2_1[1], Guitar1_tab_notes2_1[2], Guitar1_tab_notes2_1[3]]);
var Guitar2_St2_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
const Guitar1_tab_beam2_2 = new VF.Beam([Guitar1_tab_notes2_1[4], Guitar1_tab_notes2_1[5], Guitar1_tab_notes2_1[6], Guitar1_tab_notes2_1[7]]);
Guitar2_St2_Voice_1.setStrict(true);
Guitar2_St2_Voice_1.addTickables(Guitar2_St2_notes_1);


var Guitar1_tab_St2_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar2_St2_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_tab_St2_1Voice.setStrict(true);
Guitar2_St2_Voice_2.setStrict(true);
Guitar1_tab_St2_1Voice.addTickables(Guitar1_tab_notes2_1);
Guitar2_St2_Voice_2.addTickables(Guitar2_St2_notes_2);


var Guitar1_tab_St2_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var formatterGuitar2_St2 = new VF.Formatter().joinVoices([Guitar2_St2_Voice_1, Guitar2_St2_Voice_2]);
Guitar1_tab_St2_2Voice.setStrict(true);
formatterGuitar2_St2.format([Guitar2_St2_Voice_1, Guitar2_St2_Voice_2], nStaveWidth - 20 - 10);
Guitar1_tab_St2_2Voice.addTickables(Guitar1_tab_notes2_2);
Guitar2_St2_Voice_1.draw(ctx, Guitar2_St2);
Guitar2_St2_Voice_2.draw(ctx, Guitar2_St2);


var formatterGuitar1_tab_St2_1 = new Vex.Flow.Formatter().joinVoices([Guitar1_tab_St2_2Voice, Guitar1_tab_St2_1Voice]);
shiftGuitar2_2st= addShift(
formatterGuitar1_tab_St2_1.format([Guitar1_tab_St2_2Voice, Guitar1_tab_St2_1Voice], nStaveWidth - 20);
  Guitar2_St2_notes_1,  
Guitar1_tab_St2_1Voice.draw(ctx, Guitar1_Tab2);
  [0, 1],
Guitar1_tab_St2_2Voice.draw(ctx, Guitar1_Tab2);
  [3, 3]
);


shiftGuitar1_tab2 = addShift(
const Guitar2_St2_1 = new Stave(Guitar2_St1.width + Guitar2_St1.x + 45, Guitar2_St1.y, 0).setContext(ctx);
  Guitar1_tab_notes2_1,  
Guitar2_St2_1.setBegBarType(VF.Barline.type.NONE);
  [0, 0, 0, 0, 1, 1, 2, 3, 4, 4, 5, 6, 7],
Guitar2_St2_1.setEndBarType(VF.Barline.type.NONE);
  [1, 0, 1, 0, 1, 0, 0, 1, 2, 1, 2, 2, 3]
Guitar2_St2_1.draw();
);


Guitar1_tab_beam2_1.setContext(ctx).draw();
Guitar1_tab_beam2_2.setContext(ctx).draw();


const Guitar1_Tab3 = new Stave(Guitar1_Tab2.width + Guitar1_Tab2.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
const Guitar2_St3 = new Stave(Guitar2_St2.width + Guitar2_St2.x, Guitar2_St2.y, nStaveWidth).setContext(ctx);
Guitar1_Tab3.draw();
Guitar2_St3.draw();


const Guitar1_tab_notes3_1 = [
const Guitar2_St3_notes_1 = [
   new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "2", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "4", stem_direction: -1 }),
   new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/4"], duration: "4", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
  new VF.StaveNote({ keys: ["g/4"], duration: "16" }),
   new VF.StaveNote({ keys: ["g/4"], duration: "16" }),
  new VF.GhostNote({ keys: ["b/4"], duration: "2" }),
];
];
const Guitar1_tab_notes3_2 = [
const Guitar2_St3_notes_2 = [
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
1,002行目: 1,024行目:


];
];
UniqueIds = getUniqueNoteheadIds(Guitar1_tab_notes3_1, [0, 1, 2, 3, 4, 5, 6, 7]);
UniqueIds = getUniqueNoteheadIds(Guitar2_St3_notes_1, [0, 1, 2]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
allUniqueIds = updateAllUniqueIds(UniqueIds);


const Guitar1_tab_beam3_1 = new VF.Beam([Guitar1_tab_notes3_1[0], Guitar1_tab_notes3_1[1], Guitar1_tab_notes3_1[2], Guitar1_tab_notes3_1[3]]);
var Guitar2_St3_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
const Guitar1_tab_beam3_2 = new VF.Beam([Guitar1_tab_notes3_1[4], Guitar1_tab_notes3_1[5], Guitar1_tab_notes3_1[6]]);
Guitar2_St3_Voice_1.setStrict(true);
 
Guitar2_St3_Voice_1.addTickables(Guitar2_St3_notes_1);
var Guitar1_tab_St3_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_tab_St3_1Voice.setStrict(true);
Guitar1_tab_St3_1Voice.addTickables(Guitar1_tab_notes3_1);


var Guitar1_tab_St3_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar2_St3_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_tab_St3_2Voice.setStrict(true);
Guitar2_St3_Voice_2.setStrict(true);
Guitar1_tab_St3_2Voice.addTickables(Guitar1_tab_notes3_2);
Guitar2_St3_Voice_2.addTickables(Guitar2_St3_notes_2);


var formatterGuitar1_tab_St3_1 = new Vex.Flow.Formatter().joinVoices([Guitar1_tab_St3_2Voice, Guitar1_tab_St3_1Voice]);
var formatterGuitar2_St3 = new VF.Formatter().joinVoices([Guitar2_St3_Voice_1, Guitar2_St3_Voice_2]);
formatterGuitar1_tab_St3_1.format([Guitar1_tab_St3_2Voice, Guitar1_tab_St3_1Voice], nStaveWidth - 20);
formatterGuitar2_St3.format([Guitar2_St3_Voice_1, Guitar2_St3_Voice_2], nStaveWidth - 20 - 10);
Guitar1_tab_St3_1Voice.draw(ctx, Guitar1_Tab3);
Guitar2_St3_Voice_1.draw(ctx, Guitar2_St3);
Guitar1_tab_St3_2Voice.draw(ctx, Guitar1_Tab3);
Guitar2_St3_Voice_2.draw(ctx, Guitar2_St3);


shiftGuitar1_tab3 = addShift(
shiftGuitar2_3st= addShift(
   Guitar1_tab_notes3_1,  
   Guitar2_St3_notes_1,  
   [0, 1, 2, 3, 4, 5, 6, 7],
   [0, 1, 2],
   [2, 2, 2, 2, 2, 4, 4, 4]
   [1, 1, 1]
);
);


Guitar1_tab_beam3_1.setContext(ctx).draw();
const Guitar2_St4 = new Stave(Guitar2_St3.width + Guitar2_St3.x, Guitar2_St3.y, nStaveWidth).setContext(ctx);
Guitar1_tab_beam3_2.setContext(ctx).draw();
Guitar2_St4.draw();


var Guitar1_tab_vibrato3 = new VF.VibratoBracket({
  start: Guitar1_tab_notes3_1[7],
  stop: null,
});
Guitar1_tab_vibrato3.setLine(1);
Guitar1_tab_vibrato3.setHarsh(true);
Guitar1_tab_vibrato3.setContext(ctx).draw();


const Guitar2_Tab1_1 = new Stave(Guitar2_St1.x + nHeadMargin + 20, Guitar2_St1.y + 120, 0).setContext(ctx);
Guitar2_Tab1_1.setBegBarType(VF.Barline.type.NONE);
Guitar2_Tab1_1.setEndBarType(VF.Barline.type.NONE);
Guitar2_Tab1_1.draw();
const Guitar2_Tab1 = new Stave(Guitar2_St1.x, Guitar2_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar2_Tab1.draw();


Guitar2tab_1st.x = Guitar2_Tab1_1.x;
Guitar2tab_1st.y = Guitar2_Tab1_1.y;


const Guitar1_Tab4 = new Stave(Guitar1_Tab3.width + Guitar1_Tab3.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar2Tab1.x = Guitar2_Tab1.x;
Guitar1_Tab4.draw();
Guitar2Tab1.y = Guitar2_Tab1.y;


const Guitar1_tab_gracenotes4 = [
const Guitar2_Tab2 = new Stave(Guitar2_Tab1.width + Guitar2_Tab1.x, Guitar2_Tab1.y, nStaveWidth).setContext(ctx);
  new VF.GraceNote({ keys: ['d/5'], duration: '8', slash: true })
Guitar2_Tab2.draw();
];


const Guitar1_tab_notes4_1 = [
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
  new VF.StaveNote({ keys: ["d/5"], duration: "4" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }),
];
const Guitar1_tab_notes4_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar2_Tab2_1 = new Stave(Guitar2_Tab1.width + Guitar2_Tab1.x + 45, Guitar2_Tab1.y, 0).setContext(ctx);
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Guitar2_Tab2_1.setBegBarType(VF.Barline.type.NONE);
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Guitar2_Tab2_1.setEndBarType(VF.Barline.type.NONE);
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Guitar2_Tab2_1.draw();


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Guitar2tab_2st.x = Guitar2_Tab2.x;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Guitar2tab_2st.y = Guitar2_Tab2.y;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar2_Tab3 = new Stave(Guitar2_Tab2.width + Guitar2_Tab2.x, Guitar2_Tab2.y, nStaveWidth).setContext(ctx);
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Guitar2_Tab3.draw();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


];
Guitar2tab_3st.x = Guitar2_Tab3.x;
Guitar1_tab_notes4_1[3].addModifier(new VF.GraceNoteGroup(Guitar1_tab_gracenotes4, false), 0);
Guitar2tab_3st.y = Guitar2_Tab3.y;


SteveNoteUniqueIds = getUniqueStaveNotesIds(Guitar1_tab_notes4_1, [0, 1]);
allFlagUniqueIds = updateAllFlagUniqueIds(SteveNoteUniqueIds);


UniqueIds = getUniqueNoteheadIds(Guitar1_tab_notes4_1, [0, 1, 2, 3, 4, 5, 6, 7]);
const Guitar2_Tab4 = new Stave(Guitar2_Tab3.width + Guitar2_Tab3.x, Guitar2_Tab3.y, nStaveWidth).setContext(ctx);
allUniqueIds = updateAllUniqueIds(UniqueIds);
Guitar2_Tab4.draw();


const Guitar1_tab_beam4_1 = new VF.Beam([Guitar1_tab_notes4_1[2], Guitar1_tab_notes4_1[3]]);
Guitar2tab_4st.x = Guitar2_Tab4.x;
const Guitar1_tab_beam4_2 = new VF.Beam([Guitar1_tab_notes4_1[5], Guitar1_tab_notes4_1[6], Guitar1_tab_notes4_1[7]]);
Guitar2tab_4st.y = Guitar2_Tab4.y;


var Guitar1_tab_St4_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar2_connect = new VF.StaveConnector(Guitar2_St1, Guitar2_Tab1);
Guitar1_tab_St4_1Voice.setStrict(true);
Guitar2_connect.setType(VF.StaveConnector.type.BRACKET);
Guitar1_tab_St4_1Voice.addTickables(Guitar1_tab_notes4_1);
Guitar2_connect.setContext(ctx);
Guitar2_connect.draw();


var Guitar1_tab_St4_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
const Guitar2_Tab1_tab = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y - 10, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar1_tab_St4_2Voice.setStrict(true);
for (var i = 0; i < 5; i++) {
Guitar1_tab_St4_2Voice.addTickables(Guitar1_tab_notes4_2);
  if (i == 0) continue;
  Guitar2_Tab1_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab1_tab.draw();


var formatterGuitar1_tab_St4_1 = new Vex.Flow.Formatter().joinVoices([Guitar1_tab_St4_2Voice, Guitar1_tab_St4_1Voice]);
const Guitar2_Tab2_tab = new Stave(Guitar2_Tab1_tab.width + Guitar2_Tab1_tab.x, Guitar2_Tab1_tab.y, nStaveWidth).setContext(ctx);
formatterGuitar1_tab_St4_1.format([Guitar1_tab_St4_2Voice, Guitar1_tab_St4_1Voice], nStaveWidth - 20);
for (var i = 0; i < 5; i++) {
Guitar1_tab_St4_1Voice.draw(ctx, Guitar1_Tab4);
  if (i == 0) continue;
Guitar1_tab_St4_2Voice.draw(ctx, Guitar1_Tab4);
  Guitar2_Tab2_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab2_tab.draw();


shiftGuitar1_tab4 = addShift(
const Guitar2_Tab3_tab = new Stave(Guitar2_Tab2_tab.width + Guitar2_Tab2_tab.x, Guitar2_Tab2_tab.y, nStaveWidth).setContext(ctx);
  Guitar1_tab_notes4_1,
for (var i = 0; i < 5; i++) {
   [0, 1, 2, 3, 3, 4, 5, 6, 7, 7],
   if (i == 0) continue;
   [2, 2, 2, 2, 2, 2, 1, 1, 1, 1]
   Guitar2_Tab3_tab.setConfigForLine(i, {visible: false} );
);
}
Guitar2_Tab3_tab.draw();


shiftGuitar1_tab4_tr = addShift(
const Guitar2_Tab4_tab = new Stave(Guitar2_Tab3_tab.width + Guitar2_Tab3_tab.x, Guitar2_Tab3_tab.y, nStaveWidth).setContext(ctx);
  Guitar1_tab_notes4_1,  
for (var i = 0; i < 5; i++) {
  [0, 1],
  if (i == 0) continue;
  [3, 2.5]
  Guitar2_Tab4_tab.setConfigForLine(i, {visible: false} );
);
}
 
Guitar2_Tab4_tab.draw();
Guitar1_tab_beam4_1.setContext(ctx).draw();
Guitar1_tab_beam4_2.setContext(ctx).draw();


Guitar2Inst.x = Guitar2_St1.x - 30;
Guitar2Inst.y = Guitar2_St1.y + ((Guitar2_Tab1.y - Guitar2_St1.y) / 2) + 90;


const Guitar2_St1 = new Stave(Guitar1_Tab1.x, Guitar1_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
const Base_St1 = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar2_St1.addClef("treble").setContext(ctx);
Base_St1.addClef("bass").setContext(ctx);
Guitar2_St1.addTimeSignature('4/4').setContext(ctx);
Base_St1.addTimeSignature('4/4').setContext(ctx);
Guitar2_St1.addKeySignature('D').setContext(ctx);
Base_St1.addKeySignature('D').setContext(ctx);
Guitar2_St1.draw();
Base_St1.draw();


const Guitar2_notes1_1 = [
const Base_St2 = new Stave(Base_St1.width + Base_St1.x, Base_St1.y, nStaveWidth).setContext(ctx);
  dotted(new VF.StaveNote({ keys: ["g/4"], duration: "8d" })),
Base_St2.draw();
  new VF.StaveNote({ keys: ["g/4"], duration: "16" }),


  new VF.StaveNote({ keys: ["g/4"], duration: "8" }),
const Base_St3 = new Stave(Base_St2.width + Base_St2.x, Base_St2.y, nStaveWidth).setContext(ctx);
  new VF.StaveNote({ keys: ["g/4"], duration: "16" }),
Base_St3.draw();
  new VF.StaveNote({ keys: ["g/4"], duration: "16" }),


  new VF.StaveNote({ keys: ["g/4"], duration: "16" }),
const Base_St4 = new Stave(Base_St3.width + Base_St3.x, Base_St3.y, nStaveWidth).setContext(ctx);
  new VF.StaveNote({ keys: ["g/4"], duration: "16" }),
Base_St4.draw();
  new VF.StaveNote({ keys: ["g/4"], duration: "16" }),
  new VF.StaveNote({ keys: ["g/4"], duration: "16" }),


  new VF.StaveNote({ keys: ["g/4"], duration: "8" }),
const Base_Tab1 = new Stave(Base_St1.x, Base_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
  new VF.StaveNote({ keys: ["g/4"], duration: "8" }),
Base_Tab1.setEndBarType(VF.Barline.type.NONE);
];
for (var i = 0; i < 5; i++) {
const Guitar2_notes1_2 = [
   if (i != 0) continue;
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   Base_Tab1.setConfigForLine(i, {visible: false} );
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
}
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Base_Tab1.draw();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
BaseTab1.x = Base_Tab1.x;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
BaseTab1.y = Base_Tab1.y;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
BaseInst.x = Base_St1.x - 30;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
BaseInst.y = Base_St1.y + ((Base_Tab1.y - Base_St1.y) / 2) + 90;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
StaveBase1 = Base_Tab1;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


];
const Base_Tab2 = new Stave(Base_Tab1.width + Base_Tab1.x, Base_Tab1.y, nStaveWidth).setContext(ctx);
const Guitar2_St1_beam1_1 = new VF.Beam([Guitar2_notes1_1[0], Guitar2_notes1_1[1]]);
Base_Tab2.setBegBarType(VF.Barline.type.NONE);
const Guitar2_St1_beam1_2 = new VF.Beam([Guitar2_notes1_1[2], Guitar2_notes1_1[3], Guitar2_notes1_1[4]]);
Base_Tab2.setEndBarType(VF.Barline.type.NONE);
const Guitar2_St1_beam1_3 = new VF.Beam([Guitar2_notes1_1[5], Guitar2_notes1_1[6], Guitar2_notes1_1[7], Guitar2_notes1_1[8]]);
for (var i = 0; i < 5; i++) {
const Guitar2_St1_beam1_4 = new VF.Beam([Guitar2_notes1_1[9], Guitar2_notes1_1[10]]);
  if (i != 0) continue;
  Base_Tab2.setConfigForLine(i, {visible: false} );
}
Base_Tab2.draw();


UniqueIds = getUniqueNoteheadIds(Guitar2_notes1_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
StaveBase2 = Base_Tab2;
allUniqueIds = updateAllUniqueIds(UniqueIds);


var Guitar2_St1_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
const Base_Tab3 = new Stave(Base_Tab2.width + Base_Tab2.x, Base_Tab2.y, nStaveWidth).setContext(ctx);
Guitar2_St1_1Voice.setStrict(true);
Base_Tab3.setBegBarType(VF.Barline.type.NONE);
Guitar2_St1_1Voice.addTickables(Guitar2_notes1_1);
Base_Tab3.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab3.setConfigForLine(i, {visible: false} );
}
Base_Tab3.draw();


var Guitar2_St1_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
StaveBase3 = Base_Tab3;
Guitar2_St1_2Voice.setStrict(true);
Guitar2_St1_2Voice.addTickables(Guitar2_notes1_2);


var formatterGuitar2_St1_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_St1_2Voice, Guitar2_St1_1Voice]);
const Base_Tab4 = new Stave(Base_Tab3.width + Base_Tab3.x, Base_Tab3.y, nStaveWidth).setContext(ctx);
formatterGuitar2_St1_1.format([Guitar2_St1_2Voice, Guitar2_St1_1Voice], nStaveWidth - 40 - 10);
Base_Tab4.setBegBarType(VF.Barline.type.NONE);
Guitar2_St1_1Voice.draw(ctx, Guitar2_St1);
Base_Tab4.setEndBarType(VF.Barline.type.NONE);
Guitar2_St1_2Voice.draw(ctx, Guitar2_St1);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab4.setConfigForLine(i, {visible: false} );
}
Base_Tab4.draw();


Guitar2_St1_beam1_1.setContext(ctx).draw();
StaveBase4 = Base_Tab4;
Guitar2_St1_beam1_2.setContext(ctx).draw();
Guitar2_St1_beam1_3.setContext(ctx).draw();
Guitar2_St1_beam1_4.setContext(ctx).draw();


shiftGuitar2_St1 = addShift(
var Base_connect = new VF.StaveConnector(Base_St1, Base_Tab1);
  Guitar2_notes1_1,  
Base_connect.setType(VF.StaveConnector.type.BRACKET);
  [0, 1, 2, 3, 4, 6, 7, 8, 9, 10],
Base_connect.setContext(ctx);
  [4, 4, 4, 4, 4, 4, 4, 4, 4,  4]
Base_connect.draw();
);


const Drum_St1 = new Stave(Base_Tab1.x, Base_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Drum_St1.addClef("bass").setContext(ctx);
Drum_St1.addTimeSignature('4/4').setContext(ctx);
Drum_St1.draw();


DrumInst.x = Drum_St1.x - 30;
DrumInst.y = Drum_St1.y + 90;


const Guitar2_St2 = new Stave(Guitar2_St1.width + Guitar2_St1.x, Guitar2_St1.y, nStaveWidth).setContext(ctx);
const Drum_St1_1 = new Stave(nHeadMargin + Base_Tab1.x, Base_Tab1.y + 120, 0).setContext(ctx);
Guitar2_St2.draw();
Drum_St1_1.setBegBarType(VF.Barline.type.NONE);
Drum_St1_1.setEndBarType(VF.Barline.type.NONE);
Drum_St1_1.draw();


const Guitar2_St2_1 = new Stave(Guitar2_St1.width + Guitar2_St1.x + 45, Guitar2_St1.y, 0).setContext(ctx);
const Drum_St1_2 = new Stave(nHeadMargin + Base_Tab1.x, Base_Tab1.y + 120, 0).setContext(ctx);
Guitar2_St2_1.setBegBarType(VF.Barline.type.NONE);
Drum_St1_2.setBegBarType(VF.Barline.type.NONE);
Guitar2_St2_1.setEndBarType(VF.Barline.type.NONE);
Drum_St1_2.setEndBarType(VF.Barline.type.NONE);
Guitar2_St2_1.draw();
Drum_St1_2.draw();


const Guitar2_notes2_1 = [
const Drum_St2 = new Stave(Drum_St1.width + Drum_St1.x, Drum_St1.y, nStaveWidth).setContext(ctx);
  dotted(new VF.StaveNote({ keys: ["c/5"], duration: "8d", stem_direction: -1 })),
Drum_St2.draw();
  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["c/5"], duration: "8", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: -1 }),
const Drum_St3 = new Stave(Drum_St2.width + Drum_St2.x, Drum_St1.y, nStaveWidth).setContext(ctx);
  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: -1 }),
Drum_St3.draw();
  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["c/5"], duration: "8", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["c/5"], duration: "8", stem_direction: -1 }),
];
const Guitar2_notes2_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Drum_St4 = new Stave(Drum_St3.width + Drum_St3.x, Drum_St1.y, nStaveWidth).setContext(ctx);
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Drum_St4.draw();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Perc_St1 = new Stave(Drum_St1.x, Drum_St1.y + 100, nHeadMargin + nStaveWidth).setContext(ctx);
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Perc_St1.addTimeSignature('4/4').setContext(ctx);
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


];
const Perc_St1_1 = new Stave(nHeadMargin + Drum_St1.x, Drum_St1.y + 100, 0).setContext(ctx);
const Guitar2_St2_beam1_1 = new VF.Beam([Guitar2_notes2_1[0], Guitar2_notes2_1[1]]);
Perc_St1_1.setBegBarType(VF.Barline.type.NONE);
const Guitar2_St2_beam1_2 = new VF.Beam([Guitar2_notes2_1[2], Guitar2_notes2_1[3], Guitar2_notes2_1[4]]);
Perc_St1_1.setEndBarType(VF.Barline.type.NONE);
const Guitar2_St2_beam1_3 = new VF.Beam([Guitar2_notes2_1[5], Guitar2_notes2_1[6], Guitar2_notes2_1[7], Guitar2_notes2_1[8]]);
Perc_St1_1.draw();
const Guitar2_St2_beam1_4 = new VF.Beam([Guitar2_notes2_1[9], Guitar2_notes2_1[10]]);


UniqueIds = getUniqueNoteheadIds(Guitar2_notes2_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
for (var i = 0; i < 5; i++) {
allUniqueIds = updateAllUniqueIds(UniqueIds);
  if (i == 2) continue;
  Perc_St1.setConfigForLine(i, {visible: false} );
}


var Guitar2_St2_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
Perc_St1.draw();
Guitar2_St2_1Voice.setStrict(true);
Guitar2_St2_1Voice.addTickables(Guitar2_notes2_1);


var Guitar2_St2_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
PercInst.x = Perc_St1.x - 30;
Guitar2_St2_2Voice.setStrict(true);
PercInst.y = Perc_St1.y + 90;  
Guitar2_St2_2Voice.addTickables(Guitar2_notes2_2);


var formatterGuitar2_St2_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_St2_2Voice, Guitar2_St2_1Voice]);
var AllConnector = new VF.StaveConnector(VocalSt1, Perc_St1);
formatterGuitar2_St2_1.format([Guitar2_St2_2Voice, Guitar2_St2_1Voice], nStaveWidth - 45 - 10);
AllConnector.setType(VF.StaveConnector.type.SINGLE);
Guitar2_St2_1Voice.draw(ctx, Guitar2_St2_1);
AllConnector.setContext(ctx);
Guitar2_St2_2Voice.draw(ctx, Guitar2_St2_1);
AllConnector.draw();


Guitar2_St2_beam1_1.setContext(ctx).draw();
Guitar2_St2_beam1_2.setContext(ctx).draw();
Guitar2_St2_beam1_3.setContext(ctx).draw();
Guitar2_St2_beam1_4.setContext(ctx).draw();
shiftGuitar2_St2 = addShift(
  Guitar2_notes2_1,
  [0, 1, 2, 3, 4, 6, 7, 8, 9, 10],
  [2, 2, 2, 2, 2, 2, 2, 2, 2,  2]
);


const Perc_St2 = new Stave(Perc_St1.width + Perc_St1.x, Perc_St1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St2.setConfigForLine(i, {visible: false} );
}
Perc_St2.draw();


const Perc_St3 = new Stave(Perc_St2.width + Perc_St2.x, Perc_St2.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St3.setConfigForLine(i, {visible: false} );
}
Perc_St3.draw();


const Perc_St4 = new Stave(Perc_St3.width + Perc_St3.x, Perc_St3.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St4.setConfigForLine(i, {visible: false} );
}
Perc_St4.draw();


const Guitar2_St3 = new Stave(Guitar2_St2.width + Guitar2_St2.x, Guitar2_St2.y, nStaveWidth).setContext(ctx);
})();
Guitar2_St3.draw();


const Guitar2_notes3_1 = [
const svgElement2 = document.querySelector('#yonet202403Mid_Output01 svg');
  new VF.StaveNote({ keys: ["d/4", "a/4", "d/5", "f/5"], duration: "8" }),
svgElement2.style.backgroundColor = '#F5F5F5';
  new VF.StaveNote({ keys: ["f/5"], duration: "8" }),
var svgContainer = document.getElementById('yonet202403Mid_Output01');
var svgElement = svgContainer.querySelector('svg');


  new VF.StaveNote({ keys: ["f/5"], duration: "8" }),
var VocalText_options = {
  new VF.StaveNote({ keys: ["f/5"], duration: "16" }),
    textContent: ["Vocal"], // 必須文字列
  new VF.StaveNote({ keys: ["f/5"], duration: "16" }),
    strID: "VocalText", // 必須
    Stave_x: Vocal.x,
    Stave_y: Vocal.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(VocalText_options);


  new VF.StaveNote({ keys: ["f/5"], duration: "16" }),
var EGuitarText_options = {
  new VF.StaveNote({ keys: ["f/5"], duration: "16" }),
    textContent: ["E.Guitar1"], // 必須文字列
  new VF.StaveNote({ keys: ["f/5"], duration: "8" }),
    strID: "EGuitarText", // 必須
 
    Stave_x: Guitar1Inst.x,
  new VF.StaveNote({ keys: ["f/5"], duration: "8" }),
    Stave_y: Guitar1Inst.y,
  new VF.StaveNote({ keys: ["f/5"], duration: "8" }),
    fontFamily: "Arial, sans-serif",
];
    fontSize: "20pt",
const Guitar2_notes3_2 = [
    Rotate: -90
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
};
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
insertTextToSVG(EGuitarText_options);
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
var EGuitarTab_options = {
    textContent: [""], // 必須文字列
    strID: "EGuitarTab", // 必須
    Stave_x: Stave9Pos.x,
    Stave_y: Stave9Pos.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 80,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(EGuitarTab_options);
 
//shiftGuitar1_1st
var Guitar1_st1_option = {
    textContent: [";", ";", ";", "", "", "", ""], // 必須文字列
    strID: "Guitar1_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_1st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st1_option);


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
var Guitar1_st2_option = {
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    textContent: [";", ";", ";", "", "", "", "\uFF64"], // 必須文字列
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    strID: "Guitar1_st2", // 必須
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_2st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st2_option);


];
insertTiePathToSVG({x:shiftGuitar1_2st[2].x , y:shiftGuitar1_2st[2].y + 10}, {x:shiftGuitar1_2st[2].x + 35, y:shiftGuitar1_2st[2].y + 10});
const Guitar2_St3_beam1_1 = new VF.Beam([Guitar2_notes3_1[0], Guitar2_notes3_1[1]]);
const Guitar2_St3_beam1_2 = new VF.Beam([Guitar2_notes3_1[2], Guitar2_notes3_1[3], Guitar2_notes3_1[4]]);
const Guitar2_St3_beam1_3 = new VF.Beam([Guitar2_notes3_1[5], Guitar2_notes3_1[6], Guitar2_notes3_1[7]]);
const Guitar2_St3_beam1_4 = new VF.Beam([Guitar2_notes3_1[8], Guitar2_notes3_1[9]]);


UniqueIds = getUniqueNoteheadIds(Guitar2_notes3_1, [1, 2, 3, 4, 5, 6, 7, 8, 9]);
var Guitar1_st3_option = {
allUniqueIds = updateAllUniqueIds(UniqueIds);
    textContent: [";", ";", ";", ";", ";", ";", "\uFF64"], // 必須文字列
    strID: "Guitar1_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_3st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st3_option);


var Guitar2_St3_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
insertTiePathToSVG({x:shiftGuitar1_3st[2].x , y:shiftGuitar1_3st[2].y + 10}, {x:shiftGuitar1_3st[2].x + 35, y:shiftGuitar1_3st[2].y + 10});
Guitar2_St3_1Voice.setStrict(true);
Guitar2_St3_1Voice.addTickables(Guitar2_notes3_1);


var Guitar2_St3_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var Guitar1_st4_option = {
Guitar2_St3_2Voice.setStrict(true);
    textContent: [";", ";", ";", ";", ";", ";", ";", "\uFF64"], // 必須文字列
Guitar2_St3_2Voice.addTickables(Guitar2_notes3_2);
    strID: "Guitar1_st4", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_4st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st4_option);


var formatterGuitar2_St3_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_St3_2Voice, Guitar2_St3_1Voice]);
insertTiePathToSVG({x:shiftGuitar1_4st[0].x , y:shiftGuitar1_4st[0].y + 10}, {x:shiftGuitar1_4st[0].x + 35, y:shiftGuitar1_4st[0].y + 10});
formatterGuitar2_St3_1.format([Guitar2_St3_2Voice, Guitar2_St3_1Voice], nStaveWidth - 10);
Guitar2_St3_1Voice.draw(ctx, Guitar2_St3);
Guitar2_St3_2Voice.draw(ctx, Guitar2_St3);


Guitar2_St3_beam1_1.setContext(ctx).draw();
insertTiePathToSVG({x:shiftGuitar1_4st[3].x , y:shiftGuitar1_4st[3].y + 10}, {x:shiftGuitar1_4st[3].x + 35, y:shiftGuitar1_4st[3].y + 10});
Guitar2_St3_beam1_2.setContext(ctx).draw();
Guitar2_St3_beam1_3.setContext(ctx).draw();
Guitar2_St3_beam1_4.setContext(ctx).draw();


shiftGuitar2_St3 = addShift(
insertArrowPathToSVG({x:shiftGuitar1_4st[1].x + 10 , y:shiftGuitar1_4st[1].y + 20}, {x:shiftGuitar1_4st[1].x + 45, y:shiftGuitar1_4st[1].y + 70});
  Guitar2_notes3_1,  
  [0, 1, 2, 3, 4, 6, 7, 8, 9],
  [2, 2, 2, 2, 2, 2, 2, 2, 2]
);


//u254F左利き用4線フレット
insertTiePathToSVG({x:shiftGuitar1_1st[2].x , y:shiftGuitar1_1st[2].y + 10}, {x:shiftGuitar1_1st[2].x + 35, y:shiftGuitar1_1st[2].y + 10});


var Guitar1tab_st1_option = {
    textContent: ["\uFFAF", "3", "2", "1", ":", ":", "/", "/", "/", "/"], // 必須文字列
    strID: "Guitar1tab_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_1st.x + 10, y:Guitar1tab_1st.y + 80},
{x:Guitar1tab_1st.x + 15, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 30, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 45, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 27, y:Guitar1tab_1st.y + 70},//4弦中ポジ
{x:Guitar1tab_1st.x + 27, y:Guitar1tab_1st.y + 60},//5弦中ポジ
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 30},//1弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 40},//2弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 50},//3弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st1_option);


var Guitar1tab_st2_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", ":", ":", "["], // 必須文字列
    strID: "Guitar1tab_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 80},
{x:Guitar1tab_2st.x + 15, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 30, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 45, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 27, y:Guitar1tab_2st.y + 50},//3弦中ポジ
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 60},//4弦内ポジ
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 70},//5弦内ポジ
{x:Guitar1tab_2st.x + 42, y:Guitar1tab_2st.y + 80},//外全セーハ
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st2_option);


var Guitar1tab_st3_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", "_", "?", "?"], // 必須文字列
    strID: "Guitar1tab_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 80},
{x:Guitar1tab_3st.x + 15, y:Guitar1tab_3st.y + 90},
{x:Guitar1tab_3st.x + 30, y:Guitar1tab_3st.y + 90},
{x:Guitar1tab_3st.x + 45, y:Guitar1tab_3st.y + 90},
//{x:Guitar1tab_3st.x + 27, y:Guitar1tab_3st.y + 50},//3弦中ポジ
//{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 60},//4弦内ポジ
{x:Guitar1tab_3st.x + 42, y:Guitar1tab_3st.y + 70},//5弦外ポジ
{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 60},//内全セーハ
//{x:Guitar1tab_3st.x + 42, y:Guitar1tab_3st.y + 60},//外全セーハ
{x:Guitar1tab_3st.x + 80, y:Guitar1tab_3st.y + 30},//1弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 60},//4弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 70},//5弦ネックマーク
{x:Guitar1tab_3st.x + 80, y:Guitar1tab_3st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st3_option);


const Guitar2_St4 = new Stave(Guitar2_St3.width + Guitar2_St3.x, Guitar2_St3.y, nStaveWidth).setContext(ctx);
var Guitar1tab_st4_option = {
Guitar2_St4.draw();
    textContent: ["\uFF03", "6", "5", "4", ":", "_", "?", "?", "\uFF03", "7", "6", "5", ":", "_", "?", "?"], // 必須文字列
    strID: "Guitar1tab_st4", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 80},
{x:Guitar1tab_4st.x + 15, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 30, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 45, y:Guitar1tab_4st.y + 90},
//{x:Guitar1tab_4st.x + 27, y:Guitar1tab_4st.y + 50},//3弦中ポジ
//{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 60},//4弦内ポジ
{x:Guitar1tab_4st.x + 42, y:Guitar1tab_4st.y + 70},//5弦外ポジ
{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 60},//内全セーハ
//{x:Guitar1tab_4st.x + 42, y:Guitar1tab_4st.y + 60},//外全セーハ
{x:Guitar1tab_4st.x + 80, y:Guitar1tab_4st.y + 30},//1弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 60},//4弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 70},//5弦ネックマーク
{x:Guitar1tab_4st.x + 80, y:Guitar1tab_4st.y + 80},//6弦ネックマーク


const Guitar2_notes4_1 = [
{x:Guitar1tab_4st.x + 100 + 10, y:Guitar1tab_4st.y + 80},
  new VF.StaveNote({ keys: ["g/3", "d/4", "g/4", "d/5"], duration: "8" }),
{x:Guitar1tab_4st.x + 100 + 15, y:Guitar1tab_4st.y + 90},
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
{x:Guitar1tab_4st.x + 100 + 30, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 100 + 45, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 100 + 42, y:Guitar1tab_4st.y + 70},//5弦外ポジ
{x:Guitar1tab_4st.x + 100 + 10, y:Guitar1tab_4st.y + 60},//内全セーハ
{x:Guitar1tab_4st.x + 100 + 80, y:Guitar1tab_4st.y + 30},//1弦ネックマーク
{x:Guitar1tab_4st.x + 100 + 80, y:Guitar1tab_4st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st4_option);


  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
var Guitar2_st1_option = {
  new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
    textContent: [""], // 必須文字列
  new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
    strID: "Guitar2_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar2_1st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st1_option);


  new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
var Guitar2_st2_option = {
  new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
    textContent: [""], // 必須文字列
  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
    strID: "Guitar2_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar2_2st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st2_option);


  new VF.StaveNote({ keys: ["d/5"], duration: "8" }),
var Guitar2_st3_option = {
  new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
    textContent: ["\uFF88", "\uFF87", "\uFF87"], // 必須文字列
  new VF.StaveNote({ keys: ["d/5"], duration: "16" }),
    strID: "Guitar2_st3", // 必須
];
    Stave_x_Offset: 0,
const Guitar2_notes4_2 = [
    Stave_y_Offset: 0,
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    fontSize: 40,
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    shift_x: shiftGuitar2_3st,
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st3_option);


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
var Guitar2tab_st1_option = {
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    textContent: ["\uFFAF", "3", "2", "1", ":", ":", "/", "/", "/", "/"], // 必須文字列
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    strID: "Guitar2tab_st1", // 必須
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_1st.x + 10, y:Guitar2tab_1st.y + 80},
{x:Guitar2tab_1st.x + 15, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 30, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 45, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 27, y:Guitar2tab_1st.y + 70},//4弦中ポジ
{x:Guitar2tab_1st.x + 27, y:Guitar2tab_1st.y + 60},//5弦中ポジ
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 30},//1弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 40},//2弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 50},//3弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st1_option);


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
var Guitar2tab_st2_option = {
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    textContent: ["\uFF03", "5", "4", "3", ":", ":", ":", "["], // 必須文字列
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    strID: "Guitar2tab_st2", // 必須
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 80},
{x:Guitar2tab_2st.x + 15, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 30, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 45, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 27, y:Guitar2tab_2st.y + 50},//3弦中ポジ
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 60},//4弦内ポジ
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 70},//5弦内ポジ
{x:Guitar2tab_2st.x + 42, y:Guitar2tab_2st.y + 80},//外全セーハ
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 40},//2弦ネックマーク
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 50},//3弦ネックマーク
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st2_option);


];
var Guitar2tab_st3_option = {
const Guitar2_St4_beam1_1 = new VF.Beam([Guitar2_notes4_1[0], Guitar2_notes4_1[1]]);
    textContent: ["\uFF03", "5", "4", "3", ":", "_", "?", "?"], // 必須文字列
const Guitar2_St4_beam1_2 = new VF.Beam([Guitar2_notes4_1[2], Guitar2_notes4_1[3], Guitar2_notes4_1[4]]);
    strID: "Guitar2tab_st3", // 必須
const Guitar2_St4_beam1_3 = new VF.Beam([Guitar2_notes4_1[5], Guitar2_notes4_1[6], Guitar2_notes4_1[7]]);
    Stave_x_Offset: 0,
const Guitar2_St4_beam1_4 = new VF.Beam([Guitar2_notes4_1[8], Guitar2_notes4_1[9], Guitar2_notes4_1[10]]);
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 80},
{x:Guitar2tab_3st.x + 15, y:Guitar2tab_3st.y + 90},
{x:Guitar2tab_3st.x + 30, y:Guitar2tab_3st.y + 90},
{x:Guitar2tab_3st.x + 45, y:Guitar2tab_3st.y + 90},
//{x:Guitar2tab_3st.x + 27, y:Guitar2tab_3st.y + 50},//3弦中ポジ
//{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 60},//4弦内ポジ
{x:Guitar2tab_3st.x + 42, y:Guitar2tab_3st.y + 70},//5弦外ポジ
{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 60},//内全セーハ
//{x:Guitar2tab_3st.x + 42, y:Guitar2tab_3st.y + 60},//外全セーハ
{x:Guitar2tab_3st.x + 80, y:Guitar2tab_3st.y + 30},//1弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 40},//2弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 50},//3弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 60},//4弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 70},//5弦ネックマーク
{x:Guitar2tab_3st.x + 80, y:Guitar2tab_3st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st3_option);


UniqueIds = getUniqueNoteheadIds(Guitar2_notes4_1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
var EGuitar2Text_options = {
allUniqueIds = updateAllUniqueIds(UniqueIds);
    textContent: ["E.Guitar2"], // 必須文字列
    strID: "EGuitar2Text", // 必須
    Stave_x: Guitar2Inst.x,
    Stave_y: Guitar2Inst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(EGuitar2Text_options);


var Guitar2_St4_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var EGuitar2Tab_options = {
Guitar2_St4_1Voice.setStrict(true);
    textContent: ["@"], // 必須文字列
Guitar2_St4_1Voice.addTickables(Guitar2_notes4_1);
    strID: "EGuitar2Tab", // 必須
 
    Stave_x: Guitar2Tab1.x,
var Guitar2_St4_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
    Stave_y: Guitar2Tab1.y,
Guitar2_St4_2Voice.setStrict(true);
    Stave_x_Offset: 10,
Guitar2_St4_2Voice.addTickables(Guitar2_notes4_2);
    Stave_y_Offset: 80,
 
    fontFamily: "YonetMuFL, Arial",
var formatterGuitar2_St4_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_St4_2Voice, Guitar2_St4_1Voice]);
};
formatterGuitar2_St4_1.format([Guitar2_St4_2Voice, Guitar2_St4_1Voice], nStaveWidth - 10 - 10);
insertTextToSVG(EGuitar2Tab_options);
Guitar2_St4_1Voice.draw(ctx, Guitar2_St4);
Guitar2_St4_2Voice.draw(ctx, Guitar2_St4);
 
Guitar2_St4_beam1_1.setContext(ctx).draw();
Guitar2_St4_beam1_2.setContext(ctx).draw();
Guitar2_St4_beam1_3.setContext(ctx).draw();
Guitar2_St4_beam1_4.setContext(ctx).draw();
 
shiftGuitar2_St4 = addShift(
  Guitar2_notes4_1,  
  [0, 1, 2, 3, 4, 6, 7, 8, 9, 10],
  [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
);


var BaseText_options = {
    textContent: ["Base"], // 必須文字列
    strID: "BaseText", // 必須
    Stave_x: BaseInst.x,
    Stave_y: BaseInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(BaseText_options);


var BaseTab_options = {
    textContent: ["@"], // 必須文字列
    strID: "BaseTab", // 必須
    Stave_x: BaseTab1.x,
    Stave_y: BaseTab1.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 90,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(BaseTab_options);
insertBaseEndBarPathToSVG(StaveBase1);
insertBaseEndBarPathToSVG(StaveBase2);
insertBaseEndBarPathToSVG(StaveBase3);
insertBaseEndBarPathToSVG(StaveBase4);


var DrumText_options = {
    textContent: ["Drum"], // 必須文字列
    strID: "DrumText", // 必須
    Stave_x: DrumInst.x,
    Stave_y: DrumInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(DrumText_options);


const Guitar2_Tab1_1 = new Stave(Guitar2_St1.x + nHeadMargin + 20, Guitar2_St1.y + 120, 0).setContext(ctx);
var PercText_options = {
Guitar2_Tab1_1.setBegBarType(VF.Barline.type.NONE);
    textContent: ["Perc."], // 必須文字列
Guitar2_Tab1_1.setEndBarType(VF.Barline.type.NONE);
    strID: "PercText", // 必須
Guitar2_Tab1_1.draw();
    Stave_x: PercInst.x,
const Guitar2_Tab1 = new Stave(Guitar2_St1.x, Guitar2_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
    Stave_y: PercInst.y,
Guitar2_Tab1.draw();
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(PercText_options);


const Guitar2_tab_notes1_1 = [
if(allUniqueIds !== "undefined"){
  dotted(new VF.StaveNote({ keys: ["b/4"], duration: "8d" })),
// 透明にするIDの配列
   new VF.StaveNote({ keys: ["b/4"], duration: "16" }),
// 例としてここでIDを指定
 
let autoUniqueIds = allUniqueIds.map(id => "vf-" + id);
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
let Last_Stem_x = 0;
  new VF.StaveNote({ keys: ["b/4"], duration: "16" }),
// 各IDに対して処理
  new VF.StaveNote({ keys: ["b/4"], duration: "16" }),
   autoUniqueIds.forEach(id => {
    // 該当するIDの要素を取得
    let element = svgElement.getElementById(id);
    if (element) {
      let classValue = element.getAttribute("class");
      // 該当する要素があれば、描画内容を透明にする
      let paths = element.querySelectorAll("path");
      paths.forEach(path => {
          var dAttribute = path.getAttribute('d');
          // カンマで区切られた数値の数を数えます
          var numberOfValues = (dAttribute.match(/,/g) || []).length + 1; // カンマの数 + 1 = 数値の数


  new VF.StaveNote({ keys: ["b/4"], duration: "16" }),
          if (numberOfValues === 9) {
  new VF.StaveNote({ keys: ["b/4"], duration: "16" }),
            var firstCoord = dAttribute.split(',')[0];
  new VF.StaveNote({ keys: ["b/4"], duration: "16" }),
            if (dAttribute.startsWith('M')) {
  new VF.StaveNote({ keys: ["b/4"], duration: "16" }),
              var CnumberOfValues = (dAttribute.match(/C/g) || []).length; // カンマの数 + 1 = 数値の数
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(CnumberOfValues > 0){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var xdiff = coords[0] - coords[2]; // xの差を計算
                var ydiff = coords[1] - coords[3]; // yの差を計算


  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
                if (coords[0] - Last_Stem_x > 2){
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
                  if (coords[0] - Last_Stem_x < 10){
];
                    path.setAttribute("fill", "none");
const Guitar2_tab_notes1_2 = [
                    path.setAttribute("stroke", "none");
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                  }
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                }  
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                // xが0でyが0より大きい場合、描画内容を透明にします
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                if (xdiff <= -3.590) {
 
                if (xdiff >= -3.599) {
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                  if(ydiff === 0){
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                    path.setAttribute("fill", "none");
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                    path.setAttribute("stroke", "none");
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                  }
 
                }
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                }
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                if (xdiff <= -2.369) {
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                if (xdiff >= -2.374) {
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                  if(ydiff === 0){
 
                    path.setAttribute("fill", "none");
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                    path.setAttribute("stroke", "none");
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                  }
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                }
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
                }
                if (xdiff <= 1.000) {
                if (xdiff >= -1.000) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                else {
                  if(ydiff === 1.123){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
              }
            }
          }
          else if (numberOfValues === 23) {
            if (dAttribute.startsWith('M')) {
              var MnumberOfValues = (dAttribute.match(/M/g) || []).length; // カンマの数 + 1 = 数値の数
              var CnumberOfValues = (dAttribute.match(/C/g) || []).length; // カンマの数 + 1 = 数値の数
              var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
              if (MnumberOfValues == 2){
              if (CnumberOfValues == 11){
                path.setAttribute("fill", "none");
                path.setAttribute("stroke", "none");
              }
              }
            }
          }
          else if (numberOfValues === 1) {
            if (dAttribute.startsWith('M')) {
              var AnumberOfValues = (dAttribute.match(/A/g) || []).length; // カンマの数 + 1 = 数値の数
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(AnumberOfValues == 2){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var circle_right = coords[0]; // xの差を計算
                var r_x = coords[2]; // xの差を計算
                var r_y = coords[3]; // xの差を計算
                var circle_left = coords[7]; // yの差を計算


];
                if (circle_right - Last_Stem_x > 7){//7.75
const Guitar2_tab_St1_beam1_1 = new VF.Beam([Guitar2_tab_notes1_1[0], Guitar2_tab_notes1_1[1]]);
                  if (circle_right - Last_Stem_x < 8){
const Guitar2_tab_St1_beam1_2 = new VF.Beam([Guitar2_tab_notes1_1[2], Guitar2_tab_notes1_1[3], Guitar2_tab_notes1_1[4]]);
                  if (circle_left - Last_Stem_x > 3){//3.75
const Guitar2_tab_St1_beam1_3 = new VF.Beam([Guitar2_tab_notes1_1[5], Guitar2_tab_notes1_1[6], Guitar2_tab_notes1_1[7], Guitar2_tab_notes1_1[8]]);
                  if (circle_left - Last_Stem_x < 4){
const Guitar2_tab_St1_beam1_4 = new VF.Beam([Guitar2_tab_notes1_1[9], Guitar2_tab_notes1_1[10]]);
                  if (r_x == 2){
 
                  if (r_y == 2){
UniqueIds = getUniqueNoteheadIds(Guitar2_tab_notes1_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
                    path.setAttribute("fill", "none");
allUniqueIds = updateAllUniqueIds(UniqueIds);
                    path.setAttribute("stroke", "none");
 
                  }
var Guitar2_tab_St1_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
                  }
Guitar2_tab_St1_1Voice.setStrict(true);
                  }
Guitar2_tab_St1_1Voice.addTickables(Guitar2_tab_notes1_1);
                  }
 
                  }
var Guitar2_tab_St1_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
                }
Guitar2_tab_St1_2Voice.setStrict(true);
              }
Guitar2_tab_St1_2Voice.addTickables(Guitar2_tab_notes1_2);
            }
 
            if (classValue === "vf-stem"){
var formatterGuitar2_tab_St1_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_tab_St1_2Voice, Guitar2_tab_St1_1Voice]);
              var firstStemCoord = dAttribute;
formatterGuitar2_tab_St1_1.format([Guitar2_tab_St1_2Voice, Guitar2_tab_St1_1Voice], nStaveWidth - 40 - 10);
              if (dAttribute.startsWith('M')) {
Guitar2_tab_St1_1Voice.draw(ctx, Guitar2_Tab1_1);
                var StemLnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
Guitar2_tab_St1_2Voice.draw(ctx, Guitar2_Tab1_1);
                  // 座標の差を計算します
 
                if(StemLnumberOfValues > 0){
Guitar2_tab_St1_beam1_1.setContext(ctx).draw();
                  var stem_coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
Guitar2_tab_St1_beam1_2.setContext(ctx).draw();
                  Last_Stem_x = stem_coords[0]; // xの差を計算
Guitar2_tab_St1_beam1_3.setContext(ctx).draw();
                }
Guitar2_tab_St1_beam1_4.setContext(ctx).draw();
              }
 
            }
shiftGuitar2_Tab1 = addShift(
            var firstCoord = dAttribute;
  Guitar2_tab_notes1_1,
            if (dAttribute.startsWith('M')) {
  [0, 1, 2, 3, 4, 6, 7, 8, 9, 10],
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
  [3, 3, 3, 3, 3, 3, 3, 3, 3,  3]
                // 座標の差を計算します
);
              if(LnumberOfValues > 0){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var xdiff = coords[0] - coords[2]; // xの差を計算
                var ydiff = coords[1] - coords[3]; // yの差を計算


                // xが0でyが0より大きい場合、描画内容を透明にします
                if (xdiff < -10) {
                if (xdiff > -20) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
              }
            }
          }
          else if (numberOfValues === 21 || numberOfValues === 35 || numberOfValues === 95 || numberOfValues === 41) {
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
          }
      });
    }
  });
}


Guitar2Tab1.x = Guitar2_Tab1.x;
if(allFlagUniqueIds !== "undefined"){
Guitar2Tab1.y = Guitar2_Tab1.y;
  let autoFlagUniqueIds = allFlagUniqueIds.map(id => "vf-" + id);
  autoFlagUniqueIds.forEach(id => {
    // 該当するIDの要素を取得
    let element = svgElement.getElementById(id);
    if (element) {
      // 該当する要素があれば、描画内容を透明にする
      let flagpaths = element.querySelectorAll('path');
      flagpaths.forEach(path => {
        var dAttribute = path.getAttribute('d');
        // カンマで区切られた数値の数を数えます
        var numberOfValues = (dAttribute.match(/,/g) || []).length + 1; // カンマの数 + 1 = 数値の数


const Guitar2_Tab2 = new Stave(Guitar2_Tab1.width + Guitar2_Tab1.x, Guitar2_Tab1.y, nStaveWidth).setContext(ctx);
        // 数値の数が23であれば、このpath要素は求めるものです
Guitar2_Tab2.draw();
        if (numberOfValues === 23) {
 
          path.setAttribute("fill", "none");
const Guitar2_Tab2_1 = new Stave(Guitar2_Tab1.width + Guitar2_Tab1.x + 45, Guitar2_Tab1.y, 0).setContext(ctx);
          path.setAttribute("stroke", "none");
Guitar2_Tab2_1.setBegBarType(VF.Barline.type.NONE);
        }
Guitar2_Tab2_1.setEndBarType(VF.Barline.type.NONE);
      });
Guitar2_Tab2_1.draw();
    }
  });
}
})();
</yjavascript>


const Guitar2_tab_notes2_1 = [
  dotted(new VF.StaveNote({ keys: ["b/4"], duration: "8d", stem_direction: -1 })),
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }),
 コードは以下のとおりです。
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }),
<syntaxhighlight lang="javascript" line start="1" highlight="521-532, 555, 556, 579-583, 590-601, 624, 625, 648-652, 659-670, 693, 694, 717-721, 729-741, 764, 765, 790-794, 875-877, 900, 901, 916-920, 925-928, 951, 952, 967-971, 982-986, 1009, 1010, 1025-1029, 1294-1304, 1308-1318, 1322-1332, 1336-1346, 1352, 1357-1378, 1380-1402, 1404-1430, 1432-1467, 1469-1479, 1481-1491, 1493-1503, 1506-1527, 1529-1551, 1553-1579">
  new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }),
<div id="yonet202403Mid_Output01"></div>
];
<script>
const Guitar2_tab_notes2_2 = [
///////////////////////
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
(function(){
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
class Position {
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   constructor(x = 0, y = 0) {
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    this.x = x;
    this.y = y;
   }
}
var VF = Vex.Flow;
const Vocal = new Position();
const Guitar1Inst = new Position();


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar1tab_1st = new Position();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar1tab_2st = new Position();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar1tab_3st = new Position();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar1tab_4st = new Position();


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar2Inst = new Position();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar2Tab1 = new Position();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar2tab_1st = new Position();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar2tab_2st = new Position();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar2tab_3st = new Position();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
const Guitar2tab_4st = new Position();


];
const Guitar2_tab_St2_beam1_1 = new VF.Beam([Guitar2_tab_notes2_1[0], Guitar2_tab_notes2_1[1]]);
const Guitar2_tab_St2_beam1_2 = new VF.Beam([Guitar2_tab_notes2_1[2], Guitar2_tab_notes2_1[3], Guitar2_tab_notes2_1[4]]);
const Guitar2_tab_St2_beam1_3 = new VF.Beam([Guitar2_tab_notes2_1[5], Guitar2_tab_notes2_1[6], Guitar2_tab_notes2_1[7], Guitar2_tab_notes2_1[8]]);
const Guitar2_tab_St2_beam1_4 = new VF.Beam([Guitar2_tab_notes2_1[9], Guitar2_tab_notes2_1[10]]);


UniqueIds = getUniqueNoteheadIds(Guitar2_tab_notes2_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
const BaseInst = new Position();
allUniqueIds = updateAllUniqueIds(UniqueIds);
const BaseTab1 = new Position();
const DrumInst = new Position();
const PercInst = new Position();
const Stave9Pos = new Position();


var Guitar2_tab_St2_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
var StaveBase1;
Guitar2_tab_St2_1Voice.setStrict(true);
var StaveBase2;
Guitar2_tab_St2_1Voice.addTickables(Guitar2_tab_notes2_1);
var StaveBase3;
var StaveBase4;


var Guitar2_tab_St2_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
const Perc_note1_1_0 = new Position();
Guitar2_tab_St2_2Voice.setStrict(true);
Guitar2_tab_St2_2Voice.addTickables(Guitar2_tab_notes2_2);


var formatterGuitar2_tab_St2_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_tab_St2_2Voice, Guitar2_tab_St2_1Voice]);
var shiftGuitar1_1;
formatterGuitar2_tab_St2_1.format([Guitar2_tab_St2_2Voice, Guitar2_tab_St2_1Voice], nStaveWidth - 40 - 10);
var shiftGuitar1_tab4_tr;
Guitar2_tab_St2_1Voice.draw(ctx, Guitar2_Tab2_1);
Guitar2_tab_St2_2Voice.draw(ctx, Guitar2_Tab2_1);


Guitar2_tab_St2_beam1_1.setContext(ctx).draw();
var shiftGuitar1_1st;
Guitar2_tab_St2_beam1_2.setContext(ctx).draw();
var shiftGuitar1_2st;
Guitar2_tab_St2_beam1_3.setContext(ctx).draw();
var shiftGuitar1_3st;
Guitar2_tab_St2_beam1_4.setContext(ctx).draw();
var shiftGuitar1_4st;


shiftGuitar2_Tab2 = addShift(
var shiftGuitar1tab_1st;
  Guitar2_tab_notes2_1,
var shiftGuitar1tab_2st;
  [0, 1, 2, 3, 4, 6, 7, 8, 9, 10],
var shiftGuitar1tab_3st;
  [2, 2, 2, 2, 2, 2, 2, 2, 2,  2]
var shiftGuitar1tab_4st;
);


var shiftGuitar2_1st;
var shiftGuitar2_2st;
var shiftGuitar2_3st;
var shiftGuitar2_4st;


var shiftGuitar2tab_1st;
var shiftGuitar2tab_2st;
var shiftGuitar2tab_3st;
var shiftGuitar2tab_4st;


var shiftDrum1;
var shiftPerc1;


const Guitar2_Tab3 = new Stave(Guitar2_Tab2.width + Guitar2_Tab2.x, Guitar2_Tab2.y, nStaveWidth).setContext(ctx);
function insertBaseEndBarPathToSVG(Stave) {
Guitar2_Tab3.draw();
  var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
  newGroup.setAttribute('transform', 'translate(0, 0)');
  var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  var pathStr = 'M ' + (Stave.x + Stave.width) + ' ' + (Stave.y + 50) +
    ' L ' + (Stave.x + Stave.width) + ' ' + (Stave.y + 80);
  path.setAttribute('d', pathStr);
  path.setAttribute('stroke', 'black');
  path.setAttribute('stroke-width', '1');
  path.setAttribute('fill', 'none');
  newGroup.appendChild(path);
  svgElement.appendChild(newGroup);
}


const Guitar2_tab_notes3_1 = [
function insertTiePathToSVG(StartPos, EndPos, Direction = 1, Depth = 10) {
   new VF.StaveNote({ keys: ["b/5"], duration: "8" }),
   var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
   new VF.StaveNote({ keys: ["b/5"], duration: "8" }),
  newGroup.setAttribute('transform', 'translate(0, 0)');
   var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  var pathStr = 'M' + (StartPos.x) + ' ' + (StartPos.y) + 'Q' + (StartPos.x + (EndPos.x - StartPos.x)/2) + ' ' + ((StartPos.y + EndPos.y)/2 + Direction * (Depth - 2)) +
    ',' + (EndPos.x) + ' ' + (EndPos.y) + 'Q' + ((StartPos.x + EndPos.x)/2) + ' ' + (StartPos.y + (EndPos.y - StartPos.y)/2 + Direction * (Depth + 2)) +
    ','  + (StartPos.x) + ' ' + (StartPos.y) + 'Z';
  path.setAttribute('d', pathStr);
  path.setAttribute('stroke', 'none');
  path.setAttribute('stroke-width', '1');
  path.setAttribute('fill', 'black');
  newGroup.appendChild(path);
  svgElement.appendChild(newGroup);
}


  new VF.StaveNote({ keys: ["b/5"], duration: "8" }),
function insertArrowPathToSVG(StartPos, EndPos) {
   new VF.StaveNote({ keys: ["b/5"], duration: "16" }),
   var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
   new VF.StaveNote({ keys: ["b/5"], duration: "16" }),
   newGroup.setAttribute('transform', 'translate(0, 0)');
 
   var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  new VF.StaveNote({ keys: ["b/5"], duration: "16" }),
   new VF.StaveNote({ keys: ["b/5"], duration: "16" }),
  new VF.StaveNote({ keys: ["b/5"], duration: "8" }),


   new VF.StaveNote({ keys: ["b/5"], duration: "8" }),
   var arrowLength = 10;
   new VF.StaveNote({ keys: ["b/5"], duration: "8" }),
   var angle = Math.atan2(EndPos.y - StartPos.y, EndPos.x - StartPos.x);
];
   var arrowAngle = 20 * (Math.PI / 180);
const Guitar2_tab_notes3_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   // 矢印のポイント1を計算
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  var arrowX1 = EndPos.x - arrowLength * Math.cos(angle - arrowAngle);
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   var arrowY1 = EndPos.y - arrowLength * Math.sin(angle - arrowAngle);
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   
  // 矢印のポイント2を計算
   var arrowX2 = EndPos.x - arrowLength * Math.cos(angle + arrowAngle);
   var arrowY2 = EndPos.y - arrowLength * Math.sin(angle + arrowAngle);


   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   var pathStr = "M " + StartPos.x + " " + StartPos.y + " L " + EndPos.x + " " + EndPos.y + " M " + EndPos.x + " " + EndPos.y + " L " + arrowX1 + " " + arrowY1 + " M " + EndPos.x + " " + EndPos.y + " L " + arrowX2 + " " + arrowY2;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   path.setAttribute('d', pathStr);
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  path.setAttribute('stroke', 'black');
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   path.setAttribute('stroke-width', '1');
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  path.setAttribute('fill', 'none');
   newGroup.appendChild(path);
   svgElement.appendChild(newGroup);
}


];
const Guitar2_tab_St3_beam1_1 = new VF.Beam([Guitar2_tab_notes3_1[0], Guitar2_tab_notes3_1[1]]);
const Guitar2_tab_St3_beam1_2 = new VF.Beam([Guitar2_tab_notes3_1[2], Guitar2_tab_notes3_1[3], Guitar2_tab_notes3_1[4]]);
const Guitar2_tab_St3_beam1_3 = new VF.Beam([Guitar2_tab_notes3_1[5], Guitar2_tab_notes3_1[6], Guitar2_tab_notes3_1[7]]);
const Guitar2_tab_St3_beam1_4 = new VF.Beam([Guitar2_tab_notes3_1[8], Guitar2_tab_notes3_1[9]]);


UniqueIds = getUniqueNoteheadIds(Guitar2_tab_notes3_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
function insertTrilPathToSVG(Shift, Direction = 1) {
allUniqueIds = updateAllUniqueIds(UniqueIds);
  var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
 
  newGroup.setAttribute('transform', 'translate(0, 0)');
var Guitar2_tab_St3_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
  var DirectionOffset = 0;
Guitar2_tab_St3_1Voice.setStrict(true);
  if (Direction == -1) DirectionOffset = 60;
Guitar2_tab_St3_1Voice.addTickables(Guitar2_tab_notes3_1);
  var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
 
  var pathStr = 'M ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset) +
var Guitar2_tab_St3_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 40 + DirectionOffset) +
Guitar2_tab_St3_2Voice.setStrict(true);
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 36 + DirectionOffset) +
Guitar2_tab_St3_2Voice.addTickables(Guitar2_tab_notes3_2);
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 36 + DirectionOffset) +
 
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset);
var formatterGuitar2_tab_St3_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_tab_St3_2Voice, Guitar2_tab_St3_1Voice]);
  path.setAttribute('d', pathStr);
formatterGuitar2_tab_St3_1.format([Guitar2_tab_St3_2Voice, Guitar2_tab_St3_1Voice], nStaveWidth - 10);
  path.setAttribute('stroke', 'none');
Guitar2_tab_St3_1Voice.draw(ctx, Guitar2_Tab3);
  path.setAttribute('stroke-width', '1');
Guitar2_tab_St3_2Voice.draw(ctx, Guitar2_Tab3);
  path.setAttribute('fill', 'black');
 
  var path2 = document.createElementNS('http://www.w3.org/2000/svg', 'path');
Guitar2_tab_St3_beam1_1.setContext(ctx).draw();
  var pathStr2 = 'M ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset + Direction * 7) +
Guitar2_tab_St3_beam1_2.setContext(ctx).draw();
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 40 + DirectionOffset + Direction * 7) +
Guitar2_tab_St3_beam1_3.setContext(ctx).draw();
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 36 + DirectionOffset + Direction * 7) +
Guitar2_tab_St3_beam1_4.setContext(ctx).draw();
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 36 + DirectionOffset + Direction * 7) +
 
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset + Direction * 7);
shiftGuitar2_Tab3 = addShift(
  path2.setAttribute('d', pathStr2);
  Guitar2_tab_notes3_1,
  path2.setAttribute('stroke', 'none');
  [ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
  path2.setAttribute('stroke-width', '1');
  [-1, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
   path2.setAttribute('fill', 'black');
);
   var path3 = document.createElementNS('http://www.w3.org/2000/svg', 'path');
 
   var pathStr3 = 'M ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset + Direction * 14) +
 
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 40 + DirectionOffset + Direction * 14) +
 
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 36 + DirectionOffset + Direction * 14) +
const Guitar2_Tab4 = new Stave(Guitar2_Tab3.width + Guitar2_Tab3.x, Guitar2_Tab3.y, nStaveWidth).setContext(ctx);
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 36 + DirectionOffset + Direction * 14) +
Guitar2_Tab4.draw();
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset + Direction * 14);
 
   path3.setAttribute('d', pathStr3);
const Guitar2_tab_notes4_1 = [
   path3.setAttribute('stroke', 'none');
   new VF.StaveNote({ keys: ["g/5"], duration: "8" }),
   path3.setAttribute('stroke-width', '1');
   new VF.StaveNote({ keys: ["g/5"], duration: "8" }),
   path3.setAttribute('fill', 'black');
 
   newGroup.appendChild(path);
   new VF.StaveNote({ keys: ["g/5"], duration: "8" }),
   newGroup.appendChild(path2);
  new VF.StaveNote({ keys: ["g/5"], duration: "16" }),
   newGroup.appendChild(path3);
  new VF.StaveNote({ keys: ["g/5"], duration: "16" }),
   svgElement.appendChild(newGroup);
 
}
  new VF.StaveNote({ keys: ["g/5"], duration: "16" }),
  new VF.StaveNote({ keys: ["g/5"], duration: "16" }),
   new VF.StaveNote({ keys: ["g/5"], duration: "8" }),
 
   new VF.StaveNote({ keys: ["g/5"], duration: "8" }),
   new VF.StaveNote({ keys: ["g/5"], duration: "16" }),
   new VF.StaveNote({ keys: ["g/5"], duration: "16" }),
];
const Guitar2_tab_notes4_2 = [
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
function insertTextToSVG(options) {
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    var textContent = options.textContent;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    var strID = options.strID;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    var Stave_x = options.Stave_x || 0;
 
    var Stave_y = options.Stave_y || 0;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    var isOffset_x_abs = options.IsOffset_x_Abs || false;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    var Stave_x_Offset = options.Stave_x_Offset || 0;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    var Stave_y_Offset = options.Stave_y_Offset || 0;
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
    var StaveWidth = options.StaveWidth || 0;
 
    var StaveHeight = options.StaveHeight || 0;
];
    var StaveVerticalScale = options.StaveVerticalScale || 0;
const Guitar2_tab_St4_beam1_1 = new VF.Beam([Guitar2_tab_notes4_1[0], Guitar2_tab_notes4_1[1]]);
    var fontSize = options.fontSize || 40;
const Guitar2_tab_St4_beam1_2 = new VF.Beam([Guitar2_tab_notes4_1[2], Guitar2_tab_notes4_1[3], Guitar2_tab_notes4_1[4]]);
    var fontFamily = options.fontFamily || "Bravura, Arial";
const Guitar2_tab_St4_beam1_3 = new VF.Beam([Guitar2_tab_notes4_1[5], Guitar2_tab_notes4_1[6], Guitar2_tab_notes4_1[7]]);
    var shift_x = options.shift_x || [0];
const Guitar2_tab_St4_beam1_4 = new VF.Beam([Guitar2_tab_notes4_1[8], Guitar2_tab_notes4_1[9], Guitar2_tab_notes4_1[10]]);
    var Rotate = options.Rotate || 0;
 
    var offset_sum = 0;
UniqueIds = getUniqueNoteheadIds(Guitar2_tab_notes4_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
    var Stave_x_Offset_Value = 0;
allUniqueIds = updateAllUniqueIds(UniqueIds);
    var Stave_y_Offset_Value = 0;
 
    var last_Stave_x_Offset = 0;
var Guitar2_tab_St4_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
    var last_Stave_y_Offset = 0;
Guitar2_tab_St4_1Voice.setStrict(true);
    var last_textContent = "";
Guitar2_tab_St4_1Voice.addTickables(Guitar2_tab_notes4_1);
    shift_x.forEach(function(offset, index) {
 
        offset_sum = offset_sum + offset;
var Guitar2_tab_St4_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
        var newText = document.createElementNS('http://www.w3.org/2000/svg', 'text');
Guitar2_tab_St4_2Voice.setStrict(true);
        newText.setAttribute('id', strID + '_' + index); // テキスト要素にIDを付ける
Guitar2_tab_St4_2Voice.addTickables(Guitar2_tab_notes4_2);
        newText.setAttribute('x', 0);
        newText.setAttribute('y', 0);
        newText.setAttribute('font-family', fontFamily);
        newText.setAttribute('font-size', fontSize);
        newText.setAttribute('fill', 'black');


var formatterGuitar2_tab_St4_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_tab_St4_2Voice, Guitar2_tab_St4_1Voice]);
        if(typeof textContent === "string"){
formatterGuitar2_tab_St4_1.format([Guitar2_tab_St4_2Voice, Guitar2_tab_St4_1Voice], nStaveWidth - 10 - 10);
          newText.textContent = textContent;
Guitar2_tab_St4_1Voice.draw(ctx, Guitar2_Tab4);
        }
Guitar2_tab_St4_2Voice.draw(ctx, Guitar2_Tab4);
        else{
 
          if(textContent.length - 1 < index){
Guitar2_tab_St4_beam1_1.setContext(ctx).draw();
            newText.textContent = last_textContent;
Guitar2_tab_St4_beam1_2.setContext(ctx).draw();
          }
Guitar2_tab_St4_beam1_3.setContext(ctx).draw();
          else{
Guitar2_tab_St4_beam1_4.setContext(ctx).draw();
            newText.textContent = textContent[index];
 
            last_textContent = textContent[index];
shiftGuitar2_Tab4 = addShift(
          }
  Guitar2_tab_notes4_1,
        }
  [0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
  [0, 1, 2, 3, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2,  2]
);


        if(Stave_x_Offset.length - 1 < index){
          Stave_x_Offset_Value = last_Stave_x_Offset;
        }
        else{
          if(Stave_x_Offset.length >= 2){
            Stave_x_Offset_Value = Stave_x_Offset[index];
            last_Stave_x_Offset = Stave_x_Offset[index];
          }
          else{
            Stave_x_Offset_Value = Stave_x_Offset;
          }
        }


        if(Stave_y_Offset.length - 1 < index){
          Stave_y_Offset_Value = last_Stave_y_Offset;
        }
        else{
          if(Stave_y_Offset.length >= 2){
            Stave_y_Offset_Value = Stave_y_Offset[index];
            last_Stave_y_Offset = Stave_y_Offset[index];
          }
          else{
            Stave_y_Offset_Value = Stave_y_Offset;
          }
        }
        var textGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
        if(Rotate != 0){
          textGroup.setAttribute('transform', 'rotate(' + Rotate + ' ' + 0 + ' ' + 0 + ')');
          textGroup.appendChild(newText);
          svgElement.appendChild(textGroup);
        }
        else{
          svgElement.appendChild(newText);
        }
        (function() {
            var textWidth = newText.getBBox().width;
            var textHeight = newText.getBBox().height;
            var horizontalScale;
            if (typeof StaveWidth === 'undefined' || StaveWidth == 0) {
                horizontalScale = 1;
            }
            else {
                horizontalScale = StaveWidth / textWidth;
            }
            var verticalScale;
            if (typeof StaveHeight === 'undefined' || StaveHeight == 0) {
                verticalScale = 1;
            }
            else if (StaveVerticalScale != 0) {
                verticalScale = StaveVerticalScale;
            }
            else {
                verticalScale = StaveHeight / textHeight;
            }
            if(isOffset_x_abs){
              var StavePos_x = offset.x + Stave_x_Offset_Value;
              var StavePos_y = offset.y + Stave_y_Offset_Value;
            }
            else{
              var StavePos_x = Stave_x + Stave_x_Offset + offset_sum;
              var StavePos_y = Stave_y + Stave_y_Offset;
            }


            newText.setAttribute('transform', 'translate(' + StavePos_x + ',' + StavePos_y + ') scale(' + horizontalScale + ',' + verticalScale + ')');


var Guitar2_connect = new VF.StaveConnector(Guitar2_St1, Guitar2_Tab1);
            if(Rotate != 0){
Guitar2_connect.setType(VF.StaveConnector.type.BRACKET);
              textGroup.setAttribute('transform', 'rotate(' + Rotate + ' ' + StavePos_x + ' ' + StavePos_y + ')');
Guitar2_connect.setContext(ctx);
            }
Guitar2_connect.draw();
        })();
 
const Guitar2_Tab1_tab = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y - 10, nHeadMargin + nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab1_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab1_tab.draw();
 
const Guitar2_Tab2_tab = new Stave(Guitar2_Tab1_tab.width + Guitar2_Tab1_tab.x, Guitar2_Tab1_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab2_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab2_tab.draw();
 
const Guitar2_Tab3_tab = new Stave(Guitar2_Tab2_tab.width + Guitar2_Tab2_tab.x, Guitar2_Tab2_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab3_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab3_tab.draw();
 
const Guitar2_Tab4_tab = new Stave(Guitar2_Tab3_tab.width + Guitar2_Tab3_tab.x, Guitar2_Tab3_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab4_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab4_tab.draw();
 
Guitar2Inst.x = Guitar2_St1.x - 30;
Guitar2Inst.y = Guitar2_St1.y + ((Guitar2_Tab1.y - Guitar2_St1.y) / 2) + 90;  


const Base_St1 = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
        if(Rotate != 0){
Base_St1.addClef("bass").setContext(ctx);
          textGroup.appendChild(newText);
Base_St1.addTimeSignature('4/4').setContext(ctx);
          svgElement.appendChild(textGroup);
Base_St1.addKeySignature('D').setContext(ctx);
        }
Base_St1.draw();
        else{
          svgElement.appendChild(newText);
        }
    });
}


const Base_St2 = new Stave(Base_St1.width + Base_St1.x, Base_St1.y, nStaveWidth).setContext(ctx);
var allUniqueIds = [];
Base_St2.draw();
var allFlagUniqueIds = [];
 
(function(){
const Base_St3 = new Stave(Base_St2.width + Base_St2.x, Base_St2.y, nStaveWidth).setContext(ctx);
function addShift(notes, arrx = [], arry = []) {
Base_St3.draw();
 
  let tempnote;
const Base_St4 = new Stave(Base_St3.width + Base_St3.x, Base_St3.y, nStaveWidth).setContext(ctx);
  let retShift = [];
Base_St4.draw();
 
  for(let i = 0; i < arrx.length || i == 0; i++){
    const pos = new Position();
    //notesのchildrenの各要素について処理
    if(arrx.length === 0){
      tempnote = notes;
    }
    else{
      tempnote = notes[arrx[i]];
      temp_y = arry[i];
    }
    pos.x = tempnote.getAbsoluteX();
    pos.y = tempnote.getStave().getYForLine(temp_y);


const Base_Tab1 = new Stave(Base_St1.x, Base_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
    retShift.push(pos);
Base_Tab1.setEndBarType(VF.Barline.type.NONE);
   }
for (var i = 0; i < 5; i++) {
   return retShift;
   if (i != 0) continue;
   Base_Tab1.setConfigForLine(i, {visible: false} );
}
}
Base_Tab1.draw();


BaseTab1.x = Base_Tab1.x;
var UniqueIds;
BaseTab1.y = Base_Tab1.y;
function getUniqueNoteheadIds(notes, arr = []) {
 
    //すべてのidを格納するためのセットを作成
BaseInst.x = Base_St1.x - 30;
    let tempnote;
BaseInst.y = Base_St1.y + ((Base_Tab1.y - Base_St1.y) / 2) + 90;  
    uniqueIds = new Set();
    for(let i = 0; i < arr.length || i == 0; i++){
    //notesのchildrenの各要素について処理
      if(arr.length === 0){
        tempnote = notes;
      }
      else{
        tempnote = notes[arr[i]];
      }
      if (tempnote.attrs){
        if(tempnote.attrs.type === "StaveNote") {
          uniqueIds.add(tempnote.attrs.id);
        }
      }
      tempnote.children.forEach(child => {
        //typeが"notehead"であるかチェックし、idを取得
        if (child.attrs){
          if(child.attrs.type === "Stem") {
            uniqueIds.add(child.attrs.id);
          }
          if(child.attrs.type === "NoteHead") {
            uniqueIds.add(child.attrs.id);
          }
        }
      });
    }
    // セットを配列に変換して戻り値として返す
    return Array.from(uniqueIds);
}


StaveBase1 = Base_Tab1;
function updateAllUniqueIds(UniqueIds) {
 
    // allUniqueIdsにUniqueIdsを追加または結合
const Base_Tab2 = new Stave(Base_Tab1.width + Base_Tab1.x, Base_Tab1.y, nStaveWidth).setContext(ctx);
    if (allUniqueIds.length === 0) {//allUniqueIdsはグローバルな変数
Base_Tab2.setBegBarType(VF.Barline.type.NONE);
      // allUniqueIdsが空の場合、UniqueIdsをそのままコピー
Base_Tab2.setEndBarType(VF.Barline.type.NONE);
      allUniqueIds = [...UniqueIds];//スプレッド演算子で要素の中身を書き出す。
for (var i = 0; i < 5; i++) {
    } else {
  if (i != 0) continue;
      UniqueIds.forEach(id => {
  Base_Tab2.setConfigForLine(i, {visible: false} );
        if (!allUniqueIds.includes(id)) {
            allUniqueIds.push(id);
        }
      });
    }
    // 更新されたallUniqueIdsを戻り値として返す
    return allUniqueIds;
}
}
Base_Tab2.draw();


StaveBase2 = Base_Tab2;
var SteveNoteUniqueIds;
 
function getUniqueStaveNotesIds(notes, arr = []) {
const Base_Tab3 = new Stave(Base_Tab2.width + Base_Tab2.x, Base_Tab2.y, nStaveWidth).setContext(ctx);
    //すべてのidを格納するためのセットを作成
Base_Tab3.setBegBarType(VF.Barline.type.NONE);
    let tempnote;
Base_Tab3.setEndBarType(VF.Barline.type.NONE);
    uniqueIds = new Set();
for (var i = 0; i < 5; i++) {
    for(let i = 0; i < arr.length || i == 0; i++){
  if (i != 0) continue;
    //notesのchildrenの各要素について処理
  Base_Tab3.setConfigForLine(i, {visible: false} );
      if(arr.length === 0){
        tempnote = notes;
      }
      else{
        tempnote = notes[arr[i]];
      }
      if (tempnote.attrs){
        if(tempnote.attrs.type === "StaveNote") {
          uniqueIds.add(tempnote.attrs.id);
        }
      }
    }
    // セットを配列に変換して戻り値として返す
    return Array.from(uniqueIds);
}
}
Base_Tab3.draw();


StaveBase3 = Base_Tab3;
function updateAllFlagUniqueIds(FlagUniqueIds) {
 
    // allUniqueIdsにUniqueIdsを追加または結合
const Base_Tab4 = new Stave(Base_Tab3.width + Base_Tab3.x, Base_Tab3.y, nStaveWidth).setContext(ctx);
    if (allFlagUniqueIds.length === 0) {
Base_Tab4.setBegBarType(VF.Barline.type.NONE);
      // allUniqueIdsが空の場合、UniqueIdsをそのままコピー
Base_Tab4.setEndBarType(VF.Barline.type.NONE);
      allFlagUniqueIds = [...FlagUniqueIds];//スプレッド演算子で要素の中身を書き出す。
for (var i = 0; i < 5; i++) {
    } else {
  if (i != 0) continue;
      FlagUniqueIds.forEach(id => {
  Base_Tab4.setConfigForLine(i, {visible: false} );
        if (!allFlagUniqueIds.includes(id)) {
            allFlagUniqueIds.push(id);
        }
      });
    }
    // 更新されたallUniqueIdsを戻り値として返す
    return allFlagUniqueIds;
}
}
Base_Tab4.draw();


StaveBase4 = Base_Tab4;
function dotted(staveNote, noteIndex = -1) {
  if (noteIndex < 0) {
    Dot.buildAndAttach([staveNote], {
      all: true
    });
  }
  else {
    for(noteIndexValue of noteIndex){
      Dot.buildAndAttach([staveNote], {
        index: noteIndexValue
      });
    }
  }
  return staveNote;
}


var Base_connect = new VF.StaveConnector(Base_St1, Base_Tab1);
const {
Base_connect.setType(VF.StaveConnector.type.BRACKET);
  Factory,
Base_connect.setContext(ctx);
  Stave,
Base_connect.draw();
  StaveNote,
  Formatter,
  Voice,
  StaveTie,
  BarLine,
  Beam,
  Dot,
  StaveConnector,
  Modifier,
  RenderContext,
  TextDynamics,
  Articulation,
  TextNote,
  Crescendo,
  Renderer
} = Vex.Flow;


const Drum_St1 = new Stave(Base_Tab1.x, Base_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
let nscale = 0.64;
Drum_St1.addClef("bass").setContext(ctx);
let nwidth = 1040;
Drum_St1.addTimeSignature('4/4').setContext(ctx);
let nheight = 1120;
Drum_St1.draw();


DrumInst.x = Drum_St1.x - 30;
let nHeadMargin = 70;
DrumInst.y = Drum_St1.y + 90;  
let nStaveWidth = 350;


const Drum_St1_1 = new Stave(nHeadMargin + Base_Tab1.x, Base_Tab1.y + 120, 0).setContext(ctx);
const f = new Factory({
Drum_St1_1.setBegBarType(VF.Barline.type.NONE);
  renderer: { elementId: 'yonet202403Mid_Output01', width: nwidth, height: nheight * nscale }
Drum_St1_1.setEndBarType(VF.Barline.type.NONE);
  });
Drum_St1_1.draw();
const ctx = f.getContext();
ctx.scale(nscale, nscale);


const Drum_notes1_1 = [
const defaultStyle = {
  new StaveNote({ keys: ["f/4"], duration: "4", stem_direction: -1 }),
   lineWidth: ctx.lineWidth,
   new StaveNote({ keys: ["c/4"], duration: "4r" }),
   strokeStyle: ctx.strokeStyle,
   new StaveNote({ keys: ["c/4"], duration: "8r" }),
};
  new StaveNote({ keys: ["f/4"], duration: "8", stem_direction: -1 }),
  new StaveNote({ keys: ["c/4"], duration: "8r" }),
  new StaveNote({ keys: ["f/4"], duration: "8", stem_direction: -1 })
];
const Drum_beam1_1 = new VF.Beam([Drum_notes1_1[3],Drum_notes1_1[5]]);


var Drum_St1_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
for (let i = 0; i <= nwidth * (1 / nscale); i += 10) {
Drum_St1_1Voice.setStrict(true);
  ctx.beginPath();
Drum_St1_1Voice.addTickables(Drum_notes1_1);
  ctx.moveTo(0 + i, 0);
  ctx.lineTo(0 + i, nheight);
  if (i % 100 === 0){
    ctx.setLineWidth(1);
    ctx.setStrokeStyle('rgba(200, 200, 200, 0.8)');
  }
  else{
    ctx.setLineWidth(0.5);
    ctx.setStrokeStyle('rgba(230, 230, 230, 0.8)');
  }
  ctx.stroke();
}


const Drum_St1_2 = new Stave(nHeadMargin + Base_Tab1.x, Base_Tab1.y + 120, 0).setContext(ctx);
for (let i = 0; i <= nheight; i += 10) {
Drum_St1_2.setBegBarType(VF.Barline.type.NONE);
  ctx.beginPath();
Drum_St1_2.setEndBarType(VF.Barline.type.NONE);
  ctx.moveTo(0, i);
Drum_St1_2.draw();
  ctx.lineTo(nwidth * (1 / nscale), i);
  if (i % 100 === 0){
    ctx.setLineWidth(1);
    ctx.setStrokeStyle('rgba(200, 200, 200, 0.8)');
  }
  else{
    ctx.setLineWidth(0.5);
    ctx.setStrokeStyle('rgba(230, 230, 230, 0.8)');
  }
  ctx.stroke();
}


const Drum_notes1_2 = [
ctx.lineWidth = defaultStyle.lineWidth;
  new VF.StaveNote({ keys: ["g/5"], duration: "8", stem_direction: 1 }),
ctx.strokeStyle = defaultStyle.strokeStyle;
  new VF.StaveNote({ keys: ["g/5"], duration: "8", stem_direction: 1 }),
  new VF.StaveNote({ keys: ["c/5"], duration: "8", stem_direction: 1 }),
  new VF.StaveNote({ keys: ["g/5"], duration: "16", stem_direction: 1 }),
  new VF.StaveNote({ keys: ["c/5"], duration: "16", stem_direction: 1 }),
  new VF.StaveNote({ keys: ["g/5"], duration: "8", stem_direction: 1 }),
  new VF.StaveNote({ keys: ["g/5"], duration: "8", stem_direction: 1 }),
  new VF.StaveNote({ keys: ["c/5"], duration: "8", stem_direction: 1 }),
  new VF.StaveNote({ keys: ["g/5"], duration: "8", stem_direction: 1 })
];


const Drum_notes1_3 = [
const VocalSt1 = new Stave(80, 30, nHeadMargin + nStaveWidth).setContext(ctx);
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
VocalSt1.setClef("treble").setContext(ctx);
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
VocalSt1.setTimeSignature('4/4').setContext(ctx);
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
VocalSt1.addKeySignature('D').setContext(ctx);
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
VocalSt1.setMeasure(1);
VocalSt1.draw();


  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
Vocal.x = VocalSt1.x - 30;
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
Vocal.y = VocalSt1.y + 90;
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),


  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
const VocalSt2 = f.Stave({ x: VocalSt1.width + VocalSt1.x, y: VocalSt1.y, width: nStaveWidth });
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
VocalSt2.setMeasure(2);
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
VocalSt2.setContext(ctx).draw();
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),


  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
const VocalSt3 = new Stave(VocalSt2.width + VocalSt2.x, VocalSt1.y, nStaveWidth).setContext(ctx);
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
VocalSt3.setMeasure(3);
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 }),
VocalSt3.draw();
  new VF.GhostNote({ keys: ["a/5"], duration: "16", stem_direction: 1 })
];


UniqueIds = getUniqueNoteheadIds(Drum_notes1_2, [0, 1, 3, 5, 6, 8]);
const VocalSt4 = new VF.Stave(VocalSt3.width + VocalSt3.x, VocalSt1.y, nStaveWidth).setContext(ctx);
allUniqueIds = updateAllUniqueIds(UniqueIds);
VocalSt4.setMeasure(4);
VocalSt4.draw();


const Drum_beam1_2_1 = new VF.Beam([Drum_notes1_2[0], Drum_notes1_2[1]]);
const Guitar1St1 = new VF.Stave(VocalSt1.x, VocalSt1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
const Drum_beam1_2_2 = new VF.Beam([Drum_notes1_2[2], Drum_notes1_2[3], Drum_notes1_2[4]]);
Guitar1St1.addClef("treble").setContext(ctx);
const Drum_beam1_2_3 = new VF.Beam([Drum_notes1_2[5], Drum_notes1_2[6], Drum_notes1_2[7], Drum_notes1_2[8]]);
Guitar1St1.addTimeSignature('4/4').setContext(ctx);
Guitar1St1.addKeySignature('D').setContext(ctx);
Guitar1St1.draw();


var Drum_St1_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
const Guitar1_St1_notes_1 = [
Drum_St1_2Voice.setStrict(true);
  new VF.StaveNote({ keys: ["b/4"], duration: "4" }),
Drum_St1_2Voice.addTickables(Drum_notes1_2);


var Drum_St1_3Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
Drum_St1_3Voice.setStrict(true);
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
Drum_St1_3Voice.addTickables(Drum_notes1_3);


var formatterDrum_St1_2 = new Vex.Flow.Formatter().joinVoices([Drum_St1_3Voice, Drum_St1_1Voice, Drum_St1_2Voice]);
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
//formatter13_2.formatToStave([stave13_3Voice, stave13_1Voice, stave13_2Voice], stave13_2);
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
formatterDrum_St1_2.format([Drum_St1_3Voice, Drum_St1_1Voice, Drum_St1_2Voice], nStaveWidth - 30);
Drum_St1_1Voice.draw(ctx, Drum_St1_2);
Drum_St1_2Voice.draw(ctx, Drum_St1_2);


Drum_beam1_1.setContext(ctx).draw();
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St1_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),


Drum_beam1_2_1.setContext(ctx).draw();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Drum_beam1_2_2.setContext(ctx).draw();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
Drum_beam1_2_3.setContext(ctx).draw();
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
   new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
shiftDrum1 = addShift(
  Drum_notes1_2,  
   [0, 1, 2, 3, 5, 5, 6, 6, 7, 7, 8, 8],
  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
);


  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
];
UniqueIds = getUniqueNoteheadIds(Guitar1_St1_notes_1, [0, 1, 2, 3, 4, 5, 6]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
const Guitar1_St1_beam_1 = new VF.Beam([Guitar1_St1_notes_1[1], Guitar1_St1_notes_1[2]]);
const Guitar1_St1_beam_2 = new VF.Beam([
  Guitar1_St1_notes_1[3], Guitar1_St1_notes_1[4], Guitar1_St1_notes_1[5], Guitar1_St1_notes_1[6]
  ]);


const Drum_St2 = new Stave(Drum_St1.width + Drum_St1.x, Drum_St1.y, nStaveWidth).setContext(ctx);
var Guitar1_St1_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Drum_St2.draw();
Guitar1_St1_Voice_1.setStrict(true);
Guitar1_St1_Voice_1.addTickables(Guitar1_St1_notes_1);


var Guitar1_St1_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St1_Voice_2.setStrict(true);
Guitar1_St1_Voice_2.addTickables(Guitar1_St1_notes_2);


const Drum_St3 = new Stave(Drum_St2.width + Drum_St2.x, Drum_St1.y, nStaveWidth).setContext(ctx);
var formatterGuitar1_St1 = new VF.Formatter().joinVoices([Guitar1_St1_Voice_1, Guitar1_St1_Voice_2]);
Drum_St3.draw();
formatterGuitar1_St1.format([Guitar1_St1_Voice_1, Guitar1_St1_Voice_2], nStaveWidth - 40 - 10);
Guitar1_St1_Voice_1.draw(ctx, Guitar1St1);
Guitar1_St1_Voice_2.draw(ctx, Guitar1St1);


Guitar1_St1_beam_1.setContext(ctx).draw();
Guitar1_St1_beam_2.setContext(ctx).draw();
shiftGuitar1_1st= addShift(
  Guitar1_St1_notes_1,
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3]
);


const Drum_St4 = new Stave(Drum_St3.width + Drum_St3.x, Drum_St1.y, nStaveWidth).setContext(ctx);
Drum_St4.draw();




const Perc_St1 = new Stave(Drum_St1.x, Drum_St1.y + 100, nHeadMargin + nStaveWidth).setContext(ctx);
const Guitar1St2 = new Stave(Guitar1St1.width + Guitar1St1.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Perc_St1.addTimeSignature('4/4').setContext(ctx);
Guitar1St2.draw();


const Perc_St1_1 = new Stave(nHeadMargin + Drum_St1.x, Drum_St1.y + 100, 0).setContext(ctx);
const Guitar1_St2_notes_1 = [
Perc_St1_1.setBegBarType(VF.Barline.type.NONE);
  new VF.StaveNote({ keys: ["b/4"], duration: "4" }),
Perc_St1_1.setEndBarType(VF.Barline.type.NONE);
Perc_St1_1.draw();


for (var i = 0; i < 5; i++) {
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
   if (i == 2) continue;
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St2_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
];
UniqueIds = getUniqueNoteheadIds(Guitar1_St2_notes_1, [0, 1, 2, 3, 4, 5, 6]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
 
const Guitar1_St2_beam_1 = new VF.Beam([Guitar1_St2_notes_1[1], Guitar1_St2_notes_1[2]]);
const Guitar1_St2_beam_2 = new VF.Beam([
  Guitar1_St2_notes_1[3], Guitar1_St2_notes_1[4], Guitar1_St2_notes_1[5], Guitar1_St2_notes_1[6]
  ]);
 
var Guitar1_St2_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St2_Voice_1.setStrict(true);
Guitar1_St2_Voice_1.addTickables(Guitar1_St2_notes_1);
 
var Guitar1_St2_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St2_Voice_2.setStrict(true);
Guitar1_St2_Voice_2.addTickables(Guitar1_St2_notes_2);
 
var formatterGuitar1_St2 = new VF.Formatter().joinVoices([Guitar1_St2_Voice_1, Guitar1_St2_Voice_2]);
formatterGuitar1_St2.format([Guitar1_St2_Voice_1, Guitar1_St2_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St2_Voice_1.draw(ctx, Guitar1St2);
Guitar1_St2_Voice_2.draw(ctx, Guitar1St2);
 
Guitar1_St2_beam_1.setContext(ctx).draw();
Guitar1_St2_beam_2.setContext(ctx).draw();
 
shiftGuitar1_2st= addShift(
  Guitar1_St2_notes_1,
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3.8]
);
 
 
 
const Guitar1St3 = new Stave(Guitar1St2.width + Guitar1St2.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Guitar1St3.draw();
 
const Guitar1_St3_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "4" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St3_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
];
UniqueIds = getUniqueNoteheadIds(Guitar1_St3_notes_1, [0, 1, 2, 3, 4, 5, 6]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
 
const Guitar1_St3_beam_1 = new VF.Beam([Guitar1_St3_notes_1[1], Guitar1_St3_notes_1[2]]);
const Guitar1_St3_beam_2 = new VF.Beam([
  Guitar1_St3_notes_1[3], Guitar1_St3_notes_1[4], Guitar1_St3_notes_1[5], Guitar1_St3_notes_1[6]
  ]);
 
var Guitar1_St3_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St3_Voice_1.setStrict(true);
Guitar1_St3_Voice_1.addTickables(Guitar1_St3_notes_1);
 
var Guitar1_St3_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St3_Voice_2.setStrict(true);
Guitar1_St3_Voice_2.addTickables(Guitar1_St3_notes_2);
 
var formatterGuitar1_St3 = new VF.Formatter().joinVoices([Guitar1_St3_Voice_1, Guitar1_St3_Voice_2]);
formatterGuitar1_St3.format([Guitar1_St3_Voice_1, Guitar1_St3_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St3_Voice_1.draw(ctx, Guitar1St3);
Guitar1_St3_Voice_2.draw(ctx, Guitar1St3);
 
Guitar1_St3_beam_1.setContext(ctx).draw();
Guitar1_St3_beam_2.setContext(ctx).draw();
 
shiftGuitar1_3st= addShift(
  Guitar1_St3_notes_1,
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3.8]
);
 
 
 
 
const Guitar1St4 = new Stave(Guitar1St3.width + Guitar1St3.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Guitar1St4.draw();
 
const Guitar1_St4_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
 
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St4_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
];
UniqueIds = getUniqueNoteheadIds(Guitar1_St4_notes_1, [0, 1, 2, 3, 4, 5, 6, 7]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
 
const Guitar1_St4_beam_1 = new VF.Beam([
  Guitar1_St4_notes_1[0], Guitar1_St4_notes_1[1], Guitar1_St4_notes_1[2], Guitar1_St4_notes_1[3]
  ]);
const Guitar1_St4_beam_2 = new VF.Beam([
  Guitar1_St4_notes_1[4], Guitar1_St4_notes_1[5], Guitar1_St4_notes_1[6], Guitar1_St4_notes_1[7]
  ]);
 
var Guitar1_St4_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St4_Voice_1.setStrict(true);
Guitar1_St4_Voice_1.addTickables(Guitar1_St4_notes_1);
 
var Guitar1_St4_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St4_Voice_2.setStrict(true);
Guitar1_St4_Voice_2.addTickables(Guitar1_St4_notes_2);
 
var formatterGuitar1_St4 = new VF.Formatter().joinVoices([Guitar1_St4_Voice_1, Guitar1_St4_Voice_2]);
formatterGuitar1_St4.format([Guitar1_St4_Voice_1, Guitar1_St4_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St4_Voice_1.draw(ctx, Guitar1St4);
Guitar1_St4_Voice_2.draw(ctx, Guitar1St4);
 
Guitar1_St4_beam_1.setContext(ctx).draw();
Guitar1_St4_beam_2.setContext(ctx).draw();
 
shiftGuitar1_4st= addShift(
  Guitar1_St4_notes_1,
  [0, 1, 2, 3, 4, 5, 6, 7],
  [3, 3, 3, 3, 3, 3, 3, 3.8]
);
 
 
 
const Guitar1_tab1 = new Stave(Guitar1St1.x, Guitar1St1.y + 110, nHeadMargin + nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar1_tab1.setConfigForLine(i, {visible: false} );
}
Guitar1_tab1.draw();
 
const Guitar1_tab2 = new Stave(Guitar1_tab1.width + Guitar1_tab1.x, Guitar1_tab1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar1_tab2.setConfigForLine(i, {visible: false} );
}
Guitar1_tab2.draw();
 
const Guitar1_tab3 = new Stave(Guitar1_tab2.width + Guitar1_tab2.x, Guitar1_tab1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar1_tab3.setConfigForLine(i, {visible: false} );
}
Guitar1_tab3.draw();
 
const Guitar1_tab4 = new Stave(Guitar1_tab3.width + Guitar1_tab3.x, Guitar1_tab1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar1_tab4.setConfigForLine(i, {visible: false} );
}
Guitar1_tab4.draw();
 
const Guitar1_Tab1 = new Stave(Guitar1St1.x, Guitar1St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar1_Tab1.draw();
 
Stave9Pos.x = Guitar1_Tab1.x;
Stave9Pos.y = Guitar1_Tab1.y;
 
var connector9_2 = new VF.StaveConnector(Guitar1St1, Guitar1_Tab1);
connector9_2.setType(VF.StaveConnector.type.BRACKET);
connector9_2.setContext(ctx);
connector9_2.draw();
 
Guitar1Inst.x = VocalSt1.x - 30;
Guitar1Inst.y = Guitar1St1.y + ((Guitar1_Tab1.y - Guitar1St1.y) / 2) + 90;
 
const Guitar1_Tab1_1 = new Stave(Guitar1_Tab1.x + nHeadMargin + 20, Guitar1_Tab1.y, 0).setContext(ctx);
Guitar1_Tab1_1.setBegBarType(VF.Barline.type.NONE);
Guitar1_Tab1_1.setEndBarType(VF.Barline.type.NONE);
Guitar1_Tab1_1.draw();
 
Guitar1tab_1st.x = Guitar1_Tab1_1.x
Guitar1tab_1st.y = Guitar1_Tab1_1.y
 
 
 
const Guitar1_Tab2 = new Stave(Guitar1_Tab1.width + Guitar1_Tab1.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab2.draw();
 
Guitar1tab_2st.x = Guitar1_Tab2.x
Guitar1tab_2st.y = Guitar1_Tab2.y
 
const Guitar1_Tab3 = new Stave(Guitar1_Tab2.width + Guitar1_Tab2.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab3.draw();
 
Guitar1tab_3st.x = Guitar1_Tab3.x
Guitar1tab_3st.y = Guitar1_Tab3.y
 
const Guitar1_Tab4 = new Stave(Guitar1_Tab3.width + Guitar1_Tab3.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab4.draw();
 
Guitar1tab_4st.x = Guitar1_Tab4.x
Guitar1tab_4st.y = Guitar1_Tab4.y
 
 
const Guitar2_St1 = new Stave(Guitar1_Tab1.x, Guitar1_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar2_St1.addClef("treble").setContext(ctx);
Guitar2_St1.addTimeSignature('4/4').setContext(ctx);
Guitar2_St1.addKeySignature('D').setContext(ctx);
Guitar2_St1.draw();
 
const Guitar2_St1_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "1" }),
];
const Guitar2_St1_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
];
UniqueIds = getUniqueNoteheadIds(Guitar2_St1_notes_1, [0]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
 
var Guitar2_St1_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St1_Voice_1.setStrict(true);
Guitar2_St1_Voice_1.addTickables(Guitar2_St1_notes_1);
 
var Guitar2_St1_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St1_Voice_2.setStrict(true);
Guitar2_St1_Voice_2.addTickables(Guitar2_St1_notes_2);
 
var formatterGuitar2_St1 = new VF.Formatter().joinVoices([Guitar2_St1_Voice_1, Guitar2_St1_Voice_2]);
formatterGuitar2_St1.format([Guitar2_St1_Voice_1, Guitar2_St1_Voice_2], nStaveWidth - 20 - 10);
Guitar2_St1_Voice_1.draw(ctx, Guitar2_St1);
Guitar2_St1_Voice_2.draw(ctx, Guitar2_St1);
 
shiftGuitar2_1st= addShift(
  Guitar2_St1_notes_1,
  [0],
  [3]
);
 
const Guitar2_St2 = new Stave(Guitar2_St1.width + Guitar2_St1.x, Guitar2_St1.y, nStaveWidth).setContext(ctx);
Guitar2_St2.draw();
 
const Guitar2_St2_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "2" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "2" }),
];
const Guitar2_St2_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
];
UniqueIds = getUniqueNoteheadIds(Guitar2_St2_notes_1, [0, 1]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
 
var Guitar2_St2_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St2_Voice_1.setStrict(true);
Guitar2_St2_Voice_1.addTickables(Guitar2_St2_notes_1);
 
var Guitar2_St2_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St2_Voice_2.setStrict(true);
Guitar2_St2_Voice_2.addTickables(Guitar2_St2_notes_2);
 
var formatterGuitar2_St2 = new VF.Formatter().joinVoices([Guitar2_St2_Voice_1, Guitar2_St2_Voice_2]);
formatterGuitar2_St2.format([Guitar2_St2_Voice_1, Guitar2_St2_Voice_2], nStaveWidth - 20 - 10);
Guitar2_St2_Voice_1.draw(ctx, Guitar2_St2);
Guitar2_St2_Voice_2.draw(ctx, Guitar2_St2);
 
shiftGuitar2_2st= addShift(
  Guitar2_St2_notes_1,
  [0, 1],
  [3, 3]
);
 
const Guitar2_St2_1 = new Stave(Guitar2_St1.width + Guitar2_St1.x + 45, Guitar2_St1.y, 0).setContext(ctx);
Guitar2_St2_1.setBegBarType(VF.Barline.type.NONE);
Guitar2_St2_1.setEndBarType(VF.Barline.type.NONE);
Guitar2_St2_1.draw();
 
 
const Guitar2_St3 = new Stave(Guitar2_St2.width + Guitar2_St2.x, Guitar2_St2.y, nStaveWidth).setContext(ctx);
Guitar2_St3.draw();
 
const Guitar2_St3_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "2", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "4", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "4", stem_direction: -1 }),
];
const Guitar2_St3_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
 
];
UniqueIds = getUniqueNoteheadIds(Guitar2_St3_notes_1, [0, 1, 2]);
allUniqueIds = updateAllUniqueIds(UniqueIds);
 
var Guitar2_St3_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St3_Voice_1.setStrict(true);
Guitar2_St3_Voice_1.addTickables(Guitar2_St3_notes_1);
 
var Guitar2_St3_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St3_Voice_2.setStrict(true);
Guitar2_St3_Voice_2.addTickables(Guitar2_St3_notes_2);
 
var formatterGuitar2_St3 = new VF.Formatter().joinVoices([Guitar2_St3_Voice_1, Guitar2_St3_Voice_2]);
formatterGuitar2_St3.format([Guitar2_St3_Voice_1, Guitar2_St3_Voice_2], nStaveWidth - 20 - 10);
Guitar2_St3_Voice_1.draw(ctx, Guitar2_St3);
Guitar2_St3_Voice_2.draw(ctx, Guitar2_St3);
 
shiftGuitar2_3st= addShift(
  Guitar2_St3_notes_1,
  [0, 1, 2],
  [1, 1, 1]
);
 
const Guitar2_St4 = new Stave(Guitar2_St3.width + Guitar2_St3.x, Guitar2_St3.y, nStaveWidth).setContext(ctx);
Guitar2_St4.draw();
 
 
const Guitar2_Tab1_1 = new Stave(Guitar2_St1.x + nHeadMargin + 20, Guitar2_St1.y + 120, 0).setContext(ctx);
Guitar2_Tab1_1.setBegBarType(VF.Barline.type.NONE);
Guitar2_Tab1_1.setEndBarType(VF.Barline.type.NONE);
Guitar2_Tab1_1.draw();
const Guitar2_Tab1 = new Stave(Guitar2_St1.x, Guitar2_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar2_Tab1.draw();
 
Guitar2tab_1st.x = Guitar2_Tab1_1.x;
Guitar2tab_1st.y = Guitar2_Tab1_1.y;
 
Guitar2Tab1.x = Guitar2_Tab1.x;
Guitar2Tab1.y = Guitar2_Tab1.y;
 
const Guitar2_Tab2 = new Stave(Guitar2_Tab1.width + Guitar2_Tab1.x, Guitar2_Tab1.y, nStaveWidth).setContext(ctx);
Guitar2_Tab2.draw();
 
 
const Guitar2_Tab2_1 = new Stave(Guitar2_Tab1.width + Guitar2_Tab1.x + 45, Guitar2_Tab1.y, 0).setContext(ctx);
Guitar2_Tab2_1.setBegBarType(VF.Barline.type.NONE);
Guitar2_Tab2_1.setEndBarType(VF.Barline.type.NONE);
Guitar2_Tab2_1.draw();
 
Guitar2tab_2st.x = Guitar2_Tab2.x;
Guitar2tab_2st.y = Guitar2_Tab2.y;
 
const Guitar2_Tab3 = new Stave(Guitar2_Tab2.width + Guitar2_Tab2.x, Guitar2_Tab2.y, nStaveWidth).setContext(ctx);
Guitar2_Tab3.draw();
 
Guitar2tab_3st.x = Guitar2_Tab3.x;
Guitar2tab_3st.y = Guitar2_Tab3.y;
 
 
const Guitar2_Tab4 = new Stave(Guitar2_Tab3.width + Guitar2_Tab3.x, Guitar2_Tab3.y, nStaveWidth).setContext(ctx);
Guitar2_Tab4.draw();
 
Guitar2tab_4st.x = Guitar2_Tab4.x;
Guitar2tab_4st.y = Guitar2_Tab4.y;
 
var Guitar2_connect = new VF.StaveConnector(Guitar2_St1, Guitar2_Tab1);
Guitar2_connect.setType(VF.StaveConnector.type.BRACKET);
Guitar2_connect.setContext(ctx);
Guitar2_connect.draw();
 
const Guitar2_Tab1_tab = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y - 10, nHeadMargin + nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab1_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab1_tab.draw();
 
const Guitar2_Tab2_tab = new Stave(Guitar2_Tab1_tab.width + Guitar2_Tab1_tab.x, Guitar2_Tab1_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab2_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab2_tab.draw();
 
const Guitar2_Tab3_tab = new Stave(Guitar2_Tab2_tab.width + Guitar2_Tab2_tab.x, Guitar2_Tab2_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab3_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab3_tab.draw();
 
const Guitar2_Tab4_tab = new Stave(Guitar2_Tab3_tab.width + Guitar2_Tab3_tab.x, Guitar2_Tab3_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab4_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab4_tab.draw();
 
Guitar2Inst.x = Guitar2_St1.x - 30;
Guitar2Inst.y = Guitar2_St1.y + ((Guitar2_Tab1.y - Guitar2_St1.y) / 2) + 90;
 
const Base_St1 = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Base_St1.addClef("bass").setContext(ctx);
Base_St1.addTimeSignature('4/4').setContext(ctx);
Base_St1.addKeySignature('D').setContext(ctx);
Base_St1.draw();
 
const Base_St2 = new Stave(Base_St1.width + Base_St1.x, Base_St1.y, nStaveWidth).setContext(ctx);
Base_St2.draw();
 
const Base_St3 = new Stave(Base_St2.width + Base_St2.x, Base_St2.y, nStaveWidth).setContext(ctx);
Base_St3.draw();
 
const Base_St4 = new Stave(Base_St3.width + Base_St3.x, Base_St3.y, nStaveWidth).setContext(ctx);
Base_St4.draw();
 
const Base_Tab1 = new Stave(Base_St1.x, Base_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Base_Tab1.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab1.setConfigForLine(i, {visible: false} );
}
Base_Tab1.draw();
 
BaseTab1.x = Base_Tab1.x;
BaseTab1.y = Base_Tab1.y;
 
BaseInst.x = Base_St1.x - 30;
BaseInst.y = Base_St1.y + ((Base_Tab1.y - Base_St1.y) / 2) + 90;
 
StaveBase1 = Base_Tab1;
 
const Base_Tab2 = new Stave(Base_Tab1.width + Base_Tab1.x, Base_Tab1.y, nStaveWidth).setContext(ctx);
Base_Tab2.setBegBarType(VF.Barline.type.NONE);
Base_Tab2.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab2.setConfigForLine(i, {visible: false} );
}
Base_Tab2.draw();
 
StaveBase2 = Base_Tab2;
 
const Base_Tab3 = new Stave(Base_Tab2.width + Base_Tab2.x, Base_Tab2.y, nStaveWidth).setContext(ctx);
Base_Tab3.setBegBarType(VF.Barline.type.NONE);
Base_Tab3.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab3.setConfigForLine(i, {visible: false} );
}
Base_Tab3.draw();
 
StaveBase3 = Base_Tab3;
 
const Base_Tab4 = new Stave(Base_Tab3.width + Base_Tab3.x, Base_Tab3.y, nStaveWidth).setContext(ctx);
Base_Tab4.setBegBarType(VF.Barline.type.NONE);
Base_Tab4.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab4.setConfigForLine(i, {visible: false} );
}
Base_Tab4.draw();
 
StaveBase4 = Base_Tab4;
 
var Base_connect = new VF.StaveConnector(Base_St1, Base_Tab1);
Base_connect.setType(VF.StaveConnector.type.BRACKET);
Base_connect.setContext(ctx);
Base_connect.draw();
 
const Drum_St1 = new Stave(Base_Tab1.x, Base_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Drum_St1.addClef("bass").setContext(ctx);
Drum_St1.addTimeSignature('4/4').setContext(ctx);
Drum_St1.draw();
 
DrumInst.x = Drum_St1.x - 30;
DrumInst.y = Drum_St1.y + 90;
 
const Drum_St1_1 = new Stave(nHeadMargin + Base_Tab1.x, Base_Tab1.y + 120, 0).setContext(ctx);
Drum_St1_1.setBegBarType(VF.Barline.type.NONE);
Drum_St1_1.setEndBarType(VF.Barline.type.NONE);
Drum_St1_1.draw();
 
const Drum_St1_2 = new Stave(nHeadMargin + Base_Tab1.x, Base_Tab1.y + 120, 0).setContext(ctx);
Drum_St1_2.setBegBarType(VF.Barline.type.NONE);
Drum_St1_2.setEndBarType(VF.Barline.type.NONE);
Drum_St1_2.draw();
 
const Drum_St2 = new Stave(Drum_St1.width + Drum_St1.x, Drum_St1.y, nStaveWidth).setContext(ctx);
Drum_St2.draw();
 
 
const Drum_St3 = new Stave(Drum_St2.width + Drum_St2.x, Drum_St1.y, nStaveWidth).setContext(ctx);
Drum_St3.draw();
 
 
const Drum_St4 = new Stave(Drum_St3.width + Drum_St3.x, Drum_St1.y, nStaveWidth).setContext(ctx);
Drum_St4.draw();
 
 
const Perc_St1 = new Stave(Drum_St1.x, Drum_St1.y + 100, nHeadMargin + nStaveWidth).setContext(ctx);
Perc_St1.addTimeSignature('4/4').setContext(ctx);
 
const Perc_St1_1 = new Stave(nHeadMargin + Drum_St1.x, Drum_St1.y + 100, 0).setContext(ctx);
Perc_St1_1.setBegBarType(VF.Barline.type.NONE);
Perc_St1_1.setEndBarType(VF.Barline.type.NONE);
Perc_St1_1.draw();
 
for (var i = 0; i < 5; i++) {
   if (i == 2) continue;
   Perc_St1.setConfigForLine(i, {visible: false} );
   Perc_St1.setConfigForLine(i, {visible: false} );
}
}
 
 
Perc_St1.draw();
Perc_St1.draw();
 
PercInst.x = Perc_St1.x - 30;
PercInst.y = Perc_St1.y + 90;
 
var AllConnector = new VF.StaveConnector(VocalSt1, Perc_St1);
AllConnector.setType(VF.StaveConnector.type.SINGLE);
AllConnector.setContext(ctx);
AllConnector.draw();
 
 
const Perc_St2 = new Stave(Perc_St1.width + Perc_St1.x, Perc_St1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St2.setConfigForLine(i, {visible: false} );
}
Perc_St2.draw();
 
const Perc_St3 = new Stave(Perc_St2.width + Perc_St2.x, Perc_St2.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St3.setConfigForLine(i, {visible: false} );
}
Perc_St3.draw();
 
const Perc_St4 = new Stave(Perc_St3.width + Perc_St3.x, Perc_St3.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St4.setConfigForLine(i, {visible: false} );
}
Perc_St4.draw();
 
})();
 
const svgElement2 = document.querySelector('#yonet202403Mid_Output01 svg');
svgElement2.style.backgroundColor = '#F5F5F5';
var svgContainer = document.getElementById('yonet202403Mid_Output01');
var svgElement = svgContainer.querySelector('svg');
 
var VocalText_options = {
    textContent: ["Vocal"], // 必須文字列
    strID: "VocalText", // 必須
    Stave_x: Vocal.x,
    Stave_y: Vocal.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(VocalText_options);
 
var EGuitarText_options = {
    textContent: ["E.Guitar1"], // 必須文字列
    strID: "EGuitarText", // 必須
    Stave_x: Guitar1Inst.x,
    Stave_y: Guitar1Inst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(EGuitarText_options);
 
var EGuitarTab_options = {
    textContent: ["@"], // 必須文字列
    strID: "EGuitarTab", // 必須
    Stave_x: Stave9Pos.x,
    Stave_y: Stave9Pos.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 80,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(EGuitarTab_options);
 
//shiftGuitar1_1st
var Guitar1_st1_option = {
    textContent: [";", ";", ";", ";", ";", ";", ";"], // 必須文字列
    strID: "Guitar1_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_1st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st1_option);
 
 
 
var Guitar1_st2_option = {
    textContent: [";", ";", ";", ";", ";", ";", "\uFF64"], // 必須文字列
    strID: "Guitar1_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_2st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st2_option);
 
insertTiePathToSVG({x:shiftGuitar1_2st[2].x , y:shiftGuitar1_2st[2].y + 10}, {x:shiftGuitar1_2st[2].x + 35, y:shiftGuitar1_2st[2].y + 10});
 
var Guitar1_st3_option = {
    textContent: [";", ";", ";", ";", ";", ";", "\uFF64"], // 必須文字列
    strID: "Guitar1_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_3st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st3_option);
 
insertTiePathToSVG({x:shiftGuitar1_3st[2].x , y:shiftGuitar1_3st[2].y + 10}, {x:shiftGuitar1_3st[2].x + 35, y:shiftGuitar1_3st[2].y + 10});
 
var Guitar1_st4_option = {
    textContent: [";", ";", ";", ";", ";", ";", ";", "\uFF64"], // 必須文字列
    strID: "Guitar1_st4", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_4st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st4_option);
 
insertTiePathToSVG({x:shiftGuitar1_4st[0].x , y:shiftGuitar1_4st[0].y + 10}, {x:shiftGuitar1_4st[0].x + 35, y:shiftGuitar1_4st[0].y + 10});
 
insertTiePathToSVG({x:shiftGuitar1_4st[3].x , y:shiftGuitar1_4st[3].y + 10}, {x:shiftGuitar1_4st[3].x + 35, y:shiftGuitar1_4st[3].y + 10});
 
insertArrowPathToSVG({x:shiftGuitar1_4st[1].x + 10 , y:shiftGuitar1_4st[1].y + 20}, {x:shiftGuitar1_4st[1].x + 45, y:shiftGuitar1_4st[1].y + 70});
 
//u254F左利き用4線フレット
insertTiePathToSVG({x:shiftGuitar1_1st[2].x , y:shiftGuitar1_1st[2].y + 10}, {x:shiftGuitar1_1st[2].x + 35, y:shiftGuitar1_1st[2].y + 10});
 
var Guitar1tab_st1_option = {
    textContent: ["\uFFAF", "3", "2", "1", ":", ":", "/", "/", "/", "/"], // 必須文字列
    strID: "Guitar1tab_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_1st.x + 10, y:Guitar1tab_1st.y + 80},
{x:Guitar1tab_1st.x + 15, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 30, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 45, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 27, y:Guitar1tab_1st.y + 70},//4弦中ポジ
{x:Guitar1tab_1st.x + 27, y:Guitar1tab_1st.y + 60},//5弦中ポジ
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 30},//1弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 40},//2弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 50},//3弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st1_option);
 
var Guitar1tab_st2_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", ":", ":", "["], // 必須文字列
    strID: "Guitar1tab_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 80},
{x:Guitar1tab_2st.x + 15, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 30, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 45, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 27, y:Guitar1tab_2st.y + 50},//3弦中ポジ
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 60},//4弦内ポジ
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 70},//5弦内ポジ
{x:Guitar1tab_2st.x + 42, y:Guitar1tab_2st.y + 80},//外全セーハ
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st2_option);
 
var Guitar1tab_st3_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", "_", "?", "?"], // 必須文字列
    strID: "Guitar1tab_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 80},
{x:Guitar1tab_3st.x + 15, y:Guitar1tab_3st.y + 90},
{x:Guitar1tab_3st.x + 30, y:Guitar1tab_3st.y + 90},
{x:Guitar1tab_3st.x + 45, y:Guitar1tab_3st.y + 90},
//{x:Guitar1tab_3st.x + 27, y:Guitar1tab_3st.y + 50},//3弦中ポジ
//{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 60},//4弦内ポジ
{x:Guitar1tab_3st.x + 42, y:Guitar1tab_3st.y + 70},//5弦外ポジ
{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 60},//内全セーハ
//{x:Guitar1tab_3st.x + 42, y:Guitar1tab_3st.y + 60},//外全セーハ
{x:Guitar1tab_3st.x + 80, y:Guitar1tab_3st.y + 30},//1弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 60},//4弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 70},//5弦ネックマーク
{x:Guitar1tab_3st.x + 80, y:Guitar1tab_3st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st3_option);
 
var Guitar1tab_st4_option = {
    textContent: ["\uFF03", "6", "5", "4", ":", "_", "?", "?", "\uFF03", "7", "6", "5", ":", "_", "?", "?"], // 必須文字列
    strID: "Guitar1tab_st4", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 80},
{x:Guitar1tab_4st.x + 15, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 30, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 45, y:Guitar1tab_4st.y + 90},
//{x:Guitar1tab_4st.x + 27, y:Guitar1tab_4st.y + 50},//3弦中ポジ
//{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 60},//4弦内ポジ
{x:Guitar1tab_4st.x + 42, y:Guitar1tab_4st.y + 70},//5弦外ポジ
{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 60},//内全セーハ
//{x:Guitar1tab_4st.x + 42, y:Guitar1tab_4st.y + 60},//外全セーハ
{x:Guitar1tab_4st.x + 80, y:Guitar1tab_4st.y + 30},//1弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 60},//4弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 70},//5弦ネックマーク
{x:Guitar1tab_4st.x + 80, y:Guitar1tab_4st.y + 80},//6弦ネックマーク
 
{x:Guitar1tab_4st.x + 100 + 10, y:Guitar1tab_4st.y + 80},
{x:Guitar1tab_4st.x + 100 + 15, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 100 + 30, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 100 + 45, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 100 + 42, y:Guitar1tab_4st.y + 70},//5弦外ポジ
{x:Guitar1tab_4st.x + 100 + 10, y:Guitar1tab_4st.y + 60},//内全セーハ
{x:Guitar1tab_4st.x + 100 + 80, y:Guitar1tab_4st.y + 30},//1弦ネックマーク
{x:Guitar1tab_4st.x + 100 + 80, y:Guitar1tab_4st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st4_option);
 
var Guitar2_st1_option = {
    textContent: [","], // 必須文字列
    strID: "Guitar2_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar2_1st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st1_option);
 
var Guitar2_st2_option = {
    textContent: ["*"], // 必須文字列
    strID: "Guitar2_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar2_2st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st2_option);
 
var Guitar2_st3_option = {
    textContent: ["\uFF88", "\uFF87", "\uFF87"], // 必須文字列
    strID: "Guitar2_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar2_3st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st3_option);
 
 
var Guitar2tab_st1_option = {
    textContent: ["\uFFAF", "3", "2", "1", ":", ":", "/", "/", "/", "/"], // 必須文字列
    strID: "Guitar2tab_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_1st.x + 10, y:Guitar2tab_1st.y + 80},
{x:Guitar2tab_1st.x + 15, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 30, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 45, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 27, y:Guitar2tab_1st.y + 70},//4弦中ポジ
{x:Guitar2tab_1st.x + 27, y:Guitar2tab_1st.y + 60},//5弦中ポジ
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 30},//1弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 40},//2弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 50},//3弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st1_option);
 
var Guitar2tab_st2_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", ":", ":", "["], // 必須文字列
    strID: "Guitar2tab_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 80},
{x:Guitar2tab_2st.x + 15, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 30, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 45, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 27, y:Guitar2tab_2st.y + 50},//3弦中ポジ
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 60},//4弦内ポジ
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 70},//5弦内ポジ
{x:Guitar2tab_2st.x + 42, y:Guitar2tab_2st.y + 80},//外全セーハ
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 40},//2弦ネックマーク
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 50},//3弦ネックマーク
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st2_option);
 
var Guitar2tab_st3_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", "_", "?", "?"], // 必須文字列
    strID: "Guitar2tab_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 80},
{x:Guitar2tab_3st.x + 15, y:Guitar2tab_3st.y + 90},
{x:Guitar2tab_3st.x + 30, y:Guitar2tab_3st.y + 90},
{x:Guitar2tab_3st.x + 45, y:Guitar2tab_3st.y + 90},
//{x:Guitar2tab_3st.x + 27, y:Guitar2tab_3st.y + 50},//3弦中ポジ
//{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 60},//4弦内ポジ
{x:Guitar2tab_3st.x + 42, y:Guitar2tab_3st.y + 70},//5弦外ポジ
{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 60},//内全セーハ
//{x:Guitar2tab_3st.x + 42, y:Guitar2tab_3st.y + 60},//外全セーハ
{x:Guitar2tab_3st.x + 80, y:Guitar2tab_3st.y + 30},//1弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 40},//2弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 50},//3弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 60},//4弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 70},//5弦ネックマーク
{x:Guitar2tab_3st.x + 80, y:Guitar2tab_3st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st3_option);
 
var EGuitar2Text_options = {
    textContent: ["E.Guitar2"], // 必須文字列
    strID: "EGuitar2Text", // 必須
    Stave_x: Guitar2Inst.x,
    Stave_y: Guitar2Inst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(EGuitar2Text_options);
 
var EGuitar2Tab_options = {
    textContent: ["@"], // 必須文字列
    strID: "EGuitar2Tab", // 必須
    Stave_x: Guitar2Tab1.x,
    Stave_y: Guitar2Tab1.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 80,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(EGuitar2Tab_options);
 
var BaseText_options = {
    textContent: ["Base"], // 必須文字列
    strID: "BaseText", // 必須
    Stave_x: BaseInst.x,
    Stave_y: BaseInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(BaseText_options);
 
var BaseTab_options = {
    textContent: ["@"], // 必須文字列
    strID: "BaseTab", // 必須
    Stave_x: BaseTab1.x,
    Stave_y: BaseTab1.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 90,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(BaseTab_options);
insertBaseEndBarPathToSVG(StaveBase1);
insertBaseEndBarPathToSVG(StaveBase2);
insertBaseEndBarPathToSVG(StaveBase3);
insertBaseEndBarPathToSVG(StaveBase4);
 
var DrumText_options = {
    textContent: ["Drum"], // 必須文字列
    strID: "DrumText", // 必須
    Stave_x: DrumInst.x,
    Stave_y: DrumInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(DrumText_options);
 
var PercText_options = {
    textContent: ["Perc."], // 必須文字列
    strID: "PercText", // 必須
    Stave_x: PercInst.x,
    Stave_y: PercInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(PercText_options);
 
if(allUniqueIds !== "undefined"){
// 透明にするIDの配列
// 例としてここでIDを指定
let autoUniqueIds = allUniqueIds.map(id => "vf-" + id);
let Last_Stem_x = 0;
// 各IDに対して処理
  autoUniqueIds.forEach(id => {
    // 該当するIDの要素を取得
    let element = svgElement.getElementById(id);
    if (element) {
      let classValue = element.getAttribute("class");
      // 該当する要素があれば、描画内容を透明にする
      let paths = element.querySelectorAll("path");
      paths.forEach(path => {
          var dAttribute = path.getAttribute('d');
          // カンマで区切られた数値の数を数えます
          var numberOfValues = (dAttribute.match(/,/g) || []).length + 1; // カンマの数 + 1 = 数値の数
 
          if (numberOfValues === 9) {
            var firstCoord = dAttribute.split(',')[0];
            if (dAttribute.startsWith('M')) {
              var CnumberOfValues = (dAttribute.match(/C/g) || []).length; // カンマの数 + 1 = 数値の数
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(CnumberOfValues > 0){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var xdiff = coords[0] - coords[2]; // xの差を計算
                var ydiff = coords[1] - coords[3]; // yの差を計算
 
                if (coords[0] - Last_Stem_x > 2){
                  if (coords[0] - Last_Stem_x < 10){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                // xが0でyが0より大きい場合、描画内容を透明にします
                if (xdiff <= -3.590) {
                if (xdiff >= -3.599) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                if (xdiff <= -2.369) {
                if (xdiff >= -2.374) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                if (xdiff <= 1.000) {
                if (xdiff >= -1.000) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                else {
                  if(ydiff === 1.123){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
              }
            }
          }
          else if (numberOfValues === 23) {
            if (dAttribute.startsWith('M')) {
              var MnumberOfValues = (dAttribute.match(/M/g) || []).length; // カンマの数 + 1 = 数値の数
              var CnumberOfValues = (dAttribute.match(/C/g) || []).length; // カンマの数 + 1 = 数値の数
              var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
              if (MnumberOfValues == 2){
              if (CnumberOfValues == 11){
                path.setAttribute("fill", "none");
                path.setAttribute("stroke", "none");
              }
              }
            }
          }
          else if (numberOfValues === 1) {
            if (dAttribute.startsWith('M')) {
              var AnumberOfValues = (dAttribute.match(/A/g) || []).length; // カンマの数 + 1 = 数値の数
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(AnumberOfValues == 2){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var circle_right = coords[0]; // xの差を計算
                var r_x = coords[2]; // xの差を計算
                var r_y = coords[3]; // xの差を計算
                var circle_left = coords[7]; // yの差を計算
 
                if (circle_right - Last_Stem_x > 7){//7.75
                  if (circle_right - Last_Stem_x < 8){
                  if (circle_left - Last_Stem_x > 3){//3.75
                  if (circle_left - Last_Stem_x < 4){
                  if (r_x == 2){
                  if (r_y == 2){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                  }
                  }
                  }
                  }
                }
              }
            }
            if (classValue === "vf-stem"){
              var firstStemCoord = dAttribute;
              if (dAttribute.startsWith('M')) {
                var StemLnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                  // 座標の差を計算します
                if(StemLnumberOfValues > 0){
                  var stem_coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                  Last_Stem_x = stem_coords[0]; // xの差を計算
                }
              }
            }
            var firstCoord = dAttribute;
            if (dAttribute.startsWith('M')) {
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(LnumberOfValues > 0){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var xdiff = coords[0] - coords[2]; // xの差を計算
                var ydiff = coords[1] - coords[3]; // yの差を計算
 
                // xが0でyが0より大きい場合、描画内容を透明にします
                if (xdiff < -10) {
                if (xdiff > -20) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
              }
            }
          }
          else if (numberOfValues === 21 || numberOfValues === 35 || numberOfValues === 95 || numberOfValues === 41) {
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
          }
      });
    }
  });
}
 
if(allFlagUniqueIds !== "undefined"){
  let autoFlagUniqueIds = allFlagUniqueIds.map(id => "vf-" + id);
  autoFlagUniqueIds.forEach(id => {
    // 該当するIDの要素を取得
    let element = svgElement.getElementById(id);
    if (element) {
      // 該当する要素があれば、描画内容を透明にする
      let flagpaths = element.querySelectorAll('path');
      flagpaths.forEach(path => {
        var dAttribute = path.getAttribute('d');
        // カンマで区切られた数値の数を数えます
        var numberOfValues = (dAttribute.match(/,/g) || []).length + 1; // カンマの数 + 1 = 数値の数
 
        // 数値の数が23であれば、このpath要素は求めるものです
        if (numberOfValues === 23) {
          path.setAttribute("fill", "none");
          path.setAttribute("stroke", "none");
        }
      });
    }
  });
}
})();
</script>
</syntaxhighlight>


PercInst.x = Perc_St1.x - 30;
PercInst.y = Perc_St1.y + 90;


var AllConnector = new VF.StaveConnector(VocalSt1, Perc_St1);
 insertArrowPathToSVGという関数を追加しました。
AllConnector.setType(VF.StaveConnector.type.SINGLE);
AllConnector.setContext(ctx);
AllConnector.draw();


const Perc_notes1_1 = [
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
'''第一引数:'''矢印の始点を示す位置オブジェクト{x: 数値, y: 数値}という形式である必要があります。xキーには始点のx座標、yキーには始点のy座標を指定します。
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),


  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
'''第二引数:'''矢印の終点を示す位置オブジェクト。第一引数の形式に準ずるものです。
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["a/4"], duration: "16", stem_direction: -1 })
];
UniqueIds = getUniqueNoteheadIds(Perc_notes1_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
allUniqueIds = updateAllUniqueIds(UniqueIds);


const Perc_beam1_1_1 = new VF.Beam([Perc_notes1_1[0], Perc_notes1_1[1], Perc_notes1_1[2], Perc_notes1_1[3]]);
const Perc_beam1_1_2 = new VF.Beam([Perc_notes1_1[4], Perc_notes1_1[5], Perc_notes1_1[6], Perc_notes1_1[7]]);
const Perc_beam1_1_3 = new VF.Beam([Perc_notes1_1[8], Perc_notes1_1[9], Perc_notes1_1[10], Perc_notes1_1[11]]);
const Perc_beam1_1_4 = new VF.Beam([Perc_notes1_1[12], Perc_notes1_1[13], Perc_notes1_1[14], Perc_notes1_1[15]]);


var Perc_St1_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 });
 始点から終点にかけて線が描画され、終点に矢印を構成するための修飾がなされます。
Perc_St1_1Voice.setStrict(true);
Perc_St1_1Voice.addTickables(Perc_notes1_1);


var formatterPerc_St1_1 = new Vex.Flow.Formatter().joinVoices([Perc_St1_1Voice]);
//formatterPerc_St1_1.formatToStave([stave17_1Voice], Perc_St1_1);
formatterPerc_St1_1.format([Perc_St1_1Voice], nStaveWidth - 30);
Perc_St1_1Voice.draw(ctx, Perc_St1_1);


Perc_beam1_1_1.setContext(ctx).draw();
 コードフォームを表示した場合の五線譜の音符にはスラッシュノートというものに置き換える必要があります。4分音符より短い音のスラッシュノートは同一で上向きの符棒のコードポイントは";"で、セミコロンの全角に割り当てられています。下向きは"\uFF87"です。二分音符は上向きが"*"で、下向きが"\uFF88"です。全音符は","です。
Perc_beam1_1_2.setContext(ctx).draw();
Perc_beam1_1_3.setContext(ctx).draw();
Perc_beam1_1_4.setContext(ctx).draw();


Perc_note1_1_0.x = Perc_notes1_1[0].getAbsoluteX();
Perc_note1_1_0.y = Perc_notes1_1[0].getStave().getYForLine(1);


shiftPerc1 = addShift(
 コードフォームを示す図形はフレット線と押さえるべきフレットを示すドットとフレット番号をコードフォーム全体の一番下の部分に記述し、開放弦については、鳴らす弦であることを示す〇(コードポイントは"?")と鳴らさない弦であることを示す×(コードポイントは"/")のような図形で構成されます。
  Perc_notes1_1,
  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
  [4, 4, 4, 4, 4, 4, 4, 4, 4, 4,  4,  4,  4,  4,  4,  4]
);


const Perc_St2 = new Stave(Perc_St1.width + Perc_St1.x, Perc_St1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St2.setConfigForLine(i, {visible: false} );
}
Perc_St2.draw();
const Perc_St3 = new Stave(Perc_St2.width + Perc_St2.x, Perc_St2.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St3.setConfigForLine(i, {visible: false} );
}
Perc_St3.draw();
const Perc_St4 = new Stave(Perc_St3.width + Perc_St3.x, Perc_St3.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St4.setConfigForLine(i, {visible: false} );
}
Perc_St4.draw();


})();
 コードフォーム全体の高さはタブ譜の第2弦から第6弦を示すために使われた小節の座標を基準のyがあるとすると、相対位置


const svgElement2 = document.querySelector('#yonet202403Mid_Output01 svg');
svgElement2.style.backgroundColor = '#F5F5F5';
var svgContainer = document.getElementById('yonet202403Mid_Output01');
var svgElement = svgContainer.querySelector('svg');


var VocalText_options = {
*y + 30=1弦
    textContent: ["Vocal"], // 必須文字列
*y + 40=2弦
    strID: "VocalText", // 必須
*y + 50=3弦
    Stave_x: Vocal.x,
*y + 60=4弦
    Stave_y: Vocal.y,
*y + 70=5弦
    fontFamily: "Arial, sans-serif",
*y + 80=6弦
    fontSize: "20pt",
*y + 90=フレット番号表示位置
    Rotate: -90
};
insertTextToSVG(VocalText_options);


var EGuitarText_options = {
    textContent: ["E.Guitar1"], // 必須文字列
    strID: "EGuitarText", // 必須
    Stave_x: Guitar1Inst.x,
    Stave_y: Guitar1Inst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(EGuitarText_options);


var EGuitarTab_options = {
 に対応しています。
    textContent: ["@"], // 必須文字列
    strID: "EGuitarTab", // 必須
    Stave_x: Stave9Pos.x,
    Stave_y: Stave9Pos.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 80,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(EGuitarTab_options);


var EGuitar2Text_options = {
    textContent: ["E.Guitar2"], // 必須文字列
    strID: "EGuitar2Text", // 必須
    Stave_x: Guitar2Inst.x,
    Stave_y: Guitar2Inst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(EGuitar2Text_options);


var EGuitar2Tab_options = {
 x方向の対応としては●(コードポイントは"")を塗る座標として
    textContent: ["@"], // 必須文字列
    strID: "EGuitar2Tab", // 必須
    Stave_x: Guitar2Tab1.x,
    Stave_y: Guitar2Tab1.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 80,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(EGuitar2Tab_options);


var BaseText_options = {
    textContent: ["Base"], // 必須文字列
    strID: "BaseText", // 必須
    Stave_x: BaseInst.x,
    Stave_y: BaseInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(BaseText_options);


var BaseTab_options = {
*左ポジションはx + 10
    textContent: ["@"], // 必須文字列
*中ポジションはx + 30
    strID: "BaseTab", // 必須
*右ポジションはx + 42
    Stave_x: BaseTab1.x,
*ネック左側外はx + 60
    Stave_y: BaseTab1.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 90,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(BaseTab_options);
insertBaseEndBarPathToSVG(StaveBase1);
insertBaseEndBarPathToSVG(StaveBase2);
insertBaseEndBarPathToSVG(StaveBase3);
insertBaseEndBarPathToSVG(StaveBase4);


var DrumText_options = {
    textContent: ["Drum"], // 必須文字列
    strID: "DrumText", // 必須
    Stave_x: DrumInst.x,
    Stave_y: DrumInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(DrumText_options);


var PercText_options = {
x方向の対応としてはポジション番号を表示する座標として
    textContent: ["Perc."], // 必須文字列
    strID: "PercText", // 必須
    Stave_x: PercInst.x,
    Stave_y: PercInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(PercText_options);


if(allUniqueIds !== "undefined"){
// 透明にするIDの配列
// 例としてここでIDを指定
let autoUniqueIds = allUniqueIds.map(id => "vf-" + id);


// 各IDに対して処理
*左ポジションはx + 15
  autoUniqueIds.forEach(id => {
*中ポジションはx + 30
    // 該当するIDの要素を取得
*右ポジションはx + 45
    let element = svgElement.getElementById(id);
    if (element) {
      // 該当する要素があれば、描画内容を透明にする
      let paths = element.querySelectorAll("path");
      paths.forEach(path => {
          var dAttribute = path.getAttribute('d');
          // カンマで区切られた数値の数を数えます
          var numberOfValues = (dAttribute.match(/,/g) || []).length + 1; // カンマの数 + 1 = 数値の数


          if (numberOfValues === 9) {
            var firstCoord = dAttribute.split(',')[0];
            if (dAttribute.startsWith('M')) {
              var CnumberOfValues = (dAttribute.match(/C/g) || []).length; // カンマの数 + 1 = 数値の数
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(CnumberOfValues > 0){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var xdiff = coords[0] - coords[2]; // xの差を計算
                var ydiff = coords[1] - coords[3]; // yの差を計算


                // xが0でyが0より大きい場合、描画内容を透明にします
 に対応しています。
                if (xdiff <= -3.590) {
                if (xdiff >= -3.599) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                if (xdiff <= -2.369) {
                if (xdiff >= -2.374) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                if (xdiff <= 1.000) {
                if (xdiff >= -1.000) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                else {
                  if(ydiff === 1.123){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
              }
            }
          }
          else if (numberOfValues === 1) {
            var firstCoord = dAttribute;
            if (dAttribute.startsWith('M')) {
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(LnumberOfValues > 0){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var xdiff = coords[0] - coords[2]; // xの差を計算
                var ydiff = coords[1] - coords[3]; // yの差を計算


                // xが0でyが0より大きい場合、描画内容を透明にします
                if (xdiff < -10) {
                if (xdiff > -20) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
              }
            }
          }
          else if (numberOfValues === 21 || numberOfValues === 35 || numberOfValues === 95 || numberOfValues === 41) {
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
          }
      });
    }
  });
}


if(allFlagUniqueIds !== "undefined"){
"\u254F"がフレット線の左利き321ネックポジションの記号で\uFF03がネックポジションでない場合です。
  let autoFlagUniqueIds = allFlagUniqueIds.map(id => "vf-" + id);
  autoFlagUniqueIds.forEach(id => {
    // 該当するIDの要素を取得
    let element = svgElement.getElementById(id);
    if (element) {
      // 該当する要素があれば、描画内容を透明にする
      let flagpaths = element.querySelectorAll('path');
      flagpaths.forEach(path => {
        var dAttribute = path.getAttribute('d');
        // カンマで区切られた数値の数を数えます
        var numberOfValues = (dAttribute.match(/,/g) || []).length + 1; // カンマの数 + 1 = 数値の数


        // 数値の数が23であれば、このpath要素は求めるものです
        if (numberOfValues === 23) {
          path.setAttribute("fill", "none");
          path.setAttribute("stroke", "none");
        }
      });
    }
  });
}
})();
</yjavascript>


*x + 10、y + 80


 コードは以下のとおりです。


 に貼り付けると良い感じです。


<syntaxhighlight lang="javascript" line start="1" highlight="">
<div id="yonet202403Mid_Output01"></div>
<script>


</script>
 セーハは6弦分は(コードポイントは"[")、セーハは3弦分は(コードポイントは"_")
</syntaxhighlight>




 
 となっています。


 
 


[[VexFlow 使い方]]に戻る。
[[VexFlow 使い方]]に戻る。

2024年4月21日 (日) 23:04時点における最新版

VexFlow 使い方に戻る。

概要

 コードフォームをタブ譜に載せるという手法もありまして、コードが一小節で2種類くらいしか無いような曲で見られる描画方法です。その場合、五線譜には同一コード用の音符を使ってリズムだけをハタ棒とハタあるいは連桁で表現します。管理人は左利きなので、左利き用のコードフォームを表示してみました。人生初くらいだな。左利き向けのコードフォームタブ譜なんて見たことなかった。もちろん、作成したフォントには右利き向けのグリフも登録してあります。あとちょっとで完成しそうですね。フォントファイル。もうちょっとで配布できるようになる。駆け抜けたい。でもこの先まだまだ難しいタブ譜作成技術の紹介が残っています。手ごわい。アーム操作の曲線とかどうするべって感じ。VexFlowも不完全だし、機能追加にも疲れてきたっすね。


 1小節に2コードある場合、矢印でどの部分からがそのコードかを示す矢印を描く関数を追加しました。矢印を描くのって数学の知識いるよね。プログラムの世界だけにあるatan2関数とかね。三角関数を使いこなせないと、矢印をひくのは難しい。

 

タブ譜 コードフォーム


 コードは以下のとおりです。


<div id="yonet202403Mid_Output01"></div>
<script>
///////////////////////
(function(){
class Position {
  constructor(x = 0, y = 0) {
    this.x = x;
    this.y = y;
  }
}
var VF = Vex.Flow;
const Vocal = new Position();
const Guitar1Inst = new Position();

const Guitar1tab_1st = new Position();
const Guitar1tab_2st = new Position();
const Guitar1tab_3st = new Position();
const Guitar1tab_4st = new Position();

const Guitar2Inst = new Position();
const Guitar2Tab1 = new Position();

const Guitar2tab_1st = new Position();
const Guitar2tab_2st = new Position();
const Guitar2tab_3st = new Position();
const Guitar2tab_4st = new Position();


const BaseInst = new Position();
const BaseTab1 = new Position();
const DrumInst = new Position();
const PercInst = new Position();
const Stave9Pos = new Position();

var StaveBase1;
var StaveBase2;
var StaveBase3;
var StaveBase4;

const Perc_note1_1_0 = new Position();

var shiftGuitar1_1;
var shiftGuitar1_tab4_tr;

var shiftGuitar1_1st;
var shiftGuitar1_2st;
var shiftGuitar1_3st;
var shiftGuitar1_4st;

var shiftGuitar1tab_1st;
var shiftGuitar1tab_2st;
var shiftGuitar1tab_3st;
var shiftGuitar1tab_4st;

var shiftGuitar2_1st;
var shiftGuitar2_2st;
var shiftGuitar2_3st;
var shiftGuitar2_4st;

var shiftGuitar2tab_1st;
var shiftGuitar2tab_2st;
var shiftGuitar2tab_3st;
var shiftGuitar2tab_4st;

var shiftDrum1;
var shiftPerc1;

function insertBaseEndBarPathToSVG(Stave) {
  var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
  newGroup.setAttribute('transform', 'translate(0, 0)');
  var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  var pathStr = 'M ' + (Stave.x + Stave.width) + ' ' + (Stave.y + 50) +
    ' L ' + (Stave.x + Stave.width) + ' ' + (Stave.y + 80);
  path.setAttribute('d', pathStr);
  path.setAttribute('stroke', 'black');
  path.setAttribute('stroke-width', '1');
  path.setAttribute('fill', 'none');
  newGroup.appendChild(path);
  svgElement.appendChild(newGroup);
}

function insertTiePathToSVG(StartPos, EndPos, Direction = 1, Depth = 10) {
  var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
  newGroup.setAttribute('transform', 'translate(0, 0)');
  var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  var pathStr = 'M' + (StartPos.x) + ' ' + (StartPos.y) + 'Q' + (StartPos.x + (EndPos.x - StartPos.x)/2) + ' ' + ((StartPos.y + EndPos.y)/2 + Direction * (Depth - 2)) + 
    ',' + (EndPos.x) + ' ' + (EndPos.y) + 'Q' + ((StartPos.x + EndPos.x)/2) + ' ' + (StartPos.y + (EndPos.y - StartPos.y)/2 + Direction * (Depth + 2)) + 
    ','  + (StartPos.x) + ' ' + (StartPos.y) + 'Z';
  path.setAttribute('d', pathStr);
  path.setAttribute('stroke', 'none');
  path.setAttribute('stroke-width', '1');
  path.setAttribute('fill', 'black');
  newGroup.appendChild(path);
  svgElement.appendChild(newGroup);
}

function insertArrowPathToSVG(StartPos, EndPos) {
  var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
  newGroup.setAttribute('transform', 'translate(0, 0)');
  var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');

  var arrowLength = 10;
  var angle = Math.atan2(EndPos.y - StartPos.y, EndPos.x - StartPos.x);
  var arrowAngle = 20 * (Math.PI / 180);

  // 矢印のポイント1を計算
  var arrowX1 = EndPos.x - arrowLength * Math.cos(angle - arrowAngle);
  var arrowY1 = EndPos.y - arrowLength * Math.sin(angle - arrowAngle);
    
  // 矢印のポイント2を計算
  var arrowX2 = EndPos.x - arrowLength * Math.cos(angle + arrowAngle);
  var arrowY2 = EndPos.y - arrowLength * Math.sin(angle + arrowAngle);

  var pathStr = "M " + StartPos.x + " " + StartPos.y + " L " + EndPos.x + " " + EndPos.y + " M " + EndPos.x + " " + EndPos.y + " L " + arrowX1 + " " + arrowY1 + " M " + EndPos.x + " " + EndPos.y + " L " + arrowX2 + " " + arrowY2;

  path.setAttribute('d', pathStr);
  path.setAttribute('stroke', 'black');
  path.setAttribute('stroke-width', '1');
  path.setAttribute('fill', 'none');
  newGroup.appendChild(path);
  svgElement.appendChild(newGroup);
}


function insertTrilPathToSVG(Shift, Direction = 1) {
  var newGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
  newGroup.setAttribute('transform', 'translate(0, 0)');
  var DirectionOffset = 0;
  if (Direction == -1) DirectionOffset = 60;
  var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  var pathStr = 'M ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset) +
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 40 + DirectionOffset) +
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 36 + DirectionOffset) +
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 36 + DirectionOffset) +
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset);
  path.setAttribute('d', pathStr);
  path.setAttribute('stroke', 'none');
  path.setAttribute('stroke-width', '1');
  path.setAttribute('fill', 'black');
  var path2 = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  var pathStr2 = 'M ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset + Direction * 7) +
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 40 + DirectionOffset + Direction * 7) +
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 36 + DirectionOffset + Direction * 7) +
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 36 + DirectionOffset + Direction * 7) +
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset + Direction * 7);
  path2.setAttribute('d', pathStr2);
  path2.setAttribute('stroke', 'none');
  path2.setAttribute('stroke-width', '1');
  path2.setAttribute('fill', 'black');
  var path3 = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  var pathStr3 = 'M ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset + Direction * 14) +
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 40 + DirectionOffset + Direction * 14) +
    ' L ' + (Shift[1].x + 11.934 - 5) + ' ' + (Shift[1].y - 36 + DirectionOffset + Direction * 14) +
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 36 + DirectionOffset + Direction * 14) +
    ' L ' + (Shift[0].x + 11.934 + 5) + ' ' + (Shift[0].y - 40 + DirectionOffset + Direction * 14);
  path3.setAttribute('d', pathStr3);
  path3.setAttribute('stroke', 'none');
  path3.setAttribute('stroke-width', '1');
  path3.setAttribute('fill', 'black');
  newGroup.appendChild(path);
  newGroup.appendChild(path2);
  newGroup.appendChild(path3);
  svgElement.appendChild(newGroup);
}


function insertTextToSVG(options) {
    var textContent = options.textContent;
    var strID = options.strID;
    var Stave_x = options.Stave_x || 0;
    var Stave_y = options.Stave_y || 0;
    var isOffset_x_abs = options.IsOffset_x_Abs || false;
    var Stave_x_Offset = options.Stave_x_Offset || 0;
    var Stave_y_Offset = options.Stave_y_Offset || 0;
    var StaveWidth = options.StaveWidth || 0;
    var StaveHeight = options.StaveHeight || 0;
    var StaveVerticalScale = options.StaveVerticalScale || 0;
    var fontSize = options.fontSize || 40;
    var fontFamily = options.fontFamily || "Bravura, Arial";
    var shift_x = options.shift_x || [0];
    var Rotate = options.Rotate || 0;
    var offset_sum = 0;
    var Stave_x_Offset_Value = 0;
    var Stave_y_Offset_Value = 0;
    var last_Stave_x_Offset = 0;
    var last_Stave_y_Offset = 0;
    var last_textContent = "";
    shift_x.forEach(function(offset, index) {
        offset_sum = offset_sum + offset;
        var newText = document.createElementNS('http://www.w3.org/2000/svg', 'text');
        newText.setAttribute('id', strID + '_' + index); // テキスト要素にIDを付ける
        newText.setAttribute('x', 0);
        newText.setAttribute('y', 0);
        newText.setAttribute('font-family', fontFamily);
        newText.setAttribute('font-size', fontSize);
        newText.setAttribute('fill', 'black');

        if(typeof textContent === "string"){
          newText.textContent = textContent;
        }
        else{
          if(textContent.length - 1 < index){
            newText.textContent = last_textContent;
          }
          else{
            newText.textContent = textContent[index];
            last_textContent = textContent[index];
          }
        }

        if(Stave_x_Offset.length - 1 < index){
          Stave_x_Offset_Value = last_Stave_x_Offset;
        }
        else{
          if(Stave_x_Offset.length >= 2){
            Stave_x_Offset_Value = Stave_x_Offset[index];
            last_Stave_x_Offset = Stave_x_Offset[index];
          }
          else{
            Stave_x_Offset_Value = Stave_x_Offset;
          }
        }

        if(Stave_y_Offset.length - 1 < index){
          Stave_y_Offset_Value = last_Stave_y_Offset;
        }
        else{
          if(Stave_y_Offset.length >= 2){
            Stave_y_Offset_Value = Stave_y_Offset[index];
            last_Stave_y_Offset = Stave_y_Offset[index];
          }
          else{
            Stave_y_Offset_Value = Stave_y_Offset;
          }
        }
        var textGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
        if(Rotate != 0){
          textGroup.setAttribute('transform', 'rotate(' + Rotate + ' ' + 0 + ' ' + 0 + ')');
          textGroup.appendChild(newText);
          svgElement.appendChild(textGroup);
        }
        else{
          svgElement.appendChild(newText);
        }
        (function() {
            var textWidth = newText.getBBox().width;
            var textHeight = newText.getBBox().height;
            var horizontalScale;
            if (typeof StaveWidth === 'undefined' || StaveWidth == 0) {
                horizontalScale = 1;
            } 
            else {
                horizontalScale = StaveWidth / textWidth;
            }
            var verticalScale;
            if (typeof StaveHeight === 'undefined' || StaveHeight == 0) {
                verticalScale = 1;
            } 
            else if (StaveVerticalScale != 0) {
                verticalScale = StaveVerticalScale;
            } 
            else {
                verticalScale = StaveHeight / textHeight;
            }
            if(isOffset_x_abs){
              var StavePos_x = offset.x + Stave_x_Offset_Value;
              var StavePos_y = offset.y + Stave_y_Offset_Value;
            }
            else{
              var StavePos_x = Stave_x + Stave_x_Offset + offset_sum;
              var StavePos_y = Stave_y + Stave_y_Offset;
            }

            newText.setAttribute('transform', 'translate(' + StavePos_x + ',' + StavePos_y + ') scale(' + horizontalScale + ',' + verticalScale + ')');

            if(Rotate != 0){
              textGroup.setAttribute('transform', 'rotate(' + Rotate + ' ' + StavePos_x + ' ' + StavePos_y + ')');
            }
        })();

        if(Rotate != 0){
          textGroup.appendChild(newText);
          svgElement.appendChild(textGroup);
        }
        else{
          svgElement.appendChild(newText);
        }
    });
}

var allUniqueIds = [];
var allFlagUniqueIds = [];
(function(){
function addShift(notes, arrx = [], arry = []) {
 
  let tempnote;
  let retShift = [];
  
  for(let i = 0; i < arrx.length || i == 0; i++){
    const pos = new Position();
    //notesのchildrenの各要素について処理
    if(arrx.length === 0){
      tempnote = notes;
    }
    else{
      tempnote = notes[arrx[i]];
      temp_y = arry[i];
    }
    pos.x = tempnote.getAbsoluteX();
    pos.y = tempnote.getStave().getYForLine(temp_y);

    retShift.push(pos);
  }
  return retShift;
}

var UniqueIds;
function getUniqueNoteheadIds(notes, arr = []) {
    //すべてのidを格納するためのセットを作成
    let tempnote;
    uniqueIds = new Set();
    for(let i = 0; i < arr.length || i == 0; i++){
    //notesのchildrenの各要素について処理
      if(arr.length === 0){
        tempnote = notes;
      }
      else{
        tempnote = notes[arr[i]];
      }
      if (tempnote.attrs){
        if(tempnote.attrs.type === "StaveNote") {
          uniqueIds.add(tempnote.attrs.id);
        }
      }
      tempnote.children.forEach(child => {
        //typeが"notehead"であるかチェックし、idを取得
        if (child.attrs){
          if(child.attrs.type === "Stem") {
            uniqueIds.add(child.attrs.id);
          }
          if(child.attrs.type === "NoteHead") {
            uniqueIds.add(child.attrs.id);
          }
        }
      });
    }
    // セットを配列に変換して戻り値として返す
    return Array.from(uniqueIds);
}

function updateAllUniqueIds(UniqueIds) {
    // allUniqueIdsにUniqueIdsを追加または結合
    if (allUniqueIds.length === 0) {//allUniqueIdsはグローバルな変数
      // allUniqueIdsが空の場合、UniqueIdsをそのままコピー
      allUniqueIds = [...UniqueIds];//スプレッド演算子で要素の中身を書き出す。
    } else {
      UniqueIds.forEach(id => {
        if (!allUniqueIds.includes(id)) {
            allUniqueIds.push(id);
        }
      });
    }
    // 更新されたallUniqueIdsを戻り値として返す
    return allUniqueIds;
}

var SteveNoteUniqueIds;
function getUniqueStaveNotesIds(notes, arr = []) {
    //すべてのidを格納するためのセットを作成
    let tempnote;
    uniqueIds = new Set();
    for(let i = 0; i < arr.length || i == 0; i++){
    //notesのchildrenの各要素について処理
      if(arr.length === 0){
        tempnote = notes;
      }
      else{
        tempnote = notes[arr[i]];
      }
      if (tempnote.attrs){
        if(tempnote.attrs.type === "StaveNote") {
          uniqueIds.add(tempnote.attrs.id);
        }
      }
    }
    // セットを配列に変換して戻り値として返す
    return Array.from(uniqueIds);
}

function updateAllFlagUniqueIds(FlagUniqueIds) {
    // allUniqueIdsにUniqueIdsを追加または結合
    if (allFlagUniqueIds.length === 0) {
      // allUniqueIdsが空の場合、UniqueIdsをそのままコピー
      allFlagUniqueIds = [...FlagUniqueIds];//スプレッド演算子で要素の中身を書き出す。
    } else {
      FlagUniqueIds.forEach(id => {
        if (!allFlagUniqueIds.includes(id)) {
            allFlagUniqueIds.push(id);
        }
      });
    }
    // 更新されたallUniqueIdsを戻り値として返す
    return allFlagUniqueIds;
}

function dotted(staveNote, noteIndex = -1) {
  if (noteIndex < 0) {
    Dot.buildAndAttach([staveNote], {
      all: true
    });
  } 
  else {
    for(noteIndexValue of noteIndex){
      Dot.buildAndAttach([staveNote], {
        index: noteIndexValue
      });
    }
  }
  return staveNote;
}

const {
  Factory,
  Stave,
  StaveNote,
  Formatter,
  Voice,
  StaveTie,
  BarLine,
  Beam,
  Dot,
  StaveConnector,
  Modifier,
  RenderContext,
  TextDynamics,
  Articulation,
  TextNote,
  Crescendo,
  Renderer
} = Vex.Flow;

let nscale = 0.64;
let nwidth = 1040;
let nheight = 1120;

let nHeadMargin = 70;
let nStaveWidth = 350;

const f = new Factory({ 
  renderer: { elementId: 'yonet202403Mid_Output01', width: nwidth, height: nheight * nscale }
  });
const ctx = f.getContext();
ctx.scale(nscale, nscale);

const defaultStyle = {
  lineWidth: ctx.lineWidth,
  strokeStyle: ctx.strokeStyle,
};

for (let i = 0; i <= nwidth * (1 / nscale); i += 10) {
  ctx.beginPath();
  ctx.moveTo(0 + i, 0);
  ctx.lineTo(0 + i, nheight);
  if (i % 100 === 0){
    ctx.setLineWidth(1);
    ctx.setStrokeStyle('rgba(200, 200, 200, 0.8)');
  }
  else{
    ctx.setLineWidth(0.5);
    ctx.setStrokeStyle('rgba(230, 230, 230, 0.8)');
  }
  ctx.stroke();
}

for (let i = 0; i <= nheight; i += 10) {
  ctx.beginPath();
  ctx.moveTo(0, i);
  ctx.lineTo(nwidth * (1 / nscale), i);
  if (i % 100 === 0){
    ctx.setLineWidth(1);
    ctx.setStrokeStyle('rgba(200, 200, 200, 0.8)');
  }
  else{
    ctx.setLineWidth(0.5);
    ctx.setStrokeStyle('rgba(230, 230, 230, 0.8)');
  }
  ctx.stroke();
}

ctx.lineWidth = defaultStyle.lineWidth;
ctx.strokeStyle = defaultStyle.strokeStyle;

const VocalSt1 = new Stave(80, 30, nHeadMargin + nStaveWidth).setContext(ctx);
VocalSt1.setClef("treble").setContext(ctx);
VocalSt1.setTimeSignature('4/4').setContext(ctx);
VocalSt1.addKeySignature('D').setContext(ctx);
VocalSt1.setMeasure(1);
VocalSt1.draw();

Vocal.x = VocalSt1.x - 30;
Vocal.y = VocalSt1.y + 90; 

const VocalSt2 = f.Stave({ x: VocalSt1.width + VocalSt1.x, y: VocalSt1.y, width: nStaveWidth });
VocalSt2.setMeasure(2);
VocalSt2.setContext(ctx).draw();

const VocalSt3 = new Stave(VocalSt2.width + VocalSt2.x, VocalSt1.y, nStaveWidth).setContext(ctx);
VocalSt3.setMeasure(3);
VocalSt3.draw();

const VocalSt4 = new VF.Stave(VocalSt3.width + VocalSt3.x, VocalSt1.y, nStaveWidth).setContext(ctx);
VocalSt4.setMeasure(4);
VocalSt4.draw();

const Guitar1St1 = new VF.Stave(VocalSt1.x, VocalSt1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar1St1.addClef("treble").setContext(ctx);
Guitar1St1.addTimeSignature('4/4').setContext(ctx);
Guitar1St1.addKeySignature('D').setContext(ctx);
Guitar1St1.draw();

const Guitar1_St1_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "4" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St1_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

];
UniqueIds = getUniqueNoteheadIds(Guitar1_St1_notes_1, [0, 1, 2, 3, 4, 5, 6]);
allUniqueIds = updateAllUniqueIds(UniqueIds);

const Guitar1_St1_beam_1 = new VF.Beam([Guitar1_St1_notes_1[1], Guitar1_St1_notes_1[2]]);
const Guitar1_St1_beam_2 = new VF.Beam([
  Guitar1_St1_notes_1[3], Guitar1_St1_notes_1[4], Guitar1_St1_notes_1[5], Guitar1_St1_notes_1[6]
  ]);

var Guitar1_St1_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St1_Voice_1.setStrict(true);
Guitar1_St1_Voice_1.addTickables(Guitar1_St1_notes_1);

var Guitar1_St1_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St1_Voice_2.setStrict(true);
Guitar1_St1_Voice_2.addTickables(Guitar1_St1_notes_2);

var formatterGuitar1_St1 = new VF.Formatter().joinVoices([Guitar1_St1_Voice_1, Guitar1_St1_Voice_2]);
formatterGuitar1_St1.format([Guitar1_St1_Voice_1, Guitar1_St1_Voice_2], nStaveWidth - 40 - 10);
Guitar1_St1_Voice_1.draw(ctx, Guitar1St1);
Guitar1_St1_Voice_2.draw(ctx, Guitar1St1);

Guitar1_St1_beam_1.setContext(ctx).draw();
Guitar1_St1_beam_2.setContext(ctx).draw();

shiftGuitar1_1st= addShift(
  Guitar1_St1_notes_1, 
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3]
);



const Guitar1St2 = new Stave(Guitar1St1.width + Guitar1St1.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Guitar1St2.draw();

const Guitar1_St2_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "4" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St2_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

];
UniqueIds = getUniqueNoteheadIds(Guitar1_St2_notes_1, [0, 1, 2, 3, 4, 5, 6]);
allUniqueIds = updateAllUniqueIds(UniqueIds);

const Guitar1_St2_beam_1 = new VF.Beam([Guitar1_St2_notes_1[1], Guitar1_St2_notes_1[2]]);
const Guitar1_St2_beam_2 = new VF.Beam([
  Guitar1_St2_notes_1[3], Guitar1_St2_notes_1[4], Guitar1_St2_notes_1[5], Guitar1_St2_notes_1[6]
  ]);

var Guitar1_St2_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St2_Voice_1.setStrict(true);
Guitar1_St2_Voice_1.addTickables(Guitar1_St2_notes_1);

var Guitar1_St2_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St2_Voice_2.setStrict(true);
Guitar1_St2_Voice_2.addTickables(Guitar1_St2_notes_2);

var formatterGuitar1_St2 = new VF.Formatter().joinVoices([Guitar1_St2_Voice_1, Guitar1_St2_Voice_2]);
formatterGuitar1_St2.format([Guitar1_St2_Voice_1, Guitar1_St2_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St2_Voice_1.draw(ctx, Guitar1St2);
Guitar1_St2_Voice_2.draw(ctx, Guitar1St2);

Guitar1_St2_beam_1.setContext(ctx).draw();
Guitar1_St2_beam_2.setContext(ctx).draw();

shiftGuitar1_2st= addShift(
  Guitar1_St2_notes_1, 
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3.8]
);



const Guitar1St3 = new Stave(Guitar1St2.width + Guitar1St2.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Guitar1St3.draw();

const Guitar1_St3_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "4" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St3_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

];
UniqueIds = getUniqueNoteheadIds(Guitar1_St3_notes_1, [0, 1, 2, 3, 4, 5, 6]);
allUniqueIds = updateAllUniqueIds(UniqueIds);

const Guitar1_St3_beam_1 = new VF.Beam([Guitar1_St3_notes_1[1], Guitar1_St3_notes_1[2]]);
const Guitar1_St3_beam_2 = new VF.Beam([
  Guitar1_St3_notes_1[3], Guitar1_St3_notes_1[4], Guitar1_St3_notes_1[5], Guitar1_St3_notes_1[6]
  ]);

var Guitar1_St3_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St3_Voice_1.setStrict(true);
Guitar1_St3_Voice_1.addTickables(Guitar1_St3_notes_1);

var Guitar1_St3_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St3_Voice_2.setStrict(true);
Guitar1_St3_Voice_2.addTickables(Guitar1_St3_notes_2);

var formatterGuitar1_St3 = new VF.Formatter().joinVoices([Guitar1_St3_Voice_1, Guitar1_St3_Voice_2]);
formatterGuitar1_St3.format([Guitar1_St3_Voice_1, Guitar1_St3_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St3_Voice_1.draw(ctx, Guitar1St3);
Guitar1_St3_Voice_2.draw(ctx, Guitar1St3);

Guitar1_St3_beam_1.setContext(ctx).draw();
Guitar1_St3_beam_2.setContext(ctx).draw();

shiftGuitar1_3st= addShift(
  Guitar1_St3_notes_1, 
  [0, 1, 2, 3, 4, 5, 6],
  [3, 3, 3, 3, 3, 3, 3.8]
);




const Guitar1St4 = new Stave(Guitar1St3.width + Guitar1St3.x, Guitar1St1.y, nStaveWidth).setContext(ctx);
Guitar1St4.draw();

const Guitar1_St4_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),

  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "8" }),
];
const Guitar1_St4_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

];
UniqueIds = getUniqueNoteheadIds(Guitar1_St4_notes_1, [0, 1, 2, 3, 4, 5, 6, 7]);
allUniqueIds = updateAllUniqueIds(UniqueIds);

const Guitar1_St4_beam_1 = new VF.Beam([
  Guitar1_St4_notes_1[0], Guitar1_St4_notes_1[1], Guitar1_St4_notes_1[2], Guitar1_St4_notes_1[3]
  ]);
const Guitar1_St4_beam_2 = new VF.Beam([
  Guitar1_St4_notes_1[4], Guitar1_St4_notes_1[5], Guitar1_St4_notes_1[6], Guitar1_St4_notes_1[7]
  ]);

var Guitar1_St4_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St4_Voice_1.setStrict(true);
Guitar1_St4_Voice_1.addTickables(Guitar1_St4_notes_1);

var Guitar1_St4_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar1_St4_Voice_2.setStrict(true);
Guitar1_St4_Voice_2.addTickables(Guitar1_St4_notes_2);

var formatterGuitar1_St4 = new VF.Formatter().joinVoices([Guitar1_St4_Voice_1, Guitar1_St4_Voice_2]);
formatterGuitar1_St4.format([Guitar1_St4_Voice_1, Guitar1_St4_Voice_2], nStaveWidth - 20 - 10);
Guitar1_St4_Voice_1.draw(ctx, Guitar1St4);
Guitar1_St4_Voice_2.draw(ctx, Guitar1St4);

Guitar1_St4_beam_1.setContext(ctx).draw();
Guitar1_St4_beam_2.setContext(ctx).draw();

shiftGuitar1_4st= addShift(
  Guitar1_St4_notes_1, 
  [0, 1, 2, 3, 4, 5, 6, 7],
  [3, 3, 3, 3, 3, 3, 3, 3.8]
);



const Guitar1_tab1 = new Stave(Guitar1St1.x, Guitar1St1.y + 110, nHeadMargin + nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar1_tab1.setConfigForLine(i, {visible: false} );
}
Guitar1_tab1.draw();

const Guitar1_tab2 = new Stave(Guitar1_tab1.width + Guitar1_tab1.x, Guitar1_tab1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar1_tab2.setConfigForLine(i, {visible: false} );
}
Guitar1_tab2.draw();

const Guitar1_tab3 = new Stave(Guitar1_tab2.width + Guitar1_tab2.x, Guitar1_tab1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar1_tab3.setConfigForLine(i, {visible: false} );
}
Guitar1_tab3.draw();

const Guitar1_tab4 = new Stave(Guitar1_tab3.width + Guitar1_tab3.x, Guitar1_tab1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar1_tab4.setConfigForLine(i, {visible: false} );
}
Guitar1_tab4.draw();

const Guitar1_Tab1 = new Stave(Guitar1St1.x, Guitar1St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar1_Tab1.draw();

Stave9Pos.x = Guitar1_Tab1.x;
Stave9Pos.y = Guitar1_Tab1.y;

var connector9_2 = new VF.StaveConnector(Guitar1St1, Guitar1_Tab1);
connector9_2.setType(VF.StaveConnector.type.BRACKET);
connector9_2.setContext(ctx);
connector9_2.draw();

Guitar1Inst.x = VocalSt1.x - 30;
Guitar1Inst.y = Guitar1St1.y + ((Guitar1_Tab1.y - Guitar1St1.y) / 2) + 90; 

const Guitar1_Tab1_1 = new Stave(Guitar1_Tab1.x + nHeadMargin + 20, Guitar1_Tab1.y, 0).setContext(ctx);
Guitar1_Tab1_1.setBegBarType(VF.Barline.type.NONE);
Guitar1_Tab1_1.setEndBarType(VF.Barline.type.NONE);
Guitar1_Tab1_1.draw();

Guitar1tab_1st.x = Guitar1_Tab1_1.x
Guitar1tab_1st.y = Guitar1_Tab1_1.y



const Guitar1_Tab2 = new Stave(Guitar1_Tab1.width + Guitar1_Tab1.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab2.draw();

Guitar1tab_2st.x = Guitar1_Tab2.x
Guitar1tab_2st.y = Guitar1_Tab2.y

const Guitar1_Tab3 = new Stave(Guitar1_Tab2.width + Guitar1_Tab2.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab3.draw();

Guitar1tab_3st.x = Guitar1_Tab3.x
Guitar1tab_3st.y = Guitar1_Tab3.y

const Guitar1_Tab4 = new Stave(Guitar1_Tab3.width + Guitar1_Tab3.x, Guitar1_Tab1.y, nStaveWidth).setContext(ctx);
Guitar1_Tab4.draw();

Guitar1tab_4st.x = Guitar1_Tab4.x
Guitar1tab_4st.y = Guitar1_Tab4.y


const Guitar2_St1 = new Stave(Guitar1_Tab1.x, Guitar1_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar2_St1.addClef("treble").setContext(ctx);
Guitar2_St1.addTimeSignature('4/4').setContext(ctx);
Guitar2_St1.addKeySignature('D').setContext(ctx);
Guitar2_St1.draw();

const Guitar2_St1_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "1" }),
];
const Guitar2_St1_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

];
UniqueIds = getUniqueNoteheadIds(Guitar2_St1_notes_1, [0]);
allUniqueIds = updateAllUniqueIds(UniqueIds);

var Guitar2_St1_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St1_Voice_1.setStrict(true);
Guitar2_St1_Voice_1.addTickables(Guitar2_St1_notes_1);

var Guitar2_St1_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St1_Voice_2.setStrict(true);
Guitar2_St1_Voice_2.addTickables(Guitar2_St1_notes_2);

var formatterGuitar2_St1 = new VF.Formatter().joinVoices([Guitar2_St1_Voice_1, Guitar2_St1_Voice_2]);
formatterGuitar2_St1.format([Guitar2_St1_Voice_1, Guitar2_St1_Voice_2], nStaveWidth - 20 - 10);
Guitar2_St1_Voice_1.draw(ctx, Guitar2_St1);
Guitar2_St1_Voice_2.draw(ctx, Guitar2_St1);

shiftGuitar2_1st= addShift(
  Guitar2_St1_notes_1, 
  [0],
  [3]
);

const Guitar2_St2 = new Stave(Guitar2_St1.width + Guitar2_St1.x, Guitar2_St1.y, nStaveWidth).setContext(ctx);
Guitar2_St2.draw();

const Guitar2_St2_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "2" }),
  new VF.StaveNote({ keys: ["b/4"], duration: "2" }),
];
const Guitar2_St2_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

];
UniqueIds = getUniqueNoteheadIds(Guitar2_St2_notes_1, [0, 1]);
allUniqueIds = updateAllUniqueIds(UniqueIds);

var Guitar2_St2_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St2_Voice_1.setStrict(true);
Guitar2_St2_Voice_1.addTickables(Guitar2_St2_notes_1);

var Guitar2_St2_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St2_Voice_2.setStrict(true);
Guitar2_St2_Voice_2.addTickables(Guitar2_St2_notes_2);

var formatterGuitar2_St2 = new VF.Formatter().joinVoices([Guitar2_St2_Voice_1, Guitar2_St2_Voice_2]);
formatterGuitar2_St2.format([Guitar2_St2_Voice_1, Guitar2_St2_Voice_2], nStaveWidth - 20 - 10);
Guitar2_St2_Voice_1.draw(ctx, Guitar2_St2);
Guitar2_St2_Voice_2.draw(ctx, Guitar2_St2);

shiftGuitar2_2st= addShift(
  Guitar2_St2_notes_1, 
  [0, 1],
  [3, 3]
);

const Guitar2_St2_1 = new Stave(Guitar2_St1.width + Guitar2_St1.x + 45, Guitar2_St1.y, 0).setContext(ctx);
Guitar2_St2_1.setBegBarType(VF.Barline.type.NONE);
Guitar2_St2_1.setEndBarType(VF.Barline.type.NONE);
Guitar2_St2_1.draw();


const Guitar2_St3 = new Stave(Guitar2_St2.width + Guitar2_St2.x, Guitar2_St2.y, nStaveWidth).setContext(ctx);
Guitar2_St3.draw();

const Guitar2_St3_notes_1 = [
  new VF.StaveNote({ keys: ["b/4"], duration: "2", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "4", stem_direction: -1 }),
  new VF.StaveNote({ keys: ["b/4"], duration: "4", stem_direction: -1 }),
];
const Guitar2_St3_notes_2 = [
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),
  new VF.GhostNote({ keys: ["f/4"], duration: "16"}),

];
UniqueIds = getUniqueNoteheadIds(Guitar2_St3_notes_1, [0, 1, 2]);
allUniqueIds = updateAllUniqueIds(UniqueIds);

var Guitar2_St3_Voice_1 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St3_Voice_1.setStrict(true);
Guitar2_St3_Voice_1.addTickables(Guitar2_St3_notes_1);

var Guitar2_St3_Voice_2 = new VF.Voice({ num_beats: 4, beat_value: 4 });
Guitar2_St3_Voice_2.setStrict(true);
Guitar2_St3_Voice_2.addTickables(Guitar2_St3_notes_2);

var formatterGuitar2_St3 = new VF.Formatter().joinVoices([Guitar2_St3_Voice_1, Guitar2_St3_Voice_2]);
formatterGuitar2_St3.format([Guitar2_St3_Voice_1, Guitar2_St3_Voice_2], nStaveWidth - 20 - 10);
Guitar2_St3_Voice_1.draw(ctx, Guitar2_St3);
Guitar2_St3_Voice_2.draw(ctx, Guitar2_St3);

shiftGuitar2_3st= addShift(
  Guitar2_St3_notes_1, 
  [0, 1, 2],
  [1, 1, 1]
);

const Guitar2_St4 = new Stave(Guitar2_St3.width + Guitar2_St3.x, Guitar2_St3.y, nStaveWidth).setContext(ctx);
Guitar2_St4.draw();


const Guitar2_Tab1_1 = new Stave(Guitar2_St1.x + nHeadMargin + 20, Guitar2_St1.y + 120, 0).setContext(ctx);
Guitar2_Tab1_1.setBegBarType(VF.Barline.type.NONE);
Guitar2_Tab1_1.setEndBarType(VF.Barline.type.NONE);
Guitar2_Tab1_1.draw();
const Guitar2_Tab1 = new Stave(Guitar2_St1.x, Guitar2_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Guitar2_Tab1.draw();

Guitar2tab_1st.x = Guitar2_Tab1_1.x;
Guitar2tab_1st.y = Guitar2_Tab1_1.y;

Guitar2Tab1.x = Guitar2_Tab1.x;
Guitar2Tab1.y = Guitar2_Tab1.y;

const Guitar2_Tab2 = new Stave(Guitar2_Tab1.width + Guitar2_Tab1.x, Guitar2_Tab1.y, nStaveWidth).setContext(ctx);
Guitar2_Tab2.draw();


const Guitar2_Tab2_1 = new Stave(Guitar2_Tab1.width + Guitar2_Tab1.x + 45, Guitar2_Tab1.y, 0).setContext(ctx);
Guitar2_Tab2_1.setBegBarType(VF.Barline.type.NONE);
Guitar2_Tab2_1.setEndBarType(VF.Barline.type.NONE);
Guitar2_Tab2_1.draw();

Guitar2tab_2st.x = Guitar2_Tab2.x;
Guitar2tab_2st.y = Guitar2_Tab2.y;

const Guitar2_Tab3 = new Stave(Guitar2_Tab2.width + Guitar2_Tab2.x, Guitar2_Tab2.y, nStaveWidth).setContext(ctx);
Guitar2_Tab3.draw();

Guitar2tab_3st.x = Guitar2_Tab3.x;
Guitar2tab_3st.y = Guitar2_Tab3.y;


const Guitar2_Tab4 = new Stave(Guitar2_Tab3.width + Guitar2_Tab3.x, Guitar2_Tab3.y, nStaveWidth).setContext(ctx);
Guitar2_Tab4.draw();

Guitar2tab_4st.x = Guitar2_Tab4.x;
Guitar2tab_4st.y = Guitar2_Tab4.y;

var Guitar2_connect = new VF.StaveConnector(Guitar2_St1, Guitar2_Tab1);
Guitar2_connect.setType(VF.StaveConnector.type.BRACKET);
Guitar2_connect.setContext(ctx);
Guitar2_connect.draw();

const Guitar2_Tab1_tab = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y - 10, nHeadMargin + nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab1_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab1_tab.draw();

const Guitar2_Tab2_tab = new Stave(Guitar2_Tab1_tab.width + Guitar2_Tab1_tab.x, Guitar2_Tab1_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab2_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab2_tab.draw();

const Guitar2_Tab3_tab = new Stave(Guitar2_Tab2_tab.width + Guitar2_Tab2_tab.x, Guitar2_Tab2_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab3_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab3_tab.draw();

const Guitar2_Tab4_tab = new Stave(Guitar2_Tab3_tab.width + Guitar2_Tab3_tab.x, Guitar2_Tab3_tab.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 0) continue;
  Guitar2_Tab4_tab.setConfigForLine(i, {visible: false} );
}
Guitar2_Tab4_tab.draw();

Guitar2Inst.x = Guitar2_St1.x - 30;
Guitar2Inst.y = Guitar2_St1.y + ((Guitar2_Tab1.y - Guitar2_St1.y) / 2) + 90; 

const Base_St1 = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Base_St1.addClef("bass").setContext(ctx);
Base_St1.addTimeSignature('4/4').setContext(ctx);
Base_St1.addKeySignature('D').setContext(ctx);
Base_St1.draw();

const Base_St2 = new Stave(Base_St1.width + Base_St1.x, Base_St1.y, nStaveWidth).setContext(ctx);
Base_St2.draw();

const Base_St3 = new Stave(Base_St2.width + Base_St2.x, Base_St2.y, nStaveWidth).setContext(ctx);
Base_St3.draw();

const Base_St4 = new Stave(Base_St3.width + Base_St3.x, Base_St3.y, nStaveWidth).setContext(ctx);
Base_St4.draw();

const Base_Tab1 = new Stave(Base_St1.x, Base_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Base_Tab1.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab1.setConfigForLine(i, {visible: false} );
}
Base_Tab1.draw();

BaseTab1.x = Base_Tab1.x;
BaseTab1.y = Base_Tab1.y;

BaseInst.x = Base_St1.x - 30;
BaseInst.y = Base_St1.y + ((Base_Tab1.y - Base_St1.y) / 2) + 90; 

StaveBase1 = Base_Tab1;

const Base_Tab2 = new Stave(Base_Tab1.width + Base_Tab1.x, Base_Tab1.y, nStaveWidth).setContext(ctx);
Base_Tab2.setBegBarType(VF.Barline.type.NONE);
Base_Tab2.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab2.setConfigForLine(i, {visible: false} );
}
Base_Tab2.draw();

StaveBase2 = Base_Tab2;

const Base_Tab3 = new Stave(Base_Tab2.width + Base_Tab2.x, Base_Tab2.y, nStaveWidth).setContext(ctx);
Base_Tab3.setBegBarType(VF.Barline.type.NONE);
Base_Tab3.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab3.setConfigForLine(i, {visible: false} );
}
Base_Tab3.draw();

StaveBase3 = Base_Tab3;

const Base_Tab4 = new Stave(Base_Tab3.width + Base_Tab3.x, Base_Tab3.y, nStaveWidth).setContext(ctx);
Base_Tab4.setBegBarType(VF.Barline.type.NONE);
Base_Tab4.setEndBarType(VF.Barline.type.NONE);
for (var i = 0; i < 5; i++) {
  if (i != 0) continue;
  Base_Tab4.setConfigForLine(i, {visible: false} );
}
Base_Tab4.draw();

StaveBase4 = Base_Tab4;

var Base_connect = new VF.StaveConnector(Base_St1, Base_Tab1);
Base_connect.setType(VF.StaveConnector.type.BRACKET);
Base_connect.setContext(ctx);
Base_connect.draw();

const Drum_St1 = new Stave(Base_Tab1.x, Base_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx);
Drum_St1.addClef("bass").setContext(ctx);
Drum_St1.addTimeSignature('4/4').setContext(ctx);
Drum_St1.draw();

DrumInst.x = Drum_St1.x - 30;
DrumInst.y = Drum_St1.y + 90; 

const Drum_St1_1 = new Stave(nHeadMargin + Base_Tab1.x, Base_Tab1.y + 120, 0).setContext(ctx);
Drum_St1_1.setBegBarType(VF.Barline.type.NONE);
Drum_St1_1.setEndBarType(VF.Barline.type.NONE);
Drum_St1_1.draw();

const Drum_St1_2 = new Stave(nHeadMargin + Base_Tab1.x, Base_Tab1.y + 120, 0).setContext(ctx);
Drum_St1_2.setBegBarType(VF.Barline.type.NONE);
Drum_St1_2.setEndBarType(VF.Barline.type.NONE);
Drum_St1_2.draw();

const Drum_St2 = new Stave(Drum_St1.width + Drum_St1.x, Drum_St1.y, nStaveWidth).setContext(ctx);
Drum_St2.draw();


const Drum_St3 = new Stave(Drum_St2.width + Drum_St2.x, Drum_St1.y, nStaveWidth).setContext(ctx);
Drum_St3.draw();


const Drum_St4 = new Stave(Drum_St3.width + Drum_St3.x, Drum_St1.y, nStaveWidth).setContext(ctx);
Drum_St4.draw();


const Perc_St1 = new Stave(Drum_St1.x, Drum_St1.y + 100, nHeadMargin + nStaveWidth).setContext(ctx);
Perc_St1.addTimeSignature('4/4').setContext(ctx);

const Perc_St1_1 = new Stave(nHeadMargin + Drum_St1.x, Drum_St1.y + 100, 0).setContext(ctx);
Perc_St1_1.setBegBarType(VF.Barline.type.NONE);
Perc_St1_1.setEndBarType(VF.Barline.type.NONE);
Perc_St1_1.draw();

for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St1.setConfigForLine(i, {visible: false} );
}

Perc_St1.draw();

PercInst.x = Perc_St1.x - 30;
PercInst.y = Perc_St1.y + 90; 

var AllConnector = new VF.StaveConnector(VocalSt1, Perc_St1);
AllConnector.setType(VF.StaveConnector.type.SINGLE);
AllConnector.setContext(ctx);
AllConnector.draw();


const Perc_St2 = new Stave(Perc_St1.width + Perc_St1.x, Perc_St1.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St2.setConfigForLine(i, {visible: false} );
}
Perc_St2.draw();

const Perc_St3 = new Stave(Perc_St2.width + Perc_St2.x, Perc_St2.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St3.setConfigForLine(i, {visible: false} );
}
Perc_St3.draw();

const Perc_St4 = new Stave(Perc_St3.width + Perc_St3.x, Perc_St3.y, nStaveWidth).setContext(ctx);
for (var i = 0; i < 5; i++) {
  if (i == 2) continue;
  Perc_St4.setConfigForLine(i, {visible: false} );
}
Perc_St4.draw();

})();

const svgElement2 = document.querySelector('#yonet202403Mid_Output01 svg');
svgElement2.style.backgroundColor = '#F5F5F5';
var svgContainer = document.getElementById('yonet202403Mid_Output01');
var svgElement = svgContainer.querySelector('svg');

var VocalText_options = {
    textContent: ["Vocal"], // 必須文字列
    strID: "VocalText", // 必須
    Stave_x: Vocal.x,
    Stave_y: Vocal.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(VocalText_options);

var EGuitarText_options = {
    textContent: ["E.Guitar1"], // 必須文字列
    strID: "EGuitarText", // 必須
    Stave_x: Guitar1Inst.x,
    Stave_y: Guitar1Inst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(EGuitarText_options);

var EGuitarTab_options = {
    textContent: ["@"], // 必須文字列
    strID: "EGuitarTab", // 必須
    Stave_x: Stave9Pos.x,
    Stave_y: Stave9Pos.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 80,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(EGuitarTab_options);

//shiftGuitar1_1st
var Guitar1_st1_option = {
    textContent: [";", ";", ";", ";", ";", ";", ";"], // 必須文字列
    strID: "Guitar1_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_1st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st1_option);



var Guitar1_st2_option = {
    textContent: [";", ";", ";", ";", ";", ";", "\uFF64"], // 必須文字列
    strID: "Guitar1_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_2st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st2_option);

insertTiePathToSVG({x:shiftGuitar1_2st[2].x , y:shiftGuitar1_2st[2].y + 10}, {x:shiftGuitar1_2st[2].x + 35, y:shiftGuitar1_2st[2].y + 10});

var Guitar1_st3_option = {
    textContent: [";", ";", ";", ";", ";", ";", "\uFF64"], // 必須文字列
    strID: "Guitar1_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_3st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st3_option);

insertTiePathToSVG({x:shiftGuitar1_3st[2].x , y:shiftGuitar1_3st[2].y + 10}, {x:shiftGuitar1_3st[2].x + 35, y:shiftGuitar1_3st[2].y + 10});

var Guitar1_st4_option = {
    textContent: [";", ";", ";", ";", ";", ";", ";", "\uFF64"], // 必須文字列
    strID: "Guitar1_st4", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar1_4st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1_st4_option);

insertTiePathToSVG({x:shiftGuitar1_4st[0].x , y:shiftGuitar1_4st[0].y + 10}, {x:shiftGuitar1_4st[0].x + 35, y:shiftGuitar1_4st[0].y + 10});

insertTiePathToSVG({x:shiftGuitar1_4st[3].x , y:shiftGuitar1_4st[3].y + 10}, {x:shiftGuitar1_4st[3].x + 35, y:shiftGuitar1_4st[3].y + 10});

insertArrowPathToSVG({x:shiftGuitar1_4st[1].x + 10 , y:shiftGuitar1_4st[1].y + 20}, {x:shiftGuitar1_4st[1].x + 45, y:shiftGuitar1_4st[1].y + 70});

//u254F左利き用4線フレット
insertTiePathToSVG({x:shiftGuitar1_1st[2].x , y:shiftGuitar1_1st[2].y + 10}, {x:shiftGuitar1_1st[2].x + 35, y:shiftGuitar1_1st[2].y + 10});

var Guitar1tab_st1_option = {
    textContent: ["\uFFAF", "3", "2", "1", ":", ":", "/", "/", "/", "/"], // 必須文字列
    strID: "Guitar1tab_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_1st.x + 10, y:Guitar1tab_1st.y + 80},
{x:Guitar1tab_1st.x + 15, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 30, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 45, y:Guitar1tab_1st.y + 90},
{x:Guitar1tab_1st.x + 27, y:Guitar1tab_1st.y + 70},//4弦中ポジ
{x:Guitar1tab_1st.x + 27, y:Guitar1tab_1st.y + 60},//5弦中ポジ
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 30},//1弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 40},//2弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 50},//3弦ネックマーク
{x:Guitar1tab_1st.x + 60, y:Guitar1tab_1st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st1_option);

var Guitar1tab_st2_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", ":", ":", "["], // 必須文字列
    strID: "Guitar1tab_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 80},
{x:Guitar1tab_2st.x + 15, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 30, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 45, y:Guitar1tab_2st.y + 90},
{x:Guitar1tab_2st.x + 27, y:Guitar1tab_2st.y + 50},//3弦中ポジ
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 60},//4弦内ポジ
{x:Guitar1tab_2st.x + 10, y:Guitar1tab_2st.y + 70},//5弦内ポジ
{x:Guitar1tab_2st.x + 42, y:Guitar1tab_2st.y + 80},//外全セーハ
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_2st.x + 60, y:Guitar1tab_2st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st2_option);

var Guitar1tab_st3_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", "_", "?", "?"], // 必須文字列
    strID: "Guitar1tab_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 80},
{x:Guitar1tab_3st.x + 15, y:Guitar1tab_3st.y + 90},
{x:Guitar1tab_3st.x + 30, y:Guitar1tab_3st.y + 90},
{x:Guitar1tab_3st.x + 45, y:Guitar1tab_3st.y + 90},
//{x:Guitar1tab_3st.x + 27, y:Guitar1tab_3st.y + 50},//3弦中ポジ
//{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 60},//4弦内ポジ
{x:Guitar1tab_3st.x + 42, y:Guitar1tab_3st.y + 70},//5弦外ポジ
{x:Guitar1tab_3st.x + 10, y:Guitar1tab_3st.y + 60},//内全セーハ
//{x:Guitar1tab_3st.x + 42, y:Guitar1tab_3st.y + 60},//外全セーハ
{x:Guitar1tab_3st.x + 80, y:Guitar1tab_3st.y + 30},//1弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 60},//4弦ネックマーク
//{x:Guitar1tab_3st.x + 60, y:Guitar1tab_3st.y + 70},//5弦ネックマーク
{x:Guitar1tab_3st.x + 80, y:Guitar1tab_3st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st3_option);

var Guitar1tab_st4_option = {
    textContent: ["\uFF03", "6", "5", "4", ":", "_", "?", "?", "\uFF03", "7", "6", "5", ":", "_", "?", "?"], // 必須文字列
    strID: "Guitar1tab_st4", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 80},
{x:Guitar1tab_4st.x + 15, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 30, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 45, y:Guitar1tab_4st.y + 90},
//{x:Guitar1tab_4st.x + 27, y:Guitar1tab_4st.y + 50},//3弦中ポジ
//{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 60},//4弦内ポジ
{x:Guitar1tab_4st.x + 42, y:Guitar1tab_4st.y + 70},//5弦外ポジ
{x:Guitar1tab_4st.x + 10, y:Guitar1tab_4st.y + 60},//内全セーハ
//{x:Guitar1tab_4st.x + 42, y:Guitar1tab_4st.y + 60},//外全セーハ
{x:Guitar1tab_4st.x + 80, y:Guitar1tab_4st.y + 30},//1弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 40},//2弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 50},//3弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 60},//4弦ネックマーク
//{x:Guitar1tab_4st.x + 60, y:Guitar1tab_4st.y + 70},//5弦ネックマーク
{x:Guitar1tab_4st.x + 80, y:Guitar1tab_4st.y + 80},//6弦ネックマーク

{x:Guitar1tab_4st.x + 100 + 10, y:Guitar1tab_4st.y + 80},
{x:Guitar1tab_4st.x + 100 + 15, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 100 + 30, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 100 + 45, y:Guitar1tab_4st.y + 90},
{x:Guitar1tab_4st.x + 100 + 42, y:Guitar1tab_4st.y + 70},//5弦外ポジ
{x:Guitar1tab_4st.x + 100 + 10, y:Guitar1tab_4st.y + 60},//内全セーハ
{x:Guitar1tab_4st.x + 100 + 80, y:Guitar1tab_4st.y + 30},//1弦ネックマーク
{x:Guitar1tab_4st.x + 100 + 80, y:Guitar1tab_4st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar1tab_st4_option);

var Guitar2_st1_option = {
    textContent: [","], // 必須文字列
    strID: "Guitar2_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar2_1st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st1_option);

var Guitar2_st2_option = {
    textContent: ["*"], // 必須文字列
    strID: "Guitar2_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar2_2st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st2_option);

var Guitar2_st3_option = {
    textContent: ["\uFF88", "\uFF87", "\uFF87"], // 必須文字列
    strID: "Guitar2_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: shiftGuitar2_3st,
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2_st3_option);


var Guitar2tab_st1_option = {
    textContent: ["\uFFAF", "3", "2", "1", ":", ":", "/", "/", "/", "/"], // 必須文字列
    strID: "Guitar2tab_st1", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_1st.x + 10, y:Guitar2tab_1st.y + 80},
{x:Guitar2tab_1st.x + 15, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 30, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 45, y:Guitar2tab_1st.y + 90},
{x:Guitar2tab_1st.x + 27, y:Guitar2tab_1st.y + 70},//4弦中ポジ
{x:Guitar2tab_1st.x + 27, y:Guitar2tab_1st.y + 60},//5弦中ポジ
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 30},//1弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 40},//2弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 50},//3弦ネックマーク
{x:Guitar2tab_1st.x + 60, y:Guitar2tab_1st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st1_option);

var Guitar2tab_st2_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", ":", ":", "["], // 必須文字列
    strID: "Guitar2tab_st2", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 80},
{x:Guitar2tab_2st.x + 15, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 30, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 45, y:Guitar2tab_2st.y + 90},
{x:Guitar2tab_2st.x + 27, y:Guitar2tab_2st.y + 50},//3弦中ポジ
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 60},//4弦内ポジ
{x:Guitar2tab_2st.x + 10, y:Guitar2tab_2st.y + 70},//5弦内ポジ
{x:Guitar2tab_2st.x + 42, y:Guitar2tab_2st.y + 80},//外全セーハ
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 40},//2弦ネックマーク
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 50},//3弦ネックマーク
//{x:Guitar2tab_2st.x + 60, y:Guitar2tab_2st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st2_option);

var Guitar2tab_st3_option = {
    textContent: ["\uFF03", "5", "4", "3", ":", "_", "?", "?"], // 必須文字列
    strID: "Guitar2tab_st3", // 必須
    Stave_x_Offset: 0,
    Stave_y_Offset: 0,
    fontSize: 40,
    fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial"
    shift_x: [
{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 80},
{x:Guitar2tab_3st.x + 15, y:Guitar2tab_3st.y + 90},
{x:Guitar2tab_3st.x + 30, y:Guitar2tab_3st.y + 90},
{x:Guitar2tab_3st.x + 45, y:Guitar2tab_3st.y + 90},
//{x:Guitar2tab_3st.x + 27, y:Guitar2tab_3st.y + 50},//3弦中ポジ
//{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 60},//4弦内ポジ
{x:Guitar2tab_3st.x + 42, y:Guitar2tab_3st.y + 70},//5弦外ポジ
{x:Guitar2tab_3st.x + 10, y:Guitar2tab_3st.y + 60},//内全セーハ
//{x:Guitar2tab_3st.x + 42, y:Guitar2tab_3st.y + 60},//外全セーハ
{x:Guitar2tab_3st.x + 80, y:Guitar2tab_3st.y + 30},//1弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 40},//2弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 50},//3弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 60},//4弦ネックマーク
//{x:Guitar2tab_3st.x + 60, y:Guitar2tab_3st.y + 70},//5弦ネックマーク
{x:Guitar2tab_3st.x + 80, y:Guitar2tab_3st.y + 80},//6弦ネックマーク
], // xのオフセット値配列
    IsOffset_x_Abs: true
};
insertTextToSVG(Guitar2tab_st3_option);

var EGuitar2Text_options = {
    textContent: ["E.Guitar2"], // 必須文字列
    strID: "EGuitar2Text", // 必須
    Stave_x: Guitar2Inst.x,
    Stave_y: Guitar2Inst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(EGuitar2Text_options);

var EGuitar2Tab_options = {
    textContent: ["@"], // 必須文字列
    strID: "EGuitar2Tab", // 必須
    Stave_x: Guitar2Tab1.x,
    Stave_y: Guitar2Tab1.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 80,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(EGuitar2Tab_options);

var BaseText_options = {
    textContent: ["Base"], // 必須文字列
    strID: "BaseText", // 必須
    Stave_x: BaseInst.x,
    Stave_y: BaseInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(BaseText_options);

var BaseTab_options = {
    textContent: ["@"], // 必須文字列
    strID: "BaseTab", // 必須
    Stave_x: BaseTab1.x,
    Stave_y: BaseTab1.y,
    Stave_x_Offset: 10,
    Stave_y_Offset: 90,
    fontFamily: "YonetMuFL, Arial",
};
insertTextToSVG(BaseTab_options);
insertBaseEndBarPathToSVG(StaveBase1);
insertBaseEndBarPathToSVG(StaveBase2);
insertBaseEndBarPathToSVG(StaveBase3);
insertBaseEndBarPathToSVG(StaveBase4);

var DrumText_options = {
    textContent: ["Drum"], // 必須文字列
    strID: "DrumText", // 必須
    Stave_x: DrumInst.x,
    Stave_y: DrumInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(DrumText_options);

var PercText_options = {
    textContent: ["Perc."], // 必須文字列
    strID: "PercText", // 必須
    Stave_x: PercInst.x,
    Stave_y: PercInst.y,
    fontFamily: "Arial, sans-serif",
    fontSize: "20pt",
    Rotate: -90
};
insertTextToSVG(PercText_options);

if(allUniqueIds !== "undefined"){
// 透明にするIDの配列
// 例としてここでIDを指定
let autoUniqueIds = allUniqueIds.map(id => "vf-" + id);
let Last_Stem_x = 0;
// 各IDに対して処理
  autoUniqueIds.forEach(id => {
    // 該当するIDの要素を取得
    let element = svgElement.getElementById(id);
    if (element) {
      let classValue = element.getAttribute("class");
      // 該当する要素があれば、描画内容を透明にする
      let paths = element.querySelectorAll("path");
      paths.forEach(path => {
          var dAttribute = path.getAttribute('d');
          // カンマで区切られた数値の数を数えます
          var numberOfValues = (dAttribute.match(/,/g) || []).length + 1; // カンマの数 + 1 = 数値の数

          if (numberOfValues === 9) {
            var firstCoord = dAttribute.split(',')[0];
            if (dAttribute.startsWith('M')) {
              var CnumberOfValues = (dAttribute.match(/C/g) || []).length; // カンマの数 + 1 = 数値の数
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(CnumberOfValues > 0){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var xdiff = coords[0] - coords[2]; // xの差を計算
                var ydiff = coords[1] - coords[3]; // yの差を計算

                if (coords[0] - Last_Stem_x > 2){
                  if (coords[0] - Last_Stem_x < 10){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  } 
                } 
                // xが0でyが0より大きい場合、描画内容を透明にします
                if (xdiff <= -3.590) {
                if (xdiff >= -3.599) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                if (xdiff <= -2.369) {
                if (xdiff >= -2.374) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                if (xdiff <= 1.000) {
                if (xdiff >= -1.000) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
                else {
                  if(ydiff === 1.123){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
              }
            }
          }
          else if (numberOfValues === 23) {
            if (dAttribute.startsWith('M')) {
              var MnumberOfValues = (dAttribute.match(/M/g) || []).length; // カンマの数 + 1 = 数値の数
              var CnumberOfValues = (dAttribute.match(/C/g) || []).length; // カンマの数 + 1 = 数値の数
              var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
              if (MnumberOfValues == 2){
              if (CnumberOfValues == 11){
                path.setAttribute("fill", "none");
                path.setAttribute("stroke", "none");
              }
              }
            }
          }
          else if (numberOfValues === 1) {
            if (dAttribute.startsWith('M')) {
              var AnumberOfValues = (dAttribute.match(/A/g) || []).length; // カンマの数 + 1 = 数値の数
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(AnumberOfValues == 2){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var circle_right = coords[0]; // xの差を計算
                var r_x = coords[2]; // xの差を計算
                var r_y = coords[3]; // xの差を計算
                var circle_left = coords[7]; // yの差を計算

                if (circle_right - Last_Stem_x > 7){//7.75
                  if (circle_right - Last_Stem_x < 8){
                  if (circle_left - Last_Stem_x > 3){//3.75
                  if (circle_left - Last_Stem_x < 4){
                  if (r_x == 2){
                  if (r_y == 2){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  } 
                  } 
                  } 
                  } 
                  } 
                } 
              }
            }
            if (classValue === "vf-stem"){
              var firstStemCoord = dAttribute;
              if (dAttribute.startsWith('M')) {
                var StemLnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                  // 座標の差を計算します
                if(StemLnumberOfValues > 0){
                  var stem_coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                  Last_Stem_x = stem_coords[0]; // xの差を計算
                }
              }
            }
            var firstCoord = dAttribute;
            if (dAttribute.startsWith('M')) {
              var LnumberOfValues = (dAttribute.match(/L/g) || []).length; // カンマの数 + 1 = 数値の数
                // 座標の差を計算します
              if(LnumberOfValues > 0){
                var coords = dAttribute.match(/[-+]?[0-9]*\.?[0-9]+/g).map(parseFloat);
                var xdiff = coords[0] - coords[2]; // xの差を計算
                var ydiff = coords[1] - coords[3]; // yの差を計算

                // xが0でyが0より大きい場合、描画内容を透明にします
                if (xdiff < -10) {
                if (xdiff > -20) {
                  if(ydiff === 0){
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
                  }
                }
                }
              }
            }
          }
          else if (numberOfValues === 21 || numberOfValues === 35 || numberOfValues === 95 || numberOfValues === 41) {
                    path.setAttribute("fill", "none");
                    path.setAttribute("stroke", "none");
          }
      });
    }
  });
}

if(allFlagUniqueIds !== "undefined"){
  let autoFlagUniqueIds = allFlagUniqueIds.map(id => "vf-" + id);
  autoFlagUniqueIds.forEach(id => {
    // 該当するIDの要素を取得
    let element = svgElement.getElementById(id);
    if (element) {
      // 該当する要素があれば、描画内容を透明にする
      let flagpaths = element.querySelectorAll('path');
      flagpaths.forEach(path => {
        var dAttribute = path.getAttribute('d');
        // カンマで区切られた数値の数を数えます
        var numberOfValues = (dAttribute.match(/,/g) || []).length + 1; // カンマの数 + 1 = 数値の数

        // 数値の数が23であれば、このpath要素は求めるものです
        if (numberOfValues === 23) {
          path.setAttribute("fill", "none");
          path.setAttribute("stroke", "none");
        }
      });
    }
  });
}
})();
</script>


 insertArrowPathToSVGという関数を追加しました。


第一引数:矢印の始点を示す位置オブジェクト{x: 数値, y: 数値}という形式である必要があります。xキーには始点のx座標、yキーには始点のy座標を指定します。


第二引数:矢印の終点を示す位置オブジェクト。第一引数の形式に準ずるものです。


 始点から終点にかけて線が描画され、終点に矢印を構成するための修飾がなされます。


 コードフォームを表示した場合の五線譜の音符にはスラッシュノートというものに置き換える必要があります。4分音符より短い音のスラッシュノートは同一で上向きの符棒のコードポイントは";"で、セミコロンの全角に割り当てられています。下向きは"\uFF87"です。二分音符は上向きが"*"で、下向きが"\uFF88"です。全音符は","です。


 コードフォームを示す図形はフレット線と押さえるべきフレットを示すドットとフレット番号をコードフォーム全体の一番下の部分に記述し、開放弦については、鳴らす弦であることを示す〇(コードポイントは"?")と鳴らさない弦であることを示す×(コードポイントは"/")のような図形で構成されます。


 コードフォーム全体の高さはタブ譜の第2弦から第6弦を示すために使われた小節の座標を基準のyがあるとすると、相対位置


  • y + 30=1弦
  • y + 40=2弦
  • y + 50=3弦
  • y + 60=4弦
  • y + 70=5弦
  • y + 80=6弦
  • y + 90=フレット番号表示位置


 に対応しています。


 x方向の対応としては●(コードポイントは":")を塗る座標として


  • 左ポジションはx + 10
  • 中ポジションはx + 30
  • 右ポジションはx + 42
  • ネック左側外はx + 60


x方向の対応としてはポジション番号を表示する座標として


  • 左ポジションはx + 15
  • 中ポジションはx + 30
  • 右ポジションはx + 45


 に対応しています。


"\u254F"がフレット線の左利き321ネックポジションの記号で\uFF03がネックポジションでない場合です。


  • x + 10、y + 80


 に貼り付けると良い感じです。


 セーハは6弦分は(コードポイントは"[")、セーハは3弦分は(コードポイントは"_")


 となっています。

 

VexFlow 使い方に戻る。