「VexFlow タブ譜 同一コード連続弾き」の版間の差分
(ページの作成:「<yjavascript></script> <script src="https://wiki.yo-net.jp/vexflow/build/cjs/vexflow@4.2.2.0001.js"></script> <!--<script src="https://cdn.jsdelivr.net/npm/vexflow@4.2.3/build/cjs/vexflow.js"></script>--> <!--<script src="https://cdn.jsdelivr.net/npm/vexflow@4.0.2/build/cjs/vexflow.js></script>--> </yjavascript> VexFlow 使い方に戻る。 == '''概要''' == == '''タブ譜 同一コード連続弾き''' == <div id="notation"></div> <div id="yonet202…」) |
|||
(同じ利用者による、間の25版が非表示) | |||
295行目: | 295行目: | ||
else{ | else{ | ||
tempnote = notes[arr[i]]; | tempnote = notes[arr[i]]; | ||
} | |||
if (tempnote.attrs){ | |||
if(tempnote.attrs.type === "StaveNote") { | |||
uniqueIds.add(tempnote.attrs.id); | |||
} | |||
} | } | ||
tempnote.children.forEach(child => { | tempnote.children.forEach(child => { | ||
1,276行目: | 1,281行目: | ||
Guitar2_St3.draw(); | Guitar2_St3.draw(); | ||
const | const Guitar2_notes3_1 = [ | ||
new VF.StaveNote({ keys: ["d/4", "a/4", "d/5", "f/5"], duration: "8" }), | |||
new VF.StaveNote({ keys: ["f/5"], duration: "8" }), | |||
new VF.StaveNote({ keys: ["f/5"], duration: "8" }), | |||
new VF.StaveNote({ keys: ["f/5"], duration: "16" }), | |||
new VF.StaveNote({ keys: ["f/5"], duration: "16" }), | |||
new VF.StaveNote({ keys: ["f/5"], duration: "16" }), | |||
new VF.StaveNote({ keys: ["f/5"], duration: "16" }), | |||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["f/5"], duration: "8" }), | ||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["f/5"], duration: "8" }), | ||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["f/5"], duration: "8" }), | ||
new VF. | ]; | ||
const Guitar2_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"}), | |||
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,324行目: | 1,318行目: | ||
]; | ]; | ||
const | const Guitar2_St3_beam1_1 = new VF.Beam([Guitar2_notes3_1[0], Guitar2_notes3_1[1]]); | ||
const | const Guitar2_St3_beam1_2 = new VF.Beam([Guitar2_notes3_1[2], Guitar2_notes3_1[3], Guitar2_notes3_1[4]]); | ||
const | const Guitar2_St3_beam1_3 = new VF.Beam([Guitar2_notes3_1[5], Guitar2_notes3_1[6], Guitar2_notes3_1[7]]); | ||
const | const Guitar2_St3_beam1_4 = new VF.Beam([Guitar2_notes3_1[8], Guitar2_notes3_1[9]]); | ||
UniqueIds = getUniqueNoteheadIds( | UniqueIds = getUniqueNoteheadIds(Guitar2_notes3_1, [1, 2, 3, 4, 5, 6, 7, 8, 9]); | ||
allUniqueIds = updateAllUniqueIds(UniqueIds); | allUniqueIds = updateAllUniqueIds(UniqueIds); | ||
var | var Guitar2_St3_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | ||
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 }); | |||
Guitar2_St3_2Voice.setStrict(true); | |||
Guitar2_St3_2Voice.addTickables(Guitar2_notes3_2); | |||
var | var formatterGuitar2_St3_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_St3_2Voice, Guitar2_St3_1Voice]); | ||
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(); | |||
Guitar2_St3_beam1_2.setContext(ctx).draw(); | |||
Guitar2_St3_beam1_3.setContext(ctx).draw(); | |||
Guitar2_St3_beam1_4.setContext(ctx).draw(); | |||
shiftGuitar2_St3 = addShift( | |||
Guitar2_notes3_1, | |||
[0, 1, 2, 3, 4, 6, 7, 8, 9], | |||
[2, 2, 2, 2, 2, 2, 2, 2, 2] | |||
[0, 1, 2, 3, 4, 6, 7, 8, 9 | |||
[ | |||
); | ); | ||
const | const Guitar2_St4 = new Stave(Guitar2_St3.width + Guitar2_St3.x, Guitar2_St3.y, nStaveWidth).setContext(ctx); | ||
Guitar2_St4.draw(); | |||
new VF.StaveNote({ keys: [" | const Guitar2_notes4_1 = [ | ||
new VF.StaveNote({ keys: ["g/3", "d/4", "g/4", "d/5"], duration: "8" }), | |||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["d/5"], duration: "8" }), | ||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["d/5"], duration: "8" }), | ||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["d/5"], duration: "16" }), | ||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["d/5"], duration: "16" }), | ||
new VF.StaveNote({ keys: [" | |||
new VF.StaveNote({ keys: ["d/5"], duration: "16" }), | |||
new VF.StaveNote({ keys: ["d/5"], duration: "16" }), | |||
new VF.StaveNote({ keys: ["d/5"], duration: "8" }), | |||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["d/5"], duration: "8" }), | ||
new VF.StaveNote({ keys: [" | new VF.StaveNote({ keys: ["d/5"], duration: "16" }), | ||
new VF.StaveNote({ keys: ["d/5"], duration: "16" }), | |||
]; | ]; | ||
const | const Guitar2_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"}), | ||
1,406行目: | 1,395行目: | ||
]; | ]; | ||
const | const Guitar2_St4_beam1_1 = new VF.Beam([Guitar2_notes4_1[0], Guitar2_notes4_1[1]]); | ||
const | const Guitar2_St4_beam1_2 = new VF.Beam([Guitar2_notes4_1[2], Guitar2_notes4_1[3], Guitar2_notes4_1[4]]); | ||
const | const Guitar2_St4_beam1_3 = new VF.Beam([Guitar2_notes4_1[5], Guitar2_notes4_1[6], Guitar2_notes4_1[7]]); | ||
const | const Guitar2_St4_beam1_4 = new VF.Beam([Guitar2_notes4_1[8], Guitar2_notes4_1[9], Guitar2_notes4_1[10]]); | ||
UniqueIds = getUniqueNoteheadIds( | UniqueIds = getUniqueNoteheadIds(Guitar2_notes4_1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); | ||
allUniqueIds = updateAllUniqueIds(UniqueIds); | allUniqueIds = updateAllUniqueIds(UniqueIds); | ||
var | var Guitar2_St4_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | ||
Guitar2_St4_1Voice.setStrict(true); | |||
Guitar2_St4_1Voice.addTickables(Guitar2_notes4_1); | |||
var | var Guitar2_St4_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | ||
Guitar2_St4_2Voice.setStrict(true); | |||
Guitar2_St4_2Voice.addTickables(Guitar2_notes4_2); | |||
var | 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); | |||
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], | [0, 1, 2, 3, 4, 6, 7, 8, 9, 10], | ||
[2, 2, 2, 2, 2, 2, 2, 2, 2, | [2, 2, 2, 2, 2, 2, 2, 2, 2, 2] | ||
); | ); | ||
1,441行目: | 1,430行目: | ||
const | 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(); | |||
const | const Guitar2_tab_notes1_1 = [ | ||
dotted(new VF.StaveNote({ keys: ["b/4"], duration: "8d" })), | |||
new VF.StaveNote({ keys: ["b/4"], duration: "16" }), | |||
new VF.StaveNote({ keys: ["b/4"], duration: "8" }), | |||
new VF.StaveNote({ keys: ["b/4"], duration: "16" }), | |||
new VF.StaveNote({ keys: ["b/4"], duration: "16" }), | |||
const Guitar2_Tab1_tab = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y - 10, nHeadMargin + nStaveWidth).setContext(ctx); | new VF.StaveNote({ keys: ["b/4"], duration: "16" }), | ||
for (var i = 0; i < 5; i++) { | new VF.StaveNote({ keys: ["b/4"], duration: "16" }), | ||
if (i == 0) continue; | new VF.StaveNote({ keys: ["b/4"], duration: "16" }), | ||
Guitar2_Tab1_tab.setConfigForLine(i, {visible: false} ); | new VF.StaveNote({ keys: ["b/4"], duration: "16" }), | ||
} | |||
Guitar2_Tab1_tab.draw(); | new VF.StaveNote({ keys: ["b/4"], duration: "8" }), | ||
new VF.StaveNote({ keys: ["b/4"], duration: "8" }), | |||
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++) { | const Guitar2_tab_notes1_2 = [ | ||
if (i == 0) continue; | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
Guitar2_Tab2_tab.setConfigForLine(i, {visible: false} ); | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
} | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
Guitar2_Tab2_tab.draw(); | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
const Guitar2_Tab3_tab = new Stave(Guitar2_Tab2_tab.width + Guitar2_Tab2_tab.x, Guitar2_Tab2_tab.y, nStaveWidth).setContext(ctx); | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
for (var i = 0; i < 5; i++) { | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
if (i == 0) continue; | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
Guitar2_Tab3_tab.setConfigForLine(i, {visible: false} ); | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
} | |||
Guitar2_Tab3_tab.draw(); | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | |||
const Guitar2_Tab4_tab = new Stave(Guitar2_Tab3_tab.width + Guitar2_Tab3_tab.x, Guitar2_Tab3_tab.y, nStaveWidth).setContext(ctx); | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
for (var i = 0; i < 5; i++) { | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
if (i == 0) continue; | |||
Guitar2_Tab4_tab.setConfigForLine(i, {visible: false} ); | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
} | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
Guitar2_Tab4_tab.draw(); | new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | ||
new VF.GhostNote({ keys: ["f/4"], duration: "16"}), | |||
Guitar2Inst.x = Guitar2_St1.x - 30; | |||
Guitar2Inst.y = Guitar2_St1.y + ((Guitar2_Tab1.y - Guitar2_St1.y) / 2) + 90; | ]; | ||
const Guitar2_tab_St1_beam1_1 = new VF.Beam([Guitar2_tab_notes1_1[0], Guitar2_tab_notes1_1[1]]); | |||
const Base_St1 = new Stave(Guitar2_Tab1.x, Guitar2_Tab1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx); | const Guitar2_tab_St1_beam1_2 = new VF.Beam([Guitar2_tab_notes1_1[2], Guitar2_tab_notes1_1[3], Guitar2_tab_notes1_1[4]]); | ||
Base_St1.addClef("bass").setContext(ctx); | 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]]); | ||
Base_St1.addTimeSignature('4/4').setContext(ctx); | const Guitar2_tab_St1_beam1_4 = new VF.Beam([Guitar2_tab_notes1_1[9], Guitar2_tab_notes1_1[10]]); | ||
Base_St1.addKeySignature('D').setContext(ctx); | |||
Base_St1.draw(); | UniqueIds = getUniqueNoteheadIds(Guitar2_tab_notes1_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); | ||
allUniqueIds = updateAllUniqueIds(UniqueIds); | |||
const Base_St2 = new Stave(Base_St1.width + Base_St1.x, Base_St1.y, nStaveWidth).setContext(ctx); | |||
Base_St2.draw(); | var Guitar2_tab_St1_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | ||
Guitar2_tab_St1_1Voice.setStrict(true); | |||
const Base_St3 = new Stave(Base_St2.width + Base_St2.x, Base_St2.y, nStaveWidth).setContext(ctx); | Guitar2_tab_St1_1Voice.addTickables(Guitar2_tab_notes1_1); | ||
Base_St3.draw(); | |||
var Guitar2_tab_St1_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | |||
const Base_St4 = new Stave(Base_St3.width + Base_St3.x, Base_St3.y, nStaveWidth).setContext(ctx); | Guitar2_tab_St1_2Voice.setStrict(true); | ||
Base_St4.draw(); | Guitar2_tab_St1_2Voice.addTickables(Guitar2_tab_notes1_2); | ||
const Base_Tab1 = new Stave(Base_St1.x, Base_St1.y + 120, nHeadMargin + nStaveWidth).setContext(ctx); | var formatterGuitar2_tab_St1_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_tab_St1_2Voice, Guitar2_tab_St1_1Voice]); | ||
Base_Tab1.setEndBarType(VF.Barline.type.NONE); | formatterGuitar2_tab_St1_1.format([Guitar2_tab_St1_2Voice, Guitar2_tab_St1_1Voice], nStaveWidth - 40 - 10); | ||
for (var i = 0; i < 5; i++) { | Guitar2_tab_St1_1Voice.draw(ctx, Guitar2_Tab1_1); | ||
Guitar2_tab_St1_2Voice.draw(ctx, Guitar2_Tab1_1); | |||
Guitar2_tab_St1_beam1_1.setContext(ctx).draw(); | |||
Guitar2_tab_St1_beam1_2.setContext(ctx).draw(); | |||
Guitar2_tab_St1_beam1_3.setContext(ctx).draw(); | |||
Guitar2_tab_St1_beam1_4.setContext(ctx).draw(); | |||
shiftGuitar2_Tab1 = addShift( | |||
Guitar2_tab_notes1_1, | |||
[0, 1, 2, 3, 4, 6, 7, 8, 9, 10], | |||
[3, 3, 3, 3, 3, 3, 3, 3, 3, 3] | |||
); | |||
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(); | |||
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 }), | |||
new VF.StaveNote({ keys: ["b/4"], duration: "8", stem_direction: -1 }), | |||
]; | |||
const Guitar2_tab_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"}), | |||
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"}), | |||
]; | |||
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]); | |||
allUniqueIds = updateAllUniqueIds(UniqueIds); | |||
var Guitar2_tab_St2_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | |||
Guitar2_tab_St2_1Voice.setStrict(true); | |||
Guitar2_tab_St2_1Voice.addTickables(Guitar2_tab_notes2_1); | |||
var Guitar2_tab_St2_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | |||
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]); | |||
formatterGuitar2_tab_St2_1.format([Guitar2_tab_St2_2Voice, Guitar2_tab_St2_1Voice], nStaveWidth - 40 - 10); | |||
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(); | |||
Guitar2_tab_St2_beam1_2.setContext(ctx).draw(); | |||
Guitar2_tab_St2_beam1_3.setContext(ctx).draw(); | |||
Guitar2_tab_St2_beam1_4.setContext(ctx).draw(); | |||
shiftGuitar2_Tab2 = addShift( | |||
Guitar2_tab_notes2_1, | |||
[0, 1, 2, 3, 4, 6, 7, 8, 9, 10], | |||
[2, 2, 2, 2, 2, 2, 2, 2, 2, 2] | |||
); | |||
const Guitar2_Tab3 = new Stave(Guitar2_Tab2.width + Guitar2_Tab2.x, Guitar2_Tab2.y, nStaveWidth).setContext(ctx); | |||
Guitar2_Tab3.draw(); | |||
const Guitar2_tab_notes3_1 = [ | |||
new VF.StaveNote({ keys: ["b/5"], duration: "8" }), | |||
new VF.StaveNote({ keys: ["b/5"], duration: "8" }), | |||
new VF.StaveNote({ keys: ["b/5"], duration: "8" }), | |||
new VF.StaveNote({ keys: ["b/5"], duration: "16" }), | |||
new VF.StaveNote({ keys: ["b/5"], duration: "16" }), | |||
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" }), | |||
new VF.StaveNote({ keys: ["b/5"], duration: "8" }), | |||
]; | |||
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"}), | |||
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"}), | |||
]; | |||
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]); | |||
allUniqueIds = updateAllUniqueIds(UniqueIds); | |||
var Guitar2_tab_St3_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | |||
Guitar2_tab_St3_1Voice.setStrict(true); | |||
Guitar2_tab_St3_1Voice.addTickables(Guitar2_tab_notes3_1); | |||
var Guitar2_tab_St3_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | |||
Guitar2_tab_St3_2Voice.setStrict(true); | |||
Guitar2_tab_St3_2Voice.addTickables(Guitar2_tab_notes3_2); | |||
var formatterGuitar2_tab_St3_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_tab_St3_2Voice, Guitar2_tab_St3_1Voice]); | |||
formatterGuitar2_tab_St3_1.format([Guitar2_tab_St3_2Voice, Guitar2_tab_St3_1Voice], nStaveWidth - 10); | |||
Guitar2_tab_St3_1Voice.draw(ctx, Guitar2_Tab3); | |||
Guitar2_tab_St3_2Voice.draw(ctx, Guitar2_Tab3); | |||
Guitar2_tab_St3_beam1_1.setContext(ctx).draw(); | |||
Guitar2_tab_St3_beam1_2.setContext(ctx).draw(); | |||
Guitar2_tab_St3_beam1_3.setContext(ctx).draw(); | |||
Guitar2_tab_St3_beam1_4.setContext(ctx).draw(); | |||
shiftGuitar2_Tab3 = addShift( | |||
Guitar2_tab_notes3_1, | |||
[ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | |||
[-1, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] | |||
); | |||
const Guitar2_Tab4 = new Stave(Guitar2_Tab3.width + Guitar2_Tab3.x, Guitar2_Tab3.y, nStaveWidth).setContext(ctx); | |||
Guitar2_Tab4.draw(); | |||
const Guitar2_tab_notes4_1 = [ | |||
new VF.StaveNote({ keys: ["g/5"], duration: "8" }), | |||
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" }), | |||
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"}), | |||
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 Guitar2_tab_St4_beam1_1 = new VF.Beam([Guitar2_tab_notes4_1[0], Guitar2_tab_notes4_1[1]]); | |||
const Guitar2_tab_St4_beam1_2 = new VF.Beam([Guitar2_tab_notes4_1[2], Guitar2_tab_notes4_1[3], Guitar2_tab_notes4_1[4]]); | |||
const Guitar2_tab_St4_beam1_3 = new VF.Beam([Guitar2_tab_notes4_1[5], Guitar2_tab_notes4_1[6], Guitar2_tab_notes4_1[7]]); | |||
const Guitar2_tab_St4_beam1_4 = new VF.Beam([Guitar2_tab_notes4_1[8], Guitar2_tab_notes4_1[9], Guitar2_tab_notes4_1[10]]); | |||
UniqueIds = getUniqueNoteheadIds(Guitar2_tab_notes4_1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); | |||
allUniqueIds = updateAllUniqueIds(UniqueIds); | |||
var Guitar2_tab_St4_1Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | |||
Guitar2_tab_St4_1Voice.setStrict(true); | |||
Guitar2_tab_St4_1Voice.addTickables(Guitar2_tab_notes4_1); | |||
var Guitar2_tab_St4_2Voice = new Vex.Flow.Voice({ num_beats: 4, beat_value: 4 }); | |||
Guitar2_tab_St4_2Voice.setStrict(true); | |||
Guitar2_tab_St4_2Voice.addTickables(Guitar2_tab_notes4_2); | |||
var formatterGuitar2_tab_St4_1 = new Vex.Flow.Formatter().joinVoices([Guitar2_tab_St4_2Voice, Guitar2_tab_St4_1Voice]); | |||
formatterGuitar2_tab_St4_1.format([Guitar2_tab_St4_2Voice, Guitar2_tab_St4_1Voice], nStaveWidth - 10 - 10); | |||
Guitar2_tab_St4_1Voice.draw(ctx, Guitar2_Tab4); | |||
Guitar2_tab_St4_2Voice.draw(ctx, Guitar2_Tab4); | |||
Guitar2_tab_St4_beam1_1.setContext(ctx).draw(); | |||
Guitar2_tab_St4_beam1_2.setContext(ctx).draw(); | |||
Guitar2_tab_St4_beam1_3.setContext(ctx).draw(); | |||
Guitar2_tab_St4_beam1_4.setContext(ctx).draw(); | |||
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] | |||
); | |||
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; | if (i != 0) continue; | ||
Base_Tab1.setConfigForLine(i, {visible: false} ); | Base_Tab1.setConfigForLine(i, {visible: false} ); | ||
2,133行目: | 2,428行目: | ||
insertTiePathToSVG({x:shiftGuitar2_Tab2[4].x , y:shiftGuitar2_Tab2[4].y - 20}, {x:shiftGuitar2_Tab2[4].x + 35, y:shiftGuitar2_Tab2[4].y - 20}, -1); | insertTiePathToSVG({x:shiftGuitar2_Tab2[4].x , y:shiftGuitar2_Tab2[4].y - 20}, {x:shiftGuitar2_Tab2[4].x + 35, y:shiftGuitar2_Tab2[4].y - 20}, -1); | ||
var Guitar2_tab_St3_notes1_option = { | |||
textContent: ["2", "3", "2", "0"], // 必須文字列 | |||
strID: "Guitar2_tab_St3_notes1", // 必須 | |||
Stave_x_Offset: 0, | |||
Stave_y_Offset: 0, | |||
fontSize: 50, | |||
fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial" | |||
shift_x: [{x: shiftGuitar2_Tab3[0].x, y: shiftGuitar2_Tab3[0].y}, | |||
{x:shiftGuitar2_Tab3[1].x + 10, y: shiftGuitar2_Tab3[1].y}, | |||
{x:shiftGuitar2_Tab3[2].x, y: shiftGuitar2_Tab3[2].y}, | |||
{x:shiftGuitar2_Tab3[3].x + 10, y: shiftGuitar2_Tab3[3].y} ], // xのオフセット値配列 | |||
IsOffset_x_Abs: true | |||
}; | |||
insertTextToSVG(Guitar2_tab_St3_notes1_option); | |||
insertTiePathToSVG({x:shiftGuitar2_Tab3[7].x , y:shiftGuitar2_Tab3[7].y + 10}, {x:shiftGuitar2_Tab3[7].x + 35, y:shiftGuitar2_Tab3[7].y + 10}); | |||
var Guitar2_tab_St4_notes1_option = { | |||
textContent: ["3", "0", "0", "\uFF1F", "3"], // 必須文字列 | |||
strID: "Guitar2_tab_St4_notes1", // 必須 | |||
Stave_x_Offset: 0, | |||
Stave_y_Offset: 0, | |||
fontSize: 50, | |||
fontFamily: "YonetMuFL, Arial", // オプション、デフォルトは"Bravura, Arial" | |||
shift_x: [{x: shiftGuitar2_Tab4[0].x, y: shiftGuitar2_Tab4[0].y}, | |||
{x:shiftGuitar2_Tab4[1].x + 10, y: shiftGuitar2_Tab4[1].y}, | |||
{x:shiftGuitar2_Tab4[2].x, y: shiftGuitar2_Tab4[2].y}, | |||
{x:shiftGuitar2_Tab4[3].x + 30, y: shiftGuitar2_Tab4[3].y}, | |||
{x:shiftGuitar2_Tab4[4].x , y: shiftGuitar2_Tab4[4].y} ], // xのオフセット値配列 | |||
IsOffset_x_Abs: true | |||
}; | |||
insertTextToSVG(Guitar2_tab_St4_notes1_option); | |||
insertTiePathToSVG({x:shiftGuitar2_Tab4[8].x , y:shiftGuitar2_Tab4[8].y + 10}, {x:shiftGuitar2_Tab4[8].x + 35, y:shiftGuitar2_Tab4[8].y + 10}); | |||
var EGuitar2Text_options = { | var EGuitar2Text_options = { | ||
2,314行目: | 2,643行目: | ||
// xが0でyが0より大きい場合、描画内容を透明にします | // xが0でyが0より大きい場合、描画内容を透明にします | ||
if (xdiff < -10) { | if (xdiff < -10) { | ||
if (xdiff > - | if (xdiff > -20) { | ||
if(ydiff === 0){ | if(ydiff === 0){ | ||
path.setAttribute("fill", "none"); | path.setAttribute("fill", "none"); |
2024年4月10日 (水) 22:10時点における版
VexFlow 使い方に戻る。
概要
タブ譜 同一コード連続弾き
コードは以下のとおりです。
<div id="yonet202403Mid_Output01"></div>
<script>
</script>
VexFlow 使い方に戻る。