/**
  * Reads tremolo picking
  * 
  * @param NoteEffect $noteEffect
  */
 public function readTremoloPicking(NoteEffect $noteEffect)
 {
     $value = $this->reader->readUnsignedByte();
     $tremoloPicking = new EffectTremoloPicking();
     if ($value == 1) {
         $tremoloPicking->getDuration()->setValue(Duration::EIGHTH);
         $noteEffect->setTremoloPicking($tremoloPicking);
     } else {
         if ($value == 2) {
             $tremoloPicking->getDuration()->setValue(Duration::SIXTEENTH);
             $noteEffect->setTremoloPicking($tremoloPicking);
         } else {
             if ($value == 3) {
                 $tremoloPicking->getDuration()->setValue(Duration::THIRTY_SECOND);
                 $noteEffect->setTremoloPicking($tremoloPicking);
             }
         }
     }
 }
Exemple #2
0
 private function writeTremoloPicking(EffectTremoloPicking $effect)
 {
     if ($effect->getDuration()->getValue() == Duration::EIGHTH) {
         $this->writeByte(1);
     } else {
         if ($effect->getDuration()->getValue() == Duration::SIXTEENTH) {
             $this->writeByte(2);
         } else {
             if ($effect->getDuration()->getValue() == Duration::THIRTY_SECOND) {
                 $this->writeByte(3);
             }
         }
     }
 }