Example #1
0
 /**
  * Reads mix change informations
  * 
  * @param Tempo $tempo
  */
 public function readMixChange(Tempo $tempo)
 {
     $this->reader->readByte();
     //instrument
     $volume = $this->reader->readByte();
     $pan = $this->reader->readByte();
     $chorus = $this->reader->readByte();
     $reverb = $this->reader->readByte();
     $phaser = $this->reader->readByte();
     $tremolo = $this->reader->readByte();
     $tempoValue = $this->reader->readInt();
     if ($volume >= 0) {
         $this->reader->readByte();
     }
     if ($pan >= 0) {
         $this->reader->readByte();
     }
     if ($chorus >= 0) {
         $this->reader->readByte();
     }
     if ($reverb >= 0) {
         $this->reader->readByte();
     }
     if ($phaser >= 0) {
         $this->reader->readByte();
     }
     if ($tremolo >= 0) {
         $this->reader->readByte();
     }
     if ($tempoValue >= 0) {
         $tempo->setValue($tempoValue);
         $this->reader->readByte();
     }
 }
Example #2
0
 /**
  * Loops on mesures to read
  * 
  * @param Song $song
  * @param integer $measures
  * @param integer $tracks
  * @param integer $tempoValue
  */
 public function readMeasures(Song $song, $measures, $tracks, $tempoValue)
 {
     $tempo = new Tempo();
     $tempo->setValue($tempoValue);
     $start = Duration::QUARTER_TIME;
     for ($i = 0; $i < $measures; $i++) {
         $header = $song->getMeasureHeader($i);
         $header->setStart($start);
         for ($j = 0; $j < $tracks; $j++) {
             $track = $song->getTrack($j);
             $measure = new Measure($header);
             $track->addMeasure($measure);
             $this->reader->factory('GuitarPro3Measure')->readMeasure($measure, $track, $tempo);
         }
         $header->getTempo()->copyFrom($tempo);
         $start += $header->getLength();
     }
 }
Example #3
0
 /**
  * Reads mix change
  * 
  * @param Tempo $tempo
  */
 public function readMixChange(Tempo $tempo)
 {
     $this->reader->readByte();
     $this->reader->skip(16);
     $volume = $this->reader->readByte();
     $pan = $this->reader->readByte();
     $chorus = $this->reader->readByte();
     $reverb = $this->reader->readByte();
     $phaser = $this->reader->readByte();
     $tremolo = $this->reader->readByte();
     $this->reader->readStringByteSizeOfInteger();
     $tempoValue = $this->reader->readInt();
     if ($volume >= 0) {
         $this->reader->readByte();
     }
     if ($pan >= 0) {
         $this->reader->readByte();
     }
     if ($chorus >= 0) {
         $this->reader->readByte();
     }
     if ($reverb >= 0) {
         $this->reader->readByte();
     }
     if ($phaser >= 0) {
         $this->reader->readByte();
     }
     if ($tremolo >= 0) {
         $this->reader->readByte();
     }
     if ($tempoValue >= 0) {
         $tempo->setValue($tempoValue);
         $this->reader->readByte();
         if ($this->reader->getVersionIndex() > 0) {
             $this->reader->skip();
         }
     }
     $this->reader->skip(2);
     if ($this->reader->getVersionIndex() > 0) {
         $this->reader->readStringByteSizeOfInteger();
         $this->reader->readStringByteSizeOfInteger();
     }
 }