Frequency extension type

Represents an absolute pitch, a physical frequency.


See also:

on
Implemented types
Annotations
  • @immutable

Constructors

Frequency(num hertz)
Creates a new Frequency instance from hertz.
const

Properties

hashCode int
Returns a hash code for a numerical value.
no setterinherited
hertz num
final
isFinite bool
Whether this number is finite.
no setterinherited
isHumanAudible bool
Whether this Frequency is inside the HearingRange.human.
no setter
isInfinite bool
Whether this number is positive infinity or negative infinity.
no setterinherited
isNaN bool
Whether this number is a Not-a-Number value.
no setterinherited
isNegative bool
Whether this number is negative.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sign num
Negative one, zero or positive one depending on the sign and numerical value of this number.
no setterinherited

Methods

abs() num
The absolute value of this number.
inherited
ceil() int
The least integer no smaller than this.
inherited
ceilToDouble() double
Returns the least double integer value no smaller than this.
inherited
clamp(num lowerLimit, num upperLimit) num
Returns this num clamped to be in the range lowerLimit-upperLimit.
inherited
closestPitch({Frequency referenceFrequency = const Frequency(440), TuningSystem tuningSystem = const EqualTemperament.edo12()}) ClosestPitch
The ClosestPitch to this Frequency from referenceFrequency and tuningSystem.
compareTo(num other) int
Compares this to other.
inherited
floor() int
The greatest integer no greater than this number.
inherited
floorToDouble() double
Returns the greatest double integer value no greater than this.
inherited
format() String
This Frequency formatted as a string.
harmonic(int index) Frequency
The harmonic at index from this Frequency, including negative values as part of the undertone series.
harmonics({required int upToIndex}) Set<Frequency>
The Set of harmonics series upToIndex from this Frequency.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remainder(num other) num
The remainder of the truncating division of this by other.
inherited
round() int
The integer closest to this number.
inherited
roundToDouble() double
The double integer value closest to this value.
inherited
toDouble() double
This number as a double.
inherited
toInt() int
Truncates this num to an integer and returns the result as an int.
inherited
toString() String
The shortest string that correctly represents this number.
inherited
toStringAsExponential([int? fractionDigits]) String
An exponential string-representation of this number.
inherited
toStringAsFixed(int fractionDigits) String
A decimal-point string-representation of this number.
inherited
toStringAsPrecision(int precision) String
A string representation with precision significant digits.
inherited
truncate() int
The integer obtained by discarding any fractional digits from this.
inherited
truncateToDouble() double
Returns the double integer value obtained by discarding any fractional digits from the double value of this.
inherited

Operators

operator %(num other) num
Euclidean modulo of this number by other.
inherited
operator *(num other) num
Multiplies this number by other.
inherited
operator +(num other) num
Adds other to this number.
inherited
operator -(num other) num
Subtracts other from this number.
inherited
operator /(num other) double
Divides this number by other.
inherited
operator <(num other) bool
Whether this number is numerically smaller than other.
inherited
operator <=(num other) bool
Whether this number is numerically smaller than or equal to other.
inherited
operator ==(Object other) bool
Test whether this value is numerically equal to other.
inherited
operator >(num other) bool
Whether this number is numerically greater than other.
inherited
operator >=(num other) bool
Whether this number is numerically greater than or equal to other.
inherited
operator unary-() num
The negation of this value.
inherited
operator ~/(num other) int
Truncating division operator.
inherited

Constants

hertzUnitSymbol → const String
The symbol for the Hertz unit.