Skip to content

Commit

Permalink
Use actual footnote, add hyperlinks to packets.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Oct 10, 2022
1 parent 3521768 commit 21c1780
Showing 1 changed file with 33 additions and 29 deletions.
62 changes: 33 additions & 29 deletions doc/modules/ROOT/pages/touch_audio.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= Touch Audio
= Touch Audio
David Ng <nudge@nudge.id.au>
:stem: latexmath

Expand All @@ -15,10 +15,11 @@ handled.
[[touch-cue-preview-protocol]]
== Touch Cue/Preview Protocol

After startup, the mixer continuously sends timing packets (`20`) to each
supported player every 7ms. In order for a player to receive timing
packets, bit 5 of byte `cd` of the <<vcdj#cdj-status-packet,CDJ status
packet>> (type `0a`, port 50002) must be set.
After startup, the mixer continuously sends <<audio-timing,timing
packets>> (`20`) to each supported player every 7ms. In order for a
player to receive timing packets, bit 5 of byte `cd` of the
<<vcdj#cdj-status-packet,CDJ status packet>> (type `0a`, port 50002)
must be set.

The timing packets contain a flag _E_ which indicates that the "Link Cue"
button on the mixer is on or off.
Expand All @@ -32,37 +33,40 @@ disengaged"_ means that the DJ stops scrubbing on a waveform.

When touch audio is engaged on a player (the initiator player):

* The initiator player sends a zero-filled audio packet (`1e`) to the
mixer.
* The initiator player sends a zero-filled <<audio-data,audio
packet>> (`1e`) to the mixer.

* If the initiator player is currently not elected, the mixer sends a
handover packet (`1f`) to the initiator player. The next timing packet
will set T to the player number that initiated touch audio. If the
player is already the elected player, this step is skipped.
<<audio-handover,handover packet>> (`1f`) to the initiator player.
The next <<audio-timing,timing packet>> will set T to the player
number that initiated touch audio. If the player is already the
elected player, this step is skipped.

* If E is `00` and touch audio is engaged:
* If _E_ is `00` and touch audio is engaged:

** The elected player sends zero-filled ^[1]^ audio packets (`1e`) to the
mixer for every second timing packet received.
** The elected player sends zero-filledfootnote:[If touch audio is
engaged but _E_ is toggled from `01` to `00`, instead of the player
sending zero-filled <<audio-data,audio packets>> (`1e`), the player
will repeatedly send the last frame of audio data previously sent to
the mixer when E was `01`.] <<audio-data,audio packets>> (`1e`) to the
mixer for every second <audio-timing,timing packet>> received.

* If E is `01` and touch audio is engaged:
* If _E_ is `01` and touch audio is engaged:

** The elected player sends audio packets (`1e`) to mixer with uncompressed
PCM signed 16-bit, little endian, 48000Hz, stereo data for every timing
packet received.
** The elected player sends <<audio-data,audio packets>> (`1e`) to
mixer with uncompressed PCM signed 16-bit, little endian, 48000Hz,
stereo data for every <<audio-timing,timing packet>> received.

** If touch audio is disengaged, the elected player continues to send
zero-filled audio packets for every timing packet received.

* The elected player stops sending audio packets (`1e`) to the mixer when
both E is `00` and touch audio is disengaged OR the timing packet (`20`)
specifies that another player has taken over. The mixer continues to send
timing packets with T set as the last elected player.

^[1]^ If touch audio is engaged but E is toggled from `01` to `00`, instead
of the player sending zero-filled audio packets (`1e`), the player will
repeatedly send the last frame of audio data previously sent to the mixer
when E was `01`.
zero-filled <<audio-data,audio packets>> for every
<<audio-timing,timing packet>> received.

* The elected player stops sending <<audio-data,audio packets>> (`1e`)
to the mixer when both _E_ is `00` and touch audio is disengaged OR
the <<audio-timing,timing packet>> (`20`) specifies that another
player has taken over. The mixer continues to send timing packets
with T set as the last elected player.


[[audio-timing]]
== Audio Timing Packets
Expand Down Expand Up @@ -166,4 +170,4 @@ include::example$status_shared.edn[]
(draw-related-boxes (repeat 2 0))
----

_D_ indicates the number of the mixer sending the packet.
_D_ indicates the number of the mixer sending the packet.

0 comments on commit 21c1780

Please sign in to comment.