Gets the current beat detection parameter values.
Namespace:
Un4seen.Bass.AddOn.Fx
Assembly:
Bass.Net (in Bass.Net.dll) Version: 2.4.17.2
[DllImportAttribute("bass_fx")]
public static bool BASS_FX_BPM_BeatGetParameters(
int handle,
ref float bandwidth,
ref float centerfreq,
ref float beat_rtime
)
<DllImportAttribute("bass_fx">]
Public Shared Function BASS_FX_BPM_BeatGetParameters (
handle As Integer,
ByRef bandwidth As Single,
ByRef centerfreq As Single,
ByRef beat_rtime As Single
) As Boolean
Parameters
- handle
- Type: SystemInt32
Stream/music/wma/cd/any other supported add-on format. - bandwidth
- Type: SystemSingle
Current bandwidth in Hz. - centerfreq
- Type: SystemSingle
Current center-frequency in Hz of the band pass filter. - beat_rtime
- Type: SystemSingle
Current beat release time in ms.
Return Value
Type:
BooleanIf successful,
is returned, else
is returned. Use
BASS_ErrorGetCode to get the error code.
Beat detection is using a Band Pass Filter. A band-pass filter is a device that passes frequencies within a certain range and rejects (attenuates) frequencies outside that range.
So the
bandwidth parameter defines the range around a center-frequency to include in the beat detection algo.
The
centerfreq parameter actually defines the center-frequency of the band pass filter.
Once a beat is detected, the
beat_rtime parameter defines the time in ms. in which no other beat will be detected after that just detected beat.
The background is, that often you have kind-of 'double beats' in a drum set. So the
beat_rtime should avoid, that a second (quickly repeated beat) beat is detected.
ERROR CODE | Description |
---|
BASS_ERROR_HANDLE | handle is not valid. |
Get the current beat parameters:
float bandwidth = 0f;
float centerfreq = 0f;
float beat_rtime = 0f;
if (BassFx.BASS_FX_BPM_BeatGetParameters(stream, ref bandwidth, ref centerfreq, ref beat_rtime))
{
Console.WriteLine("Bandwidth={0}, Center-Freq={1}, Release-Time={2}", bandwidth, centerfreq, beat_rtime);
}
Dim bandwidth As Single = 0F
Dim centerfreq As Single = 0F
Dim beat_rtime As Single = 0F
If BassFx.BASS_FX_BPM_BeatGetParameters(stream, bandwidth, centerfreq, beat_rtime) Then
Console.WriteLine("Bandwidth={0}, Center-Freq={1}, Release-Time={2}", bandwidth, centerfreq, beat_rtime)
End If
Reference