本文整理汇总了PHP中Part::addMeasure方法的典型用法代码示例。如果您正苦于以下问题:PHP Part::addMeasure方法的具体用法?PHP Part::addMeasure怎么用?PHP Part::addMeasure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::addMeasure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Layer
$layer = new Layer();
foreach ($pitches as $pitch) {
$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;
示例2: Direction
// many direction-types can go together into one direction
$direction = new Direction(array('placement' => 'above', 'direction-type' => array(array('words' => array('default-x' => 15, 'default-y' => 15, 'font-size' => 9, 'font-style' => 'italic', 'words' => 'dolce')), array('wedge' => array())), 'offset' => -8));
$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;