Show / Hide Table of Contents

Delegate BPMBeatProcedure

User defined callback function, to get the Beat position in seconds.

Example
A very simple way to count the BPM in real-time, using only 2 beats.

double prevBeatPos; // previous beat position in seconds
double bpm; // the bpm 

void BeatProcGetBPM(int handle, double beatpos, IntPtr user)
{
    if (beatpos != prevBeatPos)
        bpm = 60 / (beatpos - prevBeatPos); // calculate the bpm

    prevBeatPos = beatpos; // save current beat position
}

Get the detection progress in percents:

var progress = 100 * (beatpos - startpos) / (endpos - startpos);
Namespace: System.Dynamic.ExpandoObject
Assembly: ManagedBass.Fx.dll
Syntax
public delegate void BPMBeatProcedure(int Channel, double BeatPosition, IntPtr User);
Parameters
Int32 Channel

Handle that the BPMBeatCallbackSet(Int32, BPMBeatProcedure, IntPtr) or BPMBeatDecodeGet(Int32, Double, Double, BassFlags, BPMBeatProcedure, IntPtr) has applied to.

Double BeatPosition

The exact beat position in seconds.

IntPtr User

The user instance data given when BPMBeatCallbackSet(Int32, BPMBeatProcedure, IntPtr) or BPMBeatDecodeGet(Int32, Double, Double, BassFlags, BPMBeatProcedure, IntPtr) was called.

Back to top Copyright © 2017 Mathew Sachin
Generated by DocFx