code: public long sendBeat(Snapshot snapshot) {
          byte[] payload = new byte[BEAT_PAYLOAD.length];
          System.arraycopy(BEAT_PAYLOAD, 0, payload, 0, BEAT_PAYLOAD.length);
          payload[0x02] = getDeviceNumber();
  
          Util.numberToBytes((int)snapshot.getBeatInterval(), payload, 0x05, 4);
          Util.numberToBytes((int)(snapshot.getBeatInterval() * 2), payload, 0x09, 4);
          Util.numberToBytes((int)(snapshot.getBeatInterval() * 4), payload, 0x11, 4);
          Util.numberToBytes((int)(snapshot.getBeatInterval() * 8), payload, 0x19, 4);
  
          final int beatsLeft = 5 - snapshot.getBeatWithinBar();
          final int nextBar = (int)(snapshot.getBeatInterval() * beatsLeft);
          Util.numberToBytes(nextBar, payload, 0x0d, 4);
          Util.numberToBytes(nextBar + (int)snapshot.getBarInterval(), payload, 0x15, 4);
  
          Util.numberToBytes((int)Math.round(snapshot.getTempo() * 100), payload, 0x3b, 2);
          payload[0x3d] = (byte)snapshot.getBeatWithinBar();
          payload[0x40] = getDeviceNumber();
  
          try {
              assembleAndSendPacket(Util.PacketType.BEAT, payload, broadcastAddress.get(), BeatFinder.BEAT_PORT);
          } catch (IOException e) {
              logger.error("VirtualCdj Failed to send beat packet.", e);
          }
  
          return snapshot.getBeat();
      }
docs: Sends a beat packet. Generally this should only be invoked when our {@link BeatSender} has determined that it is
  time to do so, but it is public to allow experimentation.
  
  @param snapshot the time at which the beat to be sent occurred, for computation of its beat number
  
  @return the beat number that was sent