$layer->addNote($note); // this essentially adds a chord with only one note in it. } $measure->addLayer($layer); $newlayer = clone $layer; $newlayer->transpose(-12); $measure->addLayer($newlayer); // puts this layer in staff two $newlayer->setStaff(2); for ($i = 0; $i < 12; $i++) { $newmeasure = clone $measure; $newmeasure->transpose($i, -1); $part->addMeasure($newmeasure); } $score->addPart($part); $xml2 = $score->toXML(); ?> <script src="vexflow/jquery.js"></script> <script src="vexflow/vexflow-debug.js"></script> <script> $(document).ready(function() { var xml2 = '<?php echo $xml2; ?> '; var doc = null; doc = new Vex.Flow.Document(xml2); doc.getFormatter().setWidth(800).draw($("#viewer2")[0]);
$measure->addNote($note); $note = new Note(array('pitch' => array('step' => 'C', 'alter' => -1, 'octave' => 4), 'duration' => 4, 'tie' => 'start', 'type' => 'whole', 'lyric' => array('syllabic' => 'end', 'text' => 'meil', 'extend' => true))); $note->transpose(4); // transposes the note up 4 semitones $measure->addNote($note); $note->transpose(-4); // transposes the note down 4 semitones $measure->addNote($note); // backup and forward lets us add "layers" to a measure with independent voicing // $duration = 16; // $measure->backup($duration); // $measure->forward($duration); $part = new Part('Viola'); $part->addMeasure($measure); $score->addPart($part); $xml2 = $score->toXML('partwise'); ?> <html> <head> <meta name="viewport" content="initial-scale = 1.0, minimum-scale = 1.0, maximum-scale = 1.0, user-scalable = no"> <script src="vexflow/jquery.js"></script> <script src="vexflow/vexflow-debug.js"></script> <script> $(document).ready(function() { var xml2 = '<?php echo $xml2; ?> ';