コード例 #1
0
 /**
  * Reads an artificial harmonic
  * 
  * @param NoteEffect $effect
  */
 private function readArtificialHarmonic(NoteEffect $effect)
 {
     $type = $this->reader->readByte();
     $harmonic = new EffectHarmonic();
     $harmonic->setData(0);
     if ($type == 1) {
         $harmonic->setType(EffectHarmonic::TYPE_NATURAL);
         $effect->setHarmonic($harmonic);
     } else {
         if ($type == 2) {
             $this->reader->skip(3);
             $harmonic->setType(EffectHarmonic::TYPE_ARTIFICIAL);
             $effect->setHarmonic($harmonic);
         } else {
             if ($type == 3) {
                 $this->reader->skip(1);
                 $harmonic->setType(EffectHarmonic::TYPE_TAPPED);
                 $effect->setHarmonic($harmonic);
             } else {
                 if ($type == 4) {
                     $harmonic->setType(EffectHarmonic::TYPE_PINCH);
                     $effect->setHarmonic($harmonic);
                 } else {
                     if ($type == 5) {
                         $harmonic->setType(EffectHarmonic::TYPE_SEMI);
                         $effect->setHarmonic($harmonic);
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
 private function readHarmonic(NoteEffect $noteEffect)
 {
     $harmonic = new EffectHarmonic();
     $type = intval($this->reader->readByte());
     if ($type == 1) {
         $harmonic->setType(EffectHarmonic::TYPE_NATURAL);
     } else {
         if ($type == 3) {
             $harmonic->setType(EffectHarmonic::TYPE_TAPPED);
         } else {
             if ($type == 4) {
                 $harmonic->setType(EffectHarmonic::TYPE_PINCH);
             } else {
                 if ($type == 5) {
                     $harmonic->setType(EffectHarmonic::TYPE_SEMI);
                 } else {
                     if ($type == 15) {
                         $harmonic->setType(EffectHarmonic::TYPE_ARTIFICIAL);
                         $harmonic->setData(2);
                     } else {
                         if ($type == 17) {
                             $harmonic->setType(EffectHarmonic::TYPE_ARTIFICIAL);
                             $harmonic->setData(3);
                         } else {
                             if ($type == 22) {
                                 $harmonic->setType(EffectHarmonic::TYPE_ARTIFICIAL);
                                 $harmonic->setData(0);
                             }
                         }
                     }
                 }
             }
         }
     }
     $noteEffect->setHarmonic($harmonic);
 }