VL.Audio.BeatTracking
0.2.0-alpha
dotnet add package VL.Audio.BeatTracking --version 0.2.0-alpha
NuGet\Install-Package VL.Audio.BeatTracking -Version 0.2.0-alpha
<PackageReference Include="VL.Audio.BeatTracking" Version="0.2.0-alpha" />
<PackageVersion Include="VL.Audio.BeatTracking" Version="0.2.0-alpha" />
<PackageReference Include="VL.Audio.BeatTracking" />
paket add VL.Audio.BeatTracking --version 0.2.0-alpha
#r "nuget: VL.Audio.BeatTracking, 0.2.0-alpha"
#:package VL.Audio.BeatTracking@0.2.0-alpha
#addin nuget:?package=VL.Audio.BeatTracking&version=0.2.0-alpha&prerelease
#tool nuget:?package=VL.Audio.BeatTracking&version=0.2.0-alpha&prerelease
VL.Audio.BeatTracking
Common parts of the beat trackers for vvvv gamma and VL.Audio:
- VL.Audio.BeatNet (MIT): the BeatNet tracker.
- VL.Audio.BTrack (GPL-3.0-or-later): the BTrack tracker.
You don't need to install this package yourself: it comes along with either tracker, and its nodes are available wherever you reference VL.Audio.BeatNet or VL.Audio.BTrack.
This package contains:
- the BeatScaler node (category
Audio.Analysis.BeatTracking), below; - BeatInfo, all values of a beat in one, for a single link from a tracker to the BeatScaler or your patch (below);
TapTempo(tempo from tapped beats, median of the intervals), used by both trackers' Tap Tempo pins;BeatDelayLine(the positive part of both trackers' Offset (s) pin: holds beats back, allocation-free);IO.WavReader/IO.WavWriter(mono WAV files, used by the tests and tools).
The logic lives in VL.Audio.BeatTracking.Core, a plain managed library (netstandard2.1 / net8.0) with no dependencies; only the
thin VL adapter is Windows-specific, because VL.Audio is.
Pin options illustrates Scale, Tap, Beats Per Bar and Tap Downbeat.
BeatScaler: bars, quarter to quadruple tempo
Place a BeatScaler below BTrack or BeatNet and connect their Beat Info output. It outputs the beat once per bar, or at a quarter, third, half, normal, double, triple or quadruple tempo, as Beat Info and as single pins, plus the applied Factor. It also counts bars of any length for any tracker: a waltz, 6/8, or bars for BTrack, which knows none.
| Pin | Description |
|---|---|
| Beat Info (in) | From BTrack, BeatNet or a BeatNet scheduler. |
| Scale | Auto (default), Bar, Quarter, Third, Half, Normal, Double, Triple or Quadruple. |
| Beats Per Bar | 0 (default): the tracker's bars (BeatNet: 2, 3 or 4; BTrack: none). 2–16: the node counts bars of this length itself, e.g. 3 for a waltz. |
| Tap | Tap at least 4 times on the musical beat, or once per bar for one beat per bar. A pause of more than 4.5 s starts a new series. |
| Tap Downbeat | Press once on beat 1 of a bar: the bar count starts there. Needs Beats Per Bar. |
| Reset | Forgets the tapped tempo (Auto falls back to Normal) and the tapped downbeat. |
| Beat Info (out) | The scaled beat with all its values, for the next node. |
| Beat, BPM, Phase (out) | The scaled beat. BPM can be outside 80–160. |
| Factor | Applied factor: 1 / beats per bar (Bar), 0.25, 0.33, 0.5, 1, 2, 3 or 4. |
| Tapped Tempo (optional) | Tempo of your taps, 0 until you tapped 4 times. |
| Tap Count (optional) | Taps of the current series (4 give a tempo); 0 once the pause since the last tap is longer than 4.5 s, so that the next tap starts a new series. |
| Status (optional) | What the node does, in words: the scale and factor, which tapped tempo Auto follows (and when it holds a factor although another one is slightly closer), which beats of the bar Half and Quarter keep and whether your tap or the switch chose them, and the tap progress. E.g. Auto: Half, matching your taps at 70.1 BPM; keeping beats 1 and 3 of 4, chosen by your tap. |
| Downbeat, Beat Count, Beat In Bar, Beats Per Bar (optional) | The bar of the scaled beat, see below. |
- Auto picks the factor (a quarter to quadruple) that brings the tracker's tempo closest to your tapped tempo,
and keeps it while the tracker's tempo jitters (with a small hysteresis). It stays Normal until you tap. With a known
bar it also considers one beat per bar, and a third and triple if the bar divides by 3: tapping once per bar of 3
gives a third, not a quarter.
- Musical tempo: connect the same button to the tracker's Tap Tempo and the BeatScaler's Tap: BTrack locks onto your beat (folded into 80–160 BPM), and the BeatScaler undoes the folding. A 70 BPM song comes out at 70 BPM, a 170 BPM song at 170 BPM.
- One beat per bar: tap once per bar of four beats, on the first beat, with a button connected only to the BeatScaler. Auto picks Quarter and keeps the beat you tap. Don't send these taps to the tracker's Tap Tempo: it folds a quarter of the tempo into its own range, and BeatNet then usually ends up at half the tempo (from 110 BPM on).
- Half keeps every second beat, Third every third, Quarter every fourth, namely the one closest to your last tap. Without taps they keep the first beat after switching from Normal, Double or Quadruple; with Beats Per Bar they keep beat 1 (Half in a bar of 4: beats 1 and 3).
- Bar keeps one beat per bar, on beat 1. It needs a bar: Beats Per Bar, or BeatNet's bars. Without one it is Normal.
- Double adds a beat when the tracker's Phase passes 0.5, Triple two beats at 1/3 and 2/3, Quadruple three beats at 0.25, 0.5 and 0.75. These extra beats have frame resolution (about 17 ms at 60 fps), unlike the tracker's own beats, which are counted on the audio thread.
- Third and Triple are for 6/8 and 12/8: a tracker that follows the eighths gives dotted quarters with Third, and one that follows the dotted quarters gives eighths with Triple.
- The bar (Downbeat, Beat In Bar, Beats Per Bar) is scaled along. Double, Triple and Quadruple count the extra beats within the bar (8 beats in a bar of 4 at double tempo); only beat 1 is a downbeat, never an extra beat. Bar, Quarter, Third and Half divide the bar if it divides evenly (a bar of 4 at a quarter: 1 beat per bar); a bar of 3 at half tempo keeps the bar's position. Beat Count counts the scaled beats. BTrack knows no bars: without Beats Per Bar, Beats Per Bar is 0.
Other bars: Beats Per Bar and Tap Downbeat
BeatNet finds 2, 3 or 4 beats per bar, but in a waltz it often hears bars of 2 or puts beat 1 on the wrong beat, and BTrack knows no bars at all. Set Beats Per Bar (3 for a waltz, 6 for 6/8 tracked in eighths) and press Tap Downbeat once on beat 1: the BeatScaler counts the bars itself, for any tracker.
- Where beat 1 comes from: your downbeat tap. Until you tap, from the tracker's downbeats: the first one, and later only when two in a row fall on the same other beat of the count (so BeatNet's bars of 2 in a waltz don't disturb a count of 3). Without a tracker downbeat (BTrack), the first beat is beat 1.
- The tap marks the last beat if it came less than half a beat earlier, otherwise the coming one. A tap is enough for the whole song; tap again after a break or when the count is off. Reset forgets it.
- Limits: the count follows the tracker's beats. If the tracker skips or adds a beat (Reactive scheduler in a break, a tempo jump), beat 1 is off by one until you tap again. The tracker's own Downbeat, Beat In Bar and Beats Per Bar stay as they are; only the BeatScaler's outputs follow the count.
- Status tells how the bar is counted, e.g.
Bar; keeping beat 1 of 3, from beat 1 of the bar; counting bars of 3, beat 1 from your downbeat tap.
The help patch HowTo Track beats using BTrack.vl (in VL.Audio.BTrack) shows this setup.
BeatInfo: one link for the beat
BTrack, BeatNet and BeatScheduler (BeatNet) output a Beat Info next to their single pins. It holds all values of the beat:
| Value | Description |
|---|---|
| Beat | True for one frame on every beat. |
| BPM | Tempo in BPM. |
| Phase | 0 at the beat, rising linearly to 1 one beat period later. |
| Downbeat | True together with Beat when the beat is the first of a bar. |
| Beat Count | Number of beats so far. |
| Beat In Bar | Position of the last beat in its bar: 0 for the downbeat. |
| Beats Per Bar | Beats per bar; 0 if the tracker knows no bars (BTrack). |
- Split (BeatInfo) takes it apart: Beat, BPM and Phase are shown, the others are optional pins.
- Create (BeatInfo) builds one, e.g. to feed the BeatScaler from your own beat source.
- Each value also has its own node (BPM, Phase, ...). BeatInfo is a small value type: passing it on does not allocate.
Repository layout
src/VL.Audio.BeatTracking.Core/ BeatScaler, TapTempo, IO/Wav
src/VL.Audio.BeatTracking/ VL adapter: BeatScalerNode ([ProcessNode]), BeatInfo (also used by the trackers' nodes)
tests/VL.Audio.BeatTracking.Core.Tests/ unit tests; TestSignals.cs is also used by the other two packages
tests/Shared/ TestSource.cs, used by the integration tests of the other two packages
VL.Audio.BeatTracking.vl VL document (package entry point)
The assemblies are VL.Audio.BeatTracking.dll (VL adapter) and VL.Audio.BeatTracking.Core.dll (the plain library),
in the namespace VL.Audio.BeatTracking. Building: see the repository README.
Licence
MIT, see LICENSE.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
net8.0-windows7.0
- VL.Audio (>= 1.9.19)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on VL.Audio.BeatTracking:
| Package | Downloads |
|---|---|
|
VL.Audio.BeatNet
Real-time beat and downbeat tracker nodes for vvvv gamma and VL.Audio, working at 44.1 and 48 kHz: a C# port of BeatNet by Heydari, Cwitkowitz and Duan (neural network and particle filter; weights CC BY 4.0, see THIRD-PARTY-NOTICES.md). Brings the BeatScaler of VL.Audio.BeatTracking along. |
|
|
VL.Audio.BTrack
Real-time beat tracker node for vvvv gamma and VL.Audio, working at 44.1 and 48 kHz: a C# port of BTrack by Adam Stark (Queen Mary University of London). Licensed GPL-3.0-or-later, as BTrack requires: patches that use it fall under the GPL. Brings the BeatScaler of VL.Audio.BeatTracking and, for its comparison help patch, VL.Audio.BeatNet along. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.2.0-alpha | 65 | 11/15/2026 |