# Double

``struct Double``

Extension to calculate scaling factors, useful for UI controls

• ``` normalized(from:taper:) ```

Return a value on [minimum, maximum] to a [0, 1] range, according to a taper

#### Declaration

Swift

``public func normalized(from range: ClosedRange<Double>, taper: Double = 1) -> Double``

#### Parameters

 ``` to ``` Source range (cannot include zero if taper is not positive) ``` taper ``` For taper > 0, there is an algebraic curve, taper = 1 is linear, and taper < 0 is exponential
• ``` normalized(minimum:maximum:taper:) ```

Return a value on [minimum, maximum] to a [0, 1] range, according to a taper

#### Declaration

Swift

``````@available(*, deprecated, renamed: "normalized(from:taper:﹚")
public func normalized(minimum: Double, maximum: Double, taper: Double = 1) -> Double``````

#### Parameters

 ``` minimum ``` Minimum of the source range (cannot be zero if taper is not positive) ``` maximum ``` Maximum of the source range ``` taper ``` For taper > 0, there is an algebraic curve, taper = 1 is linear, and taper < 0 is exponential
• ``` normalize(minimum:maximum:taper:) ```

Convert a value on [minimum, maximum] to a [0, 1] range, according to a taper

#### Declaration

Swift

``````@available(*, deprecated, renamed: "normalize(from:taper:﹚")
public mutating func normalize(minimum: Double, maximum: Double, taper: Double = 1)``````

#### Parameters

 ``` minimum ``` Minimum of the source range (cannot be zero if taper is not positive) ``` maximum ``` Maximum of the source range ``` taper ``` For taper > 0, there is an algebraic curve, taper = 1 is linear, and taper < 0 is exponential
• ``` denormalized(to:taper:) ```

Return a value on [0, 1] to a [minimum, maximum] range, according to a taper

#### Declaration

Swift

``public func denormalized(to range: ClosedRange<Double>, taper: Double = 1) -> Double``

#### Parameters

 ``` to ``` Target range (cannot contain zero if taper is not positive) ``` taper ``` For taper > 0, there is an algebraic curve, taper = 1 is linear, and taper < 0 is exponential
• ``` denormalized(minimum:maximum:taper:) ```

Return a value on [0, 1] to a [minimum, maximum] range, according to a taper

#### Declaration

Swift

``````@available(*, deprecated, renamed: "denormalized(to:taper:﹚")
public func denormalized(minimum: Double, maximum: Double, taper: Double = 1) -> Double``````

#### Parameters

 ``` minimum ``` Minimum of the target range (cannot be zero if taper is not positive) ``` maximum ``` Maximum of the target range ``` taper ``` For taper > 0, there is an algebraic curve, taper = 1 is linear, and taper < 0 is exponential
• ``` denormalize(minimum:maximum:taper:) ```

Convert a value on [0, 1] to a [min, max] range, according to a taper

#### Declaration

Swift

``````@available(*, deprecated, renamed: "denormalize(to:taper:﹚")
public mutating func denormalize(minimum: Double, maximum: Double, taper: Double = 1)``````

#### Parameters

 ``` minimum ``` Minimum of the target range (cannot be zero if taper is not positive) ``` maximum ``` Maximum of the target range ``` taper ``` For taper > 0, there is an algebraic curve, taper = 1 is linear, and taper < 0 is exponential
• ``` midiNoteToFrequency(_:) ```

Calculate frequency from a floating point MIDI Note Number

#### Declaration

Swift

``public func midiNoteToFrequency(_ aRef: Double = 440.0) -> Double``

#### Parameters

 ``` aRef ``` Reference frequency of A Note (Default: 440Hz)
• ``` frequencyToMIDINote(_:) ```

Calculate MIDI Note Number from a frequency in Hz

#### Declaration

Swift

``public func frequencyToMIDINote(_ aRef: Double = 440.0) -> Double``

#### Parameters

 ``` aRef ``` Reference frequency of A Note (Default: 440Hz)
• ``` value() ```

Get basic value as a double

#### Declaration

Swift

``public func value() -> Double``