/**
  * Gets whether this is a normal system exclusive event
  *
  * Normal sysex events are signified by the last byte of data
  * being 0xF7.
  *
  * @since 1.0
  * @uses  Util::pack()
  * @see   isDivided()
  * 
  * @return bool
  */
 public function isNormal()
 {
     $byte = end($this->data);
     reset($this->data);
     return $byte === Util::pack(0xf7);
 }
Ejemplo n.º 2
0
 /**
  * Gets a binary representation of this event
  *
  * @since 1.0
  * @uses  Util::pack()
  * 
  * @return binary
  */
 public function toBinary()
 {
     $binary = $this->isContinuation() ? '' : Util::pack($this->getType() | $this->channel);
     if ($this->param2 !== null) {
         $binary .= Util::pack($this->param1, $this->param2);
     } else {
         $binary .= Util::pack($this->param1);
     }
     return $binary;
 }
Ejemplo n.º 3
0
 /**
  * Gets the binary representation of this meta event
  *
  * @since 1.0
  * @uses  Util::pack()
  * @uses  Util::getDeltaByteSequence()
  * @uses  getSubtype()
  * 
  * @return binary
  */
 public function toBinary()
 {
     if (is_array($this->data)) {
         $data = '';
         foreach ($this->data as $datum) {
             $data .= Util::pack($datum);
         }
     } else {
         $data = $this->data;
     }
     return Util::pack($this->getType(), $this->getSubtype()) . Util::getDeltaByteSequence($this->length) . $data;
 }