Best Value Homeschooling. From £12 per family per month all in! Qualified Teachers.
Page loading ... Welcome Guest Sign In 🏡 📚 🔍    

English Tap

Start of biscuits-18n/metronome/creator-form.php See Source Code below:

Edit your ensemble pattern and see it change in the URL as you post it. /metronome/creator?p=99

End of biscuits-18n/metronome/creator-form.php


Current Ensemble DUMP
CREATOR
shortSplit4
beatInterval750
shortInterval750
barTime3000
voiceCount12
soundBankRonGreenwood
preset99
beatsPerBar4
beatsPerMinute80
volume100
barCount1
presetNameMega99
VOICES
0
nameBASS DRUM
barSplit4
audioBasenamebass-drum.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
1
nameCRASH
barSplit4
audioBasenamecrash.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
2
nameHIGH HAT CLOSED
barSplit4
audioBasenamehigh-hat-closed.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
3
nameHIGH HAT OPEN
barSplit4
audioBasenamehigh-hat-open.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
4
nameHIGH HAT STICK
barSplit4
audioBasenamehigh-hat-stick.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
5
nameHIGH HAT
barSplit4
audioBasenamehigh-hat.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
6
nameRIDE 1
barSplit4
audioBasenameride-1.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
7
nameRIDE 2
barSplit4
audioBasenameride-2.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
8
nameSNARE
barSplit4
audioBasenamesnare.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
9
nameTOM 1
barSplit4
audioBasenametom-1.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
10
nameTOM 2
barSplit4
audioBasenametom-2.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750
11
nameTOM 3
barSplit4
audioBasenametom-3.mp3
Audio
beatOneAccent100
hits1010
interval0
midiVoiceVolume100
jsIntId
voiceInterval750

Audio Players

A player is an html or php file in the metronome/players directory. It can access the jsObject or parse the PHP object:
$this->ensemble->patterns Note: this is an array so use SQUARE BRACKETS
$allVoices = $this->ensemble->patterns['VOICES'];
foreach ($allVoices as $voiceKey = $voiceArray) {
    echo $voiceArray['beatsPerBar'];
    // Your code for this voice
}
1 PLAYER : player-human

CREATOR Human Ensemble Chart

This could eventually be the HTML for the actual player. It just needs some audio controls in the beat hits and Bob's your uncle.
Ensemble Chart
CREATOR 🎹 🎑
Voice Rhythm
BASS DRUM
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
CRASH
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
HIGH HAT CLOSED
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
HIGH HAT OPEN
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
HIGH HAT STICK
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
HIGH HAT
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
RIDE 1
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
RIDE 2
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
SNARE
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
TOM 1
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
TOM 2
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹
TOM 3
𝅘𝅥 𝄽 𝅘𝅥 𝄽
🎼 🎹

DOM div id : player-human-monitor

monitorElem = document.getElementById('player-human-monitor');
View player-human.php Source Code
 001 <?php
 002 ## 2020-04-17 
 003 ## Make a human readable rhythm chat
 004 
 005 $this->tableMethods = $this->loadMethod('tableMethods');
 006 $activePattern = $this->ensemble->activeEnsemble;
 007 $beatsPerBar = intval($this->ensemble->patterns[$activePattern]['beatsPerBar']);
 008 $barCount = intval($this->ensemble->patterns[$activePattern]['barCount']);
 009 //cho('Active pattern : ' . $activePattern);
 010 ?>
 011 
 012 <script>
 013     // Push this creator pattern into the ensemble pattern JS object
 014     //lert("LEONWOOL");
 015     epOb.loadPattern(CREATOR);
 016 </script>
 017 
 018 <div id="human-chart">
 019     <h2> <?php echo $activePattern; ?> Human Ensemble Chart </h2>
 020 
 021     <?php
 022     $VOICES = $this->ensemble->getVoices();
 023     $v = 0;
 024     ## BUILD PATTERN JS OBJECT ;
 025     ?>
 026 
 027     <div class="paragraph">
 028         This could eventually be the HTML for the actual player.
 029         It just needs some audio controls in the beat hits and <a class="lookup">Bob's your uncle</a>.
 030     </div>
 031 
 032     <table class="ensemble-chart ">
 033         <caption> Ensemble Chart </caption>
 034         <?php
 035         if ($VOICES) {
 036             ?>
 037             <tr style="height: 50px;"><th class="big" colspan="<?php
 038                 echo ($beatsPerBar + 2);
 039                 ?>"><img style="height: 30px; box-shadow: 6px 7px 7px brown;" src="<?php
 040                                           // Also audio-playing.gif 
 041                                           echo '/' . VERSION . '/metronome/images/tape-playing.gif';
 042                                           ?>" class="hidden pattern-playing">                    
 043                        <?php echo $this->ensemble->activeEnsemble; ?>
 044                     <a class="far-right link" onclick="epOb.start(CREATOR);" > <?php echo MUSIC_KEYBOARD; ?> </a>
 045                     <a class="far-right link" href="#creator-form"> <?php echo MUSIC_MIXER; ?> </a>
 046                     <?php
 047                     ?><span class="player-status"></span> 
 048                 </th>
 049             </tr>
 050             <?php
 051         }
 052         ?>
 053         <tr><th> Voice </th> <th colspan="<?php echo ($beatsPerBar + 1); ?>"> Rhythm </th></tr>
 054 
 055         <?php
 056         // intVal($this->ensemble->activeEnsemble['beatsPerBar']);
 057         if ($VOICES) {
 058             foreach ($VOICES as $voice) {
 059                 $rowClass = $this->render->rowClass($v);
 060                 $hits = $voice['hits'];
 061                 $hitCount = strlen($hits);
 062                 ?>
 063                 <tr class="<?php echo $rowClass; ?>"> <td> <?php echo ucWords($voice['name']); ?> </td> 
 064                     <td colspan="6">
 065                         <table class="subbeats"><tr>        
 066                                 <?php for ($m = 1; $m <= $barCount; $m++) { ?>                                    
 067                                     <?php
 068                                     for ($b = 1; $b <= $beatsPerBar; $b++) {
 069                                         $style = "font-size: 30px;";
 070                                         if ($b == $beatsPerBar) {
 071                                             $class = "bar-end";
 072                                         } else {
 073                                             $class = '';
 074                                         }
 075                                         ?>
 076                                         <td class="<?php echo $class; ?>" style="<?php echo $style; ?>"> <?php
 077                                             $beatIt = intval(substr($hits, ($b - 1), 1));
 078                                             if ($beatIt) {
 079                                                 echo MUSIC_CROCHET;
 080                                             } else {
 081                                                 echo MUSIC_REST;
 082                                             }
 083                                             ?> </td>               
 084                                         <?php
 085                                     }
 086                                 }
 087                                 ?>
 088                             </tr>
 089                         </table>
 090                     </td>
 091                 </tr>
 092                 <tr class="<?php
 093                 echo $rowClass;
 094                 ?>">
 095                     <td class="big">
 096                         <a  title="Play this voice sound" class="link" title="Play Voice" onclick="epOb.playVoiceSound(<?php
 097                         echo $v;
 098                         ?>);"> <?php echo MUSIC_SCORE; ?> </a>
 099                         <a title="Hear this voice" class="link" onclick="epOb.playVoicePattern(<?php
 100                         echo $v;
 101                         ?>);" > <?php
 102                                echo MUSIC_KEYBOARD;
 103                                ?> </a>
 104                     </td>
 105                     <td> 
 106                         <table class="subbeats"><tr>        
 107                                 <?php for ($m = 1; $m <= $barCount; $m++) { ?>  
 108                                     <?php
 109                                     for ($h = 0; $h < $hitCount; $h++) {
 110                                         $play = substr($hits, $h, 1);
 111                                         $hitClass = 'hit';
 112 
 113                                         if ($play) {
 114                                             $hitClass .= ' hit-strike';
 115                                         } else {
 116                                             $hitClass .= ' hit hit-rest';
 117                                         }
 118                                         if ($h == 0) {
 119                                             $hitClass .= ' hit-first';
 120                                         }
 121                                         if ($h == ($hitCount - 1)) {
 122                                             $style = "border-right: 2px solid green;";
 123                                         } else {
 124                                             $style = ' border-right: 2px;';
 125                                         }
 126                                         ?> 
 127                                         <td>
 128                                             <span class="<?php echo $hitClass; ?>" style="<?php echo $style; ?>">
 129                                                 <?php
 130                                                 if ($h == ($hitCount - 1)) {
 131                                                     //cho '|' 
 132                                                 }
 133                                                 ?>
 134                                             </span
 135                                         </td><?php
 136                                     }
 137                                 }
 138                                 ?>
 139                             </tr>
 140                         </table>
 141                     </td>
 142                 </tr>
 143                 <?php
 144                 $v++;
 145             }
 146         } else {
 147             ?>
 148             <div class="notice"> NO VOICES HAVE BEEN ADDED </div>
 149             <?php
 150         }
 151         ?>
 152 
 153     </table>
 154 
 155     <?php if (MOBILE && filter_input(INPUT_GET, 'dump') != '0') { ?>   
 156         <h2> Sound Banks </h2>
 157         <?php echo $this->tableMethods->array2table($this->ensemble->soundBank); ?>
 158         <h2> Whole Pattern Object</h2>
 159         <?php echo $this->tableMethods->array2table($this->ensemble->patterns[$activePattern]); ?>        
 160     <?php }
 161     ?>
 162 
 163 
 164 
 165 </div>