Translate the given BPM to FREQ/PERCENT and vice versa or multiply BPM by 2.
Namespace: Un4seen.Bass.AddOn.Fx
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
[DllImportAttribute("bass_fx")] public static float BASS_FX_BPM_Translate( int handle, float val2tran, BASSFXBpmTrans trans )
Parameters
- handle
- Type: SystemInt32
Stream/music/wma/cd/any other supported add-on format. - val2tran
- Type: SystemSingle
Specify a value to translate to a given option (no matter if used X2). - trans
- Type: Un4seen.Bass.AddOn.FxBASSFXBpmTrans
Any of the following translation options (see BASSFXBpmTrans):BASS_FX_BPM_TRAN_X2 Multiply the original BPM value by 2. This may be used only once, and will change the original BPM as well. BASS_FX_BPM_TRAN_2FREQ BPM value to Frequency. BASS_FX_BPM_TRAN_FREQ2 Frequency to BPM value. BASS_FX_BPM_TRAN_2PERCENT Percents to BPM value. BASS_FX_BPM_TRAN_PERCENT2 BPM value to Percents.
Return Value
Type: SingleIf successful, the newly calculated value is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
ERROR CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not valid. |
BASS_ERROR_ILLPARAM | An illegal parameter was specified. |
BASS_ERROR_ALREADY | BASS_FX_BPM_TRAN_X2 already used on this handle. |
Examples
private float GetNewBPM(int sourceChannel, int tempoChannel) { return BassFx.BASS_FX_BPM_Translate(sourceChannel, BassFx.BASS_FX_TempoGetRateRatio(tempoChannel) * 100f, BASSFXBpmTrans.BASS_FX_BPM_PERCENT2); }
See Also