示例#1
0
 private function makeChannel(MidiSequenceHelper $sHelper, Channel $channel, $track)
 {
     if (($this->flags & MidiWriter::ADD_MIXER_MESSAGES) != 0) {
         $channelId = $channel->getChannelId();
         $tick = $this->getTick(Duration::QUARTER_TIME);
         $sHelper->getSequence()->addControlChange($tick, $track, $channelId, MidiWriter::VOLUME, $this->fix($channel->getVolume()));
         $sHelper->getSequence()->addControlChange($tick, $track, $channelId, MidiWriter::BALANCE, $this->fix($channel->getBalance()));
         $sHelper->getSequence()->addControlChange($tick, $track, $channelId, MidiWriter::CHORUS, $this->fix($channel->getChorus()));
         $sHelper->getSequence()->addControlChange($tick, $track, $channelId, MidiWriter::REVERB, $this->fix($channel->getReverb()));
         $sHelper->getSequence()->addControlChange($tick, $track, $channelId, MidiWriter::PHASER, $this->fix($channel->getPhaser()));
         $sHelper->getSequence()->addControlChange($tick, $track, $channelId, MidiWriter::TREMOLO, $this->fix($channel->getTremolo()));
         $sHelper->getSequence()->addControlChange($tick, $track, $channelId, MidiWriter::EXPRESSION, 127);
         if (!$channel->isPercussionChannel()) {
             $sHelper->getSequence()->addControlChange($tick, $track, $channelId, MidiWriter::BANK_SELECT, $this->fix($channel->getBank()));
         }
         $sHelper->getSequence()->addProgramChange($tick, $track, $channelId, $this->fix($channel->getProgram()));
     }
 }