public function readTrill(NoteEffect $noteEffect) { $fret = $this->reader->readByte(); $period = $this->reader->readByte(); $trill = new EffectTrill(); $trill->setFret($fret); if ($period == 1) { $trill->getDuration()->setValue(Duration::SIXTEENTH); $noteEffect->setTrill($trill); } else { if ($period == 2) { $trill->getDuration()->setValue(Duration::THIRTY_SECOND); $noteEffect->setTrill($trill); } else { if ($period == 3) { $trill->getDuration()->setValue(Duration::SIXTY_FOURTH); $noteEffect->setTrill($trill); } } } }
private function writeTrill(EffectTrill $trill) { $this->writeByte($trill->getFret()); if ($trill->getDuration()->getValue() == Duration::SIXTEENTH) { $this->writeByte(1); } else { if ($trill->getDuration()->getValue() == Duration::THIRTY_SECOND) { $this->writeByte(2); } else { if ($trill->getDuration()->getValue() == Duration::SIXTY_FOURTH) { $this->writeByte(3); } } } }