Accidental
public enum Accidental: Codable, Equatable, Hashable, RawRepresentable, ExpressibleByIntegerLiteral, ExpressibleByStringLiteral, CustomStringConvertible
The enum used for calculating values of the Key
s and Pitche
s.
-
No accidental.
Declaration
Swift
case natural
-
A flag for
description
function that determines if it should use double sharp and double flat symbols. It’s useful to set it false where the fonts do not support that symbols. Defaults true.Declaration
Swift
public static var shouldUseDoubleFlatAndDoubleSharpNotation = true
-
Declaration
Swift
public typealias RawValue = Int
-
Value of the accidental in terms of halfsteps.
Declaration
Swift
public var rawValue: Int
-
Initilizes the accidental with an integer that represents the halfstep amount.
Declaration
Swift
public init?(rawValue: Accidental.RawValue)
Parameters
rawValue
Halfstep value of the accidental. Zero if natural, above zero if sharp, below zero if flat.
-
Declaration
Swift
public typealias IntegerLiteralType = Int
-
Initilizes the accidental with an integer literal value.
Declaration
Swift
public init(integerLiteral value: Accidental.IntegerLiteralType)
Parameters
value
Halfstep value of the accidental. Zero if natural, above zero if sharp, below zero if flat.
-
Declaration
Swift
public typealias StringLiteralType = String
-
Declaration
Swift
public init(stringLiteral value: Accidental.StringLiteralType)
-
Returns the notation string of the accidental.
Declaration
Swift
public var notation: String
-
Returns the notation string of the accidental. Returns empty string if accidental is natural.
Declaration
Swift
public var description: String