public class Beat extends DeviceUpdate
VirtualCdj.getLatestStatusFor(DeviceUpdate) to find the current detailed status for that device,
as long as the Virtual CDJ is active.| Constructor and Description |
|---|
Beat(DatagramPacket packet)
Constructor sets all the immutable interpreted fields based on the packet content.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBeatWithinBar()
Get the position within a measure of music at which this beat falls (a value from 1 to 4, where 1 represents
the down beat).
|
int |
getBpm()
Get the track BPM at the time of the beat.
|
double |
getEffectiveTempo()
Get the effective tempo reflected by this update, which reflects both its track BPM and pitch as needed.
|
int |
getPitch()
Get the device pitch at the time of the beat.
|
boolean |
isBeatWithinBarMeaningful()
Returns
true if this beat is coming from a device where getBeatWithinBar() can reasonably
be expected to have musical significance, because it respects the way a track was configured within rekordbox. |
boolean |
isTempoMaster()
Was this beat sent by the current tempo master?
|
String |
toString() |
getAddress, getDeviceName, getDeviceNumber, getPacketBytes, getTimestamppublic Beat(DatagramPacket packet)
packet - the beat announcement packet that was receivedpublic int getPitch()
Util.pitchToPercentage(long), and the corresponding
fractional scaling value by passing it to Util.pitchToMultiplier(long).getPitch in class DeviceUpdatepublic int getBpm()
getBpm in class DeviceUpdatepublic int getBeatWithinBar()
getBeatWithinBar in class DeviceUpdatepublic boolean isBeatWithinBarMeaningful()
Returns true if this beat is coming from a device where getBeatWithinBar() can reasonably
be expected to have musical significance, because it respects the way a track was configured within rekordbox.
If the VirtualCdj is running, we can check the latest status update received from this device to
get a definitive answer. Otherwise we guess based on the device number; mixers seem to fall in the range
33 and up.
isBeatWithinBarMeaningful in class DeviceUpdatepublic String toString()
toString in class DeviceUpdatepublic boolean isTempoMaster()
isTempoMaster in class DeviceUpdatetrue if the device that sent this beat is the masterIllegalStateException - if the VirtualCdj is not running.public double getEffectiveTempo()
DeviceUpdategetEffectiveTempo in class DeviceUpdateCopyright © 2016–2018 Deep Symmetry, LLC. All rights reserved.