code: func (t *Track) ChunkData(endTrack bool) ([]byte, error) {
  	buff := bytes.NewBuffer(nil)
  	// time signature
  	// TODO: don't have 4/4 36, 8 hardcoded
  	buff.Write([]byte{0x00, 0xFF, 0x58, 0x04, 0x04, 0x02, 0x24, 0x08})
  
  	if endTrack {
  		if l := len(t.Events); l > 0 {
  			if t.Events[l-1].Cmd != MetaByteMap["End of Track"] {
  				t.Add(0, EndOfTrack())
  			}
  		}
  	}
  	for _, e := range t.Events {
  		if _, err := buff.Write(e.Encode()); err != nil {
  			return nil, err
  		}
  	}
  	return buff.Bytes(), nil
  }
docs: // ChunkData converts the track and its events into a binary byte slice (chunk
  // header included). If endTrack is set to true, the end track metadata will be
  // added if not already present.