# Unit DAVDCommon

Description | uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables

## Description

## Overview

### Functions and Procedures

`function ms2smp(ms, SampleRate: Single): Single;`
`function smp2ms(smp, SampleRate: Single): Single;`
`function getSyncFactor(base_factor: Single; dotted, triads: boolean): Single;`
`function Sync2Smp(SyncFactor, bpm, SampleRate: Single): Integer;`
`function Factorial(Order : Integer) : Double;`
`function f_Limit(v:Single;l:Single=-1;u:Single=1):Single; overload;`
`function f_Limit(v:Double;l:Double=-1;u:Double=1):Double; overload;`
`function f_Clip(x,l,h:Single):Single;`
`function f_Cliplo(x,l:Single):Single;`
`function f_Cliphi(x,h:Single):Single;`
`function dB_to_Amp(g:Single):Single;`
`function Amp_to_dB(v:Single):Single; overload;`
`function Smallest(A, B: Single): Single;`
`function Largest(A, B: Single): Single;`
`function LimitAngle(const Angle: Single): Single;`
`function f_Ln2(f:Single):Single; overload;`
`function f_Floorln2(f:Single):Integer;`
`function f_Arctan(Value:Single):Single; overload;`
`function f_Arctan(Value:Double):Double; overload;`
`function FreqLinearToLog(value:Single):Single;`
`function FreqLogToLinear(value:Single):Single;`
`procedure GetSinCos(Frequency: Double; var SinValue, CosValue : Double); overload;`
`procedure GetSinCos(Frequency: Extended; var SinValue, CosValue : Extended); overload;`
`procedure GetSinCos(Frequency: Single; var SinValue, CosValue : Single); overload;`
`function RoundToPowerOf2(Value:Integer) : Integer;`
`function TruncToPowerOf2(Value:Integer) : Integer;`
`function OnOff(value:Single) : Boolean;`
`function unDenormalize(value:Single) : Single;`
`function Tanh2a(x:Single):Single;`
`function Tanh2b(x:Single):Single;`
`function Tanh2c(x:Single):Single;`
`function Tanh2d(x:Single):Single;`
`function Sigmoid(x:Single):Single;`
`function Sinc(x:Double):Double;`
`function FindMaximum(InBuffer: PSingle; Samples: Integer): Integer; overload;`
`function FindMaximum(InBuffer: PDouble; Samples: Integer): Integer; overload;`
`procedure DCSubstract(InBuffer: PSingle; Samples: Integer); overload;`
`procedure DCSubstract(InBuffer: PDouble; Samples: Integer); overload;`
`procedure ConvertSingleToDouble(Singles : PSingle; Doubles : PDouble; SampleFrames:Integer);`
`procedure ConvertDoubleToSingle(Doubles : PDouble; Singles : PSingle; SampleFrames:Integer);`

### Types

`TAVDSingleDynArray = Types.TSingleDynArray;`
`TAVDDoubleDynArray = Types.TDoubleDynArray;`
`PAVDSingleDynArray = ˆTAVDSingleDynArray;`
`PAVDDoubleDynArray = ˆTAVDDoubleDynArray;`
`TAVDSingleFixedArray = Array [0..0] of Single;`
`PAVDSingleFixedArray = ˆTAVDSingleFixedArray;`
`TAVDDoubleFixedArray = Array [0..0] of Double;`
`PAVDDoubleFixedArray = ˆTAVDDoubleFixedArray;`
`TAVDArrayOfSingleDynArray = array of TAVDSingleDynArray;`
`PAVDArrayOfSingleDynArray = ˆTAVDArrayOfSingleDynArray;`
`TAVDArrayOfDoubleDynArray = array of TAVDDoubleDynArray;`
`PAVDArrayOfDoubleDynArray = ˆTAVDArrayOfDoubleDynArray;`
`TAVDArrayOfSingleFixedArray = array [0..0] of TAVDSingleFixedArray;`
`PAVDArrayOfSingleFixedArray = ˆTAVDArrayOfSingleFixedArray;`
`TAVDArrayOfDoubleFixedArray = array [0..0] of TAVDDoubleFixedArray;`
`PAVDArrayOfDoubleFixedArray = ˆTAVDArrayOfDoubleFixedArray;`
`TAVDSingleDynMatrix = TAVDArrayOfSingleDynArray;`
`PAVDSingleDynMatrix = ˆTAVDSingleDynMatrix;`
`TAVDDoubleDynMatrix = TAVDArrayOfDoubleDynArray;`
`PAVDDoubleDynMatrix = ˆTAVDDoubleDynMatrix;`
`T4SingleArray = array[0..3] of Single;`
`P4SingleArray = ˆT4SingleArray;`
`T4DoubleArray = array[0..3] of Double;`
`P4DoubleArray = ˆT4DoubleArray;`
`T2SingleArray = array [0..1] of Single;`
`P2SingleArray = ˆT2SingleArray;`
`T2DoubleArray = array [0..1] of Double;`
`P2DoubleArray = ˆT2SingleArray;`
`TStrArray = array of string;`

### Variables

`ln10: Double;`
`ln2: Double;`
`ln22: Double;`
`ln2Rez: Double;`

## Description

### Functions and Procedures

`function ms2smp(ms, SampleRate: Single): Single;`

`function smp2ms(smp, SampleRate: Single): Single;`

`function getSyncFactor(base_factor: Single; dotted, triads: boolean): Single;`

`function Sync2Smp(SyncFactor, bpm, SampleRate: Single): Integer;`

`function Factorial(Order : Integer) : Double;`

`function f_Limit(v:Single;l:Single=-1;u:Single=1):Single; overload;`

`function f_Limit(v:Double;l:Double=-1;u:Double=1):Double; overload;`

`function f_Clip(x,l,h:Single):Single;`

`function f_Cliplo(x,l:Single):Single;`

`function f_Cliphi(x,h:Single):Single;`

`function dB_to_Amp(g:Single):Single;`

`function Amp_to_dB(v:Single):Single; overload;`

`function Smallest(A, B: Single): Single;`

`function Largest(A, B: Single): Single;`

`function LimitAngle(const Angle: Single): Single;`

`function f_Ln2(f:Single):Single; overload;`

`function f_Floorln2(f:Single):Integer;`

`function f_Arctan(Value:Single):Single; overload;`

`function f_Arctan(Value:Double):Double; overload;`

`function FreqLinearToLog(value:Single):Single;`
scale logarithmically from 20 Hz to 20 kHz

`function FreqLogToLinear(value:Single):Single;`

`procedure GetSinCos(Frequency: Double; var SinValue, CosValue : Double); overload;`

`procedure GetSinCos(Frequency: Extended; var SinValue, CosValue : Extended); overload;`

`procedure GetSinCos(Frequency: Single; var SinValue, CosValue : Single); overload;`

`function RoundToPowerOf2(Value:Integer) : Integer;`

`function TruncToPowerOf2(Value:Integer) : Integer;`

`function OnOff(value:Single) : Boolean;`

`function unDenormalize(value:Single) : Single;`

`function Tanh2a(x:Single):Single;`

`function Tanh2b(x:Single):Single;`

`function Tanh2c(x:Single):Single;`

`function Tanh2d(x:Single):Single;`

`function Sigmoid(x:Single):Single;`

`function Sinc(x:Double):Double;`

`function FindMaximum(InBuffer: PSingle; Samples: Integer): Integer; overload;`

`function FindMaximum(InBuffer: PDouble; Samples: Integer): Integer; overload;`

`procedure DCSubstract(InBuffer: PSingle; Samples: Integer); overload;`

`procedure DCSubstract(InBuffer: PDouble; Samples: Integer); overload;`

`procedure ConvertSingleToDouble(Singles : PSingle; Doubles : PDouble; SampleFrames:Integer);`

`procedure ConvertDoubleToSingle(Doubles : PDouble; Singles : PSingle; SampleFrames:Integer);`

### Types

`TAVDSingleDynArray = Types.TSingleDynArray;`
-$DEFINE Debug

`TAVDDoubleDynArray = Types.TDoubleDynArray;`

`PAVDSingleDynArray = ˆTAVDSingleDynArray;`

`PAVDDoubleDynArray = ˆTAVDDoubleDynArray;`

`TAVDSingleFixedArray = Array [0..0] of Single;`

`PAVDSingleFixedArray = ˆTAVDSingleFixedArray;`

`TAVDDoubleFixedArray = Array [0..0] of Double;`

`PAVDDoubleFixedArray = ˆTAVDDoubleFixedArray;`

`TAVDArrayOfSingleDynArray = array of TAVDSingleDynArray;`

`PAVDArrayOfSingleDynArray = ˆTAVDArrayOfSingleDynArray;`

`TAVDArrayOfDoubleDynArray = array of TAVDDoubleDynArray;`

`PAVDArrayOfDoubleDynArray = ˆTAVDArrayOfDoubleDynArray;`

`TAVDArrayOfSingleFixedArray = array [0..0] of TAVDSingleFixedArray;`

`PAVDArrayOfSingleFixedArray = ˆTAVDArrayOfSingleFixedArray;`

`TAVDArrayOfDoubleFixedArray = array [0..0] of TAVDDoubleFixedArray;`

`PAVDArrayOfDoubleFixedArray = ˆTAVDArrayOfDoubleFixedArray;`

`TAVDSingleDynMatrix = TAVDArrayOfSingleDynArray;`

`PAVDSingleDynMatrix = ˆTAVDSingleDynMatrix;`

`TAVDDoubleDynMatrix = TAVDArrayOfDoubleDynArray;`

`PAVDDoubleDynMatrix = ˆTAVDDoubleDynMatrix;`

`T4SingleArray = array[0..3] of Single;`

`P4SingleArray = ˆT4SingleArray;`

`T4DoubleArray = array[0..3] of Double;`

`P4DoubleArray = ˆT4DoubleArray;`

`T2SingleArray = array [0..1] of Single;`

`P2SingleArray = ˆT2SingleArray;`

`T2DoubleArray = array [0..1] of Double;`

`P2DoubleArray = ˆT2SingleArray;`

`TStrArray = array of string;`

### Variables

`ln10: Double;`

`ln2: Double;`

`ln22: Double;`

`ln2Rez: Double;`

Generated by PasDoc 0.10.0 on 2007-11-13 13:04:16