task6/script.js
// Create a staff using Vexflow with renderNotes
Create a staff using Vexflow with renderNotes
Create a staff using Vexflow with renderNotes
function createStaff(renderNotes) {
  const staff = document.getElementById('staff');
  while(staff.hasChildNodes()) {
    staff.removeChild(staff.lastChild);
  }
  var vf = new VF.Factory({renderer: {elementId: 'staff'}});
  var score = vf.EasyScore();
  var system = vf.System();
  system.addStave({
    voices: [score.voice(score.notes(renderNotes))]
  }).addClef('treble').addTimeSignature('4/4');
  vf.draw();
}
function createStaff ( renderNotes ) { const staff = document . getElementById ( 'staff' ) ; while ( staff . hasChildNodes ( ) ) { staff . removeChild ( staff . lastChild ) ; } var vf = new VF . Factory ( { renderer : { elementId : 'staff' } } ) ; var score = vf . EasyScore ( ) ; var system = vf . System ( ) ; system . addStave ( { voices : [ score . voice ( score . notes ( renderNotes ) ) ] } ) . addClef ( 'treble' ) . addTimeSignature ( '4/4' ) ; vf . draw ( ) ; }
Create a staff using Vexflow with renderNotes
Create a staff using Vexflow with renderNotes
// Remove any old staff // Create an SVG renderer and attach it to the DIV element named 'staff" // Add a staff and voices to our system