@@ -17,16 +17,16 @@ public struct NoteCalculator {
1717 // MARK: - Bounds
1818
1919 public static var indexBounds : ( minimum: Int , maximum: Int ) {
20- let minimum = try ! index ( frequency : Config . minimumFrequency)
21- let maximum = try ! index ( frequency : Config . maximumFrequency)
20+ let minimum = try ! index ( Config . minimumFrequency)
21+ let maximum = try ! index ( Config . maximumFrequency)
2222
2323 return ( minimum: minimum, maximum: maximum)
2424 }
2525
2626 public static var octaveBounds : ( minimum: Int , maximum: Int ) {
2727 let bounds = indexBounds
28- let minimum = try ! octave ( index : bounds. minimum)
29- let maximum = try ! octave ( index : bounds. maximum)
28+ let minimum = try ! octave ( bounds. minimum)
29+ let maximum = try ! octave ( bounds. maximum)
3030
3131 return ( minimum: minimum, maximum: maximum)
3232 }
@@ -49,7 +49,7 @@ public struct NoteCalculator {
4949
5050 // MARK: - Pitch Notations
5151
52- public static func frequency( index: Int ) throws -> Double {
52+ public static func frequency( _ index: Int ) throws -> Double {
5353 guard isValidIndex ( index) else {
5454 throw PitchError . invalidPitchIndex
5555 }
@@ -60,7 +60,7 @@ public struct NoteCalculator {
6060 return pow ( 2 , power) * Standard. frequency
6161 }
6262
63- public static func letter( index: Int ) throws -> Note . Letter {
63+ public static func letter( _ index: Int ) throws -> Note . Letter {
6464 guard isValidIndex ( index) else {
6565 throw PitchError . invalidPitchIndex
6666 }
@@ -81,7 +81,7 @@ public struct NoteCalculator {
8181 return letters [ lettersIndex]
8282 }
8383
84- public static func octave( index: Int ) throws -> Int {
84+ public static func octave( _ index: Int ) throws -> Int {
8585 guard isValidIndex ( index) else {
8686 throw PitchError . invalidPitchIndex
8787 }
@@ -98,7 +98,7 @@ public struct NoteCalculator {
9898
9999 // MARK: - Pitch Index
100100
101- public static func index( frequency: Double ) throws -> Int {
101+ public static func index( _ frequency: Double ) throws -> Int {
102102 guard PitchCalculator . isValidFrequency ( frequency) else {
103103 throw PitchError . invalidFrequency
104104 }
@@ -108,7 +108,7 @@ public struct NoteCalculator {
108108 return Int ( round ( count * log2( frequency / Standard. frequency) ) )
109109 }
110110
111- public static func index( letter: Note . Letter , octave: Int ) throws -> Int {
111+ public static func index( _ letter: Note . Letter , octave: Int ) throws -> Int {
112112 guard isValidOctave ( octave) else {
113113 throw PitchError . invalidOctave
114114 }
0 commit comments