Exemple #1
0
    $note = new Note(array('pitch' => $pitch, 'duration' => 4, 'type' => 'quarter'));
    $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]);