示例#1
0
<?php

$glen = isset($_GET['length']) ? $_GET['length'] : 8;
$glim = isset($_GET['limbs']) ? $_GET['limbs'] : 4;
$sticker = new StickingGenerator();
$sticker->setMode('plain');
for ($i = 1; $i <= $glim; $i++) {
    $limbs[$i]['pattern'] = $sticker->get_randomSticking($glen, 2);
    $limbs[$i]['accent'] = $sticker->get_randomAccent($glen);
    $pattern = $limbs[$i]['pattern'];
    $accent = $limbs[$i]['accent'];
    $limbs[$i]['full'] = $sticker->applyAccent($pattern, $accent);
}
?>
Patterns used:
<br/>
<?php 
foreach ($limbs as $l) {
    echo $l['pattern'];
    echo '<br/>';
    echo $l['accent'];
    echo '<br/>';
    //echo $l['full'];
    //echo '<br/>';
}
?>
		<p>
		Complete exercise:<br/>
		<?php 
$x = 1;
foreach ($limbs as $l) {
示例#2
0
<?php

$glen = isset($_GET['length']) ? $_GET['length'] : 8;
$glim = isset($_GET['limbs']) ? $_GET['limbs'] : 4;
$sticker = new StickingGenerator();
$pattern = $sticker->get_randomSticking($glen, $glim);
$accent = $sticker->get_randomAccent($glen);
$full = $sticker->applyAccent($pattern, $accent);
$limbs = $sticker->get_limbs();
echo '<br/>';
echo 'Pattern: ' . $pattern;
echo '<br/>';
echo 'Accents: ' . $accent;
echo '<br/>';
echo 'Complete: ' . $full;
echo '<br/>';
?>
<p>
<?php 
foreach ($limbs as $l) {
    echo $l;
    echo '<br/>';
}
?>
</p>
<p>LEGEND:<br/>
	Lowercase: Unaccented<br/>
	Uppercase: Accented<br/>
	r : Right hand<br/>
	l : Left hand<br/>
	f : Bass drum (right foot)<br/>